oh-my-opencode 4.8.1 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/prometheus/system-prompt.d.ts +1 -1
- package/dist/agents/sisyphus/claude-fable-5.d.ts +19 -0
- package/dist/agents/sisyphus/claude-opus-4-7.d.ts +3 -1
- package/dist/agents/sisyphus/claude-opus-4-8.d.ts +19 -0
- package/dist/agents/sisyphus/index.d.ts +4 -0
- package/dist/agents/types.d.ts +2 -2
- package/dist/cli/doctor/checks/codex.d.ts +1 -0
- package/dist/cli/doctor/checks/tools-gh.d.ts +8 -1
- package/dist/cli/doctor/index.d.ts +1 -0
- package/dist/cli/doctor/types.d.ts +2 -0
- package/dist/cli/index.js +1885 -776
- package/dist/cli/install-codex/codex-config-permissions.d.ts +1 -1
- package/dist/cli/install-codex/codex-config-plugins.d.ts +1 -0
- package/dist/cli/install-codex/codex-config-toml.d.ts +1 -0
- package/dist/cli/install-codex/codex-installer-bin-dir.d.ts +8 -0
- package/dist/cli/install-codex/install-codex.d.ts +1 -8
- package/dist/cli/install-codex/lsp-daemon-reaper.d.ts +5 -0
- package/dist/cli/sparkshell-condense.d.ts +10 -0
- package/dist/cli/sparkshell-parse.d.ts +3 -0
- package/dist/cli/sparkshell-session-context.d.ts +20 -0
- package/dist/cli/sparkshell-spark.d.ts +23 -0
- package/dist/cli/sparkshell.d.ts +8 -1
- package/dist/cli-node/index.js +92552 -0
- package/dist/config/schema/agent-names.d.ts +2 -0
- package/dist/config/schema/hooks.d.ts +0 -2
- package/dist/config/schema/keyword-detector.d.ts +0 -6
- package/dist/config/schema/oh-my-opencode-config.d.ts +2 -4
- package/dist/create-hooks.d.ts +0 -2
- package/dist/features/background-agent/parent-wake-dedupe.d.ts +2 -0
- package/dist/features/background-agent/parent-wake-flush-runner.d.ts +2 -0
- package/dist/features/background-agent/parent-wake-prompt-dispatch.d.ts +1 -0
- package/dist/features/background-agent/parent-wake-session-history.d.ts +4 -0
- package/dist/features/background-agent/parent-wake-session-inspector.d.ts +1 -0
- package/dist/features/builtin-commands/templates/handoff.d.ts +1 -1
- package/dist/features/builtin-skills/index.d.ts +1 -1
- package/dist/features/builtin-skills/skills.d.ts +4 -0
- package/dist/features/opencode-runtime-skills/source-server.d.ts +16 -1
- package/dist/features/opencode-skill-loader/skill-definition-record.d.ts +2 -0
- package/dist/features/team-mode/tools/lifecycle-test-fixture.d.ts +2 -0
- package/dist/features/team-mode/types.d.ts +1 -0
- package/dist/features/tmux-subagent/failed-readiness-cache.d.ts +28 -0
- package/dist/features/tmux-subagent/manager.d.ts +1 -9
- package/dist/features/tmux-subagent/resolve-server-url.d.ts +3 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/executor.d.ts +1 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/keyword-detector/constants.d.ts +0 -4
- package/dist/hooks/keyword-detector/ultrawork/source-detector.d.ts +1 -1
- package/dist/index.js +9001 -1795
- package/dist/oh-my-opencode.schema.json +2 -4
- package/dist/plugin/chat-params.d.ts +1 -8
- package/dist/plugin/hooks/create-core-hooks.d.ts +0 -2
- package/dist/plugin/hooks/create-session-hooks.d.ts +0 -2
- package/dist/plugin/hooks/create-transform-hooks.d.ts +1 -2
- package/dist/plugin/messages-transform.d.ts +0 -1
- package/dist/shared/model-availability.d.ts +10 -2
- package/package.json +25 -18
- package/packages/ast-grep-mcp/dist/cli.js +2 -10
- package/packages/git-bash-mcp/dist/cli.js +11 -4
- package/packages/lsp-daemon/dist/cli.d.ts +2 -0
- package/packages/lsp-daemon/dist/cli.js +3711 -0
- package/packages/lsp-daemon/dist/daemon-client.d.ts +19 -0
- package/packages/lsp-daemon/dist/daemon-client.js +114 -0
- package/packages/lsp-daemon/dist/daemon-server.d.ts +12 -0
- package/packages/lsp-daemon/dist/daemon-server.js +106 -0
- package/packages/lsp-daemon/dist/ensure-daemon.d.ts +21 -0
- package/packages/lsp-daemon/dist/ensure-daemon.js +97 -0
- package/packages/lsp-daemon/dist/index.d.ts +5 -0
- package/packages/lsp-daemon/dist/index.js +3573 -0
- package/packages/lsp-daemon/dist/lock.d.ts +7 -0
- package/packages/lsp-daemon/dist/lock.js +61 -0
- package/packages/lsp-daemon/dist/package.json +6 -0
- package/packages/lsp-daemon/dist/paths.d.ts +11 -0
- package/packages/lsp-daemon/dist/paths.js +49 -0
- package/packages/lsp-daemon/dist/proxy.d.ts +10 -0
- package/packages/lsp-daemon/dist/proxy.js +61 -0
- package/packages/lsp-daemon/dist/request-routing.d.ts +9 -0
- package/packages/lsp-daemon/dist/request-routing.js +44 -0
- package/packages/lsp-daemon/dist/run-daemon.d.ts +1 -0
- package/packages/lsp-daemon/dist/run-daemon.js +11 -0
- package/packages/lsp-daemon/dist/socket-jsonrpc.d.ts +5 -0
- package/packages/lsp-daemon/dist/socket-jsonrpc.js +25 -0
- package/packages/lsp-daemon/package.json +38 -0
- package/packages/lsp-tools-mcp/dist/cli.js +0 -0
- package/packages/lsp-tools-mcp/dist/lsp/client-wrapper.js +40 -17
- package/packages/lsp-tools-mcp/dist/lsp/client.js +11 -9
- package/packages/lsp-tools-mcp/dist/lsp/config-loader.js +5 -5
- package/packages/lsp-tools-mcp/dist/lsp/directory-diagnostics.js +5 -3
- package/packages/lsp-tools-mcp/dist/lsp/effective-extension.d.ts +1 -0
- package/packages/lsp-tools-mcp/dist/lsp/effective-extension.js +8 -0
- package/packages/lsp-tools-mcp/dist/lsp/infer-extension.js +3 -2
- package/packages/lsp-tools-mcp/dist/lsp/language-mappings.js +1 -0
- package/packages/lsp-tools-mcp/dist/lsp/server-definitions.js +12 -0
- package/packages/lsp-tools-mcp/dist/lsp/server-install-state.d.ts +12 -0
- package/packages/lsp-tools-mcp/dist/lsp/server-install-state.js +51 -0
- package/packages/lsp-tools-mcp/dist/lsp/workspace-edit.js +2 -1
- package/packages/lsp-tools-mcp/dist/request-context.d.ts +7 -0
- package/packages/lsp-tools-mcp/dist/request-context.js +14 -0
- package/packages/lsp-tools-mcp/dist/tools.js +44 -1
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +46 -33
- package/packages/omo-codex/plugin/.mcp.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.d.ts +7 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.js +173 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/cli.js +10 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.d.ts +22 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.js +165 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.d.ts +1 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.js +1 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/core.d.ts +5 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/core.js +4 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.d.ts +6 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.js +10 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/record.d.ts +2 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/record.js +11 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.d.ts +3 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.js +104 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/runner.d.ts +26 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/runner.js +144 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/types.d.ts +43 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/types.js +1 -0
- 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/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/cli.js +29 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/codex-hook.d.ts +28 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/codex-hook.js +137 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/index.d.ts +1 -0
- package/packages/omo-codex/plugin/components/git-bash/dist/index.js +1 -0
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +5 -2
- package/packages/omo-codex/plugin/components/lsp/.mcp.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +42 -0
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.js +40 -0
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.d.ts +16 -0
- package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.js +180 -0
- package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.d.ts +12 -0
- package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.js +95 -0
- package/packages/omo-codex/plugin/components/lsp/dist/mutated-file-paths.d.ts +6 -0
- package/packages/omo-codex/plugin/components/lsp/dist/mutated-file-paths.js +79 -0
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +7 -7
- package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-daemon.mjs +68 -0
- package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-tools.mjs +45 -22
- package/packages/omo-codex/plugin/components/lsp/src/cli.ts +1 -1
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook-cli.ts +1 -1
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +6 -2
- package/packages/omo-codex/plugin/components/lsp/src/lsp-session-state.ts +4 -0
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook-unavailable.test.ts +68 -0
- package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +8 -20
- package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus.md +69 -96
- package/packages/omo-codex/plugin/components/rules/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/rules/dist/cli.js +118 -0
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.d.ts +5 -0
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.js +1 -0
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook.d.ts +47 -0
- package/packages/omo-codex/plugin/components/rules/dist/codex-hook.js +127 -0
- package/packages/omo-codex/plugin/components/rules/dist/config.d.ts +2 -0
- package/packages/omo-codex/plugin/components/rules/dist/config.js +100 -0
- package/packages/omo-codex/plugin/components/rules/dist/context-pressure.d.ts +2 -0
- package/packages/omo-codex/plugin/components/rules/dist/context-pressure.js +26 -0
- package/packages/omo-codex/plugin/components/rules/dist/debug-log.d.ts +8 -0
- package/packages/omo-codex/plugin/components/rules/dist/debug-log.js +36 -0
- package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.d.ts +7 -0
- package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.js +65 -0
- package/packages/omo-codex/plugin/components/rules/dist/event-budget.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/event-budget.js +14 -0
- package/packages/omo-codex/plugin/components/rules/dist/hook-output.d.ts +2 -0
- package/packages/omo-codex/plugin/components/rules/dist/hook-output.js +24 -0
- package/packages/omo-codex/plugin/components/rules/dist/path-utils.d.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/dist/path-utils.js +24 -0
- package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.d.ts +13 -0
- package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.js +172 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.js +74 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.d.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.js +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.d.ts +1 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.js +32 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.d.ts +13 -0
- package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.js +29 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/cache.d.ts +9 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/cache.js +51 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/constants.d.ts +70 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/constants.js +101 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.d.ts +5 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.js +60 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.js +61 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.d.ts +7 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.js +60 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.d.ts +11 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.js +75 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.js +29 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.d.ts +44 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.js +1 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine.d.ts +5 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/engine.js +85 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/errors.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/errors.js +12 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.d.ts +14 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.js +51 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.js +33 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.d.ts +5 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.js +40 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder.d.ts +28 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/finder.js +146 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.d.ts +7 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.js +112 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.d.ts +18 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.js +93 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.js +27 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.d.ts +7 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.js +30 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.d.ts +2 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.js +237 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/parser.js +31 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.d.ts +1 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.js +48 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.d.ts +1 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.js +23 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.d.ts +14 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.js +111 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/sources.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/sources.js +9 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.d.ts +18 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.js +59 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/types.d.ts +126 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules/types.js +8 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.js +20 -0
- package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.js +41 -0
- package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.d.ts +10 -0
- package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.js +90 -0
- package/packages/omo-codex/plugin/components/rules/dist/static-injection.d.ts +3 -0
- package/packages/omo-codex/plugin/components/rules/dist/static-injection.js +128 -0
- package/packages/omo-codex/plugin/components/rules/dist/tool-paths.d.ts +6 -0
- package/packages/omo-codex/plugin/components/rules/dist/tool-paths.js +168 -0
- package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.d.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.js +49 -0
- package/packages/omo-codex/plugin/components/rules/dist/transcript-search.d.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/dist/transcript-search.js +91 -0
- 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/rules/src/codex-hook.ts +4 -2
- package/packages/omo-codex/plugin/components/rules/src/config.ts +13 -0
- package/packages/omo-codex/plugin/components/rules/src/event-budget.ts +17 -0
- package/packages/omo-codex/plugin/components/rules/src/persistent-cache.ts +4 -1
- package/packages/omo-codex/plugin/components/rules/src/post-compact-directive.ts +39 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/constants.ts +16 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/engine.ts +8 -0
- package/packages/omo-codex/plugin/components/rules/src/rules/types.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/src/sparkshell-awareness.ts +53 -4
- package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +127 -7
- package/packages/omo-codex/plugin/components/rules/src/transcript-rule-filter.ts +9 -1
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +4 -2
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +7 -2
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +9 -9
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +10 -4
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +241 -0
- package/packages/omo-codex/plugin/components/rules/test/event-budget.test.ts +168 -0
- package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +4 -0
- package/packages/omo-codex/plugin/components/rules/test/sparkshell-awareness.test.ts +86 -3
- package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +15 -15
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.d.ts +16 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.js +146 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.js +49 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.d.ts +2 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.js +80 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.d.ts +1 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.js +2 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.d.ts +5 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.js +3 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.d.ts +20 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.js +1 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +24 -2
- package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.d.ts +1 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.js +18 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +62 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.d.ts +15 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.js +42 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/data-path.d.ts +10 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/data-path.js +35 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.d.ts +12 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.js +108 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.d.ts +4 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.js +31 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.d.ts +8 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.js +68 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.d.ts +21 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +133 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.d.ts +8 -0
- package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.js +29 -0
- 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/agents/explorer.toml +5 -13
- package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +61 -185
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +122 -117
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +48 -0
- package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.d.ts +7 -0
- package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.js +122 -0
- package/packages/omo-codex/plugin/components/ultrawork/dist/directive.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ultrawork/dist/directive.js +2 -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/skills/ulw-plan/SKILL.md +20 -11
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +17 -11
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +2 -5
- package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +0 -71
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.d.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +200 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-arg-parser.d.ts +17 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-arg-parser.js +97 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.d.ts +4 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +183 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +55 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.d.ts +12 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +145 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.d.ts +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +39 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.d.ts +13 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +100 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.d.ts +26 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.js +97 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.d.ts +28 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.js +145 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/command-types.d.ts +34 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/command-types.js +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.d.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.js +41 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +95 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.js +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.d.ts +31 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.js +119 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.d.ts +12 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.js +69 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.d.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.js +59 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.d.ts +48 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +119 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.d.ts +8 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +89 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.d.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.js +123 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.d.ts +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.js +70 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/runtime.d.ts +10 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/runtime.js +13 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-types.d.ts +63 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-types.js +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.d.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +292 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/types.d.ts +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/types.js +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +14 -14
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +24 -25
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +17 -3
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli.ts +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-entrypoint.test.ts +95 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +0 -96
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate.test.ts +23 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/skill-contract.test.ts +46 -0
- package/packages/omo-codex/plugin/hooks/hooks.json +16 -16
- package/packages/omo-codex/plugin/package-lock.json +10 -9
- package/packages/omo-codex/plugin/package.json +27 -26
- package/packages/omo-codex/plugin/scripts/auto-update.mjs +64 -15
- package/packages/omo-codex/plugin/scripts/build-bundled-mcp-runtimes.mjs +16 -0
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +82 -18
- package/packages/omo-codex/plugin/scripts/migrate-codex-config.mjs +2 -2
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +23 -11
- package/packages/omo-codex/plugin/scripts/sync-version.mjs +94 -0
- package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +9 -9
- package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/SKILL.md +16 -1
- package/packages/omo-codex/plugin/skills/lcx-doctor/SKILL.md +93 -0
- package/packages/omo-codex/plugin/skills/lcx-doctor/agents/openai.yaml +11 -0
- package/packages/omo-codex/plugin/skills/lcx-report-bug/SKILL.md +17 -13
- package/packages/omo-codex/plugin/skills/lsp-setup/SKILL.md +139 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/bash/README.md +60 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/c-cpp/README.md +61 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/csharp/README.md +71 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/dart/README.md +48 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/elixir/README.md +51 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/go/README.md +57 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/haskell/README.md +57 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/java/README.md +57 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/julia/README.md +60 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/kotlin/README.md +59 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/lua/README.md +66 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/php/README.md +62 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/python/README.md +71 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/ruby/README.md +53 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/rust/README.md +59 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/swift/README.md +51 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/terraform/README.md +62 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/typescript/README.md +77 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/yaml/README.md +70 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/references/zig/README.md +49 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/scripts/detect-lsp.ts +210 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/scripts/lsp-server-table.ts +177 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/scripts/tsconfig.json +17 -0
- package/packages/omo-codex/plugin/skills/lsp-setup/scripts/verify-lsp.ts +147 -0
- package/packages/omo-codex/plugin/skills/refactor/SKILL.md +9 -9
- package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +10 -10
- package/packages/omo-codex/plugin/skills/review-work/SKILL.md +20 -22
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +38 -61
- package/packages/omo-codex/plugin/skills/ultraresearch/SKILL.md +135 -677
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +14 -14
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +24 -25
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +20 -11
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +17 -11
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +9 -9
- package/packages/omo-codex/plugin/test/aggregate-build.test.mjs +2 -1
- package/packages/omo-codex/plugin/test/aggregate-mcp.test.mjs +1 -1
- package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +5 -5
- package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +6 -6
- package/packages/omo-codex/plugin/test/auto-update-restart-notice.test.mjs +194 -0
- package/packages/omo-codex/plugin/test/auto-update.test.mjs +17 -0
- package/packages/omo-codex/plugin/test/lcx-bug-skills.test.mjs +15 -44
- package/packages/omo-codex/plugin/test/lsp-prebuild-layouts.test.mjs +140 -0
- package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +189 -7
- package/packages/omo-codex/plugin/test/start-work-skill.test.mjs +9 -31
- package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +68 -4
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +119 -0
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +11 -112
- package/packages/omo-codex/plugin/test/sync-version.test.mjs +68 -0
- package/packages/omo-codex/plugin/test/ultraresearch-skill-contract.test.mjs +126 -0
- package/packages/omo-codex/plugin/test/ulw-plan-skill.test.mjs +2 -2
- package/packages/omo-codex/scripts/install/bin-dir.mjs +20 -0
- package/packages/omo-codex/scripts/install/bin-links.mjs +43 -6
- package/packages/omo-codex/scripts/install/cache.mjs +4 -0
- package/packages/omo-codex/scripts/install/config.mjs +4 -4
- package/packages/omo-codex/scripts/install/delegated-command.mjs +5 -1
- package/packages/omo-codex/scripts/install/git-bash-mcp-env.mjs +28 -0
- package/packages/omo-codex/scripts/install/git-bash.mjs +12 -4
- package/packages/omo-codex/scripts/install/git-bash.test.mjs +39 -4
- package/packages/omo-codex/scripts/install/hook-targets.mjs +46 -0
- package/packages/omo-codex/scripts/install/multi-agent-v2-config.mjs +12 -2
- package/packages/omo-codex/scripts/install/process.mjs +1 -0
- package/packages/omo-codex/scripts/install-bin-links.test.mjs +131 -3
- package/packages/omo-codex/scripts/install-config-git-bash.test.mjs +91 -0
- package/packages/omo-codex/scripts/install-config.test.mjs +50 -44
- package/packages/omo-codex/scripts/install-delegated-command.test.mjs +78 -0
- package/packages/omo-codex/scripts/install-git-bash-mcp-env.test.mjs +93 -0
- package/packages/omo-codex/scripts/install-hook-targets.test.mjs +100 -0
- package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +3 -1
- package/packages/omo-codex/scripts/install-local.mjs +7 -18
- package/packages/omo-codex/scripts/install-local.test.mjs +34 -1
- package/packages/shared-skills/skills/lcx-contribute-bug-fix/SKILL.md +16 -1
- package/packages/shared-skills/skills/lcx-doctor/SKILL.md +93 -0
- package/packages/shared-skills/skills/lcx-doctor/agents/openai.yaml +11 -0
- package/packages/shared-skills/skills/lcx-report-bug/SKILL.md +17 -13
- package/packages/shared-skills/skills/lsp-setup/SKILL.md +139 -0
- package/packages/shared-skills/skills/lsp-setup/references/bash/README.md +60 -0
- package/packages/shared-skills/skills/lsp-setup/references/c-cpp/README.md +61 -0
- package/packages/shared-skills/skills/lsp-setup/references/csharp/README.md +71 -0
- package/packages/shared-skills/skills/lsp-setup/references/dart/README.md +48 -0
- package/packages/shared-skills/skills/lsp-setup/references/elixir/README.md +51 -0
- package/packages/shared-skills/skills/lsp-setup/references/go/README.md +57 -0
- package/packages/shared-skills/skills/lsp-setup/references/haskell/README.md +57 -0
- package/packages/shared-skills/skills/lsp-setup/references/java/README.md +57 -0
- package/packages/shared-skills/skills/lsp-setup/references/julia/README.md +60 -0
- package/packages/shared-skills/skills/lsp-setup/references/kotlin/README.md +59 -0
- package/packages/shared-skills/skills/lsp-setup/references/lua/README.md +66 -0
- package/packages/shared-skills/skills/lsp-setup/references/php/README.md +62 -0
- package/packages/shared-skills/skills/lsp-setup/references/python/README.md +71 -0
- package/packages/shared-skills/skills/lsp-setup/references/ruby/README.md +53 -0
- package/packages/shared-skills/skills/lsp-setup/references/rust/README.md +59 -0
- package/packages/shared-skills/skills/lsp-setup/references/swift/README.md +51 -0
- package/packages/shared-skills/skills/lsp-setup/references/terraform/README.md +62 -0
- package/packages/shared-skills/skills/lsp-setup/references/typescript/README.md +77 -0
- package/packages/shared-skills/skills/lsp-setup/references/yaml/README.md +70 -0
- package/packages/shared-skills/skills/lsp-setup/references/zig/README.md +49 -0
- package/packages/shared-skills/skills/lsp-setup/scripts/detect-lsp.ts +210 -0
- package/packages/shared-skills/skills/lsp-setup/scripts/lsp-server-table.ts +177 -0
- package/packages/shared-skills/skills/lsp-setup/scripts/tsconfig.json +17 -0
- package/packages/shared-skills/skills/lsp-setup/scripts/verify-lsp.ts +147 -0
- package/packages/shared-skills/skills/remove-ai-slops/SKILL.md +1 -1
- package/packages/shared-skills/skills/review-work/SKILL.md +10 -14
- package/packages/shared-skills/skills/start-work/SKILL.md +30 -59
- package/packages/shared-skills/skills/ultraresearch/SKILL.md +126 -667
- package/dist/hooks/anthropic-effort/hook.d.ts +0 -26
- package/dist/hooks/anthropic-effort/index.d.ts +0 -1
- package/dist/hooks/keyword-detector/analyze/default.d.ts +0 -12
- package/dist/hooks/keyword-detector/analyze/index.d.ts +0 -1
- package/dist/hooks/keyword-detector/search/default.d.ts +0 -12
- package/dist/hooks/keyword-detector/search/index.d.ts +0 -1
- package/dist/hooks/thinking-block-validator/hook.d.ts +0 -12
- package/dist/hooks/thinking-block-validator/index.d.ts +0 -1
- package/packages/omo-codex/plugin/components/ultrawork/test/directive-contract.test.ts +0 -18
- package/packages/omo-codex/plugin/test/global-review-debug-gate.test.mjs +0 -29
- package/packages/omo-codex/plugin/test/subagent-guidance.test.mjs +0 -151
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
|
+
import { mkdtemp, readFile, writeFile } from "node:fs/promises";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import test from "node:test";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
|
|
9
|
+
import { resolveAutoUpdatePlan, runAutoUpdateCheck } from "../scripts/auto-update.mjs";
|
|
10
|
+
|
|
11
|
+
const SCRIPT_PATH = fileURLToPath(new URL("../scripts/auto-update.mjs", import.meta.url));
|
|
12
|
+
const STARTED_NOTICE =
|
|
13
|
+
"[LazyCodex] Auto-update started in the background: v1.0.0 -> v1.0.1. Tell the user a new LazyCodex version is installing and that they should start a new Codex session after it completes to apply it.";
|
|
14
|
+
const COMPLETED_NOTICE =
|
|
15
|
+
"[LazyCodex] Auto-update completed: v1.0.0 -> v1.0.1. This session is already running the new version. Tell the user the auto-update was applied.";
|
|
16
|
+
|
|
17
|
+
function autoUpdateEnv(root, extra = {}) {
|
|
18
|
+
return {
|
|
19
|
+
CODEX_HOME: join(root, "codex-home"),
|
|
20
|
+
LAZYCODEX_CURRENT_VERSION: "1.0.0",
|
|
21
|
+
LAZYCODEX_LATEST_VERSION: "1.0.1",
|
|
22
|
+
LAZYCODEX_MODEL_CATALOG_STATE_PATH: join(root, "model-state.json"),
|
|
23
|
+
LAZYCODEX_AUTO_UPDATE_STATE_PATH: join(root, "state.json"),
|
|
24
|
+
LAZYCODEX_AUTO_UPDATE_LOG_PATH: join(root, "auto-update.log"),
|
|
25
|
+
...extra,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
test("#given a newer version #when resolving auto update plan #then plan carries current and latest versions", () => {
|
|
30
|
+
const plan = resolveAutoUpdatePlan({
|
|
31
|
+
env: { LAZYCODEX_CURRENT_VERSION: "1.0.0", LAZYCODEX_LATEST_VERSION: "1.0.1" },
|
|
32
|
+
now: 90_000_000,
|
|
33
|
+
lastCheckedAt: 0,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
assert.equal(plan.shouldRun, true);
|
|
37
|
+
assert.equal(plan.currentVersion, "1.0.0");
|
|
38
|
+
assert.equal(plan.latestVersion, "1.0.1");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("#given a newer version #when waited update succeeds #then returns update-started notice and persists pendingNotice", async () => {
|
|
42
|
+
const root = await mkdtemp(join(tmpdir(), "lazycodex-restart-notice-started-"));
|
|
43
|
+
const env = autoUpdateEnv(root, {
|
|
44
|
+
LAZYCODEX_AUTO_UPDATE_INTERVAL_MS: "0",
|
|
45
|
+
LAZYCODEX_AUTO_UPDATE_COMMAND: process.execPath,
|
|
46
|
+
LAZYCODEX_AUTO_UPDATE_ARGS_JSON: JSON.stringify(["-e", "process.exit(0)"]),
|
|
47
|
+
LAZYCODEX_AUTO_UPDATE_WAIT: "1",
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const result = await runAutoUpdateCheck({
|
|
51
|
+
env,
|
|
52
|
+
now: 123_456,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
assert.equal(result.started, true);
|
|
56
|
+
assert.equal(result.status, 0);
|
|
57
|
+
assert.deepEqual(result.notices, [STARTED_NOTICE]);
|
|
58
|
+
const state = JSON.parse(await readFile(env.LAZYCODEX_AUTO_UPDATE_STATE_PATH, "utf8"));
|
|
59
|
+
assert.deepEqual(state.pendingNotice, {
|
|
60
|
+
fromVersion: "1.0.0",
|
|
61
|
+
toVersion: "1.0.1",
|
|
62
|
+
startedAt: 123_456,
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test("#given completed pending update #when startup check is throttled #then emits completed notice and clears pendingNotice", async () => {
|
|
67
|
+
const root = await mkdtemp(join(tmpdir(), "lazycodex-restart-notice-completed-"));
|
|
68
|
+
const now = 90_000_000;
|
|
69
|
+
const env = autoUpdateEnv(root, {
|
|
70
|
+
LAZYCODEX_CURRENT_VERSION: "1.0.1",
|
|
71
|
+
LAZYCODEX_LATEST_VERSION: "1.0.1",
|
|
72
|
+
});
|
|
73
|
+
await writeFile(env.LAZYCODEX_AUTO_UPDATE_STATE_PATH, JSON.stringify({
|
|
74
|
+
lastCheckedAt: now - 1_000,
|
|
75
|
+
lastStatus: "success",
|
|
76
|
+
pendingNotice: { fromVersion: "1.0.0", toVersion: "1.0.1", startedAt: 1 },
|
|
77
|
+
}));
|
|
78
|
+
|
|
79
|
+
const result = await runAutoUpdateCheck({
|
|
80
|
+
env,
|
|
81
|
+
now,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
assert.equal(result.started, false);
|
|
85
|
+
assert.equal(result.reason, "throttled");
|
|
86
|
+
assert.deepEqual(result.notices, [COMPLETED_NOTICE]);
|
|
87
|
+
assert.deepEqual(JSON.parse(await readFile(env.LAZYCODEX_AUTO_UPDATE_STATE_PATH, "utf8")), {
|
|
88
|
+
lastCheckedAt: now - 1_000,
|
|
89
|
+
lastStatus: "success",
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
test("#given incomplete pending update #when startup check runs #then no notice and pendingNotice retained", async () => {
|
|
94
|
+
const root = await mkdtemp(join(tmpdir(), "lazycodex-restart-notice-incomplete-"));
|
|
95
|
+
const now = 90_000_000;
|
|
96
|
+
const env = autoUpdateEnv(root);
|
|
97
|
+
await writeFile(env.LAZYCODEX_AUTO_UPDATE_STATE_PATH, JSON.stringify({
|
|
98
|
+
lastAttemptedAt: now - 60_000,
|
|
99
|
+
lastStatus: "started",
|
|
100
|
+
pendingNotice: { fromVersion: "1.0.0", toVersion: "1.0.1", startedAt: 1 },
|
|
101
|
+
}));
|
|
102
|
+
|
|
103
|
+
const result = await runAutoUpdateCheck({
|
|
104
|
+
env,
|
|
105
|
+
now,
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
assert.equal(result.started, false);
|
|
109
|
+
assert.equal(result.reason, "retry-throttled");
|
|
110
|
+
assert.deepEqual(result.notices, []);
|
|
111
|
+
const state = JSON.parse(await readFile(env.LAZYCODEX_AUTO_UPDATE_STATE_PATH, "utf8"));
|
|
112
|
+
assert.deepEqual(state.pendingNotice, {
|
|
113
|
+
fromVersion: "1.0.0",
|
|
114
|
+
toVersion: "1.0.1",
|
|
115
|
+
startedAt: 1,
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
test("#given waited update fails #then no notice and no pendingNotice", async () => {
|
|
120
|
+
const root = await mkdtemp(join(tmpdir(), "lazycodex-restart-notice-failed-"));
|
|
121
|
+
const env = autoUpdateEnv(root, {
|
|
122
|
+
LAZYCODEX_AUTO_UPDATE_INTERVAL_MS: "0",
|
|
123
|
+
LAZYCODEX_AUTO_UPDATE_COMMAND: process.execPath,
|
|
124
|
+
LAZYCODEX_AUTO_UPDATE_ARGS_JSON: JSON.stringify(["-e", "process.exit(1)"]),
|
|
125
|
+
LAZYCODEX_AUTO_UPDATE_WAIT: "1",
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
const result = await runAutoUpdateCheck({
|
|
129
|
+
env,
|
|
130
|
+
now: 123_456,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
assert.equal(result.started, true);
|
|
134
|
+
assert.equal(result.status, 1);
|
|
135
|
+
assert.deepEqual(result.notices, []);
|
|
136
|
+
assert.deepEqual(JSON.parse(await readFile(env.LAZYCODEX_AUTO_UPDATE_STATE_PATH, "utf8")), {
|
|
137
|
+
lastAttemptedAt: 123_456,
|
|
138
|
+
lastStatus: "failed",
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
test("#given malformed pendingNotice toVersion #when check runs #then pendingNotice dropped silently", async () => {
|
|
143
|
+
const root = await mkdtemp(join(tmpdir(), "lazycodex-restart-notice-malformed-"));
|
|
144
|
+
const env = autoUpdateEnv(root, {
|
|
145
|
+
LAZYCODEX_CURRENT_VERSION: "1.0.1",
|
|
146
|
+
LAZYCODEX_LATEST_VERSION: "1.0.1",
|
|
147
|
+
});
|
|
148
|
+
await writeFile(env.LAZYCODEX_AUTO_UPDATE_STATE_PATH, JSON.stringify({
|
|
149
|
+
pendingNotice: { fromVersion: "1.0.0", toVersion: "not-a-version", startedAt: 1 },
|
|
150
|
+
}));
|
|
151
|
+
|
|
152
|
+
const result = await runAutoUpdateCheck({
|
|
153
|
+
env,
|
|
154
|
+
now: 123_456,
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
assert.deepEqual(result.notices, []);
|
|
158
|
+
const state = JSON.parse(await readFile(env.LAZYCODEX_AUTO_UPDATE_STATE_PATH, "utf8"));
|
|
159
|
+
assert.equal("pendingNotice" in state, false);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
test("#given completed pending update #when hook session-start runs as CLI #then prints one SessionStart JSON line", async () => {
|
|
163
|
+
const root = await mkdtemp(join(tmpdir(), "lazycodex-restart-notice-cli-"));
|
|
164
|
+
const env = autoUpdateEnv(root, {
|
|
165
|
+
LAZYCODEX_CURRENT_VERSION: "1.0.1",
|
|
166
|
+
LAZYCODEX_LATEST_VERSION: "1.0.1",
|
|
167
|
+
LAZYCODEX_CONFIG_MIGRATION_DISABLED: "1",
|
|
168
|
+
});
|
|
169
|
+
await writeFile(env.LAZYCODEX_AUTO_UPDATE_STATE_PATH, JSON.stringify({
|
|
170
|
+
lastCheckedAt: Date.now() - 1_000,
|
|
171
|
+
lastStatus: "success",
|
|
172
|
+
pendingNotice: { fromVersion: "1.0.0", toVersion: "1.0.1", startedAt: 1 },
|
|
173
|
+
}));
|
|
174
|
+
|
|
175
|
+
const result = spawnSync(process.execPath, [SCRIPT_PATH, "hook", "session-start"], {
|
|
176
|
+
encoding: "utf8",
|
|
177
|
+
env: { ...process.env, ...env },
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
assert.equal(result.status, 0);
|
|
181
|
+
const lines = result.stdout.split("\n").filter((line) => line.length > 0);
|
|
182
|
+
assert.equal(lines.length, 1);
|
|
183
|
+
const parsed = JSON.parse(lines[0]);
|
|
184
|
+
assert.equal(parsed.hookSpecificOutput.hookEventName, "SessionStart");
|
|
185
|
+
assert.match(parsed.hookSpecificOutput.additionalContext, /v1\.0\.0 -> v1\.0\.1/);
|
|
186
|
+
|
|
187
|
+
const repeat = spawnSync(process.execPath, [SCRIPT_PATH, "hook", "session-start"], {
|
|
188
|
+
encoding: "utf8",
|
|
189
|
+
env: { ...process.env, ...env },
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
assert.equal(repeat.status, 0);
|
|
193
|
+
assert.equal(repeat.stdout, "");
|
|
194
|
+
});
|
|
@@ -162,6 +162,11 @@ test("#given test command override #when running check #then records state and l
|
|
|
162
162
|
lastCheckedAt: 123_456,
|
|
163
163
|
lastAttemptedAt: 123_456,
|
|
164
164
|
lastStatus: "success",
|
|
165
|
+
pendingNotice: {
|
|
166
|
+
fromVersion: "1.0.0",
|
|
167
|
+
toVersion: "1.0.1",
|
|
168
|
+
startedAt: 123_456,
|
|
169
|
+
},
|
|
165
170
|
});
|
|
166
171
|
assert.equal(await readFile(logPath, "utf8"), "ok");
|
|
167
172
|
const updateLog = (await readFile(env.LAZYCODEX_AUTO_UPDATE_LOG_PATH, "utf8")).trim().split("\n").map((line) => JSON.parse(line));
|
|
@@ -177,6 +182,13 @@ test("#given test command override #when running check #then records state and l
|
|
|
177
182
|
event: "finished",
|
|
178
183
|
status: 0,
|
|
179
184
|
},
|
|
185
|
+
{
|
|
186
|
+
timestamp: "1970-01-01T00:02:03.456Z",
|
|
187
|
+
event: "notified",
|
|
188
|
+
kind: "update-started",
|
|
189
|
+
fromVersion: "1.0.0",
|
|
190
|
+
toVersion: "1.0.1",
|
|
191
|
+
},
|
|
180
192
|
]);
|
|
181
193
|
assert.match(await readFile(join(env.CODEX_HOME, "config.toml"), "utf8"), /model = "gpt-5\.5"/);
|
|
182
194
|
});
|
|
@@ -262,6 +274,11 @@ test("#given stale lock #when running check #then removes lock and runs update",
|
|
|
262
274
|
lastCheckedAt: 1_000_000,
|
|
263
275
|
lastAttemptedAt: 1_000_000,
|
|
264
276
|
lastStatus: "success",
|
|
277
|
+
pendingNotice: {
|
|
278
|
+
fromVersion: "1.0.0",
|
|
279
|
+
toVersion: "1.0.1",
|
|
280
|
+
startedAt: 1_000_000,
|
|
281
|
+
},
|
|
265
282
|
});
|
|
266
283
|
});
|
|
267
284
|
|
|
@@ -16,22 +16,6 @@ test("#given synced lcx-report-bug skill #when inspected #then it files LazyCode
|
|
|
16
16
|
|
|
17
17
|
// then
|
|
18
18
|
assert.match(skill, /^---\r?\nname: lcx-report-bug\r?\n/m);
|
|
19
|
-
assert.match(skill, /code-yeongyu\/lazycodex/);
|
|
20
|
-
assert.match(skill, /openai\/codex/);
|
|
21
|
-
assert.match(skill, /\/tmp\/openai-codex-source/);
|
|
22
|
-
assert.match(skill, /\$omo:debugging/);
|
|
23
|
-
assert.match(skill, /Repository Decision/);
|
|
24
|
-
assert.match(skill, /TARGET_REPO="code-yeongyu\/lazycodex" # or openai\/codex/);
|
|
25
|
-
assert.match(skill, /LABEL_ARGS=\(\)/);
|
|
26
|
-
assert.match(skill, /gh label create lazycodex-generated.*--force/);
|
|
27
|
-
assert.match(skill, /gh issue create --repo "\$TARGET_REPO".*"\$\{LABEL_ARGS\[@\]\}"/);
|
|
28
|
-
assert.match(skill, /gh pr create --repo "\$TARGET_REPO".*"\$\{LABEL_ARGS\[@\]\}"/);
|
|
29
|
-
assert.match(skill, /lazycodex-generated/);
|
|
30
|
-
assert.match(skill, /This issue or PR was generated by LazyCodex/);
|
|
31
|
-
assert.match(skill, /Tag: lazycodex-generated/);
|
|
32
|
-
assert.match(skill, /Browser use fallback/);
|
|
33
|
-
assert.match(skill, /Computer use fallback/);
|
|
34
|
-
assert.match(skill, /## Issue Body Template/);
|
|
35
19
|
assert.match(interfaceMetadata, /display_name: "lcx-report-bug \(omo\)"/);
|
|
36
20
|
assert.match(interfaceMetadata, /- "lazycodex bug"/);
|
|
37
21
|
assert.match(interfaceMetadata, /- "openai codex bug"/);
|
|
@@ -44,38 +28,25 @@ test("#given synced lcx-contribute-bug-fix skill #when inspected #then it contri
|
|
|
44
28
|
// when
|
|
45
29
|
const skill = await readFile(join(skillRoot, "SKILL.md"), "utf8");
|
|
46
30
|
const interfaceMetadata = await readFile(join(skillRoot, "agents", "openai.yaml"), "utf8");
|
|
47
|
-
const script = await readFile(join(skillRoot, "scripts", "create-pr-body.mjs"), "utf8");
|
|
48
31
|
|
|
49
32
|
// then
|
|
50
33
|
assert.match(skill, /^---\r?\nname: lcx-contribute-bug-fix\r?\n/m);
|
|
51
|
-
assert.match(skill, /Contribute a verified bug-fix PR/);
|
|
52
|
-
assert.match(skill, /fresh `\/tmp` clone\/worktree/);
|
|
53
|
-
assert.match(skill, /\/tmp\/lazycodex-fix-/);
|
|
54
|
-
assert.match(skill, /git worktree add/);
|
|
55
|
-
assert.match(skill, /apply `lazycodex-generated` when label management is available/);
|
|
56
|
-
assert.match(skill, /git add -A/);
|
|
57
|
-
assert.match(skill, /git commit -m/);
|
|
58
|
-
assert.match(skill, /git log --oneline "origin\/\$BASE_BRANCH\.\.HEAD"/);
|
|
59
|
-
assert.match(skill, /gh repo fork "\$TARGET_REPO" --remote --remote-name fork/);
|
|
60
|
-
assert.match(skill, /PUSH_REMOTE/);
|
|
61
|
-
assert.match(skill, /lazycodex-generated/);
|
|
62
|
-
assert.match(skill, /LABEL_ARGS=\(\)/);
|
|
63
|
-
assert.match(skill, /gh label create lazycodex-generated.*--force/);
|
|
64
|
-
assert.match(skill, /gh pr create --repo "\$TARGET_REPO".*"\$\{LABEL_ARGS\[@\]\}"/);
|
|
65
|
-
assert.match(skill, /--head "\$PR_HEAD"/);
|
|
66
|
-
assert.doesNotMatch(skill, /a PR without the `lazycodex-generated` label/);
|
|
67
|
-
assert.match(skill, /scripts\/create-pr-body\.mjs/);
|
|
68
|
-
assert.match(skill, /## Problem Situation/);
|
|
69
|
-
assert.match(skill, /## Reproduction Logs/);
|
|
70
|
-
assert.match(skill, /## Approach/);
|
|
71
|
-
assert.match(skill, /## Why I Am Confident/);
|
|
72
|
-
assert.match(skill, /## Risks/);
|
|
73
|
-
assert.match(skill, /## User-Visible Behavior Changes/);
|
|
74
|
-
assert.match(skill, /Clean up/);
|
|
75
34
|
assert.match(interfaceMetadata, /display_name: "lcx-contribute-bug-fix \(omo\)"/);
|
|
76
35
|
assert.match(interfaceMetadata, /- "contribute a bug fix"/);
|
|
77
36
|
assert.match(interfaceMetadata, /- "fix bug pr"/);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test("#given synced lcx-doctor skill #when inspected #then it diagnoses installs against latest /tmp sources without mutating them", async () => {
|
|
40
|
+
// given
|
|
41
|
+
const skillRoot = join(root, "skills", "lcx-doctor");
|
|
42
|
+
|
|
43
|
+
// when
|
|
44
|
+
const skill = await readFile(join(skillRoot, "SKILL.md"), "utf8");
|
|
45
|
+
const interfaceMetadata = await readFile(join(skillRoot, "agents", "openai.yaml"), "utf8");
|
|
46
|
+
|
|
47
|
+
// then
|
|
48
|
+
assert.match(skill, /^---\r?\nname: lcx-doctor\r?\n/m);
|
|
49
|
+
assert.match(interfaceMetadata, /display_name: "lcx-doctor \(omo\)"/);
|
|
50
|
+
assert.match(interfaceMetadata, /- "lazycodex doctor"/);
|
|
51
|
+
assert.match(interfaceMetadata, /- "lazycodex health check"/);
|
|
81
52
|
});
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { execFileSync } from "node:child_process";
|
|
3
|
+
import { copyFile, mkdir, mkdtemp, rm, utimes, writeFile } from "node:fs/promises";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import test from "node:test";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
|
|
9
|
+
const REPO_SCRIPTS = fileURLToPath(new URL("../components/lsp/scripts", import.meta.url));
|
|
10
|
+
const BUILD_LSP_TOOLS = join(REPO_SCRIPTS, "build-lsp-tools.mjs");
|
|
11
|
+
const BUILD_LSP_DAEMON = join(REPO_SCRIPTS, "build-lsp-daemon.mjs");
|
|
12
|
+
|
|
13
|
+
// Run a copied script (built from HEAD sources) and return { status, stdout, stderr }.
|
|
14
|
+
// execFileSync throws on non-zero exit; we capture the SpawnError fields instead.
|
|
15
|
+
function runScript(script, cwd) {
|
|
16
|
+
try {
|
|
17
|
+
const stdout = execFileSync(process.execPath, [script], { cwd, encoding: "utf8" });
|
|
18
|
+
return { status: 0, stdout, stderr: "" };
|
|
19
|
+
} catch (err) {
|
|
20
|
+
return {
|
|
21
|
+
status: typeof err.status === "number" ? err.status : 1,
|
|
22
|
+
stdout: err.stdout ?? "",
|
|
23
|
+
stderr: err.stderr ?? "",
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Escape a string for use in a RegExp literal.
|
|
29
|
+
function escapeRegex(str) {
|
|
30
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
test("#given the installed cache layout #when running build-lsp-tools #then uses the bundled dist and exits 0", async () => {
|
|
34
|
+
// given — mirror the installed plugin cache: scripts 2-up from components/lsp-tools-mcp/dist
|
|
35
|
+
const root = await mkdtemp(join(tmpdir(), "lsp-prebuild-cache-tools-"));
|
|
36
|
+
try {
|
|
37
|
+
const scriptsDir = join(root, "components", "lsp", "scripts");
|
|
38
|
+
await mkdir(scriptsDir, { recursive: true });
|
|
39
|
+
await copyFile(BUILD_LSP_TOOLS, join(scriptsDir, "build-lsp-tools.mjs"));
|
|
40
|
+
|
|
41
|
+
await mkdir(join(root, "components", "lsp-tools-mcp", "dist", "lsp"), { recursive: true });
|
|
42
|
+
await writeFile(join(root, "components", "lsp-tools-mcp", "dist", "cli.js"), "");
|
|
43
|
+
await writeFile(join(root, "components", "lsp-tools-mcp", "dist", "tools.js"), "");
|
|
44
|
+
await writeFile(join(root, "components", "lsp-tools-mcp", "dist", "lsp", "manager.js"), "");
|
|
45
|
+
|
|
46
|
+
// when
|
|
47
|
+
const result = runScript(join(scriptsDir, "build-lsp-tools.mjs"), root);
|
|
48
|
+
|
|
49
|
+
// then
|
|
50
|
+
assert.equal(result.status, 0, `expected exit 0; stderr: ${result.stderr}`);
|
|
51
|
+
assert.match(result.stdout, /Using bundled lsp-tools-mcp dist/);
|
|
52
|
+
} finally {
|
|
53
|
+
await rm(root, { recursive: true, force: true });
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test("#given the installed cache layout #when running build-lsp-daemon #then uses the bundled dist and exits 0", async () => {
|
|
58
|
+
// given — mirror the installed plugin cache: scripts 2-up from components/lsp-daemon/dist
|
|
59
|
+
const root = await mkdtemp(join(tmpdir(), "lsp-prebuild-cache-daemon-"));
|
|
60
|
+
try {
|
|
61
|
+
const scriptsDir = join(root, "components", "lsp", "scripts");
|
|
62
|
+
await mkdir(scriptsDir, { recursive: true });
|
|
63
|
+
await copyFile(BUILD_LSP_DAEMON, join(scriptsDir, "build-lsp-daemon.mjs"));
|
|
64
|
+
|
|
65
|
+
await mkdir(join(root, "components", "lsp-daemon", "dist"), { recursive: true });
|
|
66
|
+
await writeFile(join(root, "components", "lsp-daemon", "dist", "cli.js"), "");
|
|
67
|
+
await writeFile(join(root, "components", "lsp-daemon", "dist", "index.js"), "");
|
|
68
|
+
await writeFile(join(root, "components", "lsp-daemon", "dist", "index.d.ts"), "");
|
|
69
|
+
|
|
70
|
+
// when
|
|
71
|
+
const result = runScript(join(scriptsDir, "build-lsp-daemon.mjs"), root);
|
|
72
|
+
|
|
73
|
+
// then
|
|
74
|
+
assert.equal(result.status, 0, `expected exit 0; stderr: ${result.stderr}`);
|
|
75
|
+
assert.match(result.stdout, /Using bundled lsp-daemon dist/);
|
|
76
|
+
} finally {
|
|
77
|
+
await rm(root, { recursive: true, force: true });
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test("#given neither layout #when running build-lsp-tools #then fails listing every probed path", async () => {
|
|
82
|
+
// given — bare layout: only the script, no package.json anywhere, no dist outputs
|
|
83
|
+
const root = await mkdtemp(join(tmpdir(), "lsp-prebuild-none-"));
|
|
84
|
+
try {
|
|
85
|
+
const scriptsDir = join(root, "components", "lsp", "scripts");
|
|
86
|
+
await mkdir(scriptsDir, { recursive: true });
|
|
87
|
+
await copyFile(BUILD_LSP_TOOLS, join(scriptsDir, "build-lsp-tools.mjs"));
|
|
88
|
+
|
|
89
|
+
// when
|
|
90
|
+
const result = runScript(join(scriptsDir, "build-lsp-tools.mjs"), root);
|
|
91
|
+
|
|
92
|
+
// then — exit 1, stderr enumerates BOTH probed package.json paths
|
|
93
|
+
// candidate 1: 5-up repo sibling (resolves outside the temp tree)
|
|
94
|
+
const candidate1PkgJson = join(scriptsDir, "..", "..", "..", "..", "..", "lsp-tools-mcp", "package.json");
|
|
95
|
+
// candidate 2: 2-up components sibling (inside the temp tree)
|
|
96
|
+
const candidate2PkgJson = join(root, "components", "lsp-tools-mcp", "package.json");
|
|
97
|
+
|
|
98
|
+
assert.equal(result.status, 1);
|
|
99
|
+
assert.match(result.stderr, new RegExp(escapeRegex(candidate1PkgJson)));
|
|
100
|
+
assert.match(result.stderr, new RegExp(escapeRegex(candidate2PkgJson)));
|
|
101
|
+
} finally {
|
|
102
|
+
await rm(root, { recursive: true, force: true });
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
test("#given the repo sibling layout with fresh outputs #when running build-lsp-tools #then exits 0 without building", async () => {
|
|
107
|
+
// given — simulate the repo layout: script at d1/d2/d3/components/lsp/scripts/,
|
|
108
|
+
// lsp-tools-mcp at d1/ (5-up from the scripts dir), outputs newer than package.json
|
|
109
|
+
const root = await mkdtemp(join(tmpdir(), "lsp-prebuild-repo-"));
|
|
110
|
+
try {
|
|
111
|
+
const scriptsDir = join(root, "d1", "d2", "d3", "components", "lsp", "scripts");
|
|
112
|
+
await mkdir(scriptsDir, { recursive: true });
|
|
113
|
+
await copyFile(BUILD_LSP_TOOLS, join(scriptsDir, "build-lsp-tools.mjs"));
|
|
114
|
+
|
|
115
|
+
// 5-up from scriptsDir lands on join(root, "d1")
|
|
116
|
+
const lspToolsDir = join(root, "d1", "lsp-tools-mcp");
|
|
117
|
+
await mkdir(join(lspToolsDir, "dist", "lsp"), { recursive: true });
|
|
118
|
+
|
|
119
|
+
// package.json gets an older mtime
|
|
120
|
+
await writeFile(join(lspToolsDir, "package.json"), "{}");
|
|
121
|
+
const older = new Date("2025-01-01T00:00:00.000Z");
|
|
122
|
+
await utimes(join(lspToolsDir, "package.json"), older, older);
|
|
123
|
+
|
|
124
|
+
// outputs get a newer mtime — isBuildFresh returns true
|
|
125
|
+
const newer = new Date("2025-01-02T00:00:00.000Z");
|
|
126
|
+
for (const rel of ["dist/cli.js", "dist/tools.js", "dist/lsp/manager.js"]) {
|
|
127
|
+
await writeFile(join(lspToolsDir, rel), "");
|
|
128
|
+
await utimes(join(lspToolsDir, rel), newer, newer);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// when
|
|
132
|
+
const result = runScript(join(scriptsDir, "build-lsp-tools.mjs"), root);
|
|
133
|
+
|
|
134
|
+
// then — exits 0 immediately (fresh build), no npm invocation
|
|
135
|
+
assert.equal(result.status, 0, `expected exit 0; stderr: ${result.stderr}`);
|
|
136
|
+
assert.doesNotMatch(result.stdout, /Installing/);
|
|
137
|
+
} finally {
|
|
138
|
+
await rm(root, { recursive: true, force: true });
|
|
139
|
+
}
|
|
140
|
+
});
|