@robinmordasiewicz/f5xc-xcsh 1.0.91-2601040203 → 1.0.91-2601040346

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.
Files changed (2) hide show
  1. package/dist/index.js +137 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -47052,8 +47052,8 @@ function getLogoModeFromEnv(envPrefix) {
47052
47052
  var CLI_NAME = "xcsh";
47053
47053
  var CLI_FULL_NAME = "F5 Distributed Cloud Shell";
47054
47054
  function getVersion() {
47055
- if ("v1.0.91-2601040203") {
47056
- return "v1.0.91-2601040203";
47055
+ if ("v1.0.91-2601040346") {
47056
+ return "v1.0.91-2601040346";
47057
47057
  }
47058
47058
  if (process.env.XCSH_VERSION) {
47059
47059
  return process.env.XCSH_VERSION;
@@ -148664,7 +148664,7 @@ var queryCommand = {
148664
148664
  // src/domains/ai_services/chat.ts
148665
148665
  import * as readline from "readline";
148666
148666
  function parseChatArgs(args, session) {
148667
- const { remainingArgs } = parseDomainOutputFlags(
148667
+ const { options, remainingArgs } = parseDomainOutputFlags(
148668
148668
  args,
148669
148669
  session.getOutputFormat()
148670
148670
  );
@@ -148683,7 +148683,11 @@ function parseChatArgs(args, session) {
148683
148683
  }
148684
148684
  i++;
148685
148685
  }
148686
- return { spec, namespace };
148686
+ return {
148687
+ spec,
148688
+ namespace,
148689
+ suppressOutput: options.format === "none"
148690
+ };
148687
148691
  }
148688
148692
  function showChatHelp() {
148689
148693
  return [
@@ -148898,13 +148902,19 @@ var chatCommand = {
148898
148902
  usage: "[--namespace <ns>]",
148899
148903
  aliases: ["interactive", "i"],
148900
148904
  async execute(args, session) {
148901
- const { spec, namespace } = parseChatArgs(args, session);
148905
+ const { spec, namespace, suppressOutput } = parseChatArgs(
148906
+ args,
148907
+ session
148908
+ );
148902
148909
  if (spec) {
148903
148910
  const cmdSpec = getCommandSpec("generative_ai chat");
148904
148911
  if (cmdSpec) {
148905
148912
  return successResult([formatSpec(cmdSpec)]);
148906
148913
  }
148907
148914
  }
148915
+ if (suppressOutput) {
148916
+ return successResult([]);
148917
+ }
148908
148918
  if (!process.stdin.isTTY) {
148909
148919
  return errorResult(
148910
148920
  "Chat mode requires an interactive terminal. Use 'ai query' for non-interactive queries."
@@ -148922,7 +148932,7 @@ var chatCommand = {
148922
148932
 
148923
148933
  // src/domains/ai_services/feedback.ts
148924
148934
  function parseFeedbackArgs(args, session) {
148925
- const { remainingArgs } = parseDomainOutputFlags(
148935
+ const { options, remainingArgs } = parseDomainOutputFlags(
148926
148936
  args,
148927
148937
  session.getOutputFormat()
148928
148938
  );
@@ -148970,6 +148980,8 @@ function parseFeedbackArgs(args, session) {
148970
148980
  i++;
148971
148981
  }
148972
148982
  return {
148983
+ format: options.format,
148984
+ noColor: options.noColor,
148973
148985
  spec,
148974
148986
  namespace,
148975
148987
  positive,
@@ -148986,13 +148998,25 @@ var feedbackCommand = {
148986
148998
  usage: "--positive | --negative <type> [--comment <text>] [--query-id <id>]",
148987
148999
  aliases: ["fb", "rate"],
148988
149000
  async execute(args, session) {
148989
- const { spec, namespace, positive, negativeType, comment, queryId } = parseFeedbackArgs(args, session);
149001
+ const {
149002
+ format,
149003
+ noColor,
149004
+ spec,
149005
+ namespace,
149006
+ positive,
149007
+ negativeType,
149008
+ comment,
149009
+ queryId
149010
+ } = parseFeedbackArgs(args, session);
148990
149011
  if (spec) {
148991
149012
  const cmdSpec = getCommandSpec("generative_ai feedback");
148992
149013
  if (cmdSpec) {
148993
149014
  return successResult([formatSpec(cmdSpec)]);
148994
149015
  }
148995
149016
  }
149017
+ if (format === "none") {
149018
+ return successResult([]);
149019
+ }
148996
149020
  if (!positive && !negativeType) {
148997
149021
  const validTypes = getValidFeedbackTypes().join(", ");
148998
149022
  return errorResult(
@@ -149037,6 +149061,17 @@ Negative types: ${validTypes}`
149037
149061
  positive_feedback: {},
149038
149062
  comment: comment ?? void 0
149039
149063
  });
149064
+ const result2 = {
149065
+ status: "success",
149066
+ type: "positive",
149067
+ query_id: targetQueryId,
149068
+ message: "Positive feedback submitted successfully."
149069
+ };
149070
+ if (format === "json" || format === "yaml" || format === "tsv") {
149071
+ return successResult(
149072
+ formatDomainOutput(result2, { format, noColor })
149073
+ );
149074
+ }
149040
149075
  return successResult([
149041
149076
  "Positive feedback submitted successfully.",
149042
149077
  `Query ID: ${targetQueryId}`
@@ -149051,6 +149086,19 @@ Negative types: ${validTypes}`
149051
149086
  },
149052
149087
  comment: comment ?? void 0
149053
149088
  });
149089
+ const result = {
149090
+ status: "success",
149091
+ type: "negative",
149092
+ query_id: targetQueryId,
149093
+ reason: negativeType ?? "OTHER",
149094
+ ...comment ? { comment } : {},
149095
+ message: "Negative feedback submitted successfully."
149096
+ };
149097
+ if (format === "json" || format === "yaml" || format === "tsv") {
149098
+ return successResult(
149099
+ formatDomainOutput(result, { format, noColor })
149100
+ );
149101
+ }
149054
149102
  return successResult([
149055
149103
  "Negative feedback submitted successfully.",
149056
149104
  `Query ID: ${targetQueryId}`,
@@ -149302,13 +149350,94 @@ var evalSubcommands = {
149302
149350
  defaultCommand: evalQueryCommand
149303
149351
  };
149304
149352
 
149353
+ // src/domains/domain-overview.ts
149354
+ function formatDomainOverview(config) {
149355
+ const lines = [];
149356
+ lines.push("");
149357
+ lines.push(`${config.name} - ${config.description}`);
149358
+ lines.push("");
149359
+ if (config.commands.length > 0) {
149360
+ lines.push("Commands:");
149361
+ const maxNameLen = Math.max(
149362
+ ...config.commands.map((cmd) => cmd.name.length)
149363
+ );
149364
+ const padding = Math.min(maxNameLen + 2, 20);
149365
+ for (const cmd of config.commands) {
149366
+ lines.push(` ${cmd.name.padEnd(padding)} ${cmd.description}`);
149367
+ }
149368
+ lines.push("");
149369
+ }
149370
+ if (config.examples.length > 0) {
149371
+ lines.push("Examples:");
149372
+ for (const example of config.examples) {
149373
+ lines.push(` ${example}`);
149374
+ }
149375
+ lines.push("");
149376
+ }
149377
+ if (config.supportsOutputFormats) {
149378
+ lines.push("Output formats: --output json|yaml|table|tsv|none");
149379
+ lines.push("");
149380
+ }
149381
+ if (config.notes && config.notes.length > 0) {
149382
+ for (const note of config.notes) {
149383
+ lines.push(note);
149384
+ }
149385
+ lines.push("");
149386
+ }
149387
+ return lines;
149388
+ }
149389
+
149305
149390
  // src/domains/ai_services/index.ts
149391
+ var entryCommand = {
149392
+ name: "ai_services",
149393
+ description: "AI-powered query and chat services for F5 Distributed Cloud",
149394
+ descriptionShort: "AI assistant queries and feedback",
149395
+ descriptionMedium: "Query the AI assistant for help with F5 XC platform operations, configurations, and troubleshooting.",
149396
+ async execute(args, session) {
149397
+ const hasQuestion = args.length > 0 && !args[0]?.startsWith("--");
149398
+ if (hasQuestion) {
149399
+ return queryCommand.execute(args, session);
149400
+ }
149401
+ const overview = formatDomainOverview({
149402
+ name: "AI Services",
149403
+ description: "Query and chat with the F5 XC AI assistant",
149404
+ commands: [
149405
+ {
149406
+ name: "query <question>",
149407
+ description: "Ask a single question"
149408
+ },
149409
+ {
149410
+ name: "chat",
149411
+ description: "Start interactive chat session"
149412
+ },
149413
+ {
149414
+ name: "feedback",
149415
+ description: "Provide feedback on AI responses"
149416
+ }
149417
+ ],
149418
+ examples: [
149419
+ "query 'How do I create an HTTP load balancer?'",
149420
+ "query 'What is my WAF policy configuration?' --namespace prod",
149421
+ "chat",
149422
+ "feedback positive"
149423
+ ],
149424
+ supportsOutputFormats: true,
149425
+ notes: ["Use 'eval' subcommand for AI evaluation testing."]
149426
+ });
149427
+ return {
149428
+ output: overview,
149429
+ contextChanged: true,
149430
+ shouldExit: false,
149431
+ shouldClear: false
149432
+ };
149433
+ }
149434
+ };
149306
149435
  var aiServicesDomain = {
149307
149436
  name: "ai_services",
149308
149437
  description: "Interact with the F5 Distributed Cloud AI assistant for natural language queries about platform operations. Ask questions about load balancers, WAF configurations, site status, security events, or any platform topic. Supports single queries with follow-up suggestions, interactive multi-turn chat sessions, and feedback submission to improve AI responses.",
149309
149438
  descriptionShort: "AI assistant queries and feedback",
149310
149439
  descriptionMedium: "Query the AI assistant for help with F5 XC platform operations, configurations, security analysis, and troubleshooting.",
149311
- defaultCommand: queryCommand,
149440
+ defaultCommand: entryCommand,
149312
149441
  commands: /* @__PURE__ */ new Map([
149313
149442
  ["query", queryCommand],
149314
149443
  ["chat", chatCommand],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinmordasiewicz/f5xc-xcsh",
3
- "version": "1.0.91-2601040203",
3
+ "version": "1.0.91-2601040346",
4
4
  "description": "F5 Distributed Cloud Shell - Interactive CLI for F5 XC",
5
5
  "type": "module",
6
6
  "bin": {