@bytexbyte/nxtlinq-ai-agent-sdk 1.6.25 → 1.6.26

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 +1 @@
1
- {"version":3,"file":"PermissionForm.d.ts","sourceRoot":"","sources":["../../../src/components/ui/PermissionForm.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,UAAU,mBAAmB;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA4jBxD,CAAC"}
1
+ {"version":3,"file":"PermissionForm.d.ts","sourceRoot":"","sources":["../../../src/components/ui/PermissionForm.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,UAAU,mBAAmB;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA4mBxD,CAAC"}
@@ -11,12 +11,29 @@ export const PermissionForm = ({ onClose }) => {
11
11
  const [isSaving, setIsSaving] = React.useState(false);
12
12
  const [tempPermissions, setTempPermissions] = React.useState(permissions);
13
13
  const [hasUserInteracted, setHasUserInteracted] = React.useState(false);
14
+ // Check if ALL permission is selected
15
+ const isAllSelected = tempPermissions.includes('ALL');
14
16
  // Update temp permissions when permissions change, but only if user hasn't interacted
15
17
  React.useEffect(() => {
16
18
  if (!hasUserInteracted) {
17
19
  setTempPermissions(permissions);
18
20
  }
19
21
  }, [permissions, hasUserInteracted]);
22
+ // When ALL is selected, automatically select all other permissions
23
+ // This handles cases where ALL is set from initial permissions or when availablePermissions loads
24
+ React.useEffect(() => {
25
+ if (isAllSelected && availablePermissions.length > 0) {
26
+ const allPermissionLabels = availablePermissions.map(p => p.label);
27
+ const currentPermissionSet = new Set(tempPermissions);
28
+ // Check if all permissions are already selected
29
+ const hasAllPermissions = allPermissionLabels.every(label => currentPermissionSet.has(label));
30
+ if (!hasAllPermissions) {
31
+ // Add all permissions (this will include ALL and all others)
32
+ setTempPermissions([...allPermissionLabels].sort());
33
+ }
34
+ }
35
+ // eslint-disable-next-line react-hooks/exhaustive-deps
36
+ }, [isAllSelected, availablePermissions.length]);
20
37
  const fetchAvailablePermissions = async () => {
21
38
  if (!serviceId)
22
39
  return;
@@ -343,37 +360,65 @@ export const PermissionForm = ({ onClose }) => {
343
360
  overflow-y: auto !important;
344
361
  overflow-x: hidden !important;
345
362
  min-height: 0 !important;
346
- `, children: availablePermissions.map((permission) => (_jsx("div", { css: css `margin-bottom: 12px !important;`, children: _jsxs("label", { css: css `
347
- display: flex !important;
348
- align-items: center !important;
349
- gap: 12px !important;
350
- cursor: ${isAITLoading ? 'not-allowed' : 'pointer'} !important;
351
- padding: 8px !important;
352
- border-radius: 6px !important;
353
- transition: background-color 0.2s !important;
354
- opacity: ${isAITLoading ? 0.6 : 1} !important;
355
-
356
- &:hover {
357
- background-color: ${!isAITLoading ? '#e9ecef' : 'transparent'} !important;
358
- }
359
- `, children: [_jsx("input", { type: "checkbox", checked: tempPermissions.includes(permission.label), onChange: () => {
360
- if (!isAITLoading) {
361
- const newPermissions = tempPermissions.includes(permission.label)
362
- ? tempPermissions.filter(p => p !== permission.label)
363
- : [...tempPermissions, permission.label].sort();
364
- setTempPermissions(newPermissions);
365
- setHasUserInteracted(true);
366
- setIsDisabled(false);
367
- }
368
- }, disabled: isAITLoading, css: css `
369
- margin: 0 !important;
370
- width: 18px !important;
371
- height: 18px !important;
372
- cursor: ${isAITLoading ? 'not-allowed' : 'pointer'} !important;
373
- ` }), _jsx("span", { css: css `
374
- font-size: 14px !important;
375
- color: #333 !important;
376
- `, children: permission.label })] }) }, permission.id))) }))] }), _jsxs("div", { css: css `
363
+ `, children: availablePermissions.map((permission) => {
364
+ const isAllPermission = permission.label === 'ALL';
365
+ const isOtherPermissionDisabled = isAllSelected && !isAllPermission;
366
+ const isChecked = isAllSelected && !isAllPermission
367
+ ? true
368
+ : tempPermissions.includes(permission.label);
369
+ return (_jsx("div", { css: css `margin-bottom: 12px !important;`, children: _jsxs("label", { css: css `
370
+ display: flex !important;
371
+ align-items: center !important;
372
+ gap: 12px !important;
373
+ cursor: ${isAITLoading || isOtherPermissionDisabled ? 'not-allowed' : 'pointer'} !important;
374
+ padding: 8px !important;
375
+ border-radius: 6px !important;
376
+ transition: background-color 0.2s !important;
377
+ opacity: ${isAITLoading || isOtherPermissionDisabled ? 0.6 : 1} !important;
378
+
379
+ &:hover {
380
+ background-color: ${!isAITLoading && !isOtherPermissionDisabled ? '#e9ecef' : 'transparent'} !important;
381
+ }
382
+ `, children: [_jsx("input", { type: "checkbox", checked: isChecked, onChange: () => {
383
+ if (!isAITLoading) {
384
+ if (isAllPermission) {
385
+ // Handle ALL permission toggle
386
+ if (isAllSelected) {
387
+ // Unchecking ALL - keep all other permissions selected
388
+ // Get all permission labels except ALL
389
+ const allOtherPermissions = availablePermissions
390
+ .map(p => p.label)
391
+ .filter(label => label !== 'ALL');
392
+ setTempPermissions(allOtherPermissions.sort());
393
+ }
394
+ else {
395
+ // Checking ALL - add all permissions
396
+ const allPermissionLabels = availablePermissions.map(p => p.label);
397
+ setTempPermissions(allPermissionLabels.sort());
398
+ }
399
+ }
400
+ else {
401
+ // Handle other permissions (only if ALL is not selected)
402
+ if (!isAllSelected) {
403
+ const newPermissions = tempPermissions.includes(permission.label)
404
+ ? tempPermissions.filter(p => p !== permission.label)
405
+ : [...tempPermissions, permission.label].sort();
406
+ setTempPermissions(newPermissions);
407
+ }
408
+ }
409
+ setHasUserInteracted(true);
410
+ setIsDisabled(false);
411
+ }
412
+ }, disabled: isAITLoading || isOtherPermissionDisabled, css: css `
413
+ margin: 0 !important;
414
+ width: 18px !important;
415
+ height: 18px !important;
416
+ cursor: ${isAITLoading || isOtherPermissionDisabled ? 'not-allowed' : 'pointer'} !important;
417
+ ` }), _jsx("span", { css: css `
418
+ font-size: 14px !important;
419
+ color: ${isOtherPermissionDisabled ? '#999' : '#333'} !important;
420
+ `, children: permission.label })] }) }, permission.id));
421
+ }) }))] }), _jsxs("div", { css: css `
377
422
  display: flex !important;
378
423
  justify-content: flex-end !important;
379
424
  gap: 12px !important;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytexbyte/nxtlinq-ai-agent-sdk",
3
- "version": "1.6.25",
3
+ "version": "1.6.26",
4
4
  "description": "Nxtlinq AI Agent SDK - Proprietary Software with enhanced async operation handling",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",