@momentiq/dark-factory-cli 0.7.0-alpha.9 → 1.0.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/dist/cli.js +383 -29
- package/dist/cli.js.map +1 -1
- package/dist/handoff/accept-verb.d.ts +31 -0
- package/dist/handoff/accept-verb.d.ts.map +1 -0
- package/dist/handoff/accept-verb.js +165 -0
- package/dist/handoff/accept-verb.js.map +1 -0
- package/dist/handoff/args.d.ts +19 -0
- package/dist/handoff/args.d.ts.map +1 -0
- package/dist/handoff/args.js +68 -0
- package/dist/handoff/args.js.map +1 -0
- package/dist/handoff/assignees.d.ts +37 -0
- package/dist/handoff/assignees.d.ts.map +1 -0
- package/dist/handoff/assignees.js +46 -0
- package/dist/handoff/assignees.js.map +1 -0
- package/dist/handoff/handoff-verb.d.ts +34 -0
- package/dist/handoff/handoff-verb.d.ts.map +1 -0
- package/dist/handoff/handoff-verb.js +451 -0
- package/dist/handoff/handoff-verb.js.map +1 -0
- package/dist/handoff/handoffs-verb.d.ts +29 -0
- package/dist/handoff/handoffs-verb.d.ts.map +1 -0
- package/dist/handoff/handoffs-verb.js +84 -0
- package/dist/handoff/handoffs-verb.js.map +1 -0
- package/dist/handoff/index.d.ts +14 -143
- package/dist/handoff/index.d.ts.map +1 -1
- package/dist/handoff/index.js +28 -647
- package/dist/handoff/index.js.map +1 -1
- package/dist/handoff/iso.d.ts +9 -0
- package/dist/handoff/iso.d.ts.map +1 -0
- package/dist/handoff/iso.js +47 -0
- package/dist/handoff/iso.js.map +1 -0
- package/dist/handoff/links.d.ts +48 -0
- package/dist/handoff/links.d.ts.map +1 -0
- package/dist/handoff/links.js +211 -0
- package/dist/handoff/links.js.map +1 -0
- package/dist/handoff/markers.d.ts +50 -0
- package/dist/handoff/markers.d.ts.map +1 -0
- package/dist/handoff/markers.js +121 -0
- package/dist/handoff/markers.js.map +1 -0
- package/dist/handoff/ports.d.ts +126 -0
- package/dist/handoff/ports.d.ts.map +1 -0
- package/dist/handoff/ports.js +34 -0
- package/dist/handoff/ports.js.map +1 -0
- package/dist/handoff/real-clients.d.ts +43 -0
- package/dist/handoff/real-clients.d.ts.map +1 -0
- package/dist/handoff/real-clients.js +291 -0
- package/dist/handoff/real-clients.js.map +1 -0
- package/dist/handoff/rehydrate-core.d.ts +55 -0
- package/dist/handoff/rehydrate-core.d.ts.map +1 -0
- package/dist/handoff/rehydrate-core.js +243 -0
- package/dist/handoff/rehydrate-core.js.map +1 -0
- package/dist/handoff/rehydrate-render.d.ts +3 -0
- package/dist/handoff/rehydrate-render.d.ts.map +1 -0
- package/dist/handoff/rehydrate-render.js +107 -0
- package/dist/handoff/rehydrate-render.js.map +1 -0
- package/dist/handoff/rehydrate-verb.d.ts +31 -0
- package/dist/handoff/rehydrate-verb.d.ts.map +1 -0
- package/dist/handoff/rehydrate-verb.js +111 -0
- package/dist/handoff/rehydrate-verb.js.map +1 -0
- package/dist/handoff/scrub.d.ts +99 -0
- package/dist/handoff/scrub.d.ts.map +1 -0
- package/dist/handoff/scrub.js +127 -0
- package/dist/handoff/scrub.js.map +1 -0
- package/dist/handoff/strip-control.d.ts +4 -0
- package/dist/handoff/strip-control.d.ts.map +1 -0
- package/dist/handoff/strip-control.js +16 -0
- package/dist/handoff/strip-control.js.map +1 -0
- package/dist/mcp/server.d.ts +0 -8
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +1 -5
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/handoff.d.ts +16 -8
- package/dist/mcp/tools/handoff.d.ts.map +1 -1
- package/dist/mcp/tools/handoff.js +253 -303
- package/dist/mcp/tools/handoff.js.map +1 -1
- package/package.json +2 -2
- package/dist/handoff/cli.d.ts +0 -5
- package/dist/handoff/cli.d.ts.map +0 -1
- package/dist/handoff/cli.js +0 -227
- package/dist/handoff/cli.js.map +0 -1
package/dist/handoff/index.d.ts
CHANGED
|
@@ -1,145 +1,16 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { HandoffError } from "./ports.js";
|
|
2
|
+
export type { GhClient, GitClient, Clock, IssueView, IssueViewSlim, IssueListItem, IssueCreated, PrView, } from "./ports.js";
|
|
3
|
+
export { MARKER_OPEN, MARKER_CLOSE } from "./markers.js";
|
|
3
4
|
export declare const HANDOFF_LABEL = "handoff";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface ExecResult {
|
|
16
|
-
readonly code: number;
|
|
17
|
-
readonly stdout: string;
|
|
18
|
-
readonly stderr: string;
|
|
19
|
-
}
|
|
20
|
-
/** Run `gh <args>`. Default impl shells out; injectable for tests. */
|
|
21
|
-
export type GhRunner = (args: readonly string[], options?: {
|
|
22
|
-
input?: string;
|
|
23
|
-
}) => Promise<ExecResult>;
|
|
24
|
-
/** Run `git <args>`. Default impl shells out; injectable for tests. */
|
|
25
|
-
export type GitRunner = (args: readonly string[]) => Promise<ExecResult>;
|
|
26
|
-
declare function defaultExec(bin: string, args: readonly string[], options?: {
|
|
27
|
-
input?: string;
|
|
28
|
-
}): Promise<ExecResult>;
|
|
29
|
-
export declare const defaultGh: GhRunner;
|
|
30
|
-
export declare const defaultGit: GitRunner;
|
|
31
|
-
/**
|
|
32
|
-
* Test-only: the real spawn-backed runner, exposed so a test can drive a
|
|
33
|
-
* REAL subprocess (e.g. `cat`) and pin that `options.input` is actually
|
|
34
|
-
* delivered to the child's stdin. The hermetic gh/git fakes can't catch a
|
|
35
|
-
* regression where async `input` is silently dropped (the bug this spawn
|
|
36
|
-
* impl fixes); a real-subprocess round-trip can. Not part of the public API.
|
|
37
|
-
*/
|
|
38
|
-
export declare const _execForTest: typeof defaultExec;
|
|
39
|
-
/** A single line of operator feedback (stderr in the bash). */
|
|
40
|
-
export type Logger = (line: string) => void;
|
|
41
|
-
export interface HandoffDeps {
|
|
42
|
-
readonly gh: GhRunner;
|
|
43
|
-
readonly git: GitRunner;
|
|
44
|
-
/** Operator-facing log/warn sink (bash wrote these to stderr). */
|
|
45
|
-
readonly log: Logger;
|
|
46
|
-
}
|
|
47
|
-
export declare function defaultDeps(log?: Logger): HandoffDeps;
|
|
48
|
-
export declare function requireTools(deps: HandoffDeps): Promise<void>;
|
|
49
|
-
export declare function requirePrNumber(pr: string | undefined): void;
|
|
50
|
-
export interface ScrubResult {
|
|
51
|
-
readonly clean: boolean;
|
|
52
|
-
/** 1-based line numbers that matched (never the matched content). */
|
|
53
|
-
readonly lines: readonly number[];
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Scan a note body for secret-shaped content. Returns the matching LINE
|
|
57
|
-
* NUMBERS only — never the matched content (echoing it would re-surface
|
|
58
|
-
* the secret in terminal/scrollback/logs). Detection is decoupled from
|
|
59
|
-
* line formatting so a formatting hiccup can never cause a MISSED secret.
|
|
60
|
-
*/
|
|
61
|
-
export declare function scrubSecrets(body: string): ScrubResult;
|
|
62
|
-
/**
|
|
63
|
-
* A well-formed agent-context block has an open marker that precedes a
|
|
64
|
-
* close marker. Guards against posting a malformed/partial note.
|
|
65
|
-
*/
|
|
66
|
-
export declare function validateNoteMarkers(body: string): boolean;
|
|
67
|
-
export declare function stripControlChars(text: string): string;
|
|
68
|
-
/**
|
|
69
|
-
* Echo the MOST RECENT marked comment id on a PR, or undefined. There
|
|
70
|
-
* should only ever be one (upsert maintains a single note); if more
|
|
71
|
-
* exist, use the newest and warn. The issues/comments API returns
|
|
72
|
-
* ascending by creation, so the last marked one is newest.
|
|
73
|
-
*/
|
|
74
|
-
export declare function markerCommentId(deps: HandoffDeps, pr: string): Promise<number | undefined>;
|
|
75
|
-
/**
|
|
76
|
-
* Body of the MOST RECENT marked comment on a PR (undefined if none).
|
|
77
|
-
* Fetched by id so it stays consistent with upsert's most-recent target.
|
|
78
|
-
*/
|
|
79
|
-
export declare function markerCommentBody(deps: HandoffDeps, pr: string): Promise<string | undefined>;
|
|
80
|
-
/**
|
|
81
|
-
* Upsert the marked comment from a body. Returns the comment html_url.
|
|
82
|
-
* If PATCH fails (e.g. HTTP 403 — the existing note was authored by
|
|
83
|
-
* another identity), fall back to POSTing a fresh note + warn (spec §9).
|
|
84
|
-
*/
|
|
85
|
-
export declare function upsertNote(deps: HandoffDeps, pr: string, body: string): Promise<string>;
|
|
86
|
-
export interface HandoffInput {
|
|
87
|
-
/** Composed rehydration note body (with the v1 markers). */
|
|
88
|
-
readonly note: string;
|
|
89
|
-
/** Explicit PR number (optional). Empty/undefined → resolve from branch. */
|
|
90
|
-
readonly pr?: string;
|
|
91
|
-
}
|
|
92
|
-
export interface HandoffResult {
|
|
93
|
-
readonly pr: string;
|
|
94
|
-
/** html_url of the upserted note comment. */
|
|
95
|
-
readonly noteUrl: string;
|
|
96
|
-
/** True iff `git push origin HEAD` succeeded (false when gate-blocked). */
|
|
97
|
-
readonly pushed: boolean;
|
|
98
|
-
/** True iff a fresh draft PR was opened (NO-PR path). */
|
|
99
|
-
readonly createdDraftPr: boolean;
|
|
100
|
-
/** Operator-facing warnings accumulated along the way. */
|
|
101
|
-
readonly warnings: readonly string[];
|
|
102
|
-
}
|
|
103
|
-
export declare function runHandoff(input: HandoffInput, deps: HandoffDeps): Promise<HandoffResult>;
|
|
104
|
-
export interface HandoffStackEntry {
|
|
105
|
-
readonly number: number;
|
|
106
|
-
readonly title: string;
|
|
107
|
-
readonly branch: string;
|
|
108
|
-
/** GitHub login of the current owner, or undefined when OPEN. */
|
|
109
|
-
readonly owner: string | undefined;
|
|
110
|
-
readonly updatedAt: string;
|
|
111
|
-
}
|
|
112
|
-
export interface HandoffsResult {
|
|
113
|
-
readonly entries: readonly HandoffStackEntry[];
|
|
114
|
-
}
|
|
115
|
-
export declare function runHandoffs(deps: HandoffDeps): Promise<HandoffsResult>;
|
|
116
|
-
export interface RehydrateInput {
|
|
117
|
-
/** Explicit PR (optional). Empty/undefined → resolve from branch. */
|
|
118
|
-
readonly pr?: string;
|
|
119
|
-
}
|
|
120
|
-
export interface RehydrateResult {
|
|
121
|
-
readonly pr: string;
|
|
122
|
-
/** Script-derived live state line(s) — the AUTHORITATIVE truth. */
|
|
123
|
-
readonly liveState: string;
|
|
124
|
-
/** `gh pr checks` output (informational; non-zero == checks failing). */
|
|
125
|
-
readonly checks: string;
|
|
126
|
-
/** Most-recent note body, control-chars stripped. undefined if none. */
|
|
127
|
-
readonly note: string | undefined;
|
|
128
|
-
/** The `gh pr checkout <pr>` footer (script-resolved PR number). */
|
|
129
|
-
readonly checkoutHint: string;
|
|
130
|
-
}
|
|
131
|
-
export declare function runRehydrate(input: RehydrateInput, deps: HandoffDeps): Promise<RehydrateResult>;
|
|
132
|
-
export interface AcceptInput {
|
|
133
|
-
readonly pr: string;
|
|
134
|
-
}
|
|
135
|
-
export interface AcceptResult {
|
|
136
|
-
readonly pr: string;
|
|
137
|
-
/** True iff the handoff label was present and removed. */
|
|
138
|
-
readonly removedLabel: boolean;
|
|
139
|
-
readonly warnings: readonly string[];
|
|
140
|
-
/** The contained rehydrate (accept CONTAINS rehydrate). */
|
|
141
|
-
readonly rehydrate: RehydrateResult;
|
|
142
|
-
}
|
|
143
|
-
export declare function runAccept(input: AcceptInput, deps: HandoffDeps): Promise<AcceptResult>;
|
|
144
|
-
export {};
|
|
5
|
+
export { runHandoff } from "./handoff-verb.js";
|
|
6
|
+
export type { RunHandoffOptions, RunHandoffResult } from "./handoff-verb.js";
|
|
7
|
+
export { runAccept } from "./accept-verb.js";
|
|
8
|
+
export type { RunAcceptOptions, RunAcceptResult } from "./accept-verb.js";
|
|
9
|
+
export { runRehydrate } from "./rehydrate-verb.js";
|
|
10
|
+
export type { RunRehydrateOptions, RunRehydrateResult, } from "./rehydrate-verb.js";
|
|
11
|
+
export { runHandoffs } from "./handoffs-verb.js";
|
|
12
|
+
export type { RunHandoffsResult, HandoffStackRow } from "./handoffs-verb.js";
|
|
13
|
+
export type { RehydrateData, LinkedItemDerivation } from "./rehydrate-core.js";
|
|
14
|
+
export { renderRehydrateText } from "./rehydrate-render.js";
|
|
15
|
+
export { SpawnGhClient, SpawnGitClient, SystemClock, } from "./real-clients.js";
|
|
145
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/handoff/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/handoff/index.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,YAAY,EACV,QAAQ,EACR,SAAS,EACT,KAAK,EACL,SAAS,EACT,aAAa,EACb,aAAa,EACb,YAAY,EACZ,MAAM,GACP,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMzD,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE7E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EACV,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE7E,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EACL,aAAa,EACb,cAAc,EACd,WAAW,GACZ,MAAM,mBAAmB,CAAC"}
|