@litfamily/litcodex 1.0.26 → 1.0.28
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-Ko-KR.md +27 -26
- package/README.md +31 -28
- package/dist/cli.d.ts +3 -2
- package/dist/cli.js +72 -3
- package/dist/install/generated-skill-payload-hashes.d.ts +2 -2
- package/dist/install/generated-skill-payload-hashes.js +2 -2
- package/dist/postinstall.js +12 -1
- package/dist/pty-helper.d.ts +7 -0
- package/dist/pty-helper.js +45 -0
- package/dist/run.d.ts +57 -0
- package/dist/run.js +354 -0
- package/marketplace/plugins/litcodex/.codex-plugin/plugin.json +1 -1
- package/marketplace/plugins/litcodex/components/auto-update/package.json +1 -1
- package/marketplace/plugins/litcodex/components/comment-checker/package.json +1 -1
- package/marketplace/plugins/litcodex/components/git-bash/package.json +1 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-status.d.ts +8 -3
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-status.js +11 -6
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hook-cli.js +28 -10
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hud-cli.d.ts +38 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hud-cli.js +155 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hud.d.ts +42 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hud.js +297 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/run-filter.d.ts +23 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/run-filter.js +142 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/run-panel.d.ts +29 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/run-panel.js +102 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/screen-card.d.ts +24 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/screen-card.js +104 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/screen-status.d.ts +24 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/screen-status.js +110 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/statusline.d.ts +17 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/statusline.js +113 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-map.d.ts +7 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-map.js +58 -10
- package/marketplace/plugins/litcodex/components/lit-loop/package.json +1 -1
- package/marketplace/plugins/litcodex/components/lsp/package.json +1 -1
- package/marketplace/plugins/litcodex/components/rules/bundled-rules/lit-humanizer.md +2 -0
- package/marketplace/plugins/litcodex/components/rules/dist/deliverable-hedge-guard.d.ts +8 -0
- package/marketplace/plugins/litcodex/components/rules/dist/deliverable-hedge-guard.js +381 -39
- package/marketplace/plugins/litcodex/components/rules/package.json +1 -1
- package/marketplace/plugins/litcodex/components/start-work-continuation/package.json +1 -1
- package/marketplace/plugins/litcodex/components/telemetry/package.json +1 -1
- package/marketplace/plugins/litcodex/components/wikify-knowledge/package.json +1 -1
- package/marketplace/plugins/litcodex/skills/lit-humanizer/SKILL.md +4 -0
- package/marketplace/plugins/litcodex/skills/lit-humanizer/scripts/core.mjs +5 -1
- package/marketplace/plugins/litcodex/skills/lit-loop/SKILL.md +2 -1
- package/node_modules/@litcodex/lit-loop/dist/card-status.d.ts +8 -3
- package/node_modules/@litcodex/lit-loop/dist/card-status.js +11 -6
- package/node_modules/@litcodex/lit-loop/dist/hook-cli.js +28 -10
- package/node_modules/@litcodex/lit-loop/dist/hud-cli.d.ts +38 -0
- package/node_modules/@litcodex/lit-loop/dist/hud-cli.js +155 -0
- package/node_modules/@litcodex/lit-loop/dist/hud.d.ts +42 -0
- package/node_modules/@litcodex/lit-loop/dist/hud.js +297 -0
- package/node_modules/@litcodex/lit-loop/dist/run-filter.d.ts +23 -0
- package/node_modules/@litcodex/lit-loop/dist/run-filter.js +142 -0
- package/node_modules/@litcodex/lit-loop/dist/run-panel.d.ts +29 -0
- package/node_modules/@litcodex/lit-loop/dist/run-panel.js +102 -0
- package/node_modules/@litcodex/lit-loop/dist/screen-card.d.ts +24 -0
- package/node_modules/@litcodex/lit-loop/dist/screen-card.js +104 -0
- package/node_modules/@litcodex/lit-loop/dist/screen-status.d.ts +24 -0
- package/node_modules/@litcodex/lit-loop/dist/screen-status.js +110 -0
- package/node_modules/@litcodex/lit-loop/dist/statusline.d.ts +17 -0
- package/node_modules/@litcodex/lit-loop/dist/statusline.js +113 -0
- package/node_modules/@litcodex/lit-loop/dist/workflow-map.d.ts +7 -0
- package/node_modules/@litcodex/lit-loop/dist/workflow-map.js +58 -10
- package/node_modules/@litcodex/lit-loop/package.json +1 -1
- package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/SKILL.md +4 -0
- package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/scripts/core.mjs +5 -1
- package/node_modules/@litcodex/lit-loop/skills/lit-loop/SKILL.md +2 -1
- package/package.json +5 -2
- package/readme-assets/badge-version.svg +1 -1
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// src/statusline.ts — `litcodex statusline`: the LIT status as one line, for a host status line command.
|
|
2
|
+
//
|
|
3
|
+
// Codex 0.163.0 has no command-backed status line yet; this prints the line such a command would show, in
|
|
4
|
+
// the shape Claude-compatible status line hosts use: optional JSON on stdin naming `session_id` and `cwd`
|
|
5
|
+
// (or `workspace.current_dir`), one line on stdout, the width from `COLUMNS`. It picks that session's LIT
|
|
6
|
+
// records, else the newest LIT session in the same folder, else the newest LIT session, the way
|
|
7
|
+
// `litcodex hud` does (hud.ts), and reads the same card (card-status.ts) without opening a Codex rollout.
|
|
8
|
+
// Stdin is capped at 64 KiB and read for at most 200 ms. Nothing is written but the line; any problem
|
|
9
|
+
// prints an empty line, and the exit code is always 0.
|
|
10
|
+
import { clock } from "./card-status.js";
|
|
11
|
+
import { cleanStatus, fit, listSessions, readHud } from "./hud.js";
|
|
12
|
+
import { stageText } from "./screen-card.js";
|
|
13
|
+
const MAX_STDIN_BYTES = 64 * 1024;
|
|
14
|
+
const STDIN_BUDGET_MS = 200;
|
|
15
|
+
const DEFAULT_WIDTH = 120;
|
|
16
|
+
const ACCENT = "\u001b[38;2;255;155;94m";
|
|
17
|
+
const BOLD = "\u001b[1m";
|
|
18
|
+
const DIM = "\u001b[2m";
|
|
19
|
+
const RESET = "\u001b[0m";
|
|
20
|
+
const NO_INPUT = { sessionId: null, cwd: null };
|
|
21
|
+
/** Whatever arrives within the budget and the cap; null when the cap is passed. */
|
|
22
|
+
function readInput(stdin) {
|
|
23
|
+
if (stdin.isTTY === true)
|
|
24
|
+
return Promise.resolve("");
|
|
25
|
+
return new Promise((resolve) => {
|
|
26
|
+
const chunks = [];
|
|
27
|
+
let total = 0;
|
|
28
|
+
let settled = false;
|
|
29
|
+
const finish = (value) => {
|
|
30
|
+
if (settled)
|
|
31
|
+
return;
|
|
32
|
+
settled = true;
|
|
33
|
+
clearTimeout(timer);
|
|
34
|
+
stdin.removeListener("data", onData);
|
|
35
|
+
stdin.pause();
|
|
36
|
+
resolve(value);
|
|
37
|
+
};
|
|
38
|
+
const onData = (chunk) => {
|
|
39
|
+
const buffer = typeof chunk === "string" ? Buffer.from(chunk) : chunk;
|
|
40
|
+
total += buffer.length;
|
|
41
|
+
if (total > MAX_STDIN_BYTES)
|
|
42
|
+
finish(null);
|
|
43
|
+
else
|
|
44
|
+
chunks.push(buffer);
|
|
45
|
+
};
|
|
46
|
+
const timer = setTimeout(() => finish(Buffer.concat(chunks).toString("utf8")), STDIN_BUDGET_MS);
|
|
47
|
+
stdin.on("data", onData);
|
|
48
|
+
stdin.once("end", () => finish(Buffer.concat(chunks).toString("utf8")));
|
|
49
|
+
stdin.once("error", () => finish(null));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function parseInput(raw) {
|
|
53
|
+
if (raw === null || raw.trim() === "")
|
|
54
|
+
return NO_INPUT;
|
|
55
|
+
try {
|
|
56
|
+
const value = JSON.parse(raw);
|
|
57
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
58
|
+
return NO_INPUT;
|
|
59
|
+
const record = value;
|
|
60
|
+
const workspace = record["workspace"];
|
|
61
|
+
const current = typeof workspace === "object" && workspace !== null
|
|
62
|
+
? workspace["current_dir"]
|
|
63
|
+
: undefined;
|
|
64
|
+
const cwd = typeof current === "string" ? current : typeof record["cwd"] === "string" ? record["cwd"] : null;
|
|
65
|
+
const sessionId = typeof record["session_id"] === "string" ? record["session_id"] : null;
|
|
66
|
+
return { sessionId: sessionId === "" ? null : sessionId, cwd: cwd === "" ? null : cwd };
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return NO_INPUT;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** The session the line is about: the named one when LIT knows it, else the newest one in `cwd`, else null (newest). */
|
|
73
|
+
function wantedSession(env, input) {
|
|
74
|
+
const sessions = listSessions(env);
|
|
75
|
+
if (input.sessionId !== null && sessions.some((session) => session.id === input.sessionId))
|
|
76
|
+
return input.sessionId;
|
|
77
|
+
return sessions.find((session) => input.cwd !== null && session.cwd === input.cwd)?.id ?? null;
|
|
78
|
+
}
|
|
79
|
+
/** The one line, coloured on request and cut to `width` cells; "" when there is no LIT turn to show. */
|
|
80
|
+
export function statuslineText(status, options) {
|
|
81
|
+
if (status === null || status.state === "ready")
|
|
82
|
+
return "";
|
|
83
|
+
const card = cleanStatus(status);
|
|
84
|
+
const route = `🔥 LIT · ${card.mode ?? "lit"}${card.state === "complete" ? " ✓" : ""}`;
|
|
85
|
+
const parts = [card.map === null ? null : card.map.cells.map(stageText).join(" › ")];
|
|
86
|
+
if (card.step !== null)
|
|
87
|
+
parts.push(`⠹ ${card.step.tool} ${clock(card.now - card.step.startedAt)}`);
|
|
88
|
+
const rest = parts.filter((part) => part !== null && part !== "").join(" ");
|
|
89
|
+
const line = fit(rest === "" ? route : `${route} ${rest}`, Math.max(10, options.width));
|
|
90
|
+
if (!options.color)
|
|
91
|
+
return line;
|
|
92
|
+
return line.startsWith(route)
|
|
93
|
+
? `${BOLD}${ACCENT}${route}${RESET}${DIM}${line.slice(route.length)}${RESET}`
|
|
94
|
+
: `${BOLD}${ACCENT}${line}${RESET}`;
|
|
95
|
+
}
|
|
96
|
+
export async function statuslineCommand(_args, io) {
|
|
97
|
+
try {
|
|
98
|
+
const input = parseInput(await readInput(io.stdin));
|
|
99
|
+
const now = (io.now ?? Date.now)();
|
|
100
|
+
const view = readHud(io.env, wantedSession(io.env, input), now);
|
|
101
|
+
const columns = Number.parseInt(io.env["COLUMNS"] ?? "", 10);
|
|
102
|
+
const noColor = io.env["NO_COLOR"];
|
|
103
|
+
const line = statuslineText(view.status, {
|
|
104
|
+
width: Number.isFinite(columns) && columns > 0 ? columns : DEFAULT_WIDTH,
|
|
105
|
+
color: noColor === undefined || noColor === "",
|
|
106
|
+
});
|
|
107
|
+
io.stdout.write(`${line}\n`);
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
io.stdout.write("\n");
|
|
111
|
+
}
|
|
112
|
+
return 0;
|
|
113
|
+
}
|
|
@@ -34,6 +34,13 @@ export declare function progressBar(done: number, total: number): string;
|
|
|
34
34
|
* with fewer than three words left before the cut is dropped.
|
|
35
35
|
*/
|
|
36
36
|
export declare function safeTitle(label: string): string | null;
|
|
37
|
+
/** One row of the card's checklist: a plan task or a lit-loop goal. */
|
|
38
|
+
export interface ChecklistRow {
|
|
39
|
+
readonly state: "done" | "current" | "pending";
|
|
40
|
+
readonly label: string;
|
|
41
|
+
}
|
|
42
|
+
/** The checklist under the map: the start-work plan rows, else this session's lit-loop goals; [] when neither. */
|
|
43
|
+
export declare function readChecklist(repoRoot: string, sessionId: string | null): ChecklistRow[];
|
|
37
44
|
export declare function readWorkflowSignals(repoRoot: string, sessionId: string | null, now?: number): WorkflowSignals;
|
|
38
45
|
/** One stage of the map, as the text line and the LIT card both draw it. */
|
|
39
46
|
export interface MapCell {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
// src/workflow-map.ts — the
|
|
1
|
+
// src/workflow-map.ts — the LIT workflow map and the checklist under it.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
3
|
+
// The map is plain text: emoji and block cells. Codex 0.162.0 and later draw ANSI colour inside a hook
|
|
4
|
+
// `systemMessage` in the terminal UI, but other clients may show escape codes literally, so colour is
|
|
5
|
+
// added only by the card (screen-card.ts) and only when the user turns it on. Everything here is built
|
|
6
|
+
// from saved state only: the start-work record and its plan checkboxes, lit-loop goals, the lit-plan
|
|
7
|
+
// activation record and the litresearch journal. A stage with no saved signal is left out rather than
|
|
8
|
+
// guessed. Every read fails open.
|
|
7
9
|
import { createHash } from "node:crypto";
|
|
8
10
|
import { lstatSync, mkdirSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
9
11
|
import { basename, dirname, isAbsolute, join, relative, sep } from "node:path";
|
|
@@ -172,7 +174,8 @@ export function safeTitle(label) {
|
|
|
172
174
|
return `${title.slice(0, MAX_TITLE - 1)}…`;
|
|
173
175
|
return cut < 0 ? title : `${title} …`;
|
|
174
176
|
}
|
|
175
|
-
|
|
177
|
+
/** The start-work plan this session shows, with its status and text; null when there is none. */
|
|
178
|
+
function activeWorkPlan(repoRoot, sessionId) {
|
|
176
179
|
const state = readJson(repoRoot, join(repoRoot, ".litcodex/start-work/state.json"));
|
|
177
180
|
if (!isRecord(state) || !isRecord(state["works"]))
|
|
178
181
|
return null;
|
|
@@ -198,17 +201,28 @@ function readWork(repoRoot, sessionId) {
|
|
|
198
201
|
const text = readText(repoRoot, join(repoRoot, ".litcodex/plans", file));
|
|
199
202
|
if (text === null)
|
|
200
203
|
return null;
|
|
201
|
-
|
|
204
|
+
return { status: work["status"], text };
|
|
205
|
+
}
|
|
206
|
+
function readWork(repoRoot, sessionId) {
|
|
207
|
+
const plan = activeWorkPlan(repoRoot, sessionId);
|
|
208
|
+
if (plan === null)
|
|
209
|
+
return null;
|
|
210
|
+
const rows = countPlanRows(plan.text);
|
|
202
211
|
if (rows.total === 0)
|
|
203
212
|
return null;
|
|
204
|
-
return { ...rows, status:
|
|
213
|
+
return { ...rows, status: plan.status };
|
|
205
214
|
}
|
|
206
|
-
|
|
215
|
+
/** The goal records of one lit-loop goals file; null when it has none. */
|
|
216
|
+
function goalList(repoRoot, path) {
|
|
207
217
|
const plan = readJson(repoRoot, path);
|
|
208
218
|
if (!isRecord(plan) || !Array.isArray(plan["goals"]))
|
|
209
219
|
return null;
|
|
210
220
|
const goals = plan["goals"].filter(isRecord);
|
|
211
|
-
|
|
221
|
+
return goals.length === 0 ? null : goals;
|
|
222
|
+
}
|
|
223
|
+
function goalProgress(repoRoot, path) {
|
|
224
|
+
const goals = goalList(repoRoot, path);
|
|
225
|
+
if (goals === null)
|
|
212
226
|
return null;
|
|
213
227
|
const open = goals.find((goal) => goal["status"] === "in_progress") ?? goals.find((goal) => goal["status"] === "pending");
|
|
214
228
|
return {
|
|
@@ -226,6 +240,40 @@ function readGoals(repoRoot, sessionId) {
|
|
|
226
240
|
const shared = goalProgress(repoRoot, join(repoRoot, LIT_LOOP_DIR, LIT_LOOP_GOALS));
|
|
227
241
|
return shared !== null && shared.done < shared.total ? shared : null;
|
|
228
242
|
}
|
|
243
|
+
const MAX_CHECKLIST = 3;
|
|
244
|
+
/**
|
|
245
|
+
* At most three rows around the open one: the last finished row, the open row and the next one. With
|
|
246
|
+
* nothing open, the last three finished rows. A label cut down to nothing by `safeTitle` reads `#<n>`.
|
|
247
|
+
*/
|
|
248
|
+
function checklistWindow(items, current) {
|
|
249
|
+
const start = current < 0
|
|
250
|
+
? Math.max(0, items.length - MAX_CHECKLIST)
|
|
251
|
+
: Math.max(0, Math.min(current - 1, items.length - MAX_CHECKLIST));
|
|
252
|
+
return items.slice(start, start + MAX_CHECKLIST).map((item, offset) => ({
|
|
253
|
+
state: start + offset === current ? "current" : item.done ? "done" : "pending",
|
|
254
|
+
label: safeTitle(item.label) ?? `#${start + offset + 1}`,
|
|
255
|
+
}));
|
|
256
|
+
}
|
|
257
|
+
/** The checklist under the map: the start-work plan rows, else this session's lit-loop goals; [] when neither. */
|
|
258
|
+
export function readChecklist(repoRoot, sessionId) {
|
|
259
|
+
if (typeof repoRoot !== "string" || !isAbsolute(repoRoot))
|
|
260
|
+
return [];
|
|
261
|
+
const id = normalizeSessionId(sessionId);
|
|
262
|
+
const plan = activeWorkPlan(repoRoot, id);
|
|
263
|
+
const rows = plan === null ? [] : planRows(plan.text);
|
|
264
|
+
if (rows.length > 0)
|
|
265
|
+
return checklistWindow(rows, rows.findIndex((row) => !row.done));
|
|
266
|
+
const scoped = id === null ? null : goalList(repoRoot, join(repoRoot, LIT_LOOP_DIR, id, LIT_LOOP_GOALS));
|
|
267
|
+
const goals = scoped ?? goalList(repoRoot, join(repoRoot, LIT_LOOP_DIR, LIT_LOOP_GOALS));
|
|
268
|
+
if (goals === null)
|
|
269
|
+
return [];
|
|
270
|
+
const items = goals.map((goal) => ({
|
|
271
|
+
done: goal["status"] === "complete",
|
|
272
|
+
label: typeof goal["title"] === "string" ? goal["title"] : "",
|
|
273
|
+
}));
|
|
274
|
+
const running = goals.findIndex((goal) => goal["status"] === "in_progress");
|
|
275
|
+
return checklistWindow(items, running >= 0 ? running : items.findIndex((item) => !item.done));
|
|
276
|
+
}
|
|
229
277
|
function readPlanRecord(repoRoot, sessionId) {
|
|
230
278
|
if (sessionId === null)
|
|
231
279
|
return null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@litcodex/lit-loop",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": "LitCodex Lit-Loop runtime: durable repo-native multi-goal orchestration with embedded success criteria and observable evidence audit.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": true,
|
|
@@ -137,6 +137,10 @@ Load only what the task needs:
|
|
|
137
137
|
|
|
138
138
|
`rules.json` is the source for the dependency-free Node detector and its rule IDs, tiers, exemptions, and caption context. Run `node scripts/test-fixtures.mjs` for rule cases and `node scripts/test-ko-metrics.mjs` for Korean metric goldens. The metric is an optional review aid, not a quality score. Local negative-corpus material is excluded from packages and commits.
|
|
139
139
|
|
|
140
|
+
Write positive-first. Name what a figure or thing is, then attach a needed caveat once. `18,420회는 주민 수가 아님. 고유 방문자 수도 아님.` leaves the reader guessing; "18,420회는 같은 사람의 반복 방문을 포함한 방문 횟수 합계입니다" tells them. A real gap still gets one plain line, such as "고유 이용자 지표는 자료에 없습니다".
|
|
141
|
+
|
|
142
|
+
The Codex write guard runs a `negation-cluster` check beside the detector. It counts definitional negations in each paragraph, list block, or Markdown table column: the plain forms (`아닙니다`, `아님`, `아니다`, `아니며`, `아니라`, `아닌`; `is not`, `are not`, `not a`, `rather than`) and the reworded forms that say the same thing (`~로 읽을 수 없음`, `~로 볼 수 없음`, `~로 보지 않음`, `~을 뜻하지 않음`, `~와는 다르다`, `~로 읽으면 안 된다`; `should not be read as`, `does not mean`). Two Korean hits in one block, or three in any mix of languages, refuse the write, and the refusal carries the rewrite advice. Exactly two hits that are mixed or English warn and let the write through. Trading `아님` for `~로 읽을 수 없음`, `~와는 다르다` or `~로 읽으면 안 된다` still counts, so rewrite the block to state the thing itself. Table cells of 12 characters or fewer, code, inline code, quote lines, and internal records stay exempt; that is why a bad example in this skill sits in inline code or a blockquote.
|
|
143
|
+
|
|
140
144
|
## Korean deep review
|
|
141
145
|
|
|
142
146
|
Use the existing Korean review agents when the host exposes them: `style-analyzer` notes register and cadence; `prose-editor` revises without changing claims; `meaning-preservation-auditor` checks facts, modality, numbers, names, and quotes; `native-flow-reviewer` checks idiom and rhythm; `polish-orchestrator` resolves evidenced findings and runs the final detector. Limit this to two review rounds. If agent surfaces are unavailable, follow the same sequence directly; never invent unsupported agent APIs.
|
|
@@ -200,11 +200,15 @@ export function scanText(text, rules, file = '<stdin>') {
|
|
|
200
200
|
rule.regex.lastIndex = 0;
|
|
201
201
|
const match = rule.regex.exec(segment.text);
|
|
202
202
|
if (!match) continue;
|
|
203
|
+
const line = lineAtOffset(segment, match.index);
|
|
204
|
+
// A match that spans lines (a repeat rule's first and last occurrence) also names its last line.
|
|
205
|
+
const endLine = lineAtOffset(segment, match.index + Math.max(0, match[0].length - 1));
|
|
203
206
|
findings.push({
|
|
204
207
|
file,
|
|
205
208
|
rule: rule.id,
|
|
206
209
|
severity: rule.severity,
|
|
207
|
-
line
|
|
210
|
+
line,
|
|
211
|
+
...(endLine > line ? { endLine } : {}),
|
|
208
212
|
excerpt: segment.text.trim().replace(/\s+/g, ' ').slice(0, 180),
|
|
209
213
|
});
|
|
210
214
|
}
|
|
@@ -265,7 +265,8 @@ After the scope gate selects the durable path:
|
|
|
265
265
|
The bare `lit` trigger (also `lit-loop` / `litcodex` in a prompt) fires the Codex
|
|
266
266
|
`UserPromptSubmit` hook, which injects the `<lit-loop-mode>` directive into the turn. This skill is
|
|
267
267
|
the operational expansion of that directive: once you see `<lit-loop-mode>`, apply the scope gate
|
|
268
|
-
above, then follow the selected path.
|
|
268
|
+
above, then follow the selected path. A user who wants to watch the run from a terminal can keep the LIT card
|
|
269
|
+
live in a second window with `litcodex hud`, which only reads the records these hooks already write.
|
|
269
270
|
|
|
270
271
|
## Codex tool mapping
|
|
271
272
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@litfamily/litcodex",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": "Codex CLI plugin that turns a request into a goal with checks, keeps the evidence in your project and hands unfinished work to the next session.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codex",
|
|
@@ -52,11 +52,14 @@
|
|
|
52
52
|
"readme-assets"
|
|
53
53
|
],
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@litcodex/lit-loop": "1.0.
|
|
55
|
+
"@litcodex/lit-loop": "1.0.28"
|
|
56
56
|
},
|
|
57
57
|
"bundledDependencies": [
|
|
58
58
|
"@litcodex/lit-loop"
|
|
59
59
|
],
|
|
60
|
+
"optionalDependencies": {
|
|
61
|
+
"node-pty": "1.1.0"
|
|
62
|
+
},
|
|
60
63
|
"scripts": {
|
|
61
64
|
"build": "tsc -p tsconfig.build.json",
|
|
62
65
|
"postbuild": "node ../../scripts/mark-cli-executable.mjs --workspace .",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="146" height="20" role="img" aria-label="release: 1.0.
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="146" height="20" role="img" aria-label="release: 1.0.28"><title>release: 1.0.28</title><g shape-rendering="crispEdges"><rect width="49" height="20" fill="#080d14"/><rect x="49" width="97" height="20" fill="#ff6337"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text x="255" y="140" textLength="390" transform="scale(.1)">release</text><text x="965" y="140" textLength="870" transform="scale(.1)" fill="#080D14">1.0.28</text></g></svg>
|