lazycodex-ai 5.1.2 → 5.1.4
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 +233 -81
- package/dist/cli-node/index.js +233 -81
- package/package.json +1 -1
- package/packages/lsp-daemon/dist/cli.js +2 -1
- package/packages/lsp-daemon/dist/client.js +2 -1
- package/packages/lsp-daemon/dist/index.js +2 -1
- package/packages/lsp-tools-mcp/dist/cli.js +2 -1
- package/packages/lsp-tools-mcp/dist/mcp.js +2 -1
- package/packages/lsp-tools-mcp/dist/tools.js +2 -1
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/dist/cli.js +33 -7
- 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/comment-checker/src/runner.ts +4 -4
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +4 -4
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +141 -107
- package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.js +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/lsp/src/lsp-session-state.ts +2 -2
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +12 -12
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
- package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +1 -1
|
@@ -5586,7 +5586,8 @@ function missingDependencyAvailability(error) {
|
|
|
5586
5586
|
extensions: [...error.lookup.server.extensions],
|
|
5587
5587
|
installHint: error.lookup.installHint,
|
|
5588
5588
|
installDecisionTool: context.capabilities.installDecisionTool,
|
|
5589
|
-
installDecisionsPath: context.installDecisionsPath
|
|
5589
|
+
installDecisionsPath: context.installDecisionsPath,
|
|
5590
|
+
decision: loadInstallDecision(error.lookup.server.id)?.decision ?? null
|
|
5590
5591
|
};
|
|
5591
5592
|
default: {
|
|
5592
5593
|
const exhaustive = error.lookup;
|
|
@@ -5581,7 +5581,8 @@ function missingDependencyAvailability(error) {
|
|
|
5581
5581
|
extensions: [...error.lookup.server.extensions],
|
|
5582
5582
|
installHint: error.lookup.installHint,
|
|
5583
5583
|
installDecisionTool: context.capabilities.installDecisionTool,
|
|
5584
|
-
installDecisionsPath: context.installDecisionsPath
|
|
5584
|
+
installDecisionsPath: context.installDecisionsPath,
|
|
5585
|
+
decision: loadInstallDecision(error.lookup.server.id)?.decision ?? null
|
|
5585
5586
|
};
|
|
5586
5587
|
default: {
|
|
5587
5588
|
const exhaustive = error.lookup;
|
|
@@ -4919,7 +4919,8 @@ function missingDependencyAvailability(error) {
|
|
|
4919
4919
|
extensions: [...error.lookup.server.extensions],
|
|
4920
4920
|
installHint: error.lookup.installHint,
|
|
4921
4921
|
installDecisionTool: context.capabilities.installDecisionTool,
|
|
4922
|
-
installDecisionsPath: context.installDecisionsPath
|
|
4922
|
+
installDecisionsPath: context.installDecisionsPath,
|
|
4923
|
+
decision: loadInstallDecision(error.lookup.server.id)?.decision ?? null
|
|
4923
4924
|
};
|
|
4924
4925
|
default: {
|
|
4925
4926
|
const exhaustive = error.lookup;
|
|
@@ -4915,7 +4915,8 @@ function missingDependencyAvailability(error) {
|
|
|
4915
4915
|
extensions: [...error.lookup.server.extensions],
|
|
4916
4916
|
installHint: error.lookup.installHint,
|
|
4917
4917
|
installDecisionTool: context.capabilities.installDecisionTool,
|
|
4918
|
-
installDecisionsPath: context.installDecisionsPath
|
|
4918
|
+
installDecisionsPath: context.installDecisionsPath,
|
|
4919
|
+
decision: loadInstallDecision(error.lookup.server.id)?.decision ?? null
|
|
4919
4920
|
};
|
|
4920
4921
|
default: {
|
|
4921
4922
|
const exhaustive = error.lookup;
|
|
@@ -4603,7 +4603,8 @@ function missingDependencyAvailability(error) {
|
|
|
4603
4603
|
extensions: [...error.lookup.server.extensions],
|
|
4604
4604
|
installHint: error.lookup.installHint,
|
|
4605
4605
|
installDecisionTool: context.capabilities.installDecisionTool,
|
|
4606
|
-
installDecisionsPath: context.installDecisionsPath
|
|
4606
|
+
installDecisionsPath: context.installDecisionsPath,
|
|
4607
|
+
decision: loadInstallDecision(error.lookup.server.id)?.decision ?? null
|
|
4607
4608
|
};
|
|
4608
4609
|
default: {
|
|
4609
4610
|
const exhaustive = error.lookup;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"command": "node \"${PLUGIN_ROOT}/components/bootstrap/dist/cli.js\" hook session-start",
|
|
9
9
|
"commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -File \"${PLUGIN_ROOT}\\components\\bootstrap\\scripts\\bootstrap.ps1\"",
|
|
10
10
|
"timeout": 30,
|
|
11
|
-
"statusMessage": "(OmO 5.1.
|
|
11
|
+
"statusMessage": "(OmO 5.1.4) Checking Bootstrap Provisioning"
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
14
|
}
|
|
@@ -146,6 +146,34 @@ function joinPatchLines(lines) {
|
|
|
146
146
|
`)}
|
|
147
147
|
`;
|
|
148
148
|
}
|
|
149
|
+
// ../../comment-checker-core/src/package-binary.ts
|
|
150
|
+
import { createRequire } from "node:module";
|
|
151
|
+
import { dirname, join } from "node:path";
|
|
152
|
+
var COMMENT_CHECKER_PACKAGE_NAME = "@code-yeongyu/comment-checker";
|
|
153
|
+
function isModuleResolutionMiss(error) {
|
|
154
|
+
return error instanceof Error || typeof error === "object" && error !== null && "name" in error && error.name === "ResolveMessage";
|
|
155
|
+
}
|
|
156
|
+
function findCommentCheckerPackageBinary(input) {
|
|
157
|
+
const packageName = input.packageName ?? COMMENT_CHECKER_PACKAGE_NAME;
|
|
158
|
+
const platformKey = `${input.platform ?? process.platform}-${input.arch ?? process.arch}`;
|
|
159
|
+
const packageDir = dirname(input.packageJsonPath);
|
|
160
|
+
const candidates = [
|
|
161
|
+
resolvePlatformPackageBinary(input.packageJsonPath, `${packageName}-${platformKey}`, input.binaryName),
|
|
162
|
+
join(packageDir, "vendor", platformKey, input.binaryName),
|
|
163
|
+
join(packageDir, "bin", input.binaryName)
|
|
164
|
+
];
|
|
165
|
+
return candidates.find((candidate) => candidate !== null && input.existsSync(candidate)) ?? null;
|
|
166
|
+
}
|
|
167
|
+
function resolvePlatformPackageBinary(packageJsonPath, platformPackageName, binaryName) {
|
|
168
|
+
try {
|
|
169
|
+
const manifestPath = createRequire(packageJsonPath).resolve(`${platformPackageName}/package.json`);
|
|
170
|
+
return join(dirname(manifestPath), "bin", binaryName);
|
|
171
|
+
} catch (error) {
|
|
172
|
+
if (isModuleResolutionMiss(error))
|
|
173
|
+
return null;
|
|
174
|
+
throw error;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
149
177
|
// components/comment-checker/src/hook-input.ts
|
|
150
178
|
function toHookInput(request, context) {
|
|
151
179
|
return {
|
|
@@ -302,8 +330,7 @@ function getContentText(content) {
|
|
|
302
330
|
// components/comment-checker/src/runner.ts
|
|
303
331
|
import { spawn } from "node:child_process";
|
|
304
332
|
import { existsSync } from "node:fs";
|
|
305
|
-
import { createRequire } from "node:module";
|
|
306
|
-
import { dirname, join } from "node:path";
|
|
333
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
307
334
|
var MAX_PROCESS_OUTPUT_BYTES = 64 * 1024;
|
|
308
335
|
async function runCommentChecker2(input, options = {}) {
|
|
309
336
|
const binaryPath = options.binaryPath ?? (options.resolveBinary ? options.resolveBinary() : resolveCommentCheckerBinary2());
|
|
@@ -361,7 +388,7 @@ function resolveCommentCheckerBinary2() {
|
|
|
361
388
|
}
|
|
362
389
|
function resolvePackageApiBinary() {
|
|
363
390
|
try {
|
|
364
|
-
const require2 =
|
|
391
|
+
const require2 = createRequire2(import.meta.url);
|
|
365
392
|
const packageExports = require2(commentCheckerPackageName());
|
|
366
393
|
if (!isCommentCheckerPackage(packageExports))
|
|
367
394
|
return;
|
|
@@ -373,10 +400,9 @@ function resolvePackageApiBinary() {
|
|
|
373
400
|
}
|
|
374
401
|
function resolvePackageBinary(binaryName) {
|
|
375
402
|
try {
|
|
376
|
-
const require2 =
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
return existsSync(binaryPath) ? binaryPath : undefined;
|
|
403
|
+
const require2 = createRequire2(import.meta.url);
|
|
404
|
+
const packageJsonPath = require2.resolve(`${commentCheckerPackageName()}/package.json`);
|
|
405
|
+
return findCommentCheckerPackageBinary({ packageJsonPath, binaryName, existsSync }) ?? undefined;
|
|
380
406
|
} catch {
|
|
381
407
|
return;
|
|
382
408
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
import { findCommentCheckerPackageBinary } from "@oh-my-opencode/comment-checker-core";
|
|
5
6
|
|
|
6
7
|
import type { CommentCheckerHookInput } from "./core.js";
|
|
7
8
|
|
|
@@ -108,9 +109,8 @@ function resolvePackageApiBinary(): string | undefined {
|
|
|
108
109
|
function resolvePackageBinary(binaryName: string): string | undefined {
|
|
109
110
|
try {
|
|
110
111
|
const require = createRequire(import.meta.url);
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
return existsSync(binaryPath) ? binaryPath : undefined;
|
|
112
|
+
const packageJsonPath = require.resolve(`${commentCheckerPackageName()}/package.json`);
|
|
113
|
+
return findCommentCheckerPackageBinary({ packageJsonPath, binaryName, existsSync }) ?? undefined;
|
|
114
114
|
} catch {
|
|
115
115
|
return undefined;
|
|
116
116
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "command",
|
|
9
9
|
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook pre-tool-use",
|
|
10
10
|
"timeout": 5,
|
|
11
|
-
"statusMessage": "(OmO 5.1.
|
|
11
|
+
"statusMessage": "(OmO 5.1.4) Recommending Git Bash MCP"
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
14
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"type": "command",
|
|
21
21
|
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-compact",
|
|
22
22
|
"timeout": 5,
|
|
23
|
-
"statusMessage": "(OmO 5.1.
|
|
23
|
+
"statusMessage": "(OmO 5.1.4) Resetting Git Bash MCP Reminder"
|
|
24
24
|
}
|
|
25
25
|
]
|
|
26
26
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "command",
|
|
9
9
|
"command": "node \"${PLUGIN_ROOT}/components/lazycodex-executor-verify/dist/cli.js\" hook subagent-stop",
|
|
10
10
|
"timeout": 10,
|
|
11
|
-
"statusMessage": "(OmO 5.1.
|
|
11
|
+
"statusMessage": "(OmO 5.1.4) Verifying LazyCodex Executor Evidence"
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"version": "5.1.
|
|
4
|
-
"inputDigest": "sha256:
|
|
3
|
+
"version": "5.1.4",
|
|
4
|
+
"inputDigest": "sha256:4b9c0202761e8abe92155e627fa7548e4252aadd31dd92f1412d6bf1e357ed23",
|
|
5
5
|
"outputs": [
|
|
6
6
|
{
|
|
7
7
|
"path": "cli.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"path": "cli.js",
|
|
12
|
-
"sha256": "
|
|
12
|
+
"sha256": "d793d83fb82b1fafe52e619f545c5195398498d1f95f15d84904fe3d0a20befe"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"path": "codex-hook-cli.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"path": "lsp-session-state.js",
|
|
44
|
-
"sha256": "
|
|
44
|
+
"sha256": "8c0e4fff28cb9deaca9c1b12ed2b0663a93fdf8532a8028f90a241b0607b8368"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"path": "mutated-file-paths.d.ts",
|
|
@@ -4989,7 +4989,8 @@ function missingDependencyAvailability(error) {
|
|
|
4989
4989
|
extensions: [...error.lookup.server.extensions],
|
|
4990
4990
|
installHint: error.lookup.installHint,
|
|
4991
4991
|
installDecisionTool: context.capabilities.installDecisionTool,
|
|
4992
|
-
installDecisionsPath: context.installDecisionsPath
|
|
4992
|
+
installDecisionsPath: context.installDecisionsPath,
|
|
4993
|
+
decision: loadInstallDecision(error.lookup.server.id)?.decision ?? null
|
|
4993
4994
|
};
|
|
4994
4995
|
default: {
|
|
4995
4996
|
const exhaustive = error.lookup;
|
|
@@ -5782,109 +5783,18 @@ function callDiagnosticsViaDaemon2(filePath, options) {
|
|
|
5782
5783
|
return callDiagnosticsViaDaemon(filePath, options);
|
|
5783
5784
|
}
|
|
5784
5785
|
|
|
5785
|
-
// ../../../../lsp-core/src/
|
|
5786
|
-
|
|
5787
|
-
var
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
const observations = [];
|
|
5798
|
-
for (const result of results) {
|
|
5799
|
-
const classification = classifyDiagnostics(result.outcome);
|
|
5800
|
-
switch (classification.kind) {
|
|
5801
|
-
case "clean":
|
|
5802
|
-
observations.push({ filePath: result.filePath, kind: "clean" });
|
|
5803
|
-
break;
|
|
5804
|
-
case "not_configured":
|
|
5805
|
-
cache.notConfiguredExtensions.add(classification.extension);
|
|
5806
|
-
observations.push({ filePath: result.filePath, kind: "not_configured" });
|
|
5807
|
-
break;
|
|
5808
|
-
case "block":
|
|
5809
|
-
blocks.push({ filePath: result.filePath, diagnostics: classification.diagnostics });
|
|
5810
|
-
observations.push({ filePath: result.filePath, kind: "block" });
|
|
5811
|
-
break;
|
|
5812
|
-
default: {
|
|
5813
|
-
const exhaustive = classification;
|
|
5814
|
-
return exhaustive;
|
|
5815
|
-
}
|
|
5816
|
-
}
|
|
5817
|
-
}
|
|
5818
|
-
return { blocks, observations };
|
|
5819
|
-
}
|
|
5820
|
-
function firstSeenDiagnosticTargets(filePaths, cache) {
|
|
5821
|
-
const seen = new Set;
|
|
5822
|
-
const targets = [];
|
|
5823
|
-
for (const filePath of filePaths) {
|
|
5824
|
-
if (filePath.length === 0 || seen.has(filePath))
|
|
5825
|
-
continue;
|
|
5826
|
-
seen.add(filePath);
|
|
5827
|
-
const extension = extensionKey(filePath);
|
|
5828
|
-
if (extension !== undefined && cache.notConfiguredExtensions.has(extension))
|
|
5829
|
-
continue;
|
|
5830
|
-
targets.push({ index: targets.length, filePath });
|
|
5831
|
-
}
|
|
5832
|
-
return targets;
|
|
5833
|
-
}
|
|
5834
|
-
async function runBoundedDiagnostics(filePaths, runDiagnostics, maxConcurrency) {
|
|
5835
|
-
const results = [];
|
|
5836
|
-
const workerCount = Math.min(Math.max(1, maxConcurrency ?? DEFAULT_MAX_CONCURRENCY), filePaths.length);
|
|
5837
|
-
let nextIndex = 0;
|
|
5838
|
-
async function worker() {
|
|
5839
|
-
for (;; ) {
|
|
5840
|
-
const target = filePaths[nextIndex];
|
|
5841
|
-
nextIndex += 1;
|
|
5842
|
-
if (target === undefined)
|
|
5843
|
-
return;
|
|
5844
|
-
results[target.index] = {
|
|
5845
|
-
index: target.index,
|
|
5846
|
-
filePath: target.filePath,
|
|
5847
|
-
outcome: await collectFileDiagnostics(target.filePath, runDiagnostics)
|
|
5848
|
-
};
|
|
5849
|
-
}
|
|
5850
|
-
}
|
|
5851
|
-
await Promise.all(Array.from({ length: workerCount }, () => worker()));
|
|
5852
|
-
return results.filter((result) => result !== undefined);
|
|
5853
|
-
}
|
|
5854
|
-
async function collectFileDiagnostics(filePath, runDiagnostics) {
|
|
5855
|
-
try {
|
|
5856
|
-
return normalizeDiagnosticsOutcome(await runDiagnostics(filePath));
|
|
5857
|
-
} catch (error) {
|
|
5858
|
-
if (error instanceof Error)
|
|
5859
|
-
return formatDiagnosticsError(error);
|
|
5860
|
-
return normalizeDiagnosticsText(String(error));
|
|
5861
|
-
}
|
|
5862
|
-
}
|
|
5863
|
-
function normalizeDiagnosticsOutcome(outcome) {
|
|
5864
|
-
if (typeof outcome === "string")
|
|
5865
|
-
return normalizeDiagnosticsText(outcome);
|
|
5866
|
-
return outcome;
|
|
5867
|
-
}
|
|
5868
|
-
function normalizeDiagnosticsText(text) {
|
|
5869
|
-
return text.trim();
|
|
5870
|
-
}
|
|
5871
|
-
function formatDiagnosticsError(error) {
|
|
5872
|
-
const message = normalizeDiagnosticsText(error.message);
|
|
5873
|
-
return message.length > 0 ? message : normalizeDiagnosticsText(String(error));
|
|
5874
|
-
}
|
|
5875
|
-
function classifyDiagnostics(outcome) {
|
|
5876
|
-
if (typeof outcome !== "string") {
|
|
5877
|
-
return { kind: "not_configured", extension: outcome.extension };
|
|
5878
|
-
}
|
|
5879
|
-
const diagnostics = outcome;
|
|
5880
|
-
if (diagnostics.length === 0 || diagnostics === CLEAN_DIAGNOSTICS_TEXT)
|
|
5881
|
-
return { kind: "clean" };
|
|
5882
|
-
return { kind: "block", diagnostics };
|
|
5883
|
-
}
|
|
5884
|
-
function extensionKey(filePath) {
|
|
5885
|
-
const extension = extname2(filePath).toLowerCase();
|
|
5886
|
-
return extension.length === 0 ? undefined : extension;
|
|
5887
|
-
}
|
|
5786
|
+
// ../../../../lsp-core/src/lsp/workspace-markers.ts
|
|
5787
|
+
var GIT_WORKSPACE_MARKER2 = ".git";
|
|
5788
|
+
var PROJECT_WORKSPACE_MARKERS2 = [
|
|
5789
|
+
"package.json",
|
|
5790
|
+
"pyproject.toml",
|
|
5791
|
+
"Cargo.toml",
|
|
5792
|
+
"go.mod",
|
|
5793
|
+
"pom.xml",
|
|
5794
|
+
"build.gradle"
|
|
5795
|
+
];
|
|
5796
|
+
var WORKSPACE_MARKERS2 = [GIT_WORKSPACE_MARKER2, ...PROJECT_WORKSPACE_MARKERS2];
|
|
5797
|
+
|
|
5888
5798
|
// ../../../../lsp-core/src/request-context.ts
|
|
5889
5799
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
5890
5800
|
import { existsSync as existsSync13, realpathSync as realpathSync6, statSync as statSync6 } from "node:fs";
|
|
@@ -6007,7 +5917,131 @@ function errorCode2(error) {
|
|
|
6007
5917
|
const code = Reflect.get(error, "code");
|
|
6008
5918
|
return typeof code === "string" ? code : undefined;
|
|
6009
5919
|
}
|
|
6010
|
-
|
|
5920
|
+
// ../../../../lsp-core/src/post-edit/not-installed-guidance.ts
|
|
5921
|
+
function notInstalledGuidance(filePath, outcome, state, locateFile) {
|
|
5922
|
+
if (outcome.decision !== undefined)
|
|
5923
|
+
return outcome.text;
|
|
5924
|
+
if (locateFile !== undefined && locateFile(filePath) !== "project")
|
|
5925
|
+
return;
|
|
5926
|
+
if (outcome.installDecisionTool)
|
|
5927
|
+
return outcome.text;
|
|
5928
|
+
if (state.notInstalledServers.has(outcome.serverId))
|
|
5929
|
+
return;
|
|
5930
|
+
state.notInstalledServers.add(outcome.serverId);
|
|
5931
|
+
return outcome.text;
|
|
5932
|
+
}
|
|
5933
|
+
// ../../../../lsp-core/src/post-edit/orchestration.ts
|
|
5934
|
+
import { extname as extname2 } from "node:path";
|
|
5935
|
+
var DEFAULT_MAX_CONCURRENCY = 4;
|
|
5936
|
+
var CLEAN_DIAGNOSTICS_TEXT = "No diagnostics found";
|
|
5937
|
+
function createPostEditNotConfiguredCache() {
|
|
5938
|
+
return { notConfiguredExtensions: new Set, notInstalledServers: new Set };
|
|
5939
|
+
}
|
|
5940
|
+
async function collectPostEditDiagnostics(input) {
|
|
5941
|
+
const cache = input.cache === undefined ? createPostEditNotConfiguredCache() : input.cache;
|
|
5942
|
+
const filePaths = firstSeenDiagnosticTargets(input.filePaths, cache);
|
|
5943
|
+
const results = await runBoundedDiagnostics(filePaths, input.runDiagnostics, input.maxConcurrency);
|
|
5944
|
+
const blocks = [];
|
|
5945
|
+
const observations = [];
|
|
5946
|
+
for (const result of results) {
|
|
5947
|
+
const outcome = result.outcome;
|
|
5948
|
+
const classification = typeof outcome !== "string" && outcome.kind === "not_installed" ? classifyNotInstalled(notInstalledGuidance(result.filePath, outcome, cache, input.locateFile)) : classifyDiagnostics(outcome);
|
|
5949
|
+
switch (classification.kind) {
|
|
5950
|
+
case "not_installed":
|
|
5951
|
+
observations.push({ filePath: result.filePath, kind: "not_installed" });
|
|
5952
|
+
break;
|
|
5953
|
+
case "clean":
|
|
5954
|
+
observations.push({ filePath: result.filePath, kind: "clean" });
|
|
5955
|
+
break;
|
|
5956
|
+
case "not_configured":
|
|
5957
|
+
cache.notConfiguredExtensions.add(classification.extension);
|
|
5958
|
+
observations.push({ filePath: result.filePath, kind: "not_configured" });
|
|
5959
|
+
break;
|
|
5960
|
+
case "block":
|
|
5961
|
+
blocks.push({ filePath: result.filePath, diagnostics: classification.diagnostics });
|
|
5962
|
+
observations.push({ filePath: result.filePath, kind: "block" });
|
|
5963
|
+
break;
|
|
5964
|
+
default: {
|
|
5965
|
+
const exhaustive = classification;
|
|
5966
|
+
return exhaustive;
|
|
5967
|
+
}
|
|
5968
|
+
}
|
|
5969
|
+
}
|
|
5970
|
+
return { blocks, observations };
|
|
5971
|
+
}
|
|
5972
|
+
function firstSeenDiagnosticTargets(filePaths, cache) {
|
|
5973
|
+
const seen = new Set;
|
|
5974
|
+
const targets = [];
|
|
5975
|
+
for (const filePath of filePaths) {
|
|
5976
|
+
if (filePath.length === 0 || seen.has(filePath))
|
|
5977
|
+
continue;
|
|
5978
|
+
seen.add(filePath);
|
|
5979
|
+
const extension = extensionKey(filePath);
|
|
5980
|
+
if (extension !== undefined && cache.notConfiguredExtensions.has(extension))
|
|
5981
|
+
continue;
|
|
5982
|
+
targets.push({ index: targets.length, filePath });
|
|
5983
|
+
}
|
|
5984
|
+
return targets;
|
|
5985
|
+
}
|
|
5986
|
+
async function runBoundedDiagnostics(filePaths, runDiagnostics, maxConcurrency) {
|
|
5987
|
+
const results = [];
|
|
5988
|
+
const workerCount = Math.min(Math.max(1, maxConcurrency ?? DEFAULT_MAX_CONCURRENCY), filePaths.length);
|
|
5989
|
+
let nextIndex = 0;
|
|
5990
|
+
async function worker() {
|
|
5991
|
+
for (;; ) {
|
|
5992
|
+
const target = filePaths[nextIndex];
|
|
5993
|
+
nextIndex += 1;
|
|
5994
|
+
if (target === undefined)
|
|
5995
|
+
return;
|
|
5996
|
+
results[target.index] = {
|
|
5997
|
+
index: target.index,
|
|
5998
|
+
filePath: target.filePath,
|
|
5999
|
+
outcome: await collectFileDiagnostics(target.filePath, runDiagnostics)
|
|
6000
|
+
};
|
|
6001
|
+
}
|
|
6002
|
+
}
|
|
6003
|
+
await Promise.all(Array.from({ length: workerCount }, () => worker()));
|
|
6004
|
+
return results.filter((result) => result !== undefined);
|
|
6005
|
+
}
|
|
6006
|
+
async function collectFileDiagnostics(filePath, runDiagnostics) {
|
|
6007
|
+
try {
|
|
6008
|
+
return normalizeDiagnosticsOutcome(await runDiagnostics(filePath));
|
|
6009
|
+
} catch (error) {
|
|
6010
|
+
if (error instanceof Error)
|
|
6011
|
+
return formatDiagnosticsError(error);
|
|
6012
|
+
return normalizeDiagnosticsText(String(error));
|
|
6013
|
+
}
|
|
6014
|
+
}
|
|
6015
|
+
function normalizeDiagnosticsOutcome(outcome) {
|
|
6016
|
+
if (typeof outcome === "string")
|
|
6017
|
+
return normalizeDiagnosticsText(outcome);
|
|
6018
|
+
if (outcome.kind === "not_installed")
|
|
6019
|
+
return { ...outcome, text: normalizeDiagnosticsText(outcome.text) };
|
|
6020
|
+
return outcome;
|
|
6021
|
+
}
|
|
6022
|
+
function classifyNotInstalled(guidance) {
|
|
6023
|
+
return guidance === undefined ? { kind: "not_installed" } : { kind: "block", diagnostics: guidance };
|
|
6024
|
+
}
|
|
6025
|
+
function normalizeDiagnosticsText(text) {
|
|
6026
|
+
return text.trim();
|
|
6027
|
+
}
|
|
6028
|
+
function formatDiagnosticsError(error) {
|
|
6029
|
+
const message = normalizeDiagnosticsText(error.message);
|
|
6030
|
+
return message.length > 0 ? message : normalizeDiagnosticsText(String(error));
|
|
6031
|
+
}
|
|
6032
|
+
function classifyDiagnostics(outcome) {
|
|
6033
|
+
if (typeof outcome !== "string") {
|
|
6034
|
+
return { kind: "not_configured", extension: outcome.extension };
|
|
6035
|
+
}
|
|
6036
|
+
const diagnostics = outcome;
|
|
6037
|
+
if (diagnostics.length === 0 || diagnostics === CLEAN_DIAGNOSTICS_TEXT)
|
|
6038
|
+
return { kind: "clean" };
|
|
6039
|
+
return { kind: "block", diagnostics };
|
|
6040
|
+
}
|
|
6041
|
+
function extensionKey(filePath) {
|
|
6042
|
+
const extension = extname2(filePath).toLowerCase();
|
|
6043
|
+
return extension.length === 0 ? undefined : extension;
|
|
6044
|
+
}
|
|
6011
6045
|
// src/daemon-cli-path.ts
|
|
6012
6046
|
import { existsSync as existsSync14, readFileSync as readFileSync7 } from "node:fs";
|
|
6013
6047
|
import { createRequire as createRequire2 } from "node:module";
|
|
@@ -6081,9 +6115,9 @@ function sessionIdFrom(input) {
|
|
|
6081
6115
|
}
|
|
6082
6116
|
function readLspPostEditCache(sessionId) {
|
|
6083
6117
|
if (sessionId === undefined)
|
|
6084
|
-
return { notConfiguredExtensions: new Set };
|
|
6118
|
+
return { notConfiguredExtensions: new Set, notInstalledServers: new Set };
|
|
6085
6119
|
const state = readSessionState(sessionStatePath(sessionId));
|
|
6086
|
-
return { notConfiguredExtensions: new Set(state.notConfiguredExtensions) };
|
|
6120
|
+
return { notConfiguredExtensions: new Set(state.notConfiguredExtensions), notInstalledServers: new Set };
|
|
6087
6121
|
}
|
|
6088
6122
|
function writeLspPostEditCache(sessionId, cache) {
|
|
6089
6123
|
if (sessionId === undefined)
|
|
@@ -6,9 +6,9 @@ export function sessionIdFrom(input) {
|
|
|
6
6
|
}
|
|
7
7
|
export function readLspPostEditCache(sessionId) {
|
|
8
8
|
if (sessionId === undefined)
|
|
9
|
-
return { notConfiguredExtensions: new Set() };
|
|
9
|
+
return { notConfiguredExtensions: new Set(), notInstalledServers: new Set() };
|
|
10
10
|
const state = readSessionState(sessionStatePath(sessionId));
|
|
11
|
-
return { notConfiguredExtensions: new Set(state.notConfiguredExtensions) };
|
|
11
|
+
return { notConfiguredExtensions: new Set(state.notConfiguredExtensions), notInstalledServers: new Set() };
|
|
12
12
|
}
|
|
13
13
|
export function writeLspPostEditCache(sessionId, cache) {
|
|
14
14
|
if (sessionId === undefined)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "command",
|
|
9
9
|
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use",
|
|
10
10
|
"timeout": 60,
|
|
11
|
-
"statusMessage": "(OmO 5.1.
|
|
11
|
+
"statusMessage": "(OmO 5.1.4) Checking LSP Diagnostics"
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
14
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"type": "command",
|
|
22
22
|
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-compact",
|
|
23
23
|
"timeout": 5,
|
|
24
|
-
"statusMessage": "(OmO 5.1.
|
|
24
|
+
"statusMessage": "(OmO 5.1.4) Resetting LSP Diagnostics Cache"
|
|
25
25
|
}
|
|
26
26
|
]
|
|
27
27
|
}
|
|
@@ -13,9 +13,9 @@ export function sessionIdFrom(input: { readonly session_id?: unknown }): string
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export function readLspPostEditCache(sessionId: string | undefined): PostEditNotConfiguredCache {
|
|
16
|
-
if (sessionId === undefined) return { notConfiguredExtensions: new Set() };
|
|
16
|
+
if (sessionId === undefined) return { notConfiguredExtensions: new Set(), notInstalledServers: new Set() };
|
|
17
17
|
const state = readSessionState(sessionStatePath(sessionId));
|
|
18
|
-
return { notConfiguredExtensions: new Set(state.notConfiguredExtensions) };
|
|
18
|
+
return { notConfiguredExtensions: new Set(state.notConfiguredExtensions), notInstalledServers: new Set() };
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export function writeLspPostEditCache(sessionId: string | undefined, cache: PostEditNotConfiguredCache): void {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"type": "command",
|
|
8
8
|
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook session-start",
|
|
9
9
|
"timeout": 10,
|
|
10
|
-
"statusMessage": "(OmO 5.1.
|
|
10
|
+
"statusMessage": "(OmO 5.1.4) Loading Project Rules"
|
|
11
11
|
}
|
|
12
12
|
]
|
|
13
13
|
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"type": "command",
|
|
20
20
|
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook user-prompt-submit",
|
|
21
21
|
"timeout": 10,
|
|
22
|
-
"statusMessage": "(OmO 5.1.
|
|
22
|
+
"statusMessage": "(OmO 5.1.4) Loading Project Rules"
|
|
23
23
|
}
|
|
24
24
|
]
|
|
25
25
|
}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"type": "command",
|
|
33
33
|
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use",
|
|
34
34
|
"timeout": 10,
|
|
35
|
-
"statusMessage": "(OmO 5.1.
|
|
35
|
+
"statusMessage": "(OmO 5.1.4) Matching Project Rules"
|
|
36
36
|
}
|
|
37
37
|
]
|
|
38
38
|
}
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"type": "command",
|
|
46
46
|
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-compact",
|
|
47
47
|
"timeout": 10,
|
|
48
|
-
"statusMessage": "(OmO 5.1.
|
|
48
|
+
"statusMessage": "(OmO 5.1.4) Resetting Project Rule Cache"
|
|
49
49
|
}
|
|
50
50
|
]
|
|
51
51
|
}
|