@robinmordasiewicz/f5xc-xcsh 1.0.90-2601022257 → 1.0.91-2601022325

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/completions/_xcsh CHANGED
@@ -27,6 +27,7 @@ _xcsh() {
27
27
  local -a domains builtins
28
28
  domains=(
29
29
  'admin_console_and_ui:Static UI components and console assets.'
30
+ 'ai_services:AI assistant queries and feedback collection.'
30
31
  'api:Interface definitions, schema validation, and grouping.'
31
32
  'authentication:Authentication API'
32
33
  'bigip:iRules, data groups, and APM integration.'
@@ -70,6 +71,9 @@ _xcsh() {
70
71
  'console-ui:Alias for admin_console_and_ui'
71
72
  'ui-assets:Alias for admin_console_and_ui'
72
73
  'static-components:Alias for admin_console_and_ui'
74
+ 'ai:Alias for ai_services'
75
+ 'genai:Alias for ai_services'
76
+ 'assistant:Alias for ai_services'
73
77
  'apisec:Alias for api'
74
78
  'api-discovery:Alias for api'
75
79
  'authn:Alias for authentication'
@@ -176,6 +180,7 @@ _xcsh() {
176
180
  'exit:Exit the shell'
177
181
  'clear:Clear the screen'
178
182
  'history:Show command history'
183
+ 'refresh:Refresh git status in statusline'
179
184
  'context:Show current navigation context'
180
185
  'ctx:Show current navigation context'
181
186
  )
@@ -196,7 +201,7 @@ _xcsh() {
196
201
  (login)
197
202
  _values 'command' 'banner:Display xcsh banner with logo' 'profile:Manage saved connection profiles' 'context:Manage default namespace context'
198
203
  ;;
199
- (help|quit|exit|clear|history|context|ctx)
204
+ (help|quit|exit|clear|history|refresh|context|ctx)
200
205
  ;;
201
206
  (*)
202
207
  local -a actions
@@ -6,9 +6,9 @@ _xcsh_completions() {
6
6
  local cur prev words cword
7
7
  _init_completion || return
8
8
 
9
- local commands="admin_console_and_ui api authentication bigip billing_and_usage blindfold bot_and_threat_defense cdn ce_management certificates cloud_infrastructure cloudstatus completion container_services data_and_privacy_security data_intelligence ddos dns generative_ai login managed_kubernetes marketplace network network_security nginx_one object_storage observability rate_limiting secops_and_incident_response service_mesh shape sites statistics support telemetry_and_insights tenant_and_identity threat_campaign users virtual vpm_and_node_management waf console-ui ui-assets static-components apisec api-discovery authn oidc sso f5-bigip irule ltm billing-usage quotas usage-tracking bf encrypt secrets threat-defense tpm shape-bot cache content ce-mgmt edge-management ce-lifecycle cert certs ssl tls cloud infra provider vk8s containers workloads data-privacy pii sensitive-data lma di intelligence insights dos ddos-protect dns-zone zones mk8s appstack k8s-mgmt market addons extensions net routing bgp netsec nfw nginx nms nginx-plus storage s3 buckets obs monitoring synth ratelimit throttle policer secops incident-response mitigation mesh svc-mesh shape-sec safeap site deployment stats metrics logs tickets help-desk telemetry ti tenant-identity idm user-settings threats campaigns threat-intel user accounts iam lb loadbalancer vhost vpm nodes node-mgmt firewall appfw help quit exit clear history"
9
+ local commands="admin_console_and_ui ai_services api authentication bigip billing_and_usage blindfold bot_and_threat_defense cdn ce_management certificates cloud_infrastructure cloudstatus completion container_services data_and_privacy_security data_intelligence ddos dns generative_ai login managed_kubernetes marketplace network network_security nginx_one object_storage observability rate_limiting secops_and_incident_response service_mesh shape sites statistics support telemetry_and_insights tenant_and_identity threat_campaign users virtual vpm_and_node_management waf console-ui ui-assets static-components ai genai assistant apisec api-discovery authn oidc sso f5-bigip irule ltm billing-usage quotas usage-tracking bf encrypt secrets threat-defense tpm shape-bot cache content ce-mgmt edge-management ce-lifecycle cert certs ssl tls cloud infra provider vk8s containers workloads data-privacy pii sensitive-data lma di intelligence insights dos ddos-protect dns-zone zones mk8s appstack k8s-mgmt market addons extensions net routing bgp netsec nfw nginx nms nginx-plus storage s3 buckets obs monitoring synth ratelimit throttle policer secops incident-response mitigation mesh svc-mesh shape-sec safeap site deployment stats metrics logs tickets help-desk telemetry ti tenant-identity idm user-settings threats campaigns threat-intel user accounts iam lb loadbalancer vhost vpm nodes node-mgmt firewall appfw help quit exit clear history refresh"
10
10
  local actions="list get create delete replace apply status patch add-labels remove-labels"
11
- local builtins="help quit exit clear history context ctx"
11
+ local builtins="help quit exit clear history context ctx refresh"
12
12
  local global_flags="--help -h --version -v --no-color --output -o --namespace -ns --spec"
13
13
 
14
14
  # Handle completion based on position
@@ -54,7 +54,7 @@ _xcsh_completions() {
54
54
  COMPREPLY=($(compgen -W "show set list" -- "${cur}"))
55
55
  return 0
56
56
  ;;
57
- help | quit | exit | clear | history | context | ctx)
57
+ help | quit | exit | clear | history | refresh | context | ctx)
58
58
  return 0
59
59
  ;;
60
60
  *)
@@ -18,11 +18,13 @@ complete -c xcsh -n "__fish_use_subcommand" -a "quit" -d 'Exit the shell'
18
18
  complete -c xcsh -n "__fish_use_subcommand" -a "exit" -d 'Exit the shell'
19
19
  complete -c xcsh -n "__fish_use_subcommand" -a "clear" -d 'Clear the screen'
20
20
  complete -c xcsh -n "__fish_use_subcommand" -a "history" -d 'Show command history'
21
+ complete -c xcsh -n "__fish_use_subcommand" -a "refresh" -d 'Refresh git status in statusline'
21
22
  complete -c xcsh -n "__fish_use_subcommand" -a "context" -d 'Show current navigation context'
22
23
  complete -c xcsh -n "__fish_use_subcommand" -a "ctx" -d 'Show current navigation context'
23
24
 
24
25
  # Domain completions
25
26
  complete -c xcsh -n "__fish_use_subcommand" -a "admin_console_and_ui" -d 'Static UI components and console assets.'
27
+ complete -c xcsh -n "__fish_use_subcommand" -a "ai_services" -d 'AI assistant queries and feedback collection.'
26
28
  complete -c xcsh -n "__fish_use_subcommand" -a "api" -d 'Interface definitions, schema validation, and grouping.'
27
29
  complete -c xcsh -n "__fish_use_subcommand" -a "authentication" -d 'Authentication API'
28
30
  complete -c xcsh -n "__fish_use_subcommand" -a "bigip" -d 'iRules, data groups, and APM integration.'
@@ -68,6 +70,9 @@ complete -c xcsh -n "__fish_use_subcommand" -a "waf" -d 'Request inspection, att
68
70
  complete -c xcsh -n "__fish_use_subcommand" -a "console-ui" -d 'Alias for admin_console_and_ui'
69
71
  complete -c xcsh -n "__fish_use_subcommand" -a "ui-assets" -d 'Alias for admin_console_and_ui'
70
72
  complete -c xcsh -n "__fish_use_subcommand" -a "static-components" -d 'Alias for admin_console_and_ui'
73
+ complete -c xcsh -n "__fish_use_subcommand" -a "ai" -d 'Alias for ai_services'
74
+ complete -c xcsh -n "__fish_use_subcommand" -a "genai" -d 'Alias for ai_services'
75
+ complete -c xcsh -n "__fish_use_subcommand" -a "assistant" -d 'Alias for ai_services'
71
76
  complete -c xcsh -n "__fish_use_subcommand" -a "apisec" -d 'Alias for api'
72
77
  complete -c xcsh -n "__fish_use_subcommand" -a "api-discovery" -d 'Alias for api'
73
78
  complete -c xcsh -n "__fish_use_subcommand" -a "authn" -d 'Alias for authentication'
@@ -206,6 +211,16 @@ complete -c xcsh -n "__fish_seen_subcommand_from admin_console_and_ui" -a "statu
206
211
  complete -c xcsh -n "__fish_seen_subcommand_from admin_console_and_ui" -a "patch" -d 'Patch a resource'
207
212
  complete -c xcsh -n "__fish_seen_subcommand_from admin_console_and_ui" -a "add-labels" -d 'Add labels to a resource'
208
213
  complete -c xcsh -n "__fish_seen_subcommand_from admin_console_and_ui" -a "remove-labels" -d 'Remove labels from a resource'
214
+ complete -c xcsh -n "__fish_seen_subcommand_from ai_services" -a "list" -d 'List resources'
215
+ complete -c xcsh -n "__fish_seen_subcommand_from ai_services" -a "get" -d 'Get a specific resource'
216
+ complete -c xcsh -n "__fish_seen_subcommand_from ai_services" -a "create" -d 'Create a new resource'
217
+ complete -c xcsh -n "__fish_seen_subcommand_from ai_services" -a "delete" -d 'Delete a resource'
218
+ complete -c xcsh -n "__fish_seen_subcommand_from ai_services" -a "replace" -d 'Replace a resource'
219
+ complete -c xcsh -n "__fish_seen_subcommand_from ai_services" -a "apply" -d 'Apply configuration from file'
220
+ complete -c xcsh -n "__fish_seen_subcommand_from ai_services" -a "status" -d 'Get resource status'
221
+ complete -c xcsh -n "__fish_seen_subcommand_from ai_services" -a "patch" -d 'Patch a resource'
222
+ complete -c xcsh -n "__fish_seen_subcommand_from ai_services" -a "add-labels" -d 'Add labels to a resource'
223
+ complete -c xcsh -n "__fish_seen_subcommand_from ai_services" -a "remove-labels" -d 'Remove labels from a resource'
209
224
  complete -c xcsh -n "__fish_seen_subcommand_from api" -a "list" -d 'List resources'
210
225
  complete -c xcsh -n "__fish_seen_subcommand_from api" -a "get" -d 'Get a specific resource'
211
226
  complete -c xcsh -n "__fish_seen_subcommand_from api" -a "create" -d 'Create a new resource'
package/dist/index.js CHANGED
@@ -1372,7 +1372,7 @@ var require_react_development = __commonJS({
1372
1372
  }
1373
1373
  return dispatcher.useContext(Context);
1374
1374
  }
1375
- function useState8(initialState) {
1375
+ function useState9(initialState) {
1376
1376
  var dispatcher = resolveDispatcher();
1377
1377
  return dispatcher.useState(initialState);
1378
1378
  }
@@ -1380,11 +1380,11 @@ var require_react_development = __commonJS({
1380
1380
  var dispatcher = resolveDispatcher();
1381
1381
  return dispatcher.useReducer(reducer, initialArg, init);
1382
1382
  }
1383
- function useRef3(initialValue) {
1383
+ function useRef4(initialValue) {
1384
1384
  var dispatcher = resolveDispatcher();
1385
1385
  return dispatcher.useRef(initialValue);
1386
1386
  }
1387
- function useEffect6(create2, deps) {
1387
+ function useEffect7(create2, deps) {
1388
1388
  var dispatcher = resolveDispatcher();
1389
1389
  return dispatcher.useEffect(create2, deps);
1390
1390
  }
@@ -1396,7 +1396,7 @@ var require_react_development = __commonJS({
1396
1396
  var dispatcher = resolveDispatcher();
1397
1397
  return dispatcher.useLayoutEffect(create2, deps);
1398
1398
  }
1399
- function useCallback6(callback, deps) {
1399
+ function useCallback7(callback, deps) {
1400
1400
  var dispatcher = resolveDispatcher();
1401
1401
  return dispatcher.useCallback(callback, deps);
1402
1402
  }
@@ -2163,19 +2163,19 @@ var require_react_development = __commonJS({
2163
2163
  exports.memo = memo;
2164
2164
  exports.startTransition = startTransition;
2165
2165
  exports.unstable_act = act;
2166
- exports.useCallback = useCallback6;
2166
+ exports.useCallback = useCallback7;
2167
2167
  exports.useContext = useContext7;
2168
2168
  exports.useDebugValue = useDebugValue;
2169
2169
  exports.useDeferredValue = useDeferredValue;
2170
- exports.useEffect = useEffect6;
2170
+ exports.useEffect = useEffect7;
2171
2171
  exports.useId = useId;
2172
2172
  exports.useImperativeHandle = useImperativeHandle;
2173
2173
  exports.useInsertionEffect = useInsertionEffect;
2174
2174
  exports.useLayoutEffect = useLayoutEffect2;
2175
2175
  exports.useMemo = useMemo3;
2176
2176
  exports.useReducer = useReducer;
2177
- exports.useRef = useRef3;
2178
- exports.useState = useState8;
2177
+ exports.useRef = useRef4;
2178
+ exports.useState = useState9;
2179
2179
  exports.useSyncExternalStore = useSyncExternalStore;
2180
2180
  exports.useTransition = useTransition;
2181
2181
  exports.version = ReactVersion;
@@ -44144,6 +44144,47 @@ var generatedDomains = /* @__PURE__ */ new Map([
44144
44144
  }
44145
44145
  ]
44146
44146
  }],
44147
+ ["ai_services", {
44148
+ name: "ai_services",
44149
+ displayName: "Ai Services",
44150
+ description: "Query handling through inference routing with production and test modes. Positive and negative quality markers with detailed categorization capture assistant performance. Streaming connections support authenticated access, subscription lifecycles, and feature flags. IP provisioning services allocate infrastructure resources for model workloads across distributed systems.",
44151
+ descriptionShort: "AI assistant queries and feedback collection.",
44152
+ descriptionMedium: "Natural language processing with quality signals and anomaly monitoring. Token authentication for data stream subscriptions.",
44153
+ aliases: ["ai", "genai", "assistant"],
44154
+ complexity: "simple",
44155
+ isPreview: true,
44156
+ requiresTier: "Advanced",
44157
+ category: "AI",
44158
+ useCases: ["Access AI-powered features", "Configure AI assistant policies", "Enable flow anomaly detection", "Manage AI data collection"],
44159
+ relatedDomains: [],
44160
+ icon: "\u{1F916}",
44161
+ logoSvg: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236366F1'%3E%3Cpath d='M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3v7.12zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8h1.5z'/%3E%3C/svg%3E",
44162
+ uiCategory: "AI & Automation",
44163
+ primaryResources: [
44164
+ {
44165
+ name: "ai_policy",
44166
+ description: "AI policy for generative AI traffic control",
44167
+ descriptionShort: "AI policy",
44168
+ tier: "Advanced",
44169
+ icon: "\u{1F916}",
44170
+ category: "Security",
44171
+ supportsLogs: true,
44172
+ supportsMetrics: true
44173
+ },
44174
+ {
44175
+ name: "ai_gateway",
44176
+ description: "AI gateway for LLM API management",
44177
+ descriptionShort: "AI gateway",
44178
+ tier: "Advanced",
44179
+ icon: "\u{1F680}",
44180
+ category: "API Management",
44181
+ supportsLogs: true,
44182
+ supportsMetrics: true,
44183
+ dependencies: { optional: ["ai_policy"] },
44184
+ relationshipHints: ["ai_policy: Policy for AI traffic control"]
44185
+ }
44186
+ ]
44187
+ }],
44147
44188
  ["api", {
44148
44189
  name: "api",
44149
44190
  displayName: "Api",
@@ -44951,47 +44992,6 @@ var generatedDomains = /* @__PURE__ */ new Map([
44951
44992
  }
44952
44993
  ]
44953
44994
  }],
44954
- ["generative_ai", {
44955
- name: "generative_ai",
44956
- displayName: "Generative Ai",
44957
- description: "Query handling through inference routing with production and test modes. Positive and negative quality markers with detailed categorization capture assistant performance. Streaming connections support authenticated access, subscription lifecycles, and feature flags. IP provisioning services allocate infrastructure resources for model workloads across distributed systems.",
44958
- descriptionShort: "AI assistant queries and feedback collection.",
44959
- descriptionMedium: "Natural language processing with quality signals and anomaly monitoring. Token authentication for data stream subscriptions.",
44960
- aliases: ["ai", "genai", "assistant"],
44961
- complexity: "simple",
44962
- isPreview: true,
44963
- requiresTier: "Advanced",
44964
- category: "AI",
44965
- useCases: ["Access AI-powered features", "Configure AI assistant policies", "Enable flow anomaly detection", "Manage AI data collection"],
44966
- relatedDomains: [],
44967
- icon: "\u{1F916}",
44968
- logoSvg: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236366F1'%3E%3Cpath d='M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3v7.12zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8h1.5z'/%3E%3C/svg%3E",
44969
- uiCategory: "AI & Automation",
44970
- primaryResources: [
44971
- {
44972
- name: "ai_policy",
44973
- description: "AI policy for generative AI traffic control",
44974
- descriptionShort: "AI policy",
44975
- tier: "Advanced",
44976
- icon: "\u{1F916}",
44977
- category: "Security",
44978
- supportsLogs: true,
44979
- supportsMetrics: true
44980
- },
44981
- {
44982
- name: "ai_gateway",
44983
- description: "AI gateway for LLM API management",
44984
- descriptionShort: "AI gateway",
44985
- tier: "Advanced",
44986
- icon: "\u{1F680}",
44987
- category: "API Management",
44988
- supportsLogs: true,
44989
- supportsMetrics: true,
44990
- dependencies: { optional: ["ai_policy"] },
44991
- relationshipHints: ["ai_policy: Policy for AI traffic control"]
44992
- }
44993
- ]
44994
- }],
44995
44995
  ["managed_kubernetes", {
44996
44996
  name: "managed_kubernetes",
44997
44997
  displayName: "Managed Kubernetes",
@@ -46630,8 +46630,8 @@ function getLogoModeFromEnv(envPrefix) {
46630
46630
  var CLI_NAME = "xcsh";
46631
46631
  var CLI_FULL_NAME = "F5 Distributed Cloud Shell";
46632
46632
  function getVersion() {
46633
- if ("v1.0.90-2601022257") {
46634
- return "v1.0.90-2601022257";
46633
+ if ("v1.0.91-2601022325") {
46634
+ return "v1.0.91-2601022325";
46635
46635
  }
46636
46636
  if (process.env.XCSH_VERSION) {
46637
46637
  return process.env.XCSH_VERSION;
@@ -142405,7 +142405,16 @@ function formatRootHelp() {
142405
142405
  " domains List all available domains",
142406
142406
  " clear Clear the screen",
142407
142407
  " history Show command history",
142408
+ " refresh Refresh git status in statusline",
142408
142409
  " quit, exit Exit the shell",
142410
+ "",
142411
+ "KEYBOARD SHORTCUTS",
142412
+ " Ctrl+C (x2) Exit the shell",
142413
+ " Ctrl+D Exit immediately",
142414
+ " Ctrl+G Refresh git status",
142415
+ " Tab Trigger completion",
142416
+ " Up/Down Navigate history or suggestions",
142417
+ " Escape Cancel suggestions",
142409
142418
  ""
142410
142419
  ];
142411
142420
  }
@@ -144132,7 +144141,7 @@ function buildPlainPrompt(session) {
144132
144141
  }
144133
144142
 
144134
144143
  // src/repl/App.tsx
144135
- var import_react28 = __toESM(require_react(), 1);
144144
+ var import_react29 = __toESM(require_react(), 1);
144136
144145
 
144137
144146
  // src/repl/components/InputBox.tsx
144138
144147
  var import_react23 = __toESM(require_react(), 1);
@@ -146851,9 +146860,9 @@ _xcsh_completions() {
146851
146860
  local cur prev words cword
146852
146861
  _init_completion || return
146853
146862
 
146854
- local commands="${domainNames} ${allAliases.join(" ")} help quit exit clear history"
146863
+ local commands="${domainNames} ${allAliases.join(" ")} help quit exit clear history refresh"
146855
146864
  local actions="${actions}"
146856
- local builtins="help quit exit clear history context ctx"
146865
+ local builtins="help quit exit clear history context ctx refresh"
146857
146866
  local global_flags="--help -h --version -v --no-color --output -o --namespace -ns --spec"
146858
146867
 
146859
146868
  # Handle completion based on position
@@ -146872,7 +146881,7 @@ _xcsh_completions() {
146872
146881
  local domain="\${words[1]}"
146873
146882
  case "\${domain}" in
146874
146883
  ${customDomainCompletions.join("\n")}
146875
- help | quit | exit | clear | history | context | ctx)
146884
+ help | quit | exit | clear | history | refresh | context | ctx)
146876
146885
  return 0
146877
146886
  ;;
146878
146887
  *)
@@ -146961,6 +146970,7 @@ _xcsh() {
146961
146970
  'exit:Exit the shell'
146962
146971
  'clear:Clear the screen'
146963
146972
  'history:Show command history'
146973
+ 'refresh:Refresh git status in statusline'
146964
146974
  'context:Show current navigation context'
146965
146975
  'ctx:Show current navigation context'
146966
146976
  )
@@ -146970,7 +146980,7 @@ _xcsh() {
146970
146980
  (action)
146971
146981
  case \${line[1]} in
146972
146982
  ${customDomainCompletions.join("\n")}
146973
- (help|quit|exit|clear|history|context|ctx)
146983
+ (help|quit|exit|clear|history|refresh|context|ctx)
146974
146984
  ;;
146975
146985
  (*)
146976
146986
  local -a actions
@@ -147062,6 +147072,7 @@ complete -c xcsh -n "__fish_use_subcommand" -a "quit" -d 'Exit the shell'
147062
147072
  complete -c xcsh -n "__fish_use_subcommand" -a "exit" -d 'Exit the shell'
147063
147073
  complete -c xcsh -n "__fish_use_subcommand" -a "clear" -d 'Clear the screen'
147064
147074
  complete -c xcsh -n "__fish_use_subcommand" -a "history" -d 'Show command history'
147075
+ complete -c xcsh -n "__fish_use_subcommand" -a "refresh" -d 'Refresh git status in statusline'
147065
147076
  complete -c xcsh -n "__fish_use_subcommand" -a "context" -d 'Show current navigation context'
147066
147077
  complete -c xcsh -n "__fish_use_subcommand" -a "ctx" -d 'Show current navigation context'
147067
147078
 
@@ -149567,6 +149578,49 @@ function useCompletion(options) {
149567
149578
  };
149568
149579
  }
149569
149580
 
149581
+ // src/repl/hooks/useGitStatus.ts
149582
+ var import_react28 = __toESM(require_react(), 1);
149583
+ var DEFAULT_POLL_INTERVAL_MS = 3e4;
149584
+ var MIN_POLL_INTERVAL_MS = 5e3;
149585
+ function getPollInterval() {
149586
+ const envValue = process.env.XCSH_GIT_POLL_INTERVAL;
149587
+ if (envValue === void 0) return DEFAULT_POLL_INTERVAL_MS;
149588
+ if (envValue === "0") return 0;
149589
+ const seconds = parseInt(envValue, 10);
149590
+ if (isNaN(seconds) || seconds <= 0) return DEFAULT_POLL_INTERVAL_MS;
149591
+ return Math.max(seconds * 1e3, MIN_POLL_INTERVAL_MS);
149592
+ }
149593
+ function useGitStatus(options = {}) {
149594
+ const { enabled = true } = options;
149595
+ const pollIntervalMs = options.pollIntervalMs ?? getPollInterval();
149596
+ const [gitInfo, setGitInfo] = (0, import_react28.useState)(void 0);
149597
+ const [lastRefresh, setLastRefresh] = (0, import_react28.useState)(0);
149598
+ const intervalRef = (0, import_react28.useRef)(null);
149599
+ const refresh = (0, import_react28.useCallback)(() => {
149600
+ const info = getGitInfo();
149601
+ setGitInfo(info);
149602
+ setLastRefresh(Date.now());
149603
+ }, []);
149604
+ (0, import_react28.useEffect)(() => {
149605
+ if (enabled) {
149606
+ refresh();
149607
+ }
149608
+ }, [enabled, refresh]);
149609
+ (0, import_react28.useEffect)(() => {
149610
+ if (!enabled || pollIntervalMs === 0) {
149611
+ return;
149612
+ }
149613
+ intervalRef.current = setInterval(refresh, pollIntervalMs);
149614
+ return () => {
149615
+ if (intervalRef.current) {
149616
+ clearInterval(intervalRef.current);
149617
+ intervalRef.current = null;
149618
+ }
149619
+ };
149620
+ }, [enabled, pollIntervalMs, refresh]);
149621
+ return { gitInfo, refresh, lastRefresh };
149622
+ }
149623
+
149570
149624
  // src/validation/namespace.ts
149571
149625
  function validateNamespaceScope(domain, action, currentNamespace, resourceType) {
149572
149626
  const opInfo = getOperationDescription(domain, action, resourceType);
@@ -149691,7 +149745,8 @@ var BUILTIN_COMMANDS = /* @__PURE__ */ new Set([
149691
149745
  "history",
149692
149746
  "version",
149693
149747
  "domains",
149694
- "whoami"
149748
+ "whoami",
149749
+ "refresh"
149695
149750
  ]);
149696
149751
  function parseCommand(input) {
149697
149752
  const trimmed = input.trim();
@@ -149954,6 +150009,15 @@ function executeBuiltin(cmd, session, ctx) {
149954
150009
  contextChanged: false
149955
150010
  };
149956
150011
  }
150012
+ if (command === "refresh") {
150013
+ return {
150014
+ output: ["Git status refreshed"],
150015
+ shouldExit: false,
150016
+ shouldClear: false,
150017
+ contextChanged: false,
150018
+ refreshGit: true
150019
+ };
150020
+ }
149957
150021
  return {
149958
150022
  output: [`Unknown command: ${cmd.raw}`],
149959
150023
  shouldExit: false,
@@ -150639,7 +150703,8 @@ function getBuiltinDescription(cmd) {
150639
150703
  ["ctx", "Show current context"],
150640
150704
  ["history", "Show command history"],
150641
150705
  ["version", "Show version info"],
150642
- ["domains", "List available domains"]
150706
+ ["domains", "List available domains"],
150707
+ ["refresh", "Refresh git status"]
150643
150708
  ]);
150644
150709
  return descriptions.get(cmd) ?? "Built-in command";
150645
150710
  }
@@ -150665,11 +150730,11 @@ function toUISuggestions(suggestions) {
150665
150730
  function App2({ initialSession } = {}) {
150666
150731
  const { exit } = use_app_default();
150667
150732
  const { stdout } = use_stdout_default();
150668
- const [session] = (0, import_react28.useState)(() => initialSession ?? new REPLSession());
150669
- const [isInitialized, setIsInitialized] = (0, import_react28.useState)(!!initialSession);
150670
- const [input, setInputState] = (0, import_react28.useState)("");
150671
- const inputRef = (0, import_react28.useRef)("");
150672
- const setInput = (0, import_react28.useCallback)(
150733
+ const [session] = (0, import_react29.useState)(() => initialSession ?? new REPLSession());
150734
+ const [isInitialized, setIsInitialized] = (0, import_react29.useState)(!!initialSession);
150735
+ const [input, setInputState] = (0, import_react29.useState)("");
150736
+ const inputRef = (0, import_react29.useRef)("");
150737
+ const setInput = (0, import_react29.useCallback)(
150673
150738
  (value) => {
150674
150739
  setInputState((prev) => {
150675
150740
  const newValue = typeof value === "function" ? value(prev) : value;
@@ -150679,19 +150744,18 @@ function App2({ initialSession } = {}) {
150679
150744
  },
150680
150745
  []
150681
150746
  );
150682
- const [outputItems, setOutputItems] = (0, import_react28.useState)([]);
150683
- const outputIdRef = (0, import_react28.useRef)(0);
150684
- const [prompt, setPrompt] = (0, import_react28.useState)("> ");
150685
- const [width, setWidth] = (0, import_react28.useState)(stdout?.columns ?? 80);
150686
- const [gitInfo, setGitInfo] = (0, import_react28.useState)(void 0);
150687
- const [statusHint, setStatusHint] = (0, import_react28.useState)("Ctrl+C twice to exit");
150688
- const [historyArray, setHistoryArray] = (0, import_react28.useState)([]);
150689
- const [inputKey, setInputKey] = (0, import_react28.useState)(0);
150690
- const [hideStatusBar, setHideStatusBar] = (0, import_react28.useState)(false);
150691
- const [pendingRawStdout, setPendingRawStdout] = (0, import_react28.useState)(
150747
+ const [outputItems, setOutputItems] = (0, import_react29.useState)([]);
150748
+ const outputIdRef = (0, import_react29.useRef)(0);
150749
+ const [prompt, setPrompt] = (0, import_react29.useState)("> ");
150750
+ const [width, setWidth] = (0, import_react29.useState)(stdout?.columns ?? 80);
150751
+ const [statusHint, setStatusHint] = (0, import_react29.useState)("Ctrl+C twice to exit");
150752
+ const [historyArray, setHistoryArray] = (0, import_react29.useState)([]);
150753
+ const [inputKey, setInputKey] = (0, import_react29.useState)(0);
150754
+ const [hideStatusBar, setHideStatusBar] = (0, import_react29.useState)(false);
150755
+ const [pendingRawStdout, setPendingRawStdout] = (0, import_react29.useState)(
150692
150756
  null
150693
150757
  );
150694
- (0, import_react28.useEffect)(() => {
150758
+ (0, import_react29.useEffect)(() => {
150695
150759
  if (hideStatusBar && pendingRawStdout) {
150696
150760
  process.stdout.write(pendingRawStdout);
150697
150761
  process.stdout.write("\n\n\n");
@@ -150699,6 +150763,7 @@ function App2({ initialSession } = {}) {
150699
150763
  setHideStatusBar(false);
150700
150764
  }
150701
150765
  }, [hideStatusBar, pendingRawStdout]);
150766
+ const gitStatus = useGitStatus({ enabled: isInitialized });
150702
150767
  const completion = useCompletion({
150703
150768
  session: isInitialized ? session : null
150704
150769
  });
@@ -150719,7 +150784,7 @@ function App2({ initialSession } = {}) {
150719
150784
  session.saveHistory().finally(() => exit());
150720
150785
  }
150721
150786
  });
150722
- (0, import_react28.useEffect)(() => {
150787
+ (0, import_react29.useEffect)(() => {
150723
150788
  const init = async () => {
150724
150789
  if (!isInitialized) {
150725
150790
  await session.initialize();
@@ -150730,11 +150795,10 @@ function App2({ initialSession } = {}) {
150730
150795
  if (histMgr) {
150731
150796
  setHistoryArray(histMgr.getHistory());
150732
150797
  }
150733
- setGitInfo(getGitInfo());
150734
150798
  };
150735
150799
  init();
150736
150800
  }, [session]);
150737
- (0, import_react28.useEffect)(() => {
150801
+ (0, import_react29.useEffect)(() => {
150738
150802
  const handleResize = () => {
150739
150803
  if (stdout) {
150740
150804
  const newWidth = stdout.columns ?? 80;
@@ -150750,7 +150814,7 @@ function App2({ initialSession } = {}) {
150750
150814
  stdout?.off("resize", handleResize);
150751
150815
  };
150752
150816
  }, [stdout]);
150753
- const addOutput = (0, import_react28.useCallback)((line) => {
150817
+ const addOutput = (0, import_react29.useCallback)((line) => {
150754
150818
  const lines = line.split("\n");
150755
150819
  const newItems = lines.map((content) => ({
150756
150820
  id: outputIdRef.current++,
@@ -150764,7 +150828,7 @@ function App2({ initialSession } = {}) {
150764
150828
  return combined;
150765
150829
  });
150766
150830
  }, []);
150767
- const applyCompletion = (0, import_react28.useCallback)(
150831
+ const applyCompletion = (0, import_react29.useCallback)(
150768
150832
  (suggestion) => {
150769
150833
  const currentInput = inputRef.current;
150770
150834
  let newValue;
@@ -150792,13 +150856,13 @@ function App2({ initialSession } = {}) {
150792
150856
  []
150793
150857
  // No dependencies needed since we use inputRef
150794
150858
  );
150795
- const refreshHistory = (0, import_react28.useCallback)(() => {
150859
+ const refreshHistory = (0, import_react29.useCallback)(() => {
150796
150860
  const histMgr = session.getHistory();
150797
150861
  if (histMgr) {
150798
150862
  setHistoryArray(histMgr.getHistory());
150799
150863
  }
150800
150864
  }, [session]);
150801
- const runCommand = (0, import_react28.useCallback)(
150865
+ const runCommand = (0, import_react29.useCallback)(
150802
150866
  async (cmd) => {
150803
150867
  const trimmed = cmd.trim();
150804
150868
  if (!trimmed) return;
@@ -150821,11 +150885,16 @@ function App2({ initialSession } = {}) {
150821
150885
  if (result.contextChanged) {
150822
150886
  setPrompt(buildPlainPrompt(session));
150823
150887
  }
150888
+ if (result.refreshGit) {
150889
+ gitStatus.refresh();
150890
+ } else {
150891
+ gitStatus.refresh();
150892
+ }
150824
150893
  refreshHistory();
150825
150894
  },
150826
- [session, prompt, addOutput, exit, refreshHistory]
150895
+ [session, prompt, addOutput, exit, refreshHistory, gitStatus]
150827
150896
  );
150828
- const handleInputChange = (0, import_react28.useCallback)(
150897
+ const handleInputChange = (0, import_react29.useCallback)(
150829
150898
  (newValue) => {
150830
150899
  const oldValue = input;
150831
150900
  setInput(newValue);
@@ -150853,7 +150922,7 @@ function App2({ initialSession } = {}) {
150853
150922
  },
150854
150923
  [input, completion]
150855
150924
  );
150856
- const handleSubmit = (0, import_react28.useCallback)(
150925
+ const handleSubmit = (0, import_react29.useCallback)(
150857
150926
  async (value) => {
150858
150927
  if (completion.isShowing && completion.suggestions.length > 0) {
150859
150928
  const selected = completion.selectCurrent();
@@ -150882,6 +150951,12 @@ function App2({ initialSession } = {}) {
150882
150951
  session.saveHistory().finally(() => exit());
150883
150952
  return;
150884
150953
  }
150954
+ if (key.ctrl && char === "g") {
150955
+ gitStatus.refresh();
150956
+ setStatusHint("Git status refreshed");
150957
+ setTimeout(() => setStatusHint("Ctrl+C twice to exit"), 2e3);
150958
+ return;
150959
+ }
150885
150960
  if (key.tab) {
150886
150961
  const currentInput = inputRef.current;
150887
150962
  if (completion.isShowing) {
@@ -150945,7 +151020,7 @@ function App2({ initialSession } = {}) {
150945
151020
  return;
150946
151021
  }
150947
151022
  });
150948
- const handleSuggestionNavigate = (0, import_react28.useCallback)(
151023
+ const handleSuggestionNavigate = (0, import_react29.useCallback)(
150949
151024
  (direction) => {
150950
151025
  if (direction === "up") {
150951
151026
  completion.navigateUp();
@@ -150955,7 +151030,7 @@ function App2({ initialSession } = {}) {
150955
151030
  },
150956
151031
  [completion]
150957
151032
  );
150958
- const handleSuggestionSelect = (0, import_react28.useCallback)(
151033
+ const handleSuggestionSelect = (0, import_react29.useCallback)(
150959
151034
  (suggestion) => {
150960
151035
  applyCompletion(suggestion);
150961
151036
  completion.hide();
@@ -150993,7 +151068,7 @@ function App2({ initialSession } = {}) {
150993
151068
  ) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
150994
151069
  StatusBar,
150995
151070
  {
150996
- gitInfo,
151071
+ gitInfo: gitStatus.gitInfo,
150997
151072
  width,
150998
151073
  hint: statusHint
150999
151074
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinmordasiewicz/f5xc-xcsh",
3
- "version": "1.0.90-2601022257",
3
+ "version": "1.0.91-2601022325",
4
4
  "description": "F5 Distributed Cloud Shell - Interactive CLI for F5 XC",
5
5
  "type": "module",
6
6
  "bin": {