crysk 0.0.0-stage → 0.3.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.
- package/LICENSE +176 -0
- package/README.md +610 -2
- package/bin/pr-hero.js +166 -0
- package/config/models/anthropic.json +5 -0
- package/dist/SKILL-7e3725zn.md +496 -0
- package/dist/SKILL-7q35wcaz.md +66 -0
- package/dist/SKILL-9at22381.md +74 -0
- package/dist/SKILL-ex2hxxh3.md +134 -0
- package/dist/adjudicator-dtg2axnh.md +86 -0
- package/dist/admission-config.example-a9vqmmad.json +9 -0
- package/dist/ci-admission-camfbx2b.md +122 -0
- package/dist/cli.js +42292 -0
- package/dist/consolidate-ac0mnfyj.md +24 -0
- package/dist/deep-review-lifecycle-m698ybjp.md +362 -0
- package/dist/deep-review-logic-a6b1gczf.md +156 -0
- package/dist/deep-review-parity-0ec904db.md +120 -0
- package/dist/deep-review-reliability-qyakbjb9.md +125 -0
- package/dist/deep-review-resilience-3tz8y26e.md +118 -0
- package/dist/index.js +20190 -0
- package/dist/opencode-ci-7b0be64p.md +141 -0
- package/dist/review-refuter-j4e9gezy.md +71 -0
- package/dist/scout-yvp153q7.md +140 -0
- package/dist/summarizer-zca44nxa.md +18 -0
- package/dist/workflow-w1g9szna.yml +151 -0
- package/package.json +82 -4
- package/prompts/consolidate.md +24 -0
- package/prompts/default/PROVENANCE.md +18 -0
- package/prompts/default/deep-review-lifecycle.md +362 -0
- package/prompts/default/deep-review-logic.md +156 -0
- package/prompts/default/deep-review-parity.md +120 -0
- package/prompts/default/deep-review-reliability.md +125 -0
- package/prompts/default/deep-review-resilience.md +118 -0
- package/prompts/default/review-refuter.md +71 -0
- package/prompts/scout.md +140 -0
- package/prompts/summarizer.md +18 -0
- package/skills/crysk/SKILL.md +74 -0
- package/skills/crysk-ci-setup/SKILL.md +134 -0
- package/skills/crysk-ci-setup/assets/admission-config.example.json +9 -0
- package/skills/crysk-ci-setup/assets/workflow.yml +151 -0
- package/skills/crysk-ci-setup/references/ci-admission.md +122 -0
- package/skills/crysk-ci-setup/references/opencode-ci.md +141 -0
- package/skills/crysk-loop/SKILL.md +496 -0
- package/skills/crysk-loop/adjudicator.md +86 -0
- package/skills/crysk-pr/SKILL.md +66 -0
- package/src/agent-env.ts +1084 -0
- package/src/asset-manifest.ts +83 -0
- package/src/assets.d.ts +6 -0
- package/src/assets.ts +183 -0
- package/src/brand-paths.ts +155 -0
- package/src/brand.ts +255 -0
- package/src/ci/admission-ledger.ts +350 -0
- package/src/ci/classify-error.ts +73 -0
- package/src/ci/cli-record.ts +271 -0
- package/src/ci/force-comment.ts +39 -0
- package/src/ci/gates.ts +923 -0
- package/src/ci/outcome.ts +2181 -0
- package/src/ci/override.ts +187 -0
- package/src/ci/publish.ts +1639 -0
- package/src/ci/reporter.ts +626 -0
- package/src/ci/review-admission.ts +901 -0
- package/src/ci/review-levels.ts +310 -0
- package/src/ci/review-policy.ts +18 -0
- package/src/ci/review-risk.ts +184 -0
- package/src/ci/setup.ts +844 -0
- package/src/ci/trigger.ts +1353 -0
- package/src/cli.ts +348 -0
- package/src/commands/activity.ts +67 -0
- package/src/commands/ci-setup-questions.ts +397 -0
- package/src/commands/ci-setup.ts +381 -0
- package/src/commands/config.ts +99 -0
- package/src/commands/doctor.ts +108 -0
- package/src/commands/init.ts +139 -0
- package/src/commands/mcp.ts +10 -0
- package/src/commands/menu.ts +129 -0
- package/src/commands/post.ts +302 -0
- package/src/commands/skills.ts +83 -0
- package/src/commands/status.ts +173 -0
- package/src/commands/triage.ts +342 -0
- package/src/commands/uninstall.ts +37 -0
- package/src/commands/upgrade.ts +214 -0
- package/src/commands/usage.ts +98 -0
- package/src/compare/compare.ts +28 -0
- package/src/compare/floor-test.ts +471 -0
- package/src/compare/martian-adapter.ts +80 -0
- package/src/config/config.ts +267 -0
- package/src/corpus/corpus.ts +1094 -0
- package/src/corpus/preflight.ts +1789 -0
- package/src/diversity/accounting.ts +90 -0
- package/src/diversity/adjudication.ts +145 -0
- package/src/diversity/admission.ts +60 -0
- package/src/diversity/benchmark.ts +195 -0
- package/src/diversity/clustering.ts +285 -0
- package/src/diversity/errors.ts +7 -0
- package/src/diversity/identity.ts +285 -0
- package/src/diversity/index.ts +11 -0
- package/src/diversity/pipeline-integration.ts +448 -0
- package/src/diversity/projection.ts +57 -0
- package/src/diversity/self-contained.ts +68 -0
- package/src/diversity/target-validation.ts +179 -0
- package/src/doctor-migration.ts +209 -0
- package/src/doctor.ts +723 -0
- package/src/errors.ts +83 -0
- package/src/execution/admission.ts +75 -0
- package/src/execution/atomic-write.ts +35 -0
- package/src/execution/attempt-evidence.ts +415 -0
- package/src/execution/bucket-id.ts +136 -0
- package/src/execution/concurrency-limiter.ts +175 -0
- package/src/execution/contracts.ts +443 -0
- package/src/execution/failure-classification.ts +42 -0
- package/src/execution/failure-policy.ts +240 -0
- package/src/execution/harness.ts +2548 -0
- package/src/execution/settlement.ts +348 -0
- package/src/execution/spawned-process.ts +66 -0
- package/src/execution/spend-limiter.ts +424 -0
- package/src/execution/step-artifacts.ts +55 -0
- package/src/execution/usage-normalized.ts +469 -0
- package/src/git/git.ts +396 -0
- package/src/git/identity.ts +64 -0
- package/src/git/refs.ts +140 -0
- package/src/home-preflight.ts +443 -0
- package/src/home.ts +243 -0
- package/src/ignore-file.ts +336 -0
- package/src/ignore-read.ts +118 -0
- package/src/index.ts +34 -0
- package/src/legacy-launchd.ts +29 -0
- package/src/mcp/mcp.ts +150 -0
- package/src/mcp/preflight.ts +407 -0
- package/src/menu-context.ts +192 -0
- package/src/model/catalog.ts +251 -0
- package/src/model/exec-snapshots.ts +390 -0
- package/src/model/free-discovery.ts +302 -0
- package/src/model/provider-capabilities.ts +814 -0
- package/src/model/routing.ts +600 -0
- package/src/pr/admission.ts +847 -0
- package/src/pr/ci-admission-gate.ts +665 -0
- package/src/pr/ci-publish.ts +76 -0
- package/src/pr/discovery.ts +432 -0
- package/src/pr/inline.ts +507 -0
- package/src/pr/plan.ts +366 -0
- package/src/pr/posting.ts +115 -0
- package/src/pr/pr-status.ts +787 -0
- package/src/pr/pr.ts +3642 -0
- package/src/pr/preflight.ts +1031 -0
- package/src/pr/publish-outcome.ts +361 -0
- package/src/pr/range.ts +119 -0
- package/src/pr/reverts-preflight.ts +606 -0
- package/src/pr/reverts.ts +377 -0
- package/src/pr/review-pr.ts +927 -0
- package/src/pr/status.ts +154 -0
- package/src/pr/target.ts +388 -0
- package/src/pr/teardown.ts +437 -0
- package/src/pr/worktree-setup.ts +60 -0
- package/src/production-runtime.ts +1877 -0
- package/src/progress.ts +487 -0
- package/src/rereview/adjudicate.ts +89 -0
- package/src/rereview/classify.ts +362 -0
- package/src/rereview/identity.ts +211 -0
- package/src/rereview/plan.ts +308 -0
- package/src/rereview/prepare.ts +1025 -0
- package/src/rereview/state.ts +767 -0
- package/src/rereview/verify.ts +241 -0
- package/src/review/boundary.ts +105 -0
- package/src/review/consolidate.ts +246 -0
- package/src/review/dedupe.ts +368 -0
- package/src/review/drafts.ts +448 -0
- package/src/review/findings-conformance.ts +120 -0
- package/src/review/findings.ts +714 -0
- package/src/review/pipeline.ts +3977 -0
- package/src/review/preflight.ts +3575 -0
- package/src/review/prompt-set.ts +177 -0
- package/src/review/proof-refs.ts +187 -0
- package/src/review/report.ts +1821 -0
- package/src/review/review.ts +490 -0
- package/src/review/root-cause.ts +120 -0
- package/src/review/route-preflight.ts +289 -0
- package/src/review/run.ts +601 -0
- package/src/review/scout.ts +323 -0
- package/src/review/size-gate.ts +595 -0
- package/src/review/spec.ts +235 -0
- package/src/review/step-runner.ts +233 -0
- package/src/runner-authority.ts +596 -0
- package/src/security/binding-policy.ts +115 -0
- package/src/security/credential-broker.ts +773 -0
- package/src/security/evidence-redaction.ts +62 -0
- package/src/security/execution-authority.ts +27 -0
- package/src/security/redact.ts +71 -0
- package/src/security/workspace-read-broker.ts +466 -0
- package/src/server/client.ts +190 -0
- package/src/server/preflight.ts +217 -0
- package/src/server/server.ts +327 -0
- package/src/signal-handler.ts +50 -0
- package/src/store/activity.ts +413 -0
- package/src/store/backfill-preflight.ts +49 -0
- package/src/store/backfill.ts +141 -0
- package/src/store/gc-preflight.ts +206 -0
- package/src/store/gc.ts +424 -0
- package/src/store/metrics-preflight.ts +229 -0
- package/src/store/metrics.ts +236 -0
- package/src/store/preflight.ts +748 -0
- package/src/store/store.ts +693 -0
- package/src/system-tools.ts +355 -0
- package/src/transport-registry.ts +1124 -0
- package/src/transports/claude-code-cli.ts +1348 -0
- package/src/transports/opencode-admission.ts +515 -0
- package/src/transports/opencode-client.ts +3328 -0
- package/src/transports/opencode-evidence.ts +557 -0
- package/src/transports/opencode-mcp.ts +248 -0
- package/src/transports/opencode-sdk.ts +2294 -0
- package/src/transports/opencode-server.ts +535 -0
- package/src/triage/adjudication.ts +113 -0
- package/src/triage/reply.ts +125 -0
- package/src/triage/triage.ts +255 -0
- package/src/ui/activity.ts +173 -0
- package/src/ui/config-edit.ts +816 -0
- package/src/ui/config.ts +462 -0
- package/src/ui/menu.ts +1325 -0
- package/src/ui/plan.ts +1039 -0
- package/src/ui/primitives.ts +300 -0
- package/src/ui/progress.ts +298 -0
- package/src/ui/result.ts +552 -0
- package/src/ui/review-menu.ts +312 -0
- package/src/ui/select.ts +528 -0
- package/src/ui/tree.ts +178 -0
- package/src/uninstaller.ts +479 -0
- package/src/updater.ts +836 -0
- package/src/usage.ts +77 -0
- package/src/watch/preflight.ts +1389 -0
- package/src/watch/watch.ts +1235 -0
- package/src/wizard.ts +877 -0
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type CliOptions,
|
|
3
|
+
DEFAULT_HOP_BUDGET,
|
|
4
|
+
type LocalConfig,
|
|
5
|
+
} from "#review/preflight";
|
|
6
|
+
import { cycleStringPreset } from "./config-edit";
|
|
7
|
+
import { clearDrawnLines } from "./menu";
|
|
8
|
+
import { bold, box, cyan, dim, sanitizeText } from "./primitives";
|
|
9
|
+
import { type KeyReader, parseKey, splitKeys } from "./select";
|
|
10
|
+
|
|
11
|
+
export interface ReviewMenuState {
|
|
12
|
+
target: "branch" | "pr";
|
|
13
|
+
head: string;
|
|
14
|
+
base: string;
|
|
15
|
+
pr?: number | "current";
|
|
16
|
+
post: boolean;
|
|
17
|
+
scout: boolean;
|
|
18
|
+
force: boolean;
|
|
19
|
+
full: boolean;
|
|
20
|
+
dryRun: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ReviewMenuIo {
|
|
24
|
+
write: (text: string) => void;
|
|
25
|
+
line: (text?: string) => void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const REVIEW_CARD_ACTIONS = [
|
|
29
|
+
"[ Start review ]",
|
|
30
|
+
"[ Discard & back ]",
|
|
31
|
+
] as const;
|
|
32
|
+
|
|
33
|
+
export function renderReviewMenuCard(
|
|
34
|
+
state: ReviewMenuState,
|
|
35
|
+
cursor: number,
|
|
36
|
+
width: number,
|
|
37
|
+
styles: boolean,
|
|
38
|
+
actions: readonly string[] = REVIEW_CARD_ACTIONS,
|
|
39
|
+
): string[] {
|
|
40
|
+
const targetLabel =
|
|
41
|
+
state.target === "branch"
|
|
42
|
+
? "Local branch"
|
|
43
|
+
: state.pr
|
|
44
|
+
? `PR #${state.pr}`
|
|
45
|
+
: "Current PR";
|
|
46
|
+
|
|
47
|
+
const fields = [
|
|
48
|
+
`Target: ${targetLabel} — Review target mode`,
|
|
49
|
+
`Base: ${state.base} · Head: ${state.head} — Git diff range`,
|
|
50
|
+
`Post to PR: ${state.post ? "[✓] Yes" : "[ ] No"} — Publish comments to GitHub PR`,
|
|
51
|
+
`Scout stage: ${state.scout ? "[✓] Enabled" : "[ ] Disabled"} — Run pre-hunt reconnaissance`,
|
|
52
|
+
`Force review: ${state.force ? "[✓] Yes" : "[ ] No"} — Bypass size gate thresholds`,
|
|
53
|
+
`Full verification: ${state.full ? "[✓] Yes" : "[ ] No"} — Run deep refuter checks`,
|
|
54
|
+
`Dry run: ${state.dryRun ? "[✓] Yes" : "[ ] No"} — Execute without posting or resolving`,
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
const lines: string[] = [];
|
|
58
|
+
|
|
59
|
+
for (let idx = 0; idx < fields.length; idx++) {
|
|
60
|
+
const isSelected = idx === cursor;
|
|
61
|
+
const prefix = isSelected ? "▸ " : " ";
|
|
62
|
+
const line = sanitizeText(`${prefix}${fields[idx]}`);
|
|
63
|
+
lines.push(isSelected ? bold(cyan(line, styles), styles) : line);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (actions.length > 0) {
|
|
67
|
+
lines.push("");
|
|
68
|
+
const innerWidth = Math.max(10, width - 4);
|
|
69
|
+
lines.push(dim("─".repeat(innerWidth), styles));
|
|
70
|
+
for (let i = 0; i < actions.length; i++) {
|
|
71
|
+
const actionIdx = fields.length + i;
|
|
72
|
+
const isSelected = actionIdx === cursor;
|
|
73
|
+
const prefix = isSelected ? "▸ " : " ";
|
|
74
|
+
const line = `${prefix}${actions[i]}`;
|
|
75
|
+
lines.push(
|
|
76
|
+
isSelected ? bold(cyan(line, styles), styles) : sanitizeText(line),
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return box("Review PR Configuration", lines, {
|
|
82
|
+
width,
|
|
83
|
+
styles,
|
|
84
|
+
borderStyle: "double",
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type ReviewMenuOutcome =
|
|
89
|
+
| { action: "launch"; options: CliOptions }
|
|
90
|
+
| { action: "back" };
|
|
91
|
+
|
|
92
|
+
export async function runReviewMenu(
|
|
93
|
+
deps: {
|
|
94
|
+
createReader?: () => KeyReader;
|
|
95
|
+
io?: ReviewMenuIo;
|
|
96
|
+
styles?: boolean;
|
|
97
|
+
width?: number;
|
|
98
|
+
effectiveConfig?: LocalConfig;
|
|
99
|
+
defaultBase?: string;
|
|
100
|
+
defaultScout?: boolean;
|
|
101
|
+
defaultPost?: boolean;
|
|
102
|
+
} = {},
|
|
103
|
+
): Promise<ReviewMenuOutcome> {
|
|
104
|
+
const resolvedBase =
|
|
105
|
+
deps.defaultBase ?? deps.effectiveConfig?.default_base ?? "main";
|
|
106
|
+
const resolvedScout =
|
|
107
|
+
deps.defaultScout ?? deps.effectiveConfig?.scout ?? false;
|
|
108
|
+
const resolvedPost = deps.defaultPost ?? deps.effectiveConfig?.post ?? false;
|
|
109
|
+
const resolvedTarget = resolvedPost ? "pr" : "branch";
|
|
110
|
+
|
|
111
|
+
const state: ReviewMenuState = {
|
|
112
|
+
target: resolvedTarget,
|
|
113
|
+
head: "HEAD",
|
|
114
|
+
base: resolvedBase,
|
|
115
|
+
post: resolvedPost,
|
|
116
|
+
scout: resolvedScout,
|
|
117
|
+
force: false,
|
|
118
|
+
full: false,
|
|
119
|
+
dryRun: false,
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const io = deps.io ?? {
|
|
123
|
+
write: (t) => process.stderr.write(t),
|
|
124
|
+
line: (t = "") => process.stderr.write(`${t}\n`),
|
|
125
|
+
};
|
|
126
|
+
const styles = deps.styles ?? false;
|
|
127
|
+
const width = deps.width ?? 80;
|
|
128
|
+
|
|
129
|
+
const createReader =
|
|
130
|
+
deps.createReader ??
|
|
131
|
+
(() => {
|
|
132
|
+
const stdin = process.stdin;
|
|
133
|
+
stdin.setRawMode(true);
|
|
134
|
+
stdin.resume();
|
|
135
|
+
stdin.setEncoding("utf8");
|
|
136
|
+
const pending: string[] = [];
|
|
137
|
+
let deliver: ((chunk: string) => void) | undefined;
|
|
138
|
+
const onData = (chunk: string): void => {
|
|
139
|
+
if (deliver === undefined) {
|
|
140
|
+
pending.push(chunk);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const resolve = deliver;
|
|
144
|
+
deliver = undefined;
|
|
145
|
+
resolve(chunk);
|
|
146
|
+
};
|
|
147
|
+
stdin.on("data", onData);
|
|
148
|
+
return {
|
|
149
|
+
raw: true,
|
|
150
|
+
read: () => {
|
|
151
|
+
const queued = pending.shift();
|
|
152
|
+
if (queued !== undefined) return Promise.resolve(queued);
|
|
153
|
+
return new Promise<string>((resolve) => {
|
|
154
|
+
deliver = resolve;
|
|
155
|
+
});
|
|
156
|
+
},
|
|
157
|
+
close: () => {
|
|
158
|
+
stdin.off("data", onData);
|
|
159
|
+
stdin.pause();
|
|
160
|
+
try {
|
|
161
|
+
stdin.setRawMode(false);
|
|
162
|
+
} catch {
|
|
163
|
+
// Ignore
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
let cursor = 0;
|
|
170
|
+
const fieldCount = 7;
|
|
171
|
+
const actions = REVIEW_CARD_ACTIONS;
|
|
172
|
+
const totalItems = fieldCount + actions.length;
|
|
173
|
+
const ESC = "\x1b";
|
|
174
|
+
const repaint = styles;
|
|
175
|
+
let drawn = 0;
|
|
176
|
+
|
|
177
|
+
const render = (clearScreen = false) => {
|
|
178
|
+
const lines: string[] = [
|
|
179
|
+
"",
|
|
180
|
+
...renderReviewMenuCard(state, cursor, width, styles, actions),
|
|
181
|
+
dim("j/k: move • space/enter: toggle • q/esc: back", styles),
|
|
182
|
+
];
|
|
183
|
+
|
|
184
|
+
let buf = "";
|
|
185
|
+
if (repaint && clearScreen) {
|
|
186
|
+
buf += `${ESC}[2J${ESC}[H`;
|
|
187
|
+
drawn = 0;
|
|
188
|
+
} else if (repaint && drawn > 0) {
|
|
189
|
+
buf += `${ESC}[${drawn}A`;
|
|
190
|
+
}
|
|
191
|
+
for (const l of lines) {
|
|
192
|
+
if (repaint && drawn > 0) buf += `${ESC}[2K`;
|
|
193
|
+
buf += `${l}\n`;
|
|
194
|
+
}
|
|
195
|
+
io.write(buf);
|
|
196
|
+
drawn = lines.length;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const reader = createReader();
|
|
200
|
+
try {
|
|
201
|
+
if (repaint) io.write(`${ESC}[?25l`);
|
|
202
|
+
render(true);
|
|
203
|
+
for (;;) {
|
|
204
|
+
const chunk = await reader.read();
|
|
205
|
+
if (chunk === undefined) return { action: "back" };
|
|
206
|
+
|
|
207
|
+
for (const raw of splitKeys(chunk)) {
|
|
208
|
+
const key = parseKey(raw);
|
|
209
|
+
if (
|
|
210
|
+
key.type === "escape" ||
|
|
211
|
+
key.type === "ctrl-c" ||
|
|
212
|
+
(key.type === "char" && key.char === "q")
|
|
213
|
+
) {
|
|
214
|
+
return { action: "back" };
|
|
215
|
+
}
|
|
216
|
+
if (key.type === "up" || (key.type === "char" && key.char === "k")) {
|
|
217
|
+
cursor = (cursor - 1 + totalItems) % totalItems;
|
|
218
|
+
render(false);
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
if (key.type === "down" || (key.type === "char" && key.char === "j")) {
|
|
222
|
+
cursor = (cursor + 1) % totalItems;
|
|
223
|
+
render(false);
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
if (key.type === "char" && /^[1-9]$/.test(key.char)) {
|
|
227
|
+
const numIdx = Number(key.char) - 1;
|
|
228
|
+
if (numIdx < totalItems) {
|
|
229
|
+
cursor = numIdx;
|
|
230
|
+
render(false);
|
|
231
|
+
}
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Action buttons
|
|
236
|
+
if (cursor >= fieldCount) {
|
|
237
|
+
const actionIdx = cursor - fieldCount;
|
|
238
|
+
if (key.type === "enter") {
|
|
239
|
+
if (actionIdx === 0) {
|
|
240
|
+
// Start review
|
|
241
|
+
const options: CliOptions = {
|
|
242
|
+
repo: ".",
|
|
243
|
+
head: state.head,
|
|
244
|
+
base: state.base,
|
|
245
|
+
pr: state.target === "pr" ? (state.pr ?? "current") : undefined,
|
|
246
|
+
post: state.post,
|
|
247
|
+
scout: state.scout,
|
|
248
|
+
force: state.force,
|
|
249
|
+
full: state.full,
|
|
250
|
+
dryRun: state.dryRun,
|
|
251
|
+
hopBudget: DEFAULT_HOP_BUDGET,
|
|
252
|
+
yes: false,
|
|
253
|
+
twoDot: false,
|
|
254
|
+
onPush: false,
|
|
255
|
+
all: false,
|
|
256
|
+
fixes: false,
|
|
257
|
+
incidents: false,
|
|
258
|
+
issues: false,
|
|
259
|
+
proximity: false,
|
|
260
|
+
threads: false,
|
|
261
|
+
};
|
|
262
|
+
return { action: "launch", options };
|
|
263
|
+
}
|
|
264
|
+
return { action: "back" };
|
|
265
|
+
}
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Field toggles / cycles
|
|
270
|
+
if (
|
|
271
|
+
key.type === "enter" ||
|
|
272
|
+
key.type === "left" ||
|
|
273
|
+
key.type === "right" ||
|
|
274
|
+
(key.type === "char" &&
|
|
275
|
+
(key.char === " " || key.char === "h" || key.char === "l"))
|
|
276
|
+
) {
|
|
277
|
+
if (cursor === 0) {
|
|
278
|
+
state.target = state.target === "branch" ? "pr" : "branch";
|
|
279
|
+
if (state.target === "branch") state.post = false;
|
|
280
|
+
} else if (cursor === 1) {
|
|
281
|
+
state.base = cycleStringPreset(state.base, [
|
|
282
|
+
"main",
|
|
283
|
+
"master",
|
|
284
|
+
"develop",
|
|
285
|
+
]);
|
|
286
|
+
} else if (cursor === 2) {
|
|
287
|
+
if (state.target === "branch") {
|
|
288
|
+
state.target = "pr";
|
|
289
|
+
state.post = true;
|
|
290
|
+
} else {
|
|
291
|
+
state.post = !state.post;
|
|
292
|
+
}
|
|
293
|
+
} else if (cursor === 3) {
|
|
294
|
+
state.scout = !state.scout;
|
|
295
|
+
} else if (cursor === 4) {
|
|
296
|
+
state.force = !state.force;
|
|
297
|
+
} else if (cursor === 5) {
|
|
298
|
+
state.full = !state.full;
|
|
299
|
+
} else if (cursor === 6) {
|
|
300
|
+
state.dryRun = !state.dryRun;
|
|
301
|
+
}
|
|
302
|
+
render(false);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
} finally {
|
|
307
|
+
clearDrawnLines(io, drawn, repaint);
|
|
308
|
+
drawn = 0;
|
|
309
|
+
if (repaint) io.write(`${ESC}[?25h`);
|
|
310
|
+
reader.close();
|
|
311
|
+
}
|
|
312
|
+
}
|