@vibe-commit/capture 0.1.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 +21 -0
- package/README.md +66 -0
- package/dist/agents/claude_code.d.ts +11 -0
- package/dist/agents/claude_code.js +162 -0
- package/dist/agents/claude_code.js.map +1 -0
- package/dist/agents/codex_cli.d.ts +15 -0
- package/dist/agents/codex_cli.js +67 -0
- package/dist/agents/codex_cli.js.map +1 -0
- package/dist/agents/cursor.d.ts +21 -0
- package/dist/agents/cursor.js +89 -0
- package/dist/agents/cursor.js.map +1 -0
- package/dist/agents/registry.d.ts +184 -0
- package/dist/agents/registry.js +212 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/agents/types.d.ts +279 -0
- package/dist/agents/types.js +67 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/commands/connect.d.ts +36 -0
- package/dist/commands/connect.js +499 -0
- package/dist/commands/connect.js.map +1 -0
- package/dist/commands/context.d.ts +45 -0
- package/dist/commands/context.js +14 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/report.d.ts +105 -0
- package/dist/commands/report.js +430 -0
- package/dist/commands/report.js.map +1 -0
- package/dist/commands/status.d.ts +29 -0
- package/dist/commands/status.js +236 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/why.d.ts +349 -0
- package/dist/commands/why.js +937 -0
- package/dist/commands/why.js.map +1 -0
- package/dist/consent.d.ts +59 -0
- package/dist/consent.js +111 -0
- package/dist/consent.js.map +1 -0
- package/dist/copy/claims.d.ts +79 -0
- package/dist/copy/claims.js +343 -0
- package/dist/copy/claims.js.map +1 -0
- package/dist/copy/grades.d.ts +117 -0
- package/dist/copy/grades.js +96 -0
- package/dist/copy/grades.js.map +1 -0
- package/dist/copy/index.d.ts +12 -0
- package/dist/copy/index.js +13 -0
- package/dist/copy/index.js.map +1 -0
- package/dist/copy/strings.d.ts +1328 -0
- package/dist/copy/strings.js +1243 -0
- package/dist/copy/strings.js.map +1 -0
- package/dist/copy/time.d.ts +27 -0
- package/dist/copy/time.js +43 -0
- package/dist/copy/time.js.map +1 -0
- package/dist/credential.d.ts +211 -0
- package/dist/credential.js +298 -0
- package/dist/credential.js.map +1 -0
- package/dist/exit.d.ts +59 -0
- package/dist/exit.js +60 -0
- package/dist/exit.js.map +1 -0
- package/dist/git.d.ts +299 -0
- package/dist/git.js +653 -0
- package/dist/git.js.map +1 -0
- package/dist/hooks/entry.d.ts +277 -0
- package/dist/hooks/entry.js +1092 -0
- package/dist/hooks/entry.js.map +1 -0
- package/dist/hooks/post_commit.d.ts +59 -0
- package/dist/hooks/post_commit.js +160 -0
- package/dist/hooks/post_commit.js.map +1 -0
- package/dist/hooks/post_rewrite.d.ts +59 -0
- package/dist/hooks/post_rewrite.js +161 -0
- package/dist/hooks/post_rewrite.js.map +1 -0
- package/dist/hooks/session_end.d.ts +101 -0
- package/dist/hooks/session_end.js +120 -0
- package/dist/hooks/session_end.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +360 -0
- package/dist/index.js.map +1 -0
- package/dist/install.d.ts +153 -0
- package/dist/install.js +284 -0
- package/dist/install.js.map +1 -0
- package/dist/json.d.ts +100 -0
- package/dist/json.js +94 -0
- package/dist/json.js.map +1 -0
- package/dist/oauth/discovery.d.ts +96 -0
- package/dist/oauth/discovery.js +163 -0
- package/dist/oauth/discovery.js.map +1 -0
- package/dist/oauth/lock.d.ts +100 -0
- package/dist/oauth/lock.js +287 -0
- package/dist/oauth/lock.js.map +1 -0
- package/dist/oauth/loopback.d.ts +85 -0
- package/dist/oauth/loopback.js +124 -0
- package/dist/oauth/loopback.js.map +1 -0
- package/dist/oauth/pkce.d.ts +58 -0
- package/dist/oauth/pkce.js +77 -0
- package/dist/oauth/pkce.js.map +1 -0
- package/dist/oauth/read.d.ts +120 -0
- package/dist/oauth/read.js +144 -0
- package/dist/oauth/read.js.map +1 -0
- package/dist/oauth/session.d.ts +80 -0
- package/dist/oauth/session.js +112 -0
- package/dist/oauth/session.js.map +1 -0
- package/dist/oauth/signin.d.ts +178 -0
- package/dist/oauth/signin.js +225 -0
- package/dist/oauth/signin.js.map +1 -0
- package/dist/oauth/token.d.ts +139 -0
- package/dist/oauth/token.js +183 -0
- package/dist/oauth/token.js.map +1 -0
- package/dist/paths.d.ts +366 -0
- package/dist/paths.js +460 -0
- package/dist/paths.js.map +1 -0
- package/dist/policy.d.ts +195 -0
- package/dist/policy.js +244 -0
- package/dist/policy.js.map +1 -0
- package/dist/post.d.ts +302 -0
- package/dist/post.js +384 -0
- package/dist/post.js.map +1 -0
- package/dist/project.d.ts +99 -0
- package/dist/project.js +192 -0
- package/dist/project.js.map +1 -0
- package/dist/redact.d.ts +175 -0
- package/dist/redact.js +700 -0
- package/dist/redact.js.map +1 -0
- package/dist/runtime.d.ts +30 -0
- package/dist/runtime.js +37 -0
- package/dist/runtime.js.map +1 -0
- package/dist/spawn_budget.d.ts +101 -0
- package/dist/spawn_budget.js +124 -0
- package/dist/spawn_budget.js.map +1 -0
- package/dist/spool.d.ts +390 -0
- package/dist/spool.js +556 -0
- package/dist/spool.js.map +1 -0
- package/dist/state.d.ts +109 -0
- package/dist/state.js +217 -0
- package/dist/state.js.map +1 -0
- package/dist/system_message.d.ts +101 -0
- package/dist/system_message.js +141 -0
- package/dist/system_message.js.map +1 -0
- package/dist/term.d.ts +112 -0
- package/dist/term.js +134 -0
- package/dist/term.js.map +1 -0
- package/dist/version.d.ts +16 -0
- package/dist/version.js +17 -0
- package/dist/version.js.map +1 -0
- package/package.json +50 -0
package/dist/term.d.ts
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal primitives — the executable form of `DESIGN.md` §13.2–§13.5.
|
|
3
|
+
*
|
|
4
|
+
* §13.2 is explicit: "Every escape sequence in the product comes from here — no
|
|
5
|
+
* literal `\x1b[` anywhere else in any repo, so the palette has exactly one
|
|
6
|
+
* definition and `NO_COLOR` has exactly one switch." `test/term.test.ts` holds
|
|
7
|
+
* that line with a source scan; it is the only reason the rule survives contact
|
|
8
|
+
* with the fifteen tasks that build on this file.
|
|
9
|
+
*
|
|
10
|
+
* The governing constraint (§13): in a terminal we own only the foreground, and
|
|
11
|
+
* the user's theme decides what every colour name resolves to. Base-16 SGR only —
|
|
12
|
+
* no 24-bit, no 256-cube, and never a background fill.
|
|
13
|
+
*/
|
|
14
|
+
/** The six roles of §13.1. `text` is deliberately empty — see §13.2. */
|
|
15
|
+
export declare const SGR: {
|
|
16
|
+
readonly reset: "\u001B[0m";
|
|
17
|
+
readonly text: "";
|
|
18
|
+
readonly muted: "\u001B[2m";
|
|
19
|
+
readonly accent: "\u001B[36m";
|
|
20
|
+
readonly ok: "\u001B[32m";
|
|
21
|
+
readonly warn: "\u001B[33m";
|
|
22
|
+
readonly bad: "\u001B[31m";
|
|
23
|
+
readonly strong: "\u001B[1m";
|
|
24
|
+
};
|
|
25
|
+
export type SgrRole = keyof typeof SGR;
|
|
26
|
+
/** §13.2 — status glyphs degrade to WORDS, never to nothing. */
|
|
27
|
+
export declare const GLYPH: {
|
|
28
|
+
readonly ok: {
|
|
29
|
+
readonly colour: "●";
|
|
30
|
+
readonly plain: "ok ";
|
|
31
|
+
};
|
|
32
|
+
readonly warn: {
|
|
33
|
+
readonly colour: "●";
|
|
34
|
+
readonly plain: "warn ";
|
|
35
|
+
};
|
|
36
|
+
readonly bad: {
|
|
37
|
+
readonly colour: "●";
|
|
38
|
+
readonly plain: "error";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type GlyphKind = keyof typeof GLYPH;
|
|
42
|
+
/** §13.4 — hard wrap. Never `process.stdout.columns`. */
|
|
43
|
+
export declare const WRAP_COLUMNS = 80;
|
|
44
|
+
/** §13.5 — fixed key column for key/value output. */
|
|
45
|
+
export declare const LABEL_GUTTER = 11;
|
|
46
|
+
/**
|
|
47
|
+
* §13.3 detection order, resolved ONCE at process start and not negotiable:
|
|
48
|
+
* 1. NO_COLOR set to any value (including empty) — wins over everything
|
|
49
|
+
* 2. !isatty(1)
|
|
50
|
+
* 3. TERM=dumb
|
|
51
|
+
* 4. CI set
|
|
52
|
+
* 5. --no-color
|
|
53
|
+
*
|
|
54
|
+
* `--json` implies all of them; callers pass `json: true`.
|
|
55
|
+
*/
|
|
56
|
+
export interface ColourInputs {
|
|
57
|
+
readonly env: NodeJS.ProcessEnv;
|
|
58
|
+
readonly isTty: boolean;
|
|
59
|
+
readonly noColorFlag: boolean;
|
|
60
|
+
readonly json: boolean;
|
|
61
|
+
}
|
|
62
|
+
export declare function resolveColour(inputs: ColourInputs): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Wrap one SGR role around text. A no-op when colour is off, which is what makes
|
|
65
|
+
* `NO_COLOR` a lossless degradation rather than a downgrade (§13.1): bold carries
|
|
66
|
+
* structure, colour carries status, and the indentation carries the rest.
|
|
67
|
+
*/
|
|
68
|
+
export declare function paint(enabled: boolean, role: SgrRole, text: string): string;
|
|
69
|
+
/** §13.2 — the glyph, or the word it degrades to. */
|
|
70
|
+
export declare function glyph(enabled: boolean, kind: GlyphKind): string;
|
|
71
|
+
/**
|
|
72
|
+
* §13.4 hard wrap at 80 columns INCLUDING the indent, with continuation lines
|
|
73
|
+
* hung to `hangingIndent`.
|
|
74
|
+
*
|
|
75
|
+
* Operates on plain text only. Wrapping painted text would count escape bytes as
|
|
76
|
+
* columns, so every caller wraps first and paints after — the reason `paint` is a
|
|
77
|
+
* separate function rather than a parameter here.
|
|
78
|
+
*
|
|
79
|
+
* A single word longer than the available width (a URL, a path) is emitted on its
|
|
80
|
+
* own line rather than broken: breaking a URL makes it uncopyable, which costs
|
|
81
|
+
* more than the overflow.
|
|
82
|
+
*/
|
|
83
|
+
export declare function wrap(text: string, indent: number, hangingIndent?: number): string[];
|
|
84
|
+
/**
|
|
85
|
+
* §13.4 — long paths truncate from the LEFT with a leading ellipsis, because the
|
|
86
|
+
* filename identifies and the directory does not.
|
|
87
|
+
*/
|
|
88
|
+
export declare function truncatePath(path: string, max: number): string;
|
|
89
|
+
/** §13.5 — key/value output on the fixed label gutter. */
|
|
90
|
+
export declare function labelled(indent: number, key: string, value: string): string;
|
|
91
|
+
/**
|
|
92
|
+
* §13.6 — the one shape for every interactive failure: what, why, fix. Fix last,
|
|
93
|
+
* always, because the last thing on screen is what gets copied.
|
|
94
|
+
*
|
|
95
|
+
* Three prohibitions the CALLER owns, because they are properties of the copy
|
|
96
|
+
* rather than of the layout: never a stack trace unless `VIBECOMMIT_DEBUG` is
|
|
97
|
+
* set, never a bare HTTP status, and **never "you" as the subject of the `what`
|
|
98
|
+
* line** — the subject is the system or the state.
|
|
99
|
+
*
|
|
100
|
+
* The `what` line carries the status colour on the glyph and `strong` on the
|
|
101
|
+
* text: one colour, one weight, per §13.1.
|
|
102
|
+
*/
|
|
103
|
+
export interface ErrorBlock {
|
|
104
|
+
readonly kind: GlyphKind;
|
|
105
|
+
readonly what: string;
|
|
106
|
+
/** Up to three lines after wrapping (§13.6). Names the state, with the value. */
|
|
107
|
+
readonly why: readonly string[];
|
|
108
|
+
readonly fixLabel?: string;
|
|
109
|
+
/** Commands to type. `accent`, per §13.6 — the one place besides a URL. */
|
|
110
|
+
readonly fixes?: readonly string[];
|
|
111
|
+
}
|
|
112
|
+
export declare function renderErrorBlock(block: ErrorBlock, colour: boolean): string[];
|
package/dist/term.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal primitives — the executable form of `DESIGN.md` §13.2–§13.5.
|
|
3
|
+
*
|
|
4
|
+
* §13.2 is explicit: "Every escape sequence in the product comes from here — no
|
|
5
|
+
* literal `\x1b[` anywhere else in any repo, so the palette has exactly one
|
|
6
|
+
* definition and `NO_COLOR` has exactly one switch." `test/term.test.ts` holds
|
|
7
|
+
* that line with a source scan; it is the only reason the rule survives contact
|
|
8
|
+
* with the fifteen tasks that build on this file.
|
|
9
|
+
*
|
|
10
|
+
* The governing constraint (§13): in a terminal we own only the foreground, and
|
|
11
|
+
* the user's theme decides what every colour name resolves to. Base-16 SGR only —
|
|
12
|
+
* no 24-bit, no 256-cube, and never a background fill.
|
|
13
|
+
*/
|
|
14
|
+
/** The six roles of §13.1. `text` is deliberately empty — see §13.2. */
|
|
15
|
+
export const SGR = {
|
|
16
|
+
reset: "\x1b[0m",
|
|
17
|
+
text: "",
|
|
18
|
+
muted: "\x1b[2m",
|
|
19
|
+
accent: "\x1b[36m",
|
|
20
|
+
ok: "\x1b[32m",
|
|
21
|
+
warn: "\x1b[33m",
|
|
22
|
+
bad: "\x1b[31m",
|
|
23
|
+
strong: "\x1b[1m",
|
|
24
|
+
};
|
|
25
|
+
/** §13.2 — status glyphs degrade to WORDS, never to nothing. */
|
|
26
|
+
export const GLYPH = {
|
|
27
|
+
ok: { colour: "●", plain: "ok " },
|
|
28
|
+
warn: { colour: "●", plain: "warn " },
|
|
29
|
+
bad: { colour: "●", plain: "error" },
|
|
30
|
+
};
|
|
31
|
+
/** §13.4 — hard wrap. Never `process.stdout.columns`. */
|
|
32
|
+
export const WRAP_COLUMNS = 80;
|
|
33
|
+
/** §13.5 — fixed key column for key/value output. */
|
|
34
|
+
export const LABEL_GUTTER = 11;
|
|
35
|
+
export function resolveColour(inputs) {
|
|
36
|
+
if (inputs.json)
|
|
37
|
+
return false;
|
|
38
|
+
if (inputs.env.NO_COLOR !== undefined)
|
|
39
|
+
return false;
|
|
40
|
+
if (!inputs.isTty)
|
|
41
|
+
return false;
|
|
42
|
+
if (inputs.env.TERM === "dumb")
|
|
43
|
+
return false;
|
|
44
|
+
if (inputs.env.CI !== undefined)
|
|
45
|
+
return false;
|
|
46
|
+
if (inputs.noColorFlag)
|
|
47
|
+
return false;
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Wrap one SGR role around text. A no-op when colour is off, which is what makes
|
|
52
|
+
* `NO_COLOR` a lossless degradation rather than a downgrade (§13.1): bold carries
|
|
53
|
+
* structure, colour carries status, and the indentation carries the rest.
|
|
54
|
+
*/
|
|
55
|
+
export function paint(enabled, role, text) {
|
|
56
|
+
const code = SGR[role];
|
|
57
|
+
if (!enabled || code === "")
|
|
58
|
+
return text;
|
|
59
|
+
return `${code}${text}${SGR.reset}`;
|
|
60
|
+
}
|
|
61
|
+
/** §13.2 — the glyph, or the word it degrades to. */
|
|
62
|
+
export function glyph(enabled, kind) {
|
|
63
|
+
return enabled ? GLYPH[kind].colour : GLYPH[kind].plain;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* §13.4 hard wrap at 80 columns INCLUDING the indent, with continuation lines
|
|
67
|
+
* hung to `hangingIndent`.
|
|
68
|
+
*
|
|
69
|
+
* Operates on plain text only. Wrapping painted text would count escape bytes as
|
|
70
|
+
* columns, so every caller wraps first and paints after — the reason `paint` is a
|
|
71
|
+
* separate function rather than a parameter here.
|
|
72
|
+
*
|
|
73
|
+
* A single word longer than the available width (a URL, a path) is emitted on its
|
|
74
|
+
* own line rather than broken: breaking a URL makes it uncopyable, which costs
|
|
75
|
+
* more than the overflow.
|
|
76
|
+
*/
|
|
77
|
+
export function wrap(text, indent, hangingIndent = indent) {
|
|
78
|
+
const words = text.split(/\s+/).filter((w) => w.length > 0);
|
|
79
|
+
if (words.length === 0)
|
|
80
|
+
return [];
|
|
81
|
+
const lines = [];
|
|
82
|
+
let current = " ".repeat(indent);
|
|
83
|
+
let currentIndent = indent;
|
|
84
|
+
let empty = true;
|
|
85
|
+
for (const word of words) {
|
|
86
|
+
const candidate = empty ? current + word : `${current} ${word}`;
|
|
87
|
+
if (!empty && candidate.length > WRAP_COLUMNS) {
|
|
88
|
+
lines.push(current);
|
|
89
|
+
currentIndent = hangingIndent;
|
|
90
|
+
current = " ".repeat(currentIndent) + word;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
current = candidate;
|
|
94
|
+
}
|
|
95
|
+
empty = false;
|
|
96
|
+
}
|
|
97
|
+
lines.push(current);
|
|
98
|
+
return lines;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* §13.4 — long paths truncate from the LEFT with a leading ellipsis, because the
|
|
102
|
+
* filename identifies and the directory does not.
|
|
103
|
+
*/
|
|
104
|
+
export function truncatePath(path, max) {
|
|
105
|
+
if (path.length <= max)
|
|
106
|
+
return path;
|
|
107
|
+
return `…${path.slice(path.length - (max - 1))}`;
|
|
108
|
+
}
|
|
109
|
+
/** §13.5 — key/value output on the fixed label gutter. */
|
|
110
|
+
export function labelled(indent, key, value) {
|
|
111
|
+
return `${" ".repeat(indent)}${key.padEnd(LABEL_GUTTER)}${value}`;
|
|
112
|
+
}
|
|
113
|
+
export function renderErrorBlock(block, colour) {
|
|
114
|
+
const out = [];
|
|
115
|
+
const marker = glyph(colour, block.kind);
|
|
116
|
+
for (const [i, line] of wrap(block.what, 2 + marker.length + 1, 4).entries()) {
|
|
117
|
+
out.push(i === 0
|
|
118
|
+
? ` ${paint(colour, block.kind, marker)} ${paint(colour, "strong", line.trimStart())}`
|
|
119
|
+
: paint(colour, "strong", line));
|
|
120
|
+
}
|
|
121
|
+
for (const paragraph of block.why) {
|
|
122
|
+
for (const line of wrap(paragraph, 4))
|
|
123
|
+
out.push(paint(colour, "muted", line));
|
|
124
|
+
}
|
|
125
|
+
if (block.fixLabel !== undefined && block.fixes !== undefined && block.fixes.length > 0) {
|
|
126
|
+
out.push("");
|
|
127
|
+
for (const line of wrap(block.fixLabel, 4))
|
|
128
|
+
out.push(line);
|
|
129
|
+
for (const fix of block.fixes)
|
|
130
|
+
out.push(` ${paint(colour, "accent", fix)}`);
|
|
131
|
+
}
|
|
132
|
+
return out;
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=term.js.map
|
package/dist/term.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"term.js","sourceRoot":"","sources":["../src/term.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,wEAAwE;AACxE,MAAM,CAAC,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,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAClC,CAAC;IACJ,CAAC;IACD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;QAClC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAChF,CAAC;IACD,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxF,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACb,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3D,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,KAAK;YAAE,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The client version that goes on the wire as `X-Client-Version` (CR-029).
|
|
3
|
+
*
|
|
4
|
+
* Deliberately a literal rather than an import of `package.json`: `rootDir` is
|
|
5
|
+
* `./src`, so importing the manifest would drag it into `dist/` and change the
|
|
6
|
+
* published tree shape. The cost of the literal is that it can drift from the
|
|
7
|
+
* manifest — which is precisely what `scripts/check-version-skew.mjs` exists to
|
|
8
|
+
* catch, and why CI runs it before publish.
|
|
9
|
+
*
|
|
10
|
+
* There is no version on the wire today and three separately-editable version
|
|
11
|
+
* fields on disk (D58 plan §ER5/§ER14). This constant plus the skew check is the
|
|
12
|
+
* whole fix: one source, asserted equal to the manifest and to the release tag.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CLIENT_VERSION = "0.1.0";
|
|
15
|
+
/** Header name for the wire contract. */
|
|
16
|
+
export declare const CLIENT_VERSION_HEADER = "X-Client-Version";
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The client version that goes on the wire as `X-Client-Version` (CR-029).
|
|
3
|
+
*
|
|
4
|
+
* Deliberately a literal rather than an import of `package.json`: `rootDir` is
|
|
5
|
+
* `./src`, so importing the manifest would drag it into `dist/` and change the
|
|
6
|
+
* published tree shape. The cost of the literal is that it can drift from the
|
|
7
|
+
* manifest — which is precisely what `scripts/check-version-skew.mjs` exists to
|
|
8
|
+
* catch, and why CI runs it before publish.
|
|
9
|
+
*
|
|
10
|
+
* There is no version on the wire today and three separately-editable version
|
|
11
|
+
* fields on disk (D58 plan §ER5/§ER14). This constant plus the skew check is the
|
|
12
|
+
* whole fix: one source, asserted equal to the manifest and to the release tag.
|
|
13
|
+
*/
|
|
14
|
+
export const CLIENT_VERSION = "0.1.0";
|
|
15
|
+
/** Header name for the wire contract. */
|
|
16
|
+
export const CLIENT_VERSION_HEADER = "X-Client-Version";
|
|
17
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAEtC,yCAAyC;AACzC,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vibe-commit/capture",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "VibeCommit capture client — records Claude Code sessions against the commits they produced.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"vibecommit": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=22.15.0"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/Vibe-Commit/vibecommit-capture.git"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/Vibe-Commit/vibecommit-capture#readme",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/Vibe-Commit/vibecommit-capture/issues"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"claude-code",
|
|
32
|
+
"audit",
|
|
33
|
+
"provenance",
|
|
34
|
+
"git",
|
|
35
|
+
"cli"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc -p tsconfig.json",
|
|
39
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json",
|
|
40
|
+
"pretest": "npm run build",
|
|
41
|
+
"test": "node --test --import tsx 'test/**/*.test.ts'",
|
|
42
|
+
"check:skew": "node scripts/check-version-skew.mjs",
|
|
43
|
+
"fixture:write": "node --import tsx scripts/write-wire-fixture.mts"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^22.10.5",
|
|
47
|
+
"tsx": "^4.19.2",
|
|
48
|
+
"typescript": "^5.7.3"
|
|
49
|
+
}
|
|
50
|
+
}
|