lazycodex-ai 5.1.48 → 5.1.51
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 +1194 -752
- package/dist/cli/service-auth/accounts-gate.d.ts +11 -0
- package/dist/cli/service-auth/commands.d.ts +2 -4
- package/dist/cli/service-auth/index.d.ts +1 -1
- package/dist/cli/service-auth/keystore.d.ts +26 -2
- package/dist/cli/service-auth/protocol.d.ts +7 -1
- package/dist/cli/service-auth/session.d.ts +6 -0
- package/dist/cli/service-auth/signed-out-marker.d.ts +11 -0
- package/dist/cli-node/index.js +1194 -752
- package/package.json +3 -1
- package/packages/lsp-core/package.json +45 -0
- package/packages/lsp-core/src/index.ts +30 -0
- package/packages/lsp-core/src/lsp/bun-command-output.ts +82 -0
- package/packages/lsp-core/src/lsp/bun-project-checks.test.ts +170 -0
- package/packages/lsp-core/src/lsp/bun-project-checks.ts +223 -0
- package/packages/lsp-core/src/lsp/cleanup-errors.test.ts +18 -0
- package/packages/lsp-core/src/lsp/cleanup-errors.ts +14 -0
- package/packages/lsp-core/src/lsp/client-diagnostics-concurrency.integration.test.ts +52 -0
- package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +471 -0
- package/packages/lsp-core/src/lsp/client-diagnostics-pull-timeout.test.ts +64 -0
- package/packages/lsp-core/src/lsp/client-wrapper-outside-cwd.test.ts +78 -0
- package/packages/lsp-core/src/lsp/client-wrapper.test.ts +213 -0
- package/packages/lsp-core/src/lsp/client-wrapper.ts +290 -0
- package/packages/lsp-core/src/lsp/client.ts +398 -0
- package/packages/lsp-core/src/lsp/config-loader.ts +254 -0
- package/packages/lsp-core/src/lsp/connection.ts +95 -0
- package/packages/lsp-core/src/lsp/constants.ts +17 -0
- package/packages/lsp-core/src/lsp/controlled-clock-test-support.ts +90 -0
- package/packages/lsp-core/src/lsp/directory-diagnostics.test.ts +221 -0
- package/packages/lsp-core/src/lsp/directory-diagnostics.ts +187 -0
- package/packages/lsp-core/src/lsp/effective-extension.ts +10 -0
- package/packages/lsp-core/src/lsp/errors.ts +89 -0
- package/packages/lsp-core/src/lsp/fake-bun-test-support.ts +102 -0
- package/packages/lsp-core/src/lsp/fixtures/diagnostics-freshness-contract-probe.ts +283 -0
- package/packages/lsp-core/src/lsp/fixtures/disposed-stdin-epipe-probe.ts +28 -0
- package/packages/lsp-core/src/lsp/fixtures/workspace-edit-contract-probe.ts +196 -0
- package/packages/lsp-core/src/lsp/fixtures/workspace-edit-server.mjs +234 -0
- package/packages/lsp-core/src/lsp/format-document.test.ts +143 -0
- package/packages/lsp-core/src/lsp/format-document.ts +90 -0
- package/packages/lsp-core/src/lsp/formatters.ts +144 -0
- package/packages/lsp-core/src/lsp/infer-extension.ts +66 -0
- package/packages/lsp-core/src/lsp/json-rpc-connection-cancellation.test.ts +97 -0
- package/packages/lsp-core/src/lsp/json-rpc-connection.ts +369 -0
- package/packages/lsp-core/src/lsp/language-mappings.ts +173 -0
- package/packages/lsp-core/src/lsp/manager-lifecycle.test.ts +262 -0
- package/packages/lsp-core/src/lsp/manager-max-clients.test.ts +151 -0
- package/packages/lsp-core/src/lsp/manager.ts +495 -0
- package/packages/lsp-core/src/lsp/outside-context-workspace.ts +33 -0
- package/packages/lsp-core/src/lsp/process-pipe-errors.test.ts +21 -0
- package/packages/lsp-core/src/lsp/process-signal-cleanup.ts +21 -0
- package/packages/lsp-core/src/lsp/process.ts +221 -0
- package/packages/lsp-core/src/lsp/server-definitions.ts +205 -0
- package/packages/lsp-core/src/lsp/server-install-state.ts +67 -0
- package/packages/lsp-core/src/lsp/server-installation.test.ts +376 -0
- package/packages/lsp-core/src/lsp/server-installation.ts +218 -0
- package/packages/lsp-core/src/lsp/server-resolution-local-binary.test.ts +170 -0
- package/packages/lsp-core/src/lsp/server-resolution.ts +117 -0
- package/packages/lsp-core/src/lsp/startup-failure.ts +1 -0
- package/packages/lsp-core/src/lsp/timer-provider.ts +13 -0
- package/packages/lsp-core/src/lsp/transport-protocol.ts +52 -0
- package/packages/lsp-core/src/lsp/transport-request-timeout.test.ts +73 -0
- package/packages/lsp-core/src/lsp/transport.ts +339 -0
- package/packages/lsp-core/src/lsp/types.ts +134 -0
- package/packages/lsp-core/src/lsp/utils.test.ts +72 -0
- package/packages/lsp-core/src/lsp/utils.ts +40 -0
- package/packages/lsp-core/src/lsp/workspace-apply-edit-failure.ts +19 -0
- package/packages/lsp-core/src/lsp/workspace-apply-edit-lease.integration.test.ts +218 -0
- package/packages/lsp-core/src/lsp/workspace-apply-edit-sync.integration.test.ts +113 -0
- package/packages/lsp-core/src/lsp/workspace-apply-edit-test-support.ts +194 -0
- package/packages/lsp-core/src/lsp/workspace-apply-edit.integration.test.ts +163 -0
- package/packages/lsp-core/src/lsp/workspace-document-state.test.ts +150 -0
- package/packages/lsp-core/src/lsp/workspace-document-state.ts +392 -0
- package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +132 -0
- package/packages/lsp-core/src/lsp/workspace-edit-commit.test.ts +140 -0
- package/packages/lsp-core/src/lsp/workspace-edit-commit.ts +220 -0
- package/packages/lsp-core/src/lsp/workspace-edit-contract-evidence.test.ts +56 -0
- package/packages/lsp-core/src/lsp/workspace-edit-contract-evidence.ts +30 -0
- package/packages/lsp-core/src/lsp/workspace-edit-fingerprint.ts +44 -0
- package/packages/lsp-core/src/lsp/workspace-edit-options.test.ts +147 -0
- package/packages/lsp-core/src/lsp/workspace-edit-parse-helpers.ts +59 -0
- package/packages/lsp-core/src/lsp/workspace-edit-parser.ts +130 -0
- package/packages/lsp-core/src/lsp/workspace-edit-path.ts +98 -0
- package/packages/lsp-core/src/lsp/workspace-edit-plan-types.ts +60 -0
- package/packages/lsp-core/src/lsp/workspace-edit-plan.ts +73 -0
- package/packages/lsp-core/src/lsp/workspace-edit-prevalidation.test.ts +174 -0
- package/packages/lsp-core/src/lsp/workspace-edit-resource-parser.ts +89 -0
- package/packages/lsp-core/src/lsp/workspace-edit-simulation.ts +183 -0
- package/packages/lsp-core/src/lsp/workspace-edit-snapshot.ts +53 -0
- package/packages/lsp-core/src/lsp/workspace-edit-text.ts +125 -0
- package/packages/lsp-core/src/lsp/workspace-edit-types.ts +121 -0
- package/packages/lsp-core/src/lsp/workspace-edit.characterization.test.ts +95 -0
- package/packages/lsp-core/src/lsp/workspace-edit.ts +55 -0
- package/packages/lsp-core/src/lsp/workspace-markers.ts +18 -0
- package/packages/lsp-core/src/lsp/workspace-mutation-controller.ts +182 -0
- package/packages/lsp-core/src/mcp-protocol-pin.test.ts +97 -0
- package/packages/lsp-core/src/mcp.ts +122 -0
- package/packages/lsp-core/src/missing-dependency-result.test.ts +135 -0
- package/packages/lsp-core/src/missing-dependency-result.ts +79 -0
- package/packages/lsp-core/src/post-edit/file-location.ts +55 -0
- package/packages/lsp-core/src/post-edit/index.ts +3 -0
- package/packages/lsp-core/src/post-edit/not-installed-guidance.ts +36 -0
- package/packages/lsp-core/src/post-edit/not-installed.test.ts +224 -0
- package/packages/lsp-core/src/post-edit/orchestration.test.ts +157 -0
- package/packages/lsp-core/src/post-edit/orchestration.ts +205 -0
- package/packages/lsp-core/src/request-context.test.ts +200 -0
- package/packages/lsp-core/src/request-context.ts +235 -0
- package/packages/lsp-core/src/tool-surface.test.ts +173 -0
- package/packages/lsp-core/src/tools/bun-directory-diagnostics.test.ts +113 -0
- package/packages/lsp-core/src/tools/bun-directory-diagnostics.ts +75 -0
- package/packages/lsp-core/src/tools/definitions.ts +156 -0
- package/packages/lsp-core/src/tools/diagnostics.ts +133 -0
- package/packages/lsp-core/src/tools/format.test.ts +56 -0
- package/packages/lsp-core/src/tools/format.ts +56 -0
- package/packages/lsp-core/src/tools/index.ts +11 -0
- package/packages/lsp-core/src/tools/install-decision.ts +39 -0
- package/packages/lsp-core/src/tools/navigation.ts +88 -0
- package/packages/lsp-core/src/tools/parameters.test.ts +51 -0
- package/packages/lsp-core/src/tools/parameters.ts +49 -0
- package/packages/lsp-core/src/tools/rename.ts +69 -0
- package/packages/lsp-core/src/tools/result.ts +5 -0
- package/packages/lsp-core/src/tools/runtime.ts +21 -0
- package/packages/lsp-core/src/tools/schema.ts +9 -0
- package/packages/lsp-core/src/tools/status.ts +28 -0
- package/packages/lsp-core/src/tools/symbols.ts +99 -0
- package/packages/lsp-core/src/tools/types.ts +116 -0
- package/packages/lsp-core/src/tools.ts +1 -0
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/README.md +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/lcx/skills/lcx-contribute-bug-fix/SKILL.md +51 -55
- package/packages/omo-codex/plugin/components/lcx/skills/lcx-contribute-bug-fix/agents/openai.yaml +1 -1
- package/packages/omo-codex/plugin/components/lcx/skills/lcx-report-bug/SKILL.md +7 -7
- package/packages/omo-codex/plugin/components/lcx/skills/lcx-report-bug/agents/openai.yaml +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 +2 -2
- package/packages/omo-codex/plugin/components/telemetry/README.md +2 -2
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +52 -15
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +52 -19
- 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/telemetry/src/codex-hook.ts +2 -9
- package/packages/omo-codex/plugin/components/telemetry/src/posthog.ts +4 -13
- package/packages/omo-codex/plugin/components/telemetry/src/product-identity.ts +0 -2
- package/packages/omo-codex/plugin/components/telemetry/test/codex-hook-diagnostics.test.ts +0 -3
- package/packages/omo-codex/plugin/components/telemetry/test/codex-hook.test.ts +3 -8
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +3 -0
- 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/ultrawork/src/directive-content.ts +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/directive.md +3 -0
- 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 +16 -16
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/shared/package.json +1 -1
- package/packages/omo-codex/plugin/skills/ast-grep/README.md +1 -1
- package/packages/omo-codex/plugin/skills/ast-grep/install.ps1 +5 -3
- package/packages/omo-codex/plugin/skills/ast-grep/install.sh +4 -5
- package/packages/omo-codex/plugin/skills/ast-grep/references/install.md +2 -2
- package/packages/omo-codex/plugin/skills/ast-grep/scripts/ast_grep_helper.py +13 -3
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/AGENTS.md +5 -4
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +11 -11
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +2 -2
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/codex.md +4 -4
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/find-agent-sessions.py +6 -3
- package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +1 -1
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +34 -12
- package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +2 -2
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +2 -1
- package/packages/omo-codex/plugin/skills/frontend/references/design/component-catalogs.md +14 -10
- package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +19 -6
- package/packages/omo-codex/plugin/skills/frontend/references/design/grounding.md +29 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/design_system.py +2 -0
- package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/search.py +2 -0
- package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/SKILL.md +51 -55
- package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/agents/openai.yaml +1 -1
- package/packages/omo-codex/plugin/skills/lcx-report-bug/SKILL.md +7 -7
- package/packages/omo-codex/plugin/skills/lcx-report-bug/agents/openai.yaml +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +5 -4
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +2 -2
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/__main__.py +9 -6
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/summary.py +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/README.md +4 -4
- package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/extract_cookies.py +4 -2
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +3 -0
- package/packages/omo-codex/plugin/skills/ulw-research/AGENTS.md +8 -4
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +7 -316
- package/packages/omo-codex/plugin/skills/ulw-research/references/deliverable-phase.md +23 -21
- package/packages/omo-codex/plugin/skills/ulw-research/references/fact-ledger-grammar.md +7 -3
- package/packages/omo-codex/plugin/skills/ulw-research/references/fact-ledger.md +42 -8
- package/packages/omo-codex/plugin/skills/ulw-research/references/fidelity-claim-kinds.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/references/markdown-blocks.md +12 -0
- package/packages/omo-codex/plugin/skills/ulw-research/references/report-gates.md +12 -5
- package/packages/omo-codex/plugin/skills/ulw-research/references/research-collection.md +195 -0
- package/packages/omo-codex/plugin/skills/ulw-research/references/research-delivery.md +123 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/claim-kinds.mjs +33 -5
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/contracts.mjs +13 -4
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/conversion-probe.mjs +229 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/css-hiding.mjs +158 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/css-lite.mjs +4 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/entities.mjs +13 -4
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-fill.mjs +11 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-meaning.mjs +13 -9
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-polish.mjs +40 -18
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands-verify.mjs +25 -8
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-commands.mjs +35 -16
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-derive.mjs +7 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-fill.mjs +6 -4
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-ledger-kinds.mjs +6 -7
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fact-locate.mjs +15 -9
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-claims.mjs +4 -3
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-csv.mjs +32 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-lexicon.mjs +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-originals.mjs +161 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-policy.mjs +4 -4
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-records.mjs +81 -14
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-snapshot-readability.mjs +49 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-sources.mjs +76 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-trace.mjs +25 -11
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-value-unit.mjs +202 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/fidelity-values.mjs +40 -39
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/gates-fidelity.mjs +8 -6
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/gates-static.mjs +10 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/html-lite.mjs +6 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/html-markup.mjs +2 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/html-text-map.mjs +140 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/markdown-closers.mjs +126 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/md-lite.mjs +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/number-grammar.mjs +33 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/numerals.mjs +18 -7
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/outcome-start.mjs +66 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/outcome.mjs +11 -22
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/placeholder.mjs +18 -6
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/polish-apply.mjs +3 -2
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/raw-decode.mjs +110 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/raw-locator.mjs +47 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/report-tools-commands.mjs +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/report-tools.mjs +7 -1
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-commands.mjs +79 -26
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-refresh.mjs +82 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-snapshot.mjs +73 -69
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/source-view.mjs +89 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/sources-citation.mjs +203 -0
- package/packages/omo-codex/plugin/skills/ulw-research/scripts/units.mjs +14 -3
- package/packages/omo-codex/plugin/test/payload-equivalence.test.mjs +6 -4
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +4 -3
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +338 -237
- package/packages/prompts-core/prompts/ultrawork/codex.md +3 -0
- package/packages/shared-skills/skill-source-filter.mjs +6 -2
- package/packages/shared-skills/skills/ast-grep/README.md +1 -1
- package/packages/shared-skills/skills/ast-grep/install.ps1 +5 -3
- package/packages/shared-skills/skills/ast-grep/install.sh +4 -5
- package/packages/shared-skills/skills/ast-grep/references/install.md +2 -2
- package/packages/shared-skills/skills/ast-grep/scripts/ast_grep_helper.py +13 -3
- package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/shared-skills/skills/coding-agent-sessions/AGENTS.md +5 -4
- package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +11 -11
- package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +2 -2
- package/packages/shared-skills/skills/coding-agent-sessions/references/codex.md +4 -4
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +1 -1
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/find-agent-sessions.py +6 -3
- package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +1 -1
- package/packages/shared-skills/skills/frontend/SKILL.md +34 -12
- package/packages/shared-skills/skills/frontend/references/design/README.md +2 -2
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +2 -1
- package/packages/shared-skills/skills/frontend/references/design/component-catalogs.md +14 -10
- package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +19 -6
- package/packages/shared-skills/skills/frontend/references/design/grounding.md +29 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/design_system.py +2 -0
- package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/search.py +2 -0
- package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +5 -4
- package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +2 -2
- package/packages/shared-skills/skills/ultimate-browsing/engine/__main__.py +9 -6
- package/packages/shared-skills/skills/ultimate-browsing/engine/summary.py +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/README.md +4 -4
- package/packages/shared-skills/skills/ultimate-browsing/scripts/extract_cookies.py +4 -2
- package/packages/shared-skills/skills/ulw-research/AGENTS.md +8 -4
- package/packages/shared-skills/skills/ulw-research/SKILL.md +7 -316
- package/packages/shared-skills/skills/ulw-research/references/deliverable-phase.md +23 -21
- package/packages/shared-skills/skills/ulw-research/references/fact-ledger-grammar.md +7 -3
- package/packages/shared-skills/skills/ulw-research/references/fact-ledger.md +42 -8
- package/packages/shared-skills/skills/ulw-research/references/fidelity-claim-kinds.md +1 -1
- package/packages/shared-skills/skills/ulw-research/references/markdown-blocks.md +12 -0
- package/packages/shared-skills/skills/ulw-research/references/report-gates.md +12 -5
- package/packages/shared-skills/skills/ulw-research/references/research-collection.md +195 -0
- package/packages/shared-skills/skills/ulw-research/references/research-delivery.md +123 -0
- package/packages/shared-skills/skills/ulw-research/scripts/claim-kinds.mjs +33 -5
- package/packages/shared-skills/skills/ulw-research/scripts/claim-kinds.test.ts +37 -2
- package/packages/shared-skills/skills/ulw-research/scripts/claim-prefix.test.ts +76 -0
- package/packages/shared-skills/skills/ulw-research/scripts/contracts-validation.test.ts +83 -0
- package/packages/shared-skills/skills/ulw-research/scripts/contracts.mjs +13 -4
- package/packages/shared-skills/skills/ulw-research/scripts/contracts.test.ts +6 -110
- package/packages/shared-skills/skills/ulw-research/scripts/conversion-altered.test.ts +154 -0
- package/packages/shared-skills/skills/ulw-research/scripts/conversion-originals.test.ts +297 -0
- package/packages/shared-skills/skills/ulw-research/scripts/conversion-probe-classes.test.ts +361 -0
- package/packages/shared-skills/skills/ulw-research/scripts/conversion-probe.mjs +229 -0
- package/packages/shared-skills/skills/ulw-research/scripts/conversion-probe.test.ts +218 -0
- package/packages/shared-skills/skills/ulw-research/scripts/copy-returns-polish.test.ts +4 -3
- package/packages/shared-skills/skills/ulw-research/scripts/css-hiding.mjs +158 -0
- package/packages/shared-skills/skills/ulw-research/scripts/css-lite.mjs +4 -2
- package/packages/shared-skills/skills/ulw-research/scripts/delivery-barrier-meaning.test.ts +186 -0
- package/packages/shared-skills/skills/ulw-research/scripts/delivery-barrier.test.ts +40 -87
- package/packages/shared-skills/skills/ulw-research/scripts/entities.mjs +13 -4
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-fill.mjs +11 -1
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-meaning.mjs +13 -9
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-polish.mjs +40 -18
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands-verify.mjs +25 -8
- package/packages/shared-skills/skills/ulw-research/scripts/fact-commands.mjs +35 -16
- package/packages/shared-skills/skills/ulw-research/scripts/fact-derive-2.test.ts +149 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-derive.mjs +7 -2
- package/packages/shared-skills/skills/ulw-research/scripts/fact-derive.test.ts +7 -192
- package/packages/shared-skills/skills/ulw-research/scripts/fact-fill.mjs +6 -4
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-kinds.mjs +6 -7
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-kinds.test.ts +2 -1
- package/packages/shared-skills/skills/ulw-research/scripts/fact-ledger-legacy.test.ts +2 -1
- package/packages/shared-skills/skills/ulw-research/scripts/fact-locate.mjs +15 -9
- package/packages/shared-skills/skills/ulw-research/scripts/fact-unit-dimensions-2.test.ts +149 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fact-unit-dimensions.test.ts +4 -168
- package/packages/shared-skills/skills/ulw-research/scripts/fact-unit-rules.test.ts +3 -229
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-claims.mjs +4 -3
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-csv.mjs +32 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-lexicon.mjs +1 -1
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-originals.mjs +161 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-policy.mjs +4 -4
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-records.mjs +81 -14
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-snapshot-readability.mjs +49 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-sources.mjs +76 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-trace.mjs +25 -11
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-value-unit.mjs +202 -0
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-values.mjs +40 -39
- package/packages/shared-skills/skills/ulw-research/scripts/fidelity-values.test.ts +8 -29
- package/packages/shared-skills/skills/ulw-research/scripts/gates-fidelity.mjs +8 -6
- package/packages/shared-skills/skills/ulw-research/scripts/gates-static-headings.test.ts +17 -0
- package/packages/shared-skills/skills/ulw-research/scripts/gates-static.mjs +10 -1
- package/packages/shared-skills/skills/ulw-research/scripts/html-lite.mjs +6 -2
- package/packages/shared-skills/skills/ulw-research/scripts/html-markup.mjs +2 -2
- package/packages/shared-skills/skills/ulw-research/scripts/html-text-map.mjs +140 -0
- package/packages/shared-skills/skills/ulw-research/scripts/html-text-map.test.ts +148 -0
- package/packages/shared-skills/skills/ulw-research/scripts/markdown-closers.mjs +126 -0
- package/packages/shared-skills/skills/ulw-research/scripts/md-lite-boundaries.test.ts +46 -0
- package/packages/shared-skills/skills/ulw-research/scripts/md-lite.mjs +1 -1
- package/packages/shared-skills/skills/ulw-research/scripts/number-grammar.mjs +33 -0
- package/packages/shared-skills/skills/ulw-research/scripts/number-grammar.test.ts +36 -0
- package/packages/shared-skills/skills/ulw-research/scripts/numerals.mjs +18 -7
- package/packages/shared-skills/skills/ulw-research/scripts/numerals.test.ts +3 -0
- package/packages/shared-skills/skills/ulw-research/scripts/outcome-start.mjs +66 -0
- package/packages/shared-skills/skills/ulw-research/scripts/outcome-start.test.ts +109 -0
- package/packages/shared-skills/skills/ulw-research/scripts/outcome.mjs +11 -22
- package/packages/shared-skills/skills/ulw-research/scripts/page-source-locator.test.ts +187 -0
- package/packages/shared-skills/skills/ulw-research/scripts/placeholder.mjs +18 -6
- package/packages/shared-skills/skills/ulw-research/scripts/polish-apply.mjs +3 -2
- package/packages/shared-skills/skills/ulw-research/scripts/polish-markup.test.ts +15 -1
- package/packages/shared-skills/skills/ulw-research/scripts/polish-partial.test.ts +42 -0
- package/packages/shared-skills/skills/ulw-research/scripts/raw-decode.mjs +110 -0
- package/packages/shared-skills/skills/ulw-research/scripts/raw-locator.mjs +47 -0
- package/packages/shared-skills/skills/ulw-research/scripts/raw-snapshot.test.ts +139 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-2.test.ts +233 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-3.test.ts +141 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-4.test.ts +135 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-5.test.ts +231 -0
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools-commands.mjs +1 -1
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools.mjs +7 -1
- package/packages/shared-skills/skills/ulw-research/scripts/report-tools.test.ts +5 -800
- package/packages/shared-skills/skills/ulw-research/scripts/snapshot-readability.test.ts +116 -0
- package/packages/shared-skills/skills/ulw-research/scripts/source-commands.mjs +79 -26
- package/packages/shared-skills/skills/ulw-research/scripts/source-integrity.test.ts +243 -0
- package/packages/shared-skills/skills/ulw-research/scripts/source-refresh.mjs +82 -0
- package/packages/shared-skills/skills/ulw-research/scripts/source-snapshot.mjs +73 -69
- package/packages/shared-skills/skills/ulw-research/scripts/source-snapshot.test.ts +7 -4
- package/packages/shared-skills/skills/ulw-research/scripts/source-view.mjs +89 -0
- package/packages/shared-skills/skills/ulw-research/scripts/sources-citation.mjs +203 -0
- package/packages/shared-skills/skills/ulw-research/scripts/sources-citation.test.ts +236 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/contracts-support.ts +147 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/delivery-barrier-session.ts +59 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/derive-clock.ts +4 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fact-derive-support.ts +65 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fact-unit-dimensions-support.ts +41 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fact-unit-rules-support.ts +241 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fidelity-values-support.ts +30 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/conversion-probe.html +14 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/fixtures/sources-shapes.html +20 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/numeral-classes.ts +196 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/report-tools-support.ts +182 -0
- package/packages/shared-skills/skills/ulw-research/scripts/tests/value-mode-support.ts +48 -0
- package/packages/shared-skills/skills/ulw-research/scripts/units.mjs +14 -3
- package/packages/shared-skills/skills/ulw-research/scripts/units.test.ts +10 -0
- package/packages/shared-skills/skills/ulw-research/scripts/value-mode-unit-classes.test.ts +255 -0
- package/packages/shared-skills/skills/ulw-research/scripts/value-mode-unit.test.ts +179 -0
- package/packages/shared-skills/skills/ulw-research/scripts/value-rules-cli.test.ts +157 -0
- package/packages/shared-skills/skills/ulw-research/scripts/value-rules-followups.test.ts +72 -0
- package/packages/shared-skills/skills/ulw-research/scripts/value-rules-priority.test.ts +80 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/amp_redirect_stub.html +0 -7
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/search_interstitial.html +0 -19
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/wayback_available.json +0 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/wayback_snapshot.html +0 -1128
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_fetch_chain.py +0 -77
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_playwright_stealth.py +0 -86
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_playwright_templates.py +0 -279
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_surrogate.py +0 -252
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_surrogate_validators.py +0 -78
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { ServerLookupResult } from "./types.js";
|
|
2
|
+
|
|
3
|
+
export type FailedServerLookupResult = Exclude<ServerLookupResult, { status: "found" }>;
|
|
4
|
+
|
|
5
|
+
export class LspConnectionClosedError extends Error {
|
|
6
|
+
override readonly name = "LspConnectionClosedError";
|
|
7
|
+
|
|
8
|
+
constructor(
|
|
9
|
+
readonly serverId: string,
|
|
10
|
+
readonly root: string,
|
|
11
|
+
message?: string,
|
|
12
|
+
) {
|
|
13
|
+
super(message ?? `LSP connection closed for ${serverId} at ${root}`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class LspProcessExitedError extends Error {
|
|
18
|
+
override readonly name = "LspProcessExitedError";
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
readonly serverId: string,
|
|
22
|
+
readonly root: string,
|
|
23
|
+
readonly exitCode: number | null,
|
|
24
|
+
readonly stderrTail?: string,
|
|
25
|
+
) {
|
|
26
|
+
const stderrSuffix = stderrTail ? `\nstderr tail: ${stderrTail}` : "";
|
|
27
|
+
super(`LSP server ${serverId} at ${root} exited with code ${exitCode ?? "null"}${stderrSuffix}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class LspRequestTimeoutError extends Error {
|
|
32
|
+
override readonly name = "LspRequestTimeoutError";
|
|
33
|
+
|
|
34
|
+
constructor(
|
|
35
|
+
readonly method: string,
|
|
36
|
+
readonly stderrTail?: string,
|
|
37
|
+
) {
|
|
38
|
+
const stderrSuffix = stderrTail ? `\nrecent stderr: ${stderrTail}` : "";
|
|
39
|
+
super(`LSP request timeout (method: ${method})${stderrSuffix}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export class LspInvalidPathError extends Error {
|
|
44
|
+
override readonly name = "LspInvalidPathError";
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export class LspServerLookupError extends Error {
|
|
48
|
+
override readonly name = "LspServerLookupError";
|
|
49
|
+
|
|
50
|
+
constructor(
|
|
51
|
+
message: string,
|
|
52
|
+
readonly lookup?: FailedServerLookupResult,
|
|
53
|
+
) {
|
|
54
|
+
super(message);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export class LspServerInitializingError extends Error {
|
|
59
|
+
override readonly name = "LspServerInitializingError";
|
|
60
|
+
|
|
61
|
+
constructor(readonly originalError: LspRequestTimeoutError) {
|
|
62
|
+
super(
|
|
63
|
+
`LSP server is still initializing. Please retry in a few seconds. Original error: ${originalError.message}`,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export class LspProcessSpawnError extends Error {
|
|
69
|
+
override readonly name = "LspProcessSpawnError";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export class LspClientRespawnBudgetExceededError extends Error {
|
|
73
|
+
override readonly name = "LspClientRespawnBudgetExceededError";
|
|
74
|
+
|
|
75
|
+
constructor(
|
|
76
|
+
readonly serverId: string,
|
|
77
|
+
readonly root: string,
|
|
78
|
+
readonly retryLimit: number,
|
|
79
|
+
) {
|
|
80
|
+
super(
|
|
81
|
+
`LSP server ${serverId} at ${root} failed to stay alive; respawn budget exhausted ` +
|
|
82
|
+
`(${retryLimit} consecutive dead generations). Retrying after the cooldown may succeed.`,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function isLspDeadConnectionError(err: unknown): err is LspConnectionClosedError | LspProcessExitedError {
|
|
88
|
+
return err instanceof LspConnectionClosedError || err instanceof LspProcessExitedError;
|
|
89
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
|
|
5
|
+
const createdDirs: string[] = [];
|
|
6
|
+
|
|
7
|
+
function createTempDir(prefix: string): string {
|
|
8
|
+
const dir = mkdtempSync(join(tmpdir(), prefix));
|
|
9
|
+
createdDirs.push(dir);
|
|
10
|
+
return dir;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function removeFakeBunFixtures(): void {
|
|
14
|
+
for (const dir of createdDirs.splice(0)) rmSync(dir, { recursive: true, force: true });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface FakeBunBehavior {
|
|
18
|
+
readonly commands: readonly ("check" | "lint" | "format")[];
|
|
19
|
+
readonly checkStdout?: string;
|
|
20
|
+
readonly checkExitCode?: number;
|
|
21
|
+
readonly lintStdout?: string;
|
|
22
|
+
readonly lintExitCode?: number;
|
|
23
|
+
readonly formatWrites?: boolean;
|
|
24
|
+
readonly hangHelpUntil?: string;
|
|
25
|
+
readonly wrapperForks?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface FakeBunCall {
|
|
29
|
+
readonly args: readonly string[];
|
|
30
|
+
readonly cwd: string;
|
|
31
|
+
readonly cwdEntries: readonly string[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface FakeBun {
|
|
35
|
+
readonly path: string;
|
|
36
|
+
calls(): FakeBunCall[];
|
|
37
|
+
upgrade(behavior: FakeBunBehavior): void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function createFakeBun(behavior: FakeBunBehavior): FakeBun {
|
|
41
|
+
const dir = createTempDir("omo-fake-bun-");
|
|
42
|
+
const logPath = join(dir, "calls.jsonl");
|
|
43
|
+
const binDir = join(dir, "bin");
|
|
44
|
+
mkdirSync(binDir);
|
|
45
|
+
const path = process.platform === "win32" ? join(binDir, "bun.cmd") : join(binDir, "bun");
|
|
46
|
+
let version = 0;
|
|
47
|
+
const install = (next: FakeBunBehavior) => {
|
|
48
|
+
version += 1;
|
|
49
|
+
const scriptPath = join(dir, `fake-bun-${version}.mjs`);
|
|
50
|
+
writeFakeBunScript(scriptPath, logPath, next);
|
|
51
|
+
if (process.platform === "win32") {
|
|
52
|
+
writeFileSync(path, `@"${process.execPath}" "${scriptPath}" %*\r\n`);
|
|
53
|
+
} else {
|
|
54
|
+
const launch = `"${process.execPath}" "${scriptPath}" "$@"`;
|
|
55
|
+
writeFileSync(path, next.wrapperForks ? `#!/bin/sh\n${launch}\n` : `#!/bin/sh\nexec ${launch}\n`);
|
|
56
|
+
chmodSync(path, 0o755);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
install(behavior);
|
|
60
|
+
return {
|
|
61
|
+
path,
|
|
62
|
+
upgrade: install,
|
|
63
|
+
calls: () =>
|
|
64
|
+
existsSync(logPath)
|
|
65
|
+
? readFileSync(logPath, "utf8")
|
|
66
|
+
.split("\n")
|
|
67
|
+
.filter((line) => line.length > 0)
|
|
68
|
+
.map((line): FakeBunCall => JSON.parse(line))
|
|
69
|
+
: [],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function writeFakeBunScript(scriptPath: string, logPath: string, behavior: FakeBunBehavior): void {
|
|
74
|
+
writeFileSync(
|
|
75
|
+
scriptPath,
|
|
76
|
+
[
|
|
77
|
+
'import { appendFileSync, existsSync, readdirSync, writeFileSync } from "node:fs";',
|
|
78
|
+
`const behavior = ${JSON.stringify(behavior)};`,
|
|
79
|
+
'if (behavior.hangHelpUntil && process.argv.includes("--help") && !existsSync(behavior.hangHelpUntil)) await new Promise((r) => setTimeout(r, 60_000));',
|
|
80
|
+
"const args = process.argv.slice(2);",
|
|
81
|
+
`appendFileSync(${JSON.stringify(logPath)}, JSON.stringify({ args, cwd: process.cwd(), cwdEntries: readdirSync(process.cwd()) }) + "\\n");`,
|
|
82
|
+
"const [command] = args;",
|
|
83
|
+
"if (!behavior.commands.includes(command)) process.exit(1);",
|
|
84
|
+
'if (args.includes("--help")) process.exit(0);',
|
|
85
|
+
'if (command === "check") { process.stdout.write(behavior.checkStdout ?? ""); process.exit(behavior.checkExitCode ?? 0); }',
|
|
86
|
+
'if (command === "lint") { process.stdout.write(behavior.lintStdout ?? "[]"); process.exit(behavior.lintExitCode ?? 0); }',
|
|
87
|
+
'if (command === "format" && behavior.formatWrites && args.includes("--write")) writeFileSync(args[args.length - 1], "const a = 1;\\n");',
|
|
88
|
+
"process.exit(0);",
|
|
89
|
+
].join("\n"),
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function createProject(files: Record<string, string>, options: { readonly git?: boolean } = {}): string {
|
|
94
|
+
const root = createTempDir("omo-bun-project-");
|
|
95
|
+
if (options.git !== false) mkdirSync(join(root, ".git"));
|
|
96
|
+
for (const [relativePath, content] of Object.entries(files)) {
|
|
97
|
+
const target = join(root, relativePath);
|
|
98
|
+
mkdirSync(join(target, ".."), { recursive: true });
|
|
99
|
+
writeFileSync(target, content);
|
|
100
|
+
}
|
|
101
|
+
return root;
|
|
102
|
+
}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { writeFileSync } from "node:fs";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
createWorkspaceEditTestHarness,
|
|
5
|
+
diagnostic,
|
|
6
|
+
readEvents,
|
|
7
|
+
waitForEventCount,
|
|
8
|
+
} from "../workspace-apply-edit-test-support.js";
|
|
9
|
+
|
|
10
|
+
class DiagnosticsFreshnessContractProbeError extends Error {
|
|
11
|
+
override readonly name = "DiagnosticsFreshnessContractProbeError";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function requireProbe(condition: boolean, message: string): asserts condition {
|
|
15
|
+
if (!condition) throw new DiagnosticsFreshnessContractProbeError(message);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const outputPath = process.argv[2];
|
|
19
|
+
if (!outputPath) throw new DiagnosticsFreshnessContractProbeError("output path is required");
|
|
20
|
+
|
|
21
|
+
const harness = createWorkspaceEditTestHarness();
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
const exactCurrent = await harness.makeClient(
|
|
25
|
+
{
|
|
26
|
+
publishDiagnostics: [
|
|
27
|
+
{
|
|
28
|
+
trigger: "didOpen",
|
|
29
|
+
version: 1,
|
|
30
|
+
diagnostics: [diagnostic("exact-current")],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{ diagnosticsFreshnessTimeoutMs: 50, versionlessPublishQuiescenceMs: 5 },
|
|
35
|
+
);
|
|
36
|
+
const [exactFirst, exactSecond] = await Promise.all([
|
|
37
|
+
exactCurrent.client.diagnostics(exactCurrent.source),
|
|
38
|
+
exactCurrent.client.diagnostics(exactCurrent.source),
|
|
39
|
+
]);
|
|
40
|
+
const exactDidOpenCount = readEvents(exactCurrent.events).filter(
|
|
41
|
+
(event) => event.type === "clientNotification" && event.method === "textDocument/didOpen",
|
|
42
|
+
).length;
|
|
43
|
+
const exactCurrentEvidence = {
|
|
44
|
+
outcome: "exact-current",
|
|
45
|
+
items: exactFirst.items.map((entry) => entry.message),
|
|
46
|
+
concurrentItems: exactSecond.items.map((entry) => entry.message),
|
|
47
|
+
didOpenCount: exactDidOpenCount,
|
|
48
|
+
ok:
|
|
49
|
+
exactDidOpenCount === 1
|
|
50
|
+
&& JSON.stringify(exactFirst.items) === JSON.stringify([diagnostic("exact-current")])
|
|
51
|
+
&& JSON.stringify(exactSecond.items) === JSON.stringify([diagnostic("exact-current")]),
|
|
52
|
+
};
|
|
53
|
+
requireProbe(exactCurrentEvidence.ok, "exact-current diagnostics did not resolve immediately with a single didOpen");
|
|
54
|
+
|
|
55
|
+
const postGenerationVersionless = await harness.makeClient(
|
|
56
|
+
{
|
|
57
|
+
publishDiagnostics: [
|
|
58
|
+
{
|
|
59
|
+
trigger: "didChange",
|
|
60
|
+
diagnostics: [diagnostic("post-generation-versionless")],
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
{ diagnosticsFreshnessTimeoutMs: 80, versionlessPublishQuiescenceMs: 20 },
|
|
65
|
+
);
|
|
66
|
+
await postGenerationVersionless.client.openFile(postGenerationVersionless.source);
|
|
67
|
+
await waitForEventCount(
|
|
68
|
+
postGenerationVersionless.events,
|
|
69
|
+
(event) => event.type === "serverNotification" && event.method === "textDocument/publishDiagnostics",
|
|
70
|
+
1,
|
|
71
|
+
);
|
|
72
|
+
writeFileSync(postGenerationVersionless.source, "const post_generation = 1;\n", "utf-8");
|
|
73
|
+
await postGenerationVersionless.client.openFile(postGenerationVersionless.source);
|
|
74
|
+
const versionlessStartedAt = Date.now();
|
|
75
|
+
const versionlessResult = await postGenerationVersionless.client.diagnostics(postGenerationVersionless.source);
|
|
76
|
+
const versionlessElapsedMs = Date.now() - versionlessStartedAt;
|
|
77
|
+
const postGenerationVersionlessEvidence = {
|
|
78
|
+
outcome: "post-generation-versionless",
|
|
79
|
+
items: versionlessResult.items.map((entry) => entry.message),
|
|
80
|
+
elapsedMs: versionlessElapsedMs,
|
|
81
|
+
ok:
|
|
82
|
+
JSON.stringify(versionlessResult.items) === JSON.stringify([diagnostic("post-generation-versionless")])
|
|
83
|
+
&& versionlessElapsedMs >= 15,
|
|
84
|
+
};
|
|
85
|
+
requireProbe(
|
|
86
|
+
postGenerationVersionlessEvidence.ok,
|
|
87
|
+
"post-generation versionless diagnostics did not wait for quiescence before resolving",
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const stale = await harness.makeClient(
|
|
91
|
+
{
|
|
92
|
+
publishDiagnostics: [
|
|
93
|
+
{
|
|
94
|
+
trigger: "didChange",
|
|
95
|
+
version: 1,
|
|
96
|
+
diagnostics: [diagnostic("stale")],
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
{ diagnosticsFreshnessTimeoutMs: 30, versionlessPublishQuiescenceMs: 5 },
|
|
101
|
+
);
|
|
102
|
+
await stale.client.openFile(stale.source);
|
|
103
|
+
writeFileSync(stale.source, "const stale = 1;\n", "utf-8");
|
|
104
|
+
await stale.client.openFile(stale.source);
|
|
105
|
+
const staleResult = await stale.client.diagnostics(stale.source);
|
|
106
|
+
const staleEvidence = {
|
|
107
|
+
outcome: "stale",
|
|
108
|
+
items: staleResult.items.map((entry) => entry.message),
|
|
109
|
+
transientError: staleResult.transientError ?? null,
|
|
110
|
+
ok: staleResult.items.length === 0 && staleResult.transientError?.kind === "freshness_timeout",
|
|
111
|
+
};
|
|
112
|
+
requireProbe(staleEvidence.ok, "stale diagnostics unexpectedly satisfied the current request");
|
|
113
|
+
|
|
114
|
+
const future = await harness.makeClient(
|
|
115
|
+
{
|
|
116
|
+
publishDiagnostics: [
|
|
117
|
+
{
|
|
118
|
+
trigger: "didChange",
|
|
119
|
+
version: 3,
|
|
120
|
+
diagnostics: [diagnostic("future")],
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
{ diagnosticsFreshnessTimeoutMs: 30, versionlessPublishQuiescenceMs: 5 },
|
|
125
|
+
);
|
|
126
|
+
await future.client.openFile(future.source);
|
|
127
|
+
writeFileSync(future.source, "const future = 1;\n", "utf-8");
|
|
128
|
+
await future.client.openFile(future.source);
|
|
129
|
+
const futureResult = await future.client.diagnostics(future.source);
|
|
130
|
+
const futureEvidence = {
|
|
131
|
+
outcome: "future",
|
|
132
|
+
items: futureResult.items.map((entry) => entry.message),
|
|
133
|
+
transientError: futureResult.transientError ?? null,
|
|
134
|
+
ok: futureResult.items.length === 0 && futureResult.transientError?.kind === "freshness_timeout",
|
|
135
|
+
};
|
|
136
|
+
requireProbe(futureEvidence.ok, "future diagnostics unexpectedly satisfied the current request");
|
|
137
|
+
|
|
138
|
+
const pullOvertaken = await harness.makeClient(
|
|
139
|
+
{
|
|
140
|
+
capabilities: { diagnosticProvider: { interFileDependencies: false, workspaceDiagnostics: false } },
|
|
141
|
+
diagnosticResponses: [
|
|
142
|
+
{
|
|
143
|
+
delayMs: 20,
|
|
144
|
+
report: { kind: "full", resultId: "v1", items: [diagnostic("pull-stale")] },
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
report: { kind: "full", resultId: "v2", items: [diagnostic("pull-fresh")] },
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
{ diagnosticsFreshnessTimeoutMs: 80, versionlessPublishQuiescenceMs: 5 },
|
|
152
|
+
);
|
|
153
|
+
await pullOvertaken.client.openFile(pullOvertaken.source);
|
|
154
|
+
const pendingPull = pullOvertaken.client.diagnostics(pullOvertaken.source);
|
|
155
|
+
await waitForEventCount(
|
|
156
|
+
pullOvertaken.events,
|
|
157
|
+
(event) => event.type === "clientRequest" && event.method === "textDocument/diagnostic",
|
|
158
|
+
1,
|
|
159
|
+
);
|
|
160
|
+
writeFileSync(pullOvertaken.source, "const pull_fresh = 1;\n", "utf-8");
|
|
161
|
+
await pullOvertaken.client.openFile(pullOvertaken.source);
|
|
162
|
+
const pullOvertakenResult = await pendingPull;
|
|
163
|
+
const pullRequestCount = readEvents(pullOvertaken.events).filter(
|
|
164
|
+
(event) => event.type === "clientRequest" && event.method === "textDocument/diagnostic",
|
|
165
|
+
).length;
|
|
166
|
+
const pullOvertakenEvidence = {
|
|
167
|
+
outcome: "pull-overtaken",
|
|
168
|
+
items: pullOvertakenResult.items.map((entry) => entry.message),
|
|
169
|
+
requestCount: pullRequestCount,
|
|
170
|
+
ok:
|
|
171
|
+
JSON.stringify(pullOvertakenResult.items) === JSON.stringify([diagnostic("pull-fresh")])
|
|
172
|
+
&& pullRequestCount === 2,
|
|
173
|
+
};
|
|
174
|
+
requireProbe(
|
|
175
|
+
pullOvertakenEvidence.ok,
|
|
176
|
+
"pull diagnostics were not invalidated and retried after a local change overtook the in-flight request",
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
const silent = await harness.makeClient({}, { diagnosticsFreshnessTimeoutMs: 35, versionlessPublishQuiescenceMs: 5 });
|
|
180
|
+
const silentResult = await silent.client.diagnostics(silent.source);
|
|
181
|
+
const silentEvidence = {
|
|
182
|
+
outcome: "silent",
|
|
183
|
+
items: silentResult.items.map((entry) => entry.message),
|
|
184
|
+
transientError: silentResult.transientError ?? null,
|
|
185
|
+
ok: silentResult.items.length === 0 && silentResult.transientError === undefined,
|
|
186
|
+
};
|
|
187
|
+
requireProbe(silentEvidence.ok, "silent no-pull server that never published did not resolve clean after the freshness window");
|
|
188
|
+
|
|
189
|
+
const closedServer = await harness.makeClient(
|
|
190
|
+
{
|
|
191
|
+
capabilities: { diagnosticProvider: { interFileDependencies: false, workspaceDiagnostics: false } },
|
|
192
|
+
diagnosticResponses: [{ action: "close" }],
|
|
193
|
+
},
|
|
194
|
+
{ diagnosticsFreshnessTimeoutMs: 50, versionlessPublishQuiescenceMs: 5 },
|
|
195
|
+
);
|
|
196
|
+
await closedServer.client.openFile(closedServer.source);
|
|
197
|
+
let closedServerError = "";
|
|
198
|
+
try {
|
|
199
|
+
await closedServer.client.diagnostics(closedServer.source);
|
|
200
|
+
} catch (error) {
|
|
201
|
+
closedServerError = error instanceof Error ? error.message : String(error);
|
|
202
|
+
}
|
|
203
|
+
const closedServerEvidence = {
|
|
204
|
+
outcome: "closed-server",
|
|
205
|
+
error: closedServerError,
|
|
206
|
+
ok: /exited|closed/i.test(closedServerError),
|
|
207
|
+
};
|
|
208
|
+
requireProbe(closedServerEvidence.ok, "closed-server diagnostics failure was not surfaced as a transport error");
|
|
209
|
+
|
|
210
|
+
const unsupportedPull = await harness.makeClient(
|
|
211
|
+
{
|
|
212
|
+
capabilities: { diagnosticProvider: { interFileDependencies: false, workspaceDiagnostics: false } },
|
|
213
|
+
publishDiagnostics: [
|
|
214
|
+
{
|
|
215
|
+
trigger: "didOpen",
|
|
216
|
+
version: 1,
|
|
217
|
+
diagnostics: [diagnostic("push-fallback")],
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
diagnosticResponses: [{ error: { code: -32601, message: "Method not found" } }],
|
|
221
|
+
},
|
|
222
|
+
{ diagnosticsFreshnessTimeoutMs: 50, versionlessPublishQuiescenceMs: 5 },
|
|
223
|
+
);
|
|
224
|
+
const unsupportedPullResult = await unsupportedPull.client.diagnostics(unsupportedPull.source);
|
|
225
|
+
const unsupportedPullEvidence = {
|
|
226
|
+
outcome: "unsupported-pull",
|
|
227
|
+
items: unsupportedPullResult.items.map((entry) => entry.message),
|
|
228
|
+
ok: JSON.stringify(unsupportedPullResult.items) === JSON.stringify([diagnostic("push-fallback")]),
|
|
229
|
+
};
|
|
230
|
+
requireProbe(unsupportedPullEvidence.ok, "explicitly unsupported pull did not fall back to push diagnostics");
|
|
231
|
+
|
|
232
|
+
const unchanged = await harness.makeClient(
|
|
233
|
+
{
|
|
234
|
+
capabilities: { diagnosticProvider: { interFileDependencies: false, workspaceDiagnostics: false } },
|
|
235
|
+
diagnosticResponses: [
|
|
236
|
+
{
|
|
237
|
+
report: { kind: "full", resultId: "same-version", items: [diagnostic("cached-full")] },
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
report: { kind: "unchanged", resultId: "same-version" },
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
},
|
|
244
|
+
{ diagnosticsFreshnessTimeoutMs: 50, versionlessPublishQuiescenceMs: 5 },
|
|
245
|
+
);
|
|
246
|
+
await unchanged.client.openFile(unchanged.source);
|
|
247
|
+
const unchangedFirst = await unchanged.client.diagnostics(unchanged.source);
|
|
248
|
+
const unchangedSecond = await unchanged.client.diagnostics(unchanged.source);
|
|
249
|
+
const unchangedEvidence = {
|
|
250
|
+
outcome: "same-version-unchanged",
|
|
251
|
+
firstItems: unchangedFirst.items.map((entry) => entry.message),
|
|
252
|
+
secondItems: unchangedSecond.items.map((entry) => entry.message),
|
|
253
|
+
ok:
|
|
254
|
+
JSON.stringify(unchangedFirst.items) === JSON.stringify([diagnostic("cached-full")])
|
|
255
|
+
&& JSON.stringify(unchangedSecond.items) === JSON.stringify([diagnostic("cached-full")]),
|
|
256
|
+
};
|
|
257
|
+
requireProbe(unchangedEvidence.ok, "unchanged pull did not reuse the cached same-version result");
|
|
258
|
+
|
|
259
|
+
writeFileSync(
|
|
260
|
+
outputPath,
|
|
261
|
+
`${JSON.stringify(
|
|
262
|
+
{
|
|
263
|
+
schemaVersion: 1,
|
|
264
|
+
outcomes: {
|
|
265
|
+
exactCurrent: exactCurrentEvidence,
|
|
266
|
+
postGenerationVersionless: postGenerationVersionlessEvidence,
|
|
267
|
+
stale: staleEvidence,
|
|
268
|
+
future: futureEvidence,
|
|
269
|
+
pullOvertaken: pullOvertakenEvidence,
|
|
270
|
+
silent: silentEvidence,
|
|
271
|
+
closedServer: closedServerEvidence,
|
|
272
|
+
unsupportedPull: unsupportedPullEvidence,
|
|
273
|
+
sameVersionUnchanged: unchangedEvidence,
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
null,
|
|
277
|
+
2,
|
|
278
|
+
)}\n`,
|
|
279
|
+
"utf-8",
|
|
280
|
+
);
|
|
281
|
+
} finally {
|
|
282
|
+
await harness.cleanup();
|
|
283
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Reproduces the Windows teardown race from #9601 on any OS: the transport
|
|
2
|
+
// disposes its JSON-RPC connection, then the server's stdin pipe fails with
|
|
3
|
+
// EPIPE. Windows reports that failure asynchronously, after dispose removed the
|
|
4
|
+
// connection's listener, so the stream is destroyed with the error here to get
|
|
5
|
+
// the same event order deterministically. The probe exits 0 only when the error
|
|
6
|
+
// was handled; an unhandled 'error' event crashes it with a non-zero exit.
|
|
7
|
+
import { JsonRpcConnection } from "../json-rpc-connection.js";
|
|
8
|
+
import { spawnProcess } from "../process.js";
|
|
9
|
+
|
|
10
|
+
const server = spawnProcess([process.execPath, "-e", "process.stdin.on('close', () => process.exit(0)).resume()"], {
|
|
11
|
+
cwd: process.cwd(),
|
|
12
|
+
env: process.env,
|
|
13
|
+
});
|
|
14
|
+
const connection = new JsonRpcConnection(server.stdout, server.stdin);
|
|
15
|
+
connection.listen();
|
|
16
|
+
connection.dispose();
|
|
17
|
+
|
|
18
|
+
const stdinClosed = new Promise<void>((resolve) => server.stdin.once("close", () => resolve()));
|
|
19
|
+
const epipe = Object.assign(new Error("EPIPE: broken pipe, write"), { code: "EPIPE", syscall: "write", errno: -4047 });
|
|
20
|
+
if (!("destroy" in server.stdin) || typeof server.stdin.destroy !== "function") {
|
|
21
|
+
throw new Error("server stdin is not destroyable");
|
|
22
|
+
}
|
|
23
|
+
server.stdin.destroy(epipe);
|
|
24
|
+
await stdinClosed;
|
|
25
|
+
|
|
26
|
+
server.kill("SIGKILL");
|
|
27
|
+
await server.exited;
|
|
28
|
+
process.stdout.write("PROBE_SURVIVED\n");
|