lazycodex-ai 5.1.58 → 5.1.60
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/index.js +17 -17
- package/dist/cli-node/index.js +17 -17
- package/package.json +1 -1
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +12 -12
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/omo-codex/plugin/skills/eval-integrity/SKILL.md +107 -0
- package/packages/omo-codex/plugin/skills/eval-integrity/agents/openai.yaml +2 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-values.mjs +5 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/html-foreign-object.mjs +61 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/html-lite.mjs +7 -3
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +1 -0
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
- package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/shared-skills/skills/eval-integrity/SKILL.md +107 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-values.mjs +5 -2
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-values.test.ts +26 -0
- package/packages/shared-skills/skills/ulw-research/scripts/html-foreign-object.mjs +61 -0
- package/packages/shared-skills/skills/ulw-research/scripts/html-lite.mjs +7 -3
- package/packages/shared-skills/skills/ulw-research/scripts/html-lite.test.ts +19 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// html-foreign-object.mjs - the <foreignObject> carve-out for the html-lite tokenizer.
|
|
2
|
+
//
|
|
3
|
+
// An <svg> element is raw drawing markup, except <foreignObject>, which by definition holds
|
|
4
|
+
// HTML. The tokenizer keeps the svg's inner source in `raw` and additionally parses each
|
|
5
|
+
// foreignObject subtree into real children of the svg node, so the fidelity checks read chart
|
|
6
|
+
// HTML exactly like prose while the rest of the svg stays raw. Plain Node ESM, no dependencies.
|
|
7
|
+
|
|
8
|
+
import { makeNode, readTag } from "./html-lite.mjs"
|
|
9
|
+
|
|
10
|
+
/** Newlines in text before offset `to`. */
|
|
11
|
+
function newlinesBefore(text, to) {
|
|
12
|
+
let count = 0
|
|
13
|
+
for (let at = text.indexOf("\n"); at !== -1 && at < to; at = text.indexOf("\n", at + 1)) count++
|
|
14
|
+
return count
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Shift a parsed subtree's line numbers by `delta` (fragment lines are relative to the fragment). */
|
|
18
|
+
function shiftLines(node, delta) {
|
|
19
|
+
node.line += delta
|
|
20
|
+
for (const child of node.children) shiftLines(child, delta)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const isLetter = (ch) => (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z")
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Parse an svg node's <foreignObject> subtrees into real children; the rest of the svg stays raw.
|
|
27
|
+
* @param {object} node an <svg> LiteNode whose `raw` holds its inner source
|
|
28
|
+
* @param {number} rawStartLine document line of the first raw character
|
|
29
|
+
* @param {(source: string) => object} parseHtml the tokenizer, passed in so this module never imports it back
|
|
30
|
+
*/
|
|
31
|
+
export function attachForeignObjects(node, rawStartLine, parseHtml) {
|
|
32
|
+
const raw = node.raw ?? ""
|
|
33
|
+
for (let lt = raw.indexOf("<"); lt !== -1; lt = raw.indexOf("<", lt + 1)) {
|
|
34
|
+
if (raw[lt + 1] === "/" || !isLetter(raw[lt + 1] ?? "")) continue
|
|
35
|
+
const open = readTag(raw, lt + 1)
|
|
36
|
+
if (open.name !== "foreignobject" || open.selfClosing) continue
|
|
37
|
+
let depth = 0
|
|
38
|
+
let innerEnd = raw.length
|
|
39
|
+
let resume = raw.length
|
|
40
|
+
for (let at = raw.indexOf("<", open.end); at !== -1; at = raw.indexOf("<", at + 1)) {
|
|
41
|
+
const closing = raw[at + 1] === "/"
|
|
42
|
+
if (!closing && !isLetter(raw[at + 1] ?? "")) continue
|
|
43
|
+
if (readTag(raw, at + (closing ? 2 : 1)).name !== "foreignobject") continue
|
|
44
|
+
if (closing) {
|
|
45
|
+
if (depth === 0) { innerEnd = at; const gt = raw.indexOf(">", at); resume = gt === -1 ? raw.length : gt + 1; break }
|
|
46
|
+
depth--
|
|
47
|
+
} else depth++
|
|
48
|
+
}
|
|
49
|
+
// Tags are lowercased by readTag, so the attached node is "foreignobject" like any parsed tag.
|
|
50
|
+
const fo = makeNode("foreignobject", open.attrs, node, rawStartLine + newlinesBefore(raw, lt))
|
|
51
|
+
const frag = parseHtml(raw.slice(open.end, innerEnd))
|
|
52
|
+
const body = frag.children.find((child) => child.tag === "body") ?? frag
|
|
53
|
+
for (const child of body.children) {
|
|
54
|
+
child.parent = fo
|
|
55
|
+
shiftLines(child, rawStartLine + newlinesBefore(raw, open.end) - 1)
|
|
56
|
+
fo.children.push(child)
|
|
57
|
+
}
|
|
58
|
+
node.children.push(fo)
|
|
59
|
+
lt = resume - 1
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
// Single forward scan with indexOf (no whole-document regex, no backtracking). Produces a
|
|
4
4
|
// LiteNode tree: { tag, attrs, children, parent, line, text, raw }. Text nodes carry
|
|
5
5
|
// tag "#text"; <style>/<script>/<svg> keep their inner source in `raw` and have no parsed
|
|
6
|
-
// children
|
|
7
|
-
//
|
|
6
|
+
// children, except an <svg> node also gains its <foreignObject> subtrees as parsed children
|
|
7
|
+
// (see html-foreign-object.mjs; the rest of the svg stays raw). The "#document"
|
|
8
|
+
// root also carries `ids` (id -> occurrence count) so selectorPath can tell whether an id
|
|
9
|
+
// is unique. Plain Node ESM, no dependencies.
|
|
8
10
|
|
|
9
11
|
import { decodeEntities } from "./entities.mjs"
|
|
12
|
+
import { attachForeignObjects } from "./html-foreign-object.mjs"
|
|
10
13
|
|
|
11
14
|
export { decodeEntities }
|
|
12
15
|
|
|
@@ -25,7 +28,7 @@ const SAFE_ID = /^[A-Za-z_][\w-]*$/
|
|
|
25
28
|
export const PROSE_TAGS = new Set(["p", "li", ...HEADINGS, "td", "th", "figcaption", "blockquote", "dd", "dt"])
|
|
26
29
|
export const PROSE_BREAKS = new Set([...P_CLOSERS, ...PROSE_TAGS, "br", "tr"])
|
|
27
30
|
|
|
28
|
-
function makeNode(tag, attrs, parent, line) {
|
|
31
|
+
export function makeNode(tag, attrs, parent, line) {
|
|
29
32
|
return { tag, attrs, children: [], parent, line, text: "", raw: null }
|
|
30
33
|
}
|
|
31
34
|
|
|
@@ -181,6 +184,7 @@ export function parseHtml(source) {
|
|
|
181
184
|
if (!tag.selfClosing) {
|
|
182
185
|
const [innerEnd, resume] = findRawClose(src, tag.end, tag.name)
|
|
183
186
|
node.raw = src.slice(tag.end, innerEnd)
|
|
187
|
+
if (tag.name === "svg") attachForeignObjects(node, lineAt(starts, tag.end), parseHtml)
|
|
184
188
|
at = textStart = resume
|
|
185
189
|
}
|
|
186
190
|
} else if (!VOID_TAGS.has(tag.name)) {
|
|
@@ -129,6 +129,25 @@ describe("parseHtml", () => {
|
|
|
129
129
|
expect(childTags(svg.parent as LiteNode)).toEqual(["script", "svg", "p"])
|
|
130
130
|
})
|
|
131
131
|
|
|
132
|
+
test("#given an svg with drawing markup and a foreignObject #when parsed #then raw is kept and only the foreignObject subtree is parsed", () => {
|
|
133
|
+
// given
|
|
134
|
+
const source =
|
|
135
|
+
"<body><svg viewBox=\"0 0 200 100\"><path d=\"M0 0\"/><text>12%</text><foreignObject>\n<div>chart 110.6 mm</div>\n</foreignObject></svg></body>"
|
|
136
|
+
// when
|
|
137
|
+
const doc = parseHtml(source)
|
|
138
|
+
// then
|
|
139
|
+
const svg = byTag(doc, "svg")[0] as LiteNode
|
|
140
|
+
expect(svg.raw).toBe("<path d=\"M0 0\"/><text>12%</text><foreignObject>\n<div>chart 110.6 mm</div>\n</foreignObject>")
|
|
141
|
+
expect(childTags(svg)).toEqual(["foreignobject"])
|
|
142
|
+
const fo = byTag(doc, "foreignobject")[0] as LiteNode
|
|
143
|
+
expect(fo.line).toBe(1)
|
|
144
|
+
const div = byTag(doc, "div")[0] as LiteNode
|
|
145
|
+
expect(div.line).toBe(2)
|
|
146
|
+
expect(proseText(div)).toBe("chart 110.6 mm")
|
|
147
|
+
expect(byTag(doc, "text")).toHaveLength(0)
|
|
148
|
+
expect(byTag(doc, "path")).toHaveLength(0)
|
|
149
|
+
})
|
|
150
|
+
|
|
132
151
|
test("#given an unclosed fragment without body #when parsed #then the tree still has body > div > p", () => {
|
|
133
152
|
// given
|
|
134
153
|
const source = "<div><p>unclosed"
|