@caplets/core 0.18.0 → 0.18.2

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.
@@ -1,4 +1,4 @@
1
- import { Ct as resolveProjectConfigPath, Mt as __exportAll, Ot as CapletsError, St as resolveProjectCapletsRoot, bt as resolveCapletsRoot, gt as loadConfigWithSources, vt as DEFAULT_AUTH_DIR, xt as resolveConfigPath, yt as DEFAULT_COMPLETION_CACHE_DIR } from "./options-DM1cMRcp.js";
1
+ import { Ct as resolveProjectConfigPath, Mt as __exportAll, Ot as CapletsError, St as resolveProjectCapletsRoot, bt as resolveCapletsRoot, gt as loadConfigWithSources, vt as DEFAULT_AUTH_DIR, xt as resolveConfigPath, yt as DEFAULT_COMPLETION_CACHE_DIR } from "./options-bnsSREid.js";
2
2
  import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
3
3
  import { dirname, join } from "node:path";
4
4
  import { createHash } from "node:crypto";
@@ -469,9 +469,17 @@ async function completeCliWords(words, options = {}) {
469
469
  if (normalized.length === 1) return prefixFilter([...topLevelCommandNames], current);
470
470
  if (normalized.length === 2 && command in cliSubcommands) return prefixFilter(cliSubcommands[command], current);
471
471
  if (normalized.length === 2 && capletIdCommands.has(command)) return prefixFilter(promptResourceCommands.has(command) ? configuredCapletIds(options, { backend: "mcp" }) : configuredCapletIds(options), current);
472
- if (normalized.length === 2 && (qualifiedToolCommands.has(command) || qualifiedPromptCommands.has(command))) {
473
- if (current.includes(".")) return prefixFilter((await discoverCompletionCandidates(current.slice(0, current.indexOf(".")), qualifiedToolCommands.has(command) ? "tools" : "prompts", discoveryOptions(options))).map((candidate) => candidate.value), current);
474
- return prefixFilter(configuredCapletIds(options, qualifiedPromptCommands.has(command) ? { backend: "mcp" } : void 0).map((id) => `${id}.`), current);
472
+ if (qualifiedToolCommands.has(command) || qualifiedPromptCommands.has(command)) {
473
+ const kind = qualifiedToolCommands.has(command) ? "tools" : "prompts";
474
+ const idFilter = qualifiedPromptCommands.has(command) ? { backend: "mcp" } : void 0;
475
+ if (normalized.length === 2) {
476
+ if (current.includes(".")) return prefixFilter((await discoverCompletionCandidates(current.slice(0, current.indexOf(".")), kind, discoveryOptions(options))).map((candidate) => candidate.value), current);
477
+ return prefixFilter(configuredCapletIds(options, idFilter), current);
478
+ }
479
+ if (normalized.length === 3 && subcommand && !subcommand.includes(".")) {
480
+ if (current.startsWith("-")) return [];
481
+ return prefixFilter((await discoverCompletionCandidates(subcommand, kind, discoveryOptions(options))).map((candidate) => candidate.value.replace(`${subcommand}.`, "")), current);
482
+ }
475
483
  }
476
484
  if (command === cliCommands.readResource && normalized.length === 3) return prefixFilter((await discoverCompletionCandidates(subcommand, "resources", discoveryOptions(options))).map((candidate) => candidate.value), current);
477
485
  if (command === cliCommands.auth && ["login", "logout"].includes(subcommand) && normalized.length === 3) return prefixFilter(configuredCapletIds(options), current);
@@ -1,2 +1,2 @@
1
- import { a as generatedToolInputJsonSchemaForCaplet, c as mcpOperations, i as generatedToolInputJsonSchema, l as operations, n as completionRefSchema, o as generatedToolInputSchema, r as generatedToolInputDescriptions, s as generatedToolInputSchemaForCaplet, t as completionArgumentSchema } from "./generated-tool-input-schema-B6rce396.js";
1
+ import { a as generatedToolInputJsonSchemaForCaplet, c as mcpOperations, i as generatedToolInputJsonSchema, l as operations, n as completionRefSchema, o as generatedToolInputSchema, r as generatedToolInputDescriptions, s as generatedToolInputSchemaForCaplet, t as completionArgumentSchema } from "./generated-tool-input-schema-BYoyY-l-.js";
2
2
  export { completionArgumentSchema, completionRefSchema, generatedToolInputDescriptions, generatedToolInputJsonSchema, generatedToolInputJsonSchemaForCaplet, generatedToolInputSchema, generatedToolInputSchemaForCaplet, mcpOperations, operations };