@jupyterlite/ai 0.11.1 → 0.12.0

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 (48) hide show
  1. package/lib/agent.d.ts +37 -5
  2. package/lib/agent.js +142 -96
  3. package/lib/chat-commands/clear.d.ts +8 -0
  4. package/lib/chat-commands/clear.js +30 -0
  5. package/lib/chat-commands/index.d.ts +2 -0
  6. package/lib/chat-commands/index.js +2 -0
  7. package/lib/chat-commands/skills.d.ts +19 -0
  8. package/lib/chat-commands/skills.js +57 -0
  9. package/lib/chat-model.d.ts +8 -0
  10. package/lib/chat-model.js +35 -3
  11. package/lib/index.d.ts +3 -3
  12. package/lib/index.js +187 -10
  13. package/lib/models/settings-model.d.ts +1 -0
  14. package/lib/models/settings-model.js +61 -14
  15. package/lib/providers/built-in-providers.js +5 -7
  16. package/lib/skills/index.d.ts +4 -0
  17. package/lib/skills/index.js +7 -0
  18. package/lib/skills/parse-skill.d.ts +25 -0
  19. package/lib/skills/parse-skill.js +69 -0
  20. package/lib/skills/skill-loader.d.ts +25 -0
  21. package/lib/skills/skill-loader.js +133 -0
  22. package/lib/skills/skill-registry.d.ts +31 -0
  23. package/lib/skills/skill-registry.js +100 -0
  24. package/lib/skills/types.d.ts +29 -0
  25. package/lib/skills/types.js +5 -0
  26. package/lib/tokens.d.ts +33 -0
  27. package/lib/tokens.js +5 -0
  28. package/lib/tools/skills.d.ts +9 -0
  29. package/lib/tools/skills.js +73 -0
  30. package/lib/widgets/ai-settings.js +33 -1
  31. package/package.json +10 -9
  32. package/schema/settings-model.json +8 -1
  33. package/src/agent.ts +198 -102
  34. package/src/chat-commands/clear.ts +46 -0
  35. package/src/chat-commands/index.ts +2 -0
  36. package/src/chat-commands/skills.ts +87 -0
  37. package/src/chat-model.ts +48 -10
  38. package/src/index.ts +242 -5
  39. package/src/models/settings-model.ts +64 -15
  40. package/src/providers/built-in-providers.ts +5 -7
  41. package/src/skills/index.ts +14 -0
  42. package/src/skills/parse-skill.ts +91 -0
  43. package/src/skills/skill-loader.ts +175 -0
  44. package/src/skills/skill-registry.ts +137 -0
  45. package/src/skills/types.ts +37 -0
  46. package/src/tokens.ts +56 -0
  47. package/src/tools/skills.ts +84 -0
  48. package/src/widgets/ai-settings.tsx +75 -0
@@ -10,6 +10,7 @@ import Delete from '@mui/icons-material/Delete';
10
10
  import Edit from '@mui/icons-material/Edit';
11
11
  import Error from '@mui/icons-material/Error';
12
12
  import ErrorOutline from '@mui/icons-material/ErrorOutline';
13
+ import InfoOutlined from '@mui/icons-material/InfoOutlined';
13
14
  import MoreVert from '@mui/icons-material/MoreVert';
14
15
  import Settings from '@mui/icons-material/Settings';
15
16
  import {
@@ -40,6 +41,7 @@ import {
40
41
  Tabs,
41
42
  TextField,
42
43
  ThemeProvider,
44
+ Tooltip,
43
45
  Typography,
44
46
  createTheme
45
47
  } from '@mui/material';
@@ -1025,6 +1027,79 @@ const AISettingsComponent: React.FC<IAISettingsComponentProps> = ({
1025
1027
 
1026
1028
  <Divider sx={{ my: 2 }} />
1027
1029
 
1030
+ <Box>
1031
+ <Typography
1032
+ variant="body1"
1033
+ gutterBottom
1034
+ sx={{
1035
+ display: 'inline-flex',
1036
+ alignItems: 'center',
1037
+ gap: 1
1038
+ }}
1039
+ >
1040
+ {trans.__('Skills Paths')}
1041
+ <Tooltip
1042
+ title={trans.__(
1043
+ 'Directories containing agent skills, relative to the server root. Skills are loaded from all paths; the first occurrence of a skill name takes priority.'
1044
+ )}
1045
+ >
1046
+ <InfoOutlined sx={{ fontSize: 16 }} />
1047
+ </Tooltip>
1048
+ </Typography>
1049
+
1050
+ <List sx={{ mb: 2, maxHeight: 200, overflow: 'auto' }}>
1051
+ {(config.skillsPaths ?? []).map((skillPath, index) => (
1052
+ <ListItem
1053
+ key={index}
1054
+ divider
1055
+ secondaryAction={
1056
+ <IconButton
1057
+ onClick={() => {
1058
+ const newPaths = [...config.skillsPaths];
1059
+ newPaths.splice(index, 1);
1060
+ handleConfigUpdate({ skillsPaths: newPaths });
1061
+ }}
1062
+ size="small"
1063
+ >
1064
+ <Delete />
1065
+ </IconButton>
1066
+ }
1067
+ >
1068
+ <ListItemText primary={skillPath} />
1069
+ </ListItem>
1070
+ ))}
1071
+ </List>
1072
+
1073
+ <TextField
1074
+ fullWidth
1075
+ label={trans.__('Add Skills Path')}
1076
+ placeholder={trans.__('e.g., .claude/skills')}
1077
+ onKeyDown={e => {
1078
+ if (e.key === 'Enter') {
1079
+ const value = (
1080
+ e.target as HTMLInputElement
1081
+ ).value.trim();
1082
+ if (
1083
+ value &&
1084
+ !(config.skillsPaths ?? []).includes(value)
1085
+ ) {
1086
+ const newPaths = [
1087
+ ...(config.skillsPaths ?? []),
1088
+ value
1089
+ ];
1090
+ handleConfigUpdate({ skillsPaths: newPaths });
1091
+ (e.target as HTMLInputElement).value = '';
1092
+ }
1093
+ }
1094
+ }}
1095
+ helperText={trans.__(
1096
+ 'Press Enter to add a path. Defaults: .agents/skills, _agents/skills'
1097
+ )}
1098
+ />
1099
+ </Box>
1100
+
1101
+ <Divider sx={{ my: 2 }} />
1102
+
1028
1103
  <Box>
1029
1104
  <Typography variant="body1" gutterBottom>
1030
1105
  {trans.__('Commands Requiring Approval')}