@pkgseer/cli 0.5.2 → 0.5.3
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.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
version
|
|
4
|
-
} from "./shared/chunk-
|
|
4
|
+
} from "./shared/chunk-dzjh13qr.js";
|
|
5
5
|
|
|
6
6
|
// src/cli.ts
|
|
7
7
|
import { Command } from "commander";
|
|
@@ -6883,7 +6883,7 @@ var schemas = {
|
|
|
6883
6883
|
packageName: z2.string().max(255).describe("Name of the package"),
|
|
6884
6884
|
version: z2.string().max(100).optional().describe("Specific version, e.g. '4.18.2' (defaults to latest)"),
|
|
6885
6885
|
navigationMode: z2.enum(["summary", "detailed"]).optional().describe("Response detail level. summary (default) returns core fields; detailed adds all optional fields."),
|
|
6886
|
-
waitTimeoutMs: z2.coerce.number().int().min(0).max(60000).optional().describe("Max milliseconds to wait for indexing (0-60000, default 10000).
|
|
6886
|
+
waitTimeoutMs: z2.coerce.number().int().min(0).max(60000).optional().describe("Max milliseconds to wait for repository indexing (0-60000, default 10000). " + "On first access, unindexed code is auto-indexed — small packages complete within the default 10s. " + "If indexing exceeds this timeout, the response includes an indexingRef — " + "poll progress with indexing_status(ref), then retry when status is INDEXED. " + "Set 0 to skip waiting."),
|
|
6887
6887
|
symbolReference: z2.object({
|
|
6888
6888
|
symbol_ref: z2.string().optional().describe("Compound symbol reference (registry:package:version:id) from find_symbol or list_symbols results. Self-contained — no additional fields needed."),
|
|
6889
6889
|
registry: z2.enum(["npm", "pypi", "hex", "crates", "nuget", "maven", "zig", "vcpkg"]).optional().describe("Package registry. For package-scoped lookup (with package_name + symbol_name)."),
|
|
@@ -6972,7 +6972,7 @@ function buildCodeTargetVars(resolved) {
|
|
|
6972
6972
|
}
|
|
6973
6973
|
var DEFAULT_WAIT_TIMEOUT_MS2 = 1e4;
|
|
6974
6974
|
var MCP_HINTS = {
|
|
6975
|
-
being_indexed: "Hint:
|
|
6975
|
+
being_indexed: "Hint: use indexing_status to poll progress, then retry when status is INDEXED.",
|
|
6976
6976
|
timeout: "Hint: this may be transient — retry the same query. If the issue persists, try simplifying the query."
|
|
6977
6977
|
};
|
|
6978
6978
|
function buildHintedMessage(operation, message) {
|
|
@@ -7002,7 +7002,7 @@ function buildHintedMessage(operation, message) {
|
|
|
7002
7002
|
}
|
|
7003
7003
|
var MCP_GRAPHQL_HINTS = {
|
|
7004
7004
|
not_found: "Hint: verify the package name, registry, or repository URL are correct.",
|
|
7005
|
-
being_indexed: "Hint:
|
|
7005
|
+
being_indexed: "Hint: use indexing_status to poll progress, then retry when status is INDEXED.",
|
|
7006
7006
|
timeout: "Hint: this may be transient — retry the same query. If the issue persists, try simplifying the query."
|
|
7007
7007
|
};
|
|
7008
7008
|
function getExtensionCode(errors) {
|
|
@@ -7025,7 +7025,7 @@ function getExtensionIndexingRef(errors) {
|
|
|
7025
7025
|
return;
|
|
7026
7026
|
}
|
|
7027
7027
|
var EXTENSION_CODE_HINTS = {
|
|
7028
|
-
PACKAGE_INDEXING: "Hint:
|
|
7028
|
+
PACKAGE_INDEXING: "Hint: use indexing_status to poll progress, then retry when status is INDEXED.",
|
|
7029
7029
|
NOT_FOUND: "Hint: verify the package name, registry, or repository URL are correct."
|
|
7030
7030
|
};
|
|
7031
7031
|
function handleGraphQLErrors(errors) {
|
|
@@ -7038,7 +7038,7 @@ function handleGraphQLErrors(errors) {
|
|
|
7038
7038
|
error: combined,
|
|
7039
7039
|
indexingStatus: "INDEXING",
|
|
7040
7040
|
indexingRef,
|
|
7041
|
-
message:
|
|
7041
|
+
message: `Target is being indexed. Poll with indexing_status(ref: "${indexingRef}"), then retry this query when status is INDEXED.`
|
|
7042
7042
|
}));
|
|
7043
7043
|
}
|
|
7044
7044
|
if (extensionCode === "PACKAGE_INDEXING") {
|
|
@@ -7060,12 +7060,15 @@ async function withErrorHandling(operation, fn) {
|
|
|
7060
7060
|
}
|
|
7061
7061
|
function handleIndexingStatus(data) {
|
|
7062
7062
|
if (data.indexingStatus === "INDEXING") {
|
|
7063
|
+
const ref = data.indexingRef;
|
|
7063
7064
|
const response = {
|
|
7064
|
-
indexingStatus: "INDEXING"
|
|
7065
|
-
message: "Target is being indexed. Use indexing_status tool with this indexingRef to poll progress, " + "or retry the original query after indexing completes."
|
|
7065
|
+
indexingStatus: "INDEXING"
|
|
7066
7066
|
};
|
|
7067
|
-
if (
|
|
7068
|
-
response.indexingRef =
|
|
7067
|
+
if (ref) {
|
|
7068
|
+
response.indexingRef = ref;
|
|
7069
|
+
response.message = `Target is being indexed. Poll with indexing_status(ref: "${ref}"), then retry this query when status is INDEXED.`;
|
|
7070
|
+
} else {
|
|
7071
|
+
response.message = "Target is being indexed. Retry this query in a few seconds, or with a longer wait_timeout_ms.";
|
|
7069
7072
|
}
|
|
7070
7073
|
return errorResult(JSON.stringify(response));
|
|
7071
7074
|
}
|
|
@@ -7317,11 +7320,11 @@ function createIndexingStatusTool(pkgseerService) {
|
|
|
7317
7320
|
response.elapsedMs = progress.elapsedMs;
|
|
7318
7321
|
}
|
|
7319
7322
|
if (progress.status === "INDEXED") {
|
|
7320
|
-
response.message = "Indexing
|
|
7323
|
+
response.message = "Indexing complete. Retry your original query to get results.";
|
|
7321
7324
|
} else if (progress.status === "INDEXING" || progress.status === "PENDING") {
|
|
7322
|
-
response.message =
|
|
7325
|
+
response.message = `Still indexing. Call indexing_status(ref: "${ref}") again to check progress.`;
|
|
7323
7326
|
} else if (progress.status === "FAILED") {
|
|
7324
|
-
response.message = "Indexing failed.";
|
|
7327
|
+
response.message = "Indexing failed. The package may not exist or the repository may be inaccessible.";
|
|
7325
7328
|
} else if (progress.status === "NOT_FOUND") {
|
|
7326
7329
|
response.message = "Indexing reference not found. The ref may be invalid or the session may have expired.";
|
|
7327
7330
|
}
|
package/dist/index.js
CHANGED