@jupyterlite/ai 0.18.0 → 0.19.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.
- package/lib/chat-commands/clear.d.ts +1 -0
- package/lib/chat-commands/index.d.ts +1 -0
- package/lib/chat-commands/skills.d.ts +2 -1
- package/lib/chat-model-handler.d.ts +3 -1
- package/lib/chat-model.d.ts +46 -8
- package/lib/chat-model.js +51 -21
- package/lib/completion/completion-provider.d.ts +3 -1
- package/lib/completion/completion-provider.js +1 -2
- package/lib/completion/index.d.ts +1 -0
- package/lib/components/clear-button.d.ts +1 -0
- package/lib/components/clear-button.js +3 -4
- package/lib/components/completion-status.d.ts +1 -0
- package/lib/components/completion-status.js +5 -4
- package/lib/components/index.d.ts +1 -0
- package/lib/components/model-select.d.ts +1 -0
- package/lib/components/model-select.js +62 -67
- package/lib/components/save-button.d.ts +1 -0
- package/lib/components/save-button.js +4 -5
- package/lib/components/stop-button.d.ts +1 -0
- package/lib/components/stop-button.js +3 -4
- package/lib/components/tool-select.d.ts +3 -1
- package/lib/components/tool-select.js +47 -60
- package/lib/components/usage-display.d.ts +4 -2
- package/lib/components/usage-display.js +50 -61
- package/lib/diff-manager.d.ts +3 -1
- package/lib/index.d.ts +3 -2
- package/lib/index.js +28 -17
- package/lib/models/settings-model.d.ts +3 -1
- package/lib/rendered-message-outputarea.d.ts +1 -0
- package/lib/tokens.d.ts +18 -640
- package/lib/tokens.js +2 -31
- package/lib/widgets/ai-settings.d.ts +3 -1
- package/lib/widgets/ai-settings.js +185 -349
- package/lib/widgets/main-area-chat.d.ts +1 -0
- package/lib/widgets/provider-config-dialog.d.ts +2 -1
- package/lib/widgets/provider-config-dialog.js +102 -167
- package/package.json +111 -258
- package/src/chat-commands/skills.ts +2 -2
- package/src/chat-model-handler.ts +6 -4
- package/src/chat-model.ts +66 -19
- package/src/completion/completion-provider.ts +6 -6
- package/src/components/clear-button.tsx +0 -2
- package/src/components/completion-status.tsx +2 -2
- package/src/components/model-select.tsx +1 -1
- package/src/components/stop-button.tsx +0 -2
- package/src/components/tool-select.tsx +10 -9
- package/src/components/usage-display.tsx +4 -2
- package/src/diff-manager.ts +4 -3
- package/src/index.ts +62 -44
- package/src/models/settings-model.ts +6 -6
- package/src/tokens.ts +23 -788
- package/src/widgets/ai-settings.tsx +14 -11
- package/src/widgets/provider-config-dialog.tsx +8 -8
- package/LICENSE +0 -30
- package/README.md +0 -49
- package/lib/agent.d.ts +0 -280
- package/lib/agent.js +0 -1103
- package/lib/icons.d.ts +0 -3
- package/lib/icons.js +0 -8
- package/lib/providers/built-in-providers.d.ts +0 -21
- package/lib/providers/built-in-providers.js +0 -233
- package/lib/providers/generated-model-info.d.ts +0 -8
- package/lib/providers/generated-model-info.js +0 -502
- package/lib/providers/model-info.d.ts +0 -6
- package/lib/providers/model-info.js +0 -91
- package/lib/providers/models.d.ts +0 -37
- package/lib/providers/models.js +0 -28
- package/lib/providers/provider-registry.d.ts +0 -49
- package/lib/providers/provider-registry.js +0 -72
- package/lib/providers/provider-tools.d.ts +0 -36
- package/lib/providers/provider-tools.js +0 -93
- package/lib/skills/index.d.ts +0 -4
- package/lib/skills/index.js +0 -7
- package/lib/skills/parse-skill.d.ts +0 -25
- package/lib/skills/parse-skill.js +0 -69
- package/lib/skills/skill-loader.d.ts +0 -25
- package/lib/skills/skill-loader.js +0 -133
- package/lib/skills/skill-registry.d.ts +0 -31
- package/lib/skills/skill-registry.js +0 -100
- package/lib/skills/types.d.ts +0 -29
- package/lib/skills/types.js +0 -5
- package/lib/tools/commands.d.ts +0 -11
- package/lib/tools/commands.js +0 -154
- package/lib/tools/skills.d.ts +0 -9
- package/lib/tools/skills.js +0 -73
- package/lib/tools/tool-registry.d.ts +0 -35
- package/lib/tools/tool-registry.js +0 -55
- package/lib/tools/web.d.ts +0 -8
- package/lib/tools/web.js +0 -196
- package/src/agent.ts +0 -1431
- package/src/icons.ts +0 -11
- package/src/providers/built-in-providers.ts +0 -241
- package/src/providers/generated-model-info.ts +0 -508
- package/src/providers/model-info.ts +0 -145
- package/src/providers/models.ts +0 -76
- package/src/providers/provider-registry.ts +0 -88
- package/src/providers/provider-tools.ts +0 -179
- package/src/skills/index.ts +0 -14
- package/src/skills/parse-skill.ts +0 -91
- package/src/skills/skill-loader.ts +0 -175
- package/src/skills/skill-registry.ts +0 -137
- package/src/skills/types.ts +0 -37
- package/src/tools/commands.ts +0 -210
- package/src/tools/skills.ts +0 -84
- package/src/tools/tool-registry.ts +0 -63
- package/src/tools/web.ts +0 -238
- package/src/types.d.ts +0 -4
- package/style/icons/jupyternaut-lite.svg +0 -7
|
@@ -1,18 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { TooltippedIconButton } from '@jupyter/chat';
|
|
2
3
|
import StopIcon from '@mui/icons-material/Stop';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
/**
|
|
5
5
|
* The stop button component.
|
|
6
6
|
*/
|
|
7
7
|
export function StopButton(props) {
|
|
8
8
|
const { translator: trans } = props;
|
|
9
9
|
const tooltip = trans.__('Stop streaming');
|
|
10
|
-
return (
|
|
10
|
+
return (_jsx(TooltippedIconButton, { onClick: props.stopStreaming, tooltip: tooltip, buttonProps: {
|
|
11
11
|
title: tooltip
|
|
12
12
|
}, sx: {
|
|
13
13
|
backgroundColor: 'var(--mui-palette-error-main, #d32f2f);'
|
|
14
|
-
} }
|
|
15
|
-
React.createElement(StopIcon, null)));
|
|
14
|
+
}, children: _jsx(StopIcon, {}) }));
|
|
16
15
|
}
|
|
17
16
|
/**
|
|
18
17
|
* Factory returning the stop button toolbar item.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { IProviderRegistry, IToolRegistry } from '@jupyternaut/agent';
|
|
1
2
|
import { InputToolbarRegistry } from '@jupyter/chat';
|
|
2
3
|
import type { TranslationBundle } from '@jupyterlab/translation';
|
|
3
|
-
import type { IAISettingsModel
|
|
4
|
+
import type { IAISettingsModel } from '../tokens';
|
|
4
5
|
/**
|
|
5
6
|
* Properties for the tool select component.
|
|
6
7
|
*/
|
|
@@ -38,3 +39,4 @@ export declare function ToolSelect(props: IToolSelectProps): JSX.Element;
|
|
|
38
39
|
* Factory function returning the toolbar item for tool selection.
|
|
39
40
|
*/
|
|
40
41
|
export declare function createToolSelectItem(toolRegistry: IToolRegistry, settingsModel: IAISettingsModel, providerRegistry: IProviderRegistry, toolsEnabled: boolean | undefined, translator: TranslationBundle): InputToolbarRegistry.IToolbarItem;
|
|
42
|
+
//# sourceMappingURL=tool-select.d.ts.map
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createProviderTools } from '@jupyternaut/agent';
|
|
1
3
|
import { TooltippedButton } from '@jupyter/chat';
|
|
2
4
|
import BuildIcon from '@mui/icons-material/Build';
|
|
3
5
|
import CheckIcon from '@mui/icons-material/Check';
|
|
4
6
|
import { Divider, Menu, MenuItem, Tooltip, Typography } from '@mui/material';
|
|
5
|
-
import
|
|
6
|
-
import { createProviderTools } from '../providers/provider-tools';
|
|
7
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
7
8
|
const SELECT_ITEM_CLASS = 'jp-AIToolSelect-item';
|
|
8
9
|
/**
|
|
9
10
|
* The tool select component for choosing AI tools.
|
|
@@ -97,68 +98,54 @@ export function ToolSelect(props) {
|
|
|
97
98
|
}, [tools, selectedToolNames.length, onToolSelectionChange]);
|
|
98
99
|
// Don't render if tools are disabled or no tools available
|
|
99
100
|
if (!toolsEnabled || (tools.length === 0 && providerToolNames.length === 0)) {
|
|
100
|
-
return
|
|
101
|
+
return _jsx(_Fragment, {});
|
|
101
102
|
}
|
|
102
103
|
const selectedCount = selectedToolNames.length + providerToolNames.length;
|
|
103
104
|
const totalCount = tools.length + providerToolNames.length;
|
|
104
|
-
return (
|
|
105
|
-
React.createElement(TooltippedButton, { onClick: e => {
|
|
106
|
-
openMenu(e.currentTarget);
|
|
107
|
-
}, tooltip: trans.__('Tools (%1/%2 selected)', selectedCount.toString(), totalCount.toString()), buttonProps: {
|
|
108
|
-
...(selectedCount === 0 && {
|
|
109
|
-
variant: 'outlined'
|
|
110
|
-
}),
|
|
111
|
-
title: trans.__('Select AI Tools'),
|
|
112
|
-
onKeyDown: e => {
|
|
113
|
-
if (e.key !== 'Enter' && e.key !== ' ') {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
105
|
+
return (_jsxs(_Fragment, { children: [_jsx(TooltippedButton, { onClick: e => {
|
|
116
106
|
openMenu(e.currentTarget);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
vertical: 'bottom',
|
|
129
|
-
horizontal: 'right'
|
|
130
|
-
}, sx: {
|
|
131
|
-
'& .MuiMenuItem-root': {
|
|
132
|
-
padding: '0.5em',
|
|
133
|
-
paddingRight: '2em'
|
|
134
|
-
}
|
|
135
|
-
} },
|
|
136
|
-
tools.map(namedTool => (React.createElement(Tooltip, { key: namedTool.name, title: namedTool.tool.description || namedTool.name, placement: "left" },
|
|
137
|
-
React.createElement(MenuItem, { className: SELECT_ITEM_CLASS, onClick: e => {
|
|
138
|
-
toggleTool(namedTool.name);
|
|
139
|
-
// Prevent sending message on tool selection
|
|
107
|
+
}, tooltip: trans.__('Tools (%1/%2 selected)', selectedCount.toString(), totalCount.toString()), buttonProps: {
|
|
108
|
+
...(selectedCount === 0 && {
|
|
109
|
+
variant: 'outlined'
|
|
110
|
+
}),
|
|
111
|
+
title: trans.__('Select AI Tools'),
|
|
112
|
+
onKeyDown: e => {
|
|
113
|
+
if (e.key !== 'Enter' && e.key !== ' ') {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
openMenu(e.currentTarget);
|
|
117
|
+
// Stop propagation to prevent sending message
|
|
140
118
|
e.stopPropagation();
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
119
|
+
}
|
|
120
|
+
}, sx: selectedCount === 0
|
|
121
|
+
? { backgroundColor: 'var(--jp-layout-color3)' }
|
|
122
|
+
: {}, children: _jsx(BuildIcon, { sx: { fontSize: 'small' } }) }), _jsxs(Menu, { open: menuOpen, onClose: closeMenu, anchorEl: menuAnchorEl, anchorOrigin: {
|
|
123
|
+
vertical: 'top',
|
|
124
|
+
horizontal: 'right'
|
|
125
|
+
}, transformOrigin: {
|
|
126
|
+
vertical: 'bottom',
|
|
127
|
+
horizontal: 'right'
|
|
128
|
+
}, sx: {
|
|
129
|
+
'& .MuiMenuItem-root': {
|
|
130
|
+
padding: '0.5em',
|
|
131
|
+
paddingRight: '2em'
|
|
132
|
+
}
|
|
133
|
+
}, children: [tools.map(namedTool => (_jsx(Tooltip, { title: namedTool.tool.description || namedTool.name, placement: "left", children: _jsxs(MenuItem, { className: SELECT_ITEM_CLASS, onClick: e => {
|
|
134
|
+
toggleTool(namedTool.name);
|
|
135
|
+
// Prevent sending message on tool selection
|
|
136
|
+
e.stopPropagation();
|
|
137
|
+
}, children: [selectedToolNames.includes(namedTool.name) ? (_jsx(CheckIcon, { sx: {
|
|
138
|
+
marginRight: '8px',
|
|
139
|
+
color: 'var(--jp-brand-color1, #2196F3)'
|
|
140
|
+
} })) : (_jsx("div", { style: { width: '24px', marginRight: '8px' } })), _jsx(Typography, { variant: "body2", children: namedTool.name })] }) }, namedTool.name))), providerToolNames.length > 0 && tools.length > 0 && _jsx(Divider, {}), providerToolNames.length > 0 && (_jsx(MenuItem, { disabled: true, children: _jsx(Typography, { variant: "caption", children: trans.__('Provider Tools') }) })), providerToolNames.map(toolName => {
|
|
141
|
+
return (_jsx(Tooltip, { title: trans.__('Enabled via provider settings.'), placement: "left", children: _jsxs(MenuItem, { className: SELECT_ITEM_CLASS, onClick: e => {
|
|
142
|
+
// Keep provider-managed tools read-only from this menu.
|
|
143
|
+
e.stopPropagation();
|
|
144
|
+
}, children: [_jsx(CheckIcon, { sx: {
|
|
145
|
+
marginRight: '8px',
|
|
146
|
+
color: 'text.disabled'
|
|
147
|
+
} }), _jsx(Typography, { variant: "body2", children: toolName })] }) }, toolName));
|
|
148
|
+
})] })] }));
|
|
162
149
|
}
|
|
163
150
|
/**
|
|
164
151
|
* Factory function returning the toolbar item for tool selection.
|
|
@@ -183,7 +170,7 @@ export function createToolSelectItem(toolRegistry, settingsModel, providerRegist
|
|
|
183
170
|
toolsEnabled,
|
|
184
171
|
translator
|
|
185
172
|
};
|
|
186
|
-
return
|
|
173
|
+
return _jsx(ToolSelect, { ...toolSelectProps });
|
|
187
174
|
},
|
|
188
175
|
position: 1
|
|
189
176
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { ITokenUsage } from '@jupyternaut/agent';
|
|
1
2
|
import { ReactWidget } from '@jupyterlab/ui-components';
|
|
2
3
|
import type { TranslationBundle } from '@jupyterlab/translation';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
import { ISignal } from '@lumino/signaling';
|
|
5
|
-
import
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import type { IAISettingsModel } from '../tokens';
|
|
6
7
|
/**
|
|
7
8
|
* Props for the UsageDisplay component.
|
|
8
9
|
*/
|
|
@@ -47,3 +48,4 @@ export declare class UsageWidget extends ReactWidget {
|
|
|
47
48
|
protected render(): React.ReactElement;
|
|
48
49
|
private _options;
|
|
49
50
|
}
|
|
51
|
+
//# sourceMappingURL=usage-display.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { ReactWidget, UseSignal } from '@jupyterlab/ui-components';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* React component that displays usage information.
|
|
5
5
|
* Shows input/output token counts and optional estimated context usage.
|
|
@@ -21,69 +21,58 @@ export const UsageDisplay = ({ tokenUsageChanged, settingsModel, initialTokenUsa
|
|
|
21
21
|
borderRadius: '4px',
|
|
22
22
|
whiteSpace: 'nowrap'
|
|
23
23
|
};
|
|
24
|
-
return (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
return (React.createElement(UseSignal, { signal: tokenUsageChanged, initialArgs: initialTokenUsage }, (_, tokenUsage) => {
|
|
32
|
-
if (!tokenUsage) {
|
|
24
|
+
return (_jsx(UseSignal, { signal: settingsModel.stateChanged, initialArgs: undefined, children: () => {
|
|
25
|
+
const config = settingsModel.config;
|
|
26
|
+
const showTokenUsage = config.showTokenUsage;
|
|
27
|
+
const showContextUsage = config.showContextUsage;
|
|
28
|
+
if (!showTokenUsage && !showContextUsage) {
|
|
33
29
|
return null;
|
|
34
30
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
tokenUsage.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
showTokenUsage && (React.createElement("span", { style: badgeStyle, title: trans.__('Token Usage - Sent: %1, Received: %2, Total: %3', tokenUsage.inputTokens.toLocaleString(), tokenUsage.outputTokens.toLocaleString(), total.toLocaleString()) },
|
|
63
|
-
React.createElement("span", { style: {
|
|
31
|
+
return (_jsx(UseSignal, { signal: tokenUsageChanged, initialArgs: initialTokenUsage, children: (_, tokenUsage) => {
|
|
32
|
+
if (!tokenUsage) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const total = tokenUsage.inputTokens + tokenUsage.outputTokens;
|
|
36
|
+
const hasKnownContextWindow = showContextUsage && tokenUsage.contextWindow !== undefined;
|
|
37
|
+
const contextUsagePercent = tokenUsage.lastRequestInputTokens !== undefined &&
|
|
38
|
+
tokenUsage.contextWindow !== undefined &&
|
|
39
|
+
tokenUsage.contextWindow > 0
|
|
40
|
+
? Math.max(0, Math.min(100, (tokenUsage.lastRequestInputTokens /
|
|
41
|
+
tokenUsage.contextWindow) *
|
|
42
|
+
100))
|
|
43
|
+
: undefined;
|
|
44
|
+
const hasContextEstimate = hasKnownContextWindow &&
|
|
45
|
+
contextUsagePercent !== undefined &&
|
|
46
|
+
tokenUsage.lastRequestInputTokens !== undefined;
|
|
47
|
+
const contextLabel = hasContextEstimate
|
|
48
|
+
? `${formatContextPercent(contextUsagePercent)}%`
|
|
49
|
+
: hasKnownContextWindow
|
|
50
|
+
? '0%'
|
|
51
|
+
: '?';
|
|
52
|
+
const contextTitle = hasContextEstimate
|
|
53
|
+
? trans.__('Context Usage (estimated): %1% (%2 / %3 tokens)', formatContextPercent(contextUsagePercent), tokenUsage.lastRequestInputTokens.toLocaleString(), tokenUsage.contextWindow.toLocaleString())
|
|
54
|
+
: hasKnownContextWindow
|
|
55
|
+
? trans.__('Context usage estimate will appear after the next request. Showing 0% until then. Context window: %1 tokens', tokenUsage.contextWindow.toLocaleString())
|
|
56
|
+
: trans.__('Context Usage unavailable. Configure a context window for the active provider/model to enable estimation.');
|
|
57
|
+
return (_jsxs("div", { style: {
|
|
64
58
|
display: 'flex',
|
|
65
59
|
alignItems: 'center',
|
|
66
|
-
gap: '
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
} },
|
|
83
|
-
React.createElement("span", null, "ctx"),
|
|
84
|
-
React.createElement("span", null, contextLabel))))));
|
|
85
|
-
}));
|
|
86
|
-
}));
|
|
60
|
+
gap: '6px'
|
|
61
|
+
}, children: [showTokenUsage && (_jsxs("span", { style: badgeStyle, title: trans.__('Token Usage - Sent: %1, Received: %2, Total: %3', tokenUsage.inputTokens.toLocaleString(), tokenUsage.outputTokens.toLocaleString(), total.toLocaleString()), children: [_jsxs("span", { style: {
|
|
62
|
+
display: 'flex',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
gap: '2px'
|
|
65
|
+
}, children: [_jsx("span", { children: "\u2191" }), _jsx("span", { children: tokenUsage.inputTokens.toLocaleString() })] }), _jsxs("span", { style: {
|
|
66
|
+
display: 'flex',
|
|
67
|
+
alignItems: 'center',
|
|
68
|
+
gap: '2px'
|
|
69
|
+
}, children: [_jsx("span", { children: "\u2193" }), _jsx("span", { children: tokenUsage.outputTokens.toLocaleString() })] })] })), showContextUsage && (_jsx("span", { style: badgeStyle, title: contextTitle, children: _jsxs("span", { style: {
|
|
70
|
+
display: 'flex',
|
|
71
|
+
alignItems: 'center',
|
|
72
|
+
gap: '2px'
|
|
73
|
+
}, children: [_jsx("span", { children: "ctx" }), _jsx("span", { children: contextLabel })] }) }))] }));
|
|
74
|
+
} }));
|
|
75
|
+
} }));
|
|
87
76
|
};
|
|
88
77
|
/**
|
|
89
78
|
* JupyterLab widget wrapper for the UsageDisplay component.
|
|
@@ -103,7 +92,7 @@ export class UsageWidget extends ReactWidget {
|
|
|
103
92
|
* @returns The UsageDisplay React element
|
|
104
93
|
*/
|
|
105
94
|
render() {
|
|
106
|
-
return
|
|
95
|
+
return _jsx(UsageDisplay, { ...this._options });
|
|
107
96
|
}
|
|
108
97
|
_options;
|
|
109
98
|
}
|
package/lib/diff-manager.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { IDiffManager, IShowCellDiffParams, IShowFileDiffParams } from '@jupyternaut/agent';
|
|
1
2
|
import { CommandRegistry } from '@lumino/commands';
|
|
2
|
-
import type { IAISettingsModel
|
|
3
|
+
import type { IAISettingsModel } from './tokens';
|
|
3
4
|
/**
|
|
4
5
|
* Implementation of the diff manager
|
|
5
6
|
*/
|
|
@@ -22,3 +23,4 @@ export declare class DiffManager implements IDiffManager {
|
|
|
22
23
|
private _commands;
|
|
23
24
|
private _settingsModel;
|
|
24
25
|
}
|
|
26
|
+
//# sourceMappingURL=diff-manager.d.ts.map
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { IAgentManagerFactory, IDiffManager, IProviderRegistry, IToolRegistry, ISkillRegistry } from '@jupyternaut/agent';
|
|
1
2
|
import { JupyterFrontEndPlugin } from '@jupyterlab/application';
|
|
2
3
|
import { IChatCommandRegistry, IChatTracker, IInputToolbarRegistryFactory } from '@jupyter/chat';
|
|
3
|
-
import {
|
|
4
|
+
import { IAISettingsModel, IChatModelHandler } from './tokens';
|
|
4
5
|
declare const _default: (JupyterFrontEndPlugin<IProviderRegistry> | JupyterFrontEndPlugin<void> | JupyterFrontEndPlugin<IChatCommandRegistry> | JupyterFrontEndPlugin<IChatModelHandler> | JupyterFrontEndPlugin<IChatTracker> | JupyterFrontEndPlugin<IAgentManagerFactory> | JupyterFrontEndPlugin<IAISettingsModel> | JupyterFrontEndPlugin<IDiffManager> | JupyterFrontEndPlugin<ISkillRegistry> | JupyterFrontEndPlugin<IToolRegistry> | JupyterFrontEndPlugin<IInputToolbarRegistryFactory>)[];
|
|
5
6
|
export default _default;
|
|
6
7
|
export * from './tokens';
|
|
7
|
-
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { anthropicProvider, createBrowserFetchTool, createDiscoverCommandsTool, createDiscoverSkillsTool, createExecuteCommandTool, createLoadSkillTool, genericProvider, googleProvider, loadSkillsFromPaths, mistralProvider, openaiProvider, AgentManagerFactory, IAgentManagerFactory, IDiffManager, IProviderRegistry, IToolRegistry, ISkillRegistry, ProviderRegistry, SECRETS_NAMESPACE, SkillRegistry, ToolRegistry } from '@jupyternaut/agent';
|
|
1
2
|
import { ILabShell, ILayoutRestorer } from '@jupyterlab/application';
|
|
2
3
|
import { ActiveCellManager, AttachmentOpenerRegistry, chatIcon, ChatCommandRegistry, ChatWidget, IChatCommandRegistry, IChatTracker, IInputToolbarRegistryFactory, InputToolbarRegistry, MultiChatPanel } from '@jupyter/chat';
|
|
3
4
|
import { ICommandPalette, IThemeManager, showDialog, showErrorMessage, WidgetTracker } from '@jupyterlab/apputils';
|
|
@@ -15,24 +16,16 @@ import { UUID } from '@lumino/coreutils';
|
|
|
15
16
|
import { DisposableSet } from '@lumino/disposable';
|
|
16
17
|
import { IComponentsRendererFactory } from 'jupyter-chat-components';
|
|
17
18
|
import { ISecretsManager, SecretsManager } from 'jupyter-secrets-manager';
|
|
18
|
-
import { AgentManagerFactory } from './agent';
|
|
19
19
|
import { RenderedMessageOutputAreaCompat } from './rendered-message-outputarea';
|
|
20
20
|
import { ClearCommandProvider } from './chat-commands/clear';
|
|
21
21
|
import { SkillsCommandProvider } from './chat-commands/skills';
|
|
22
|
-
import { ProviderRegistry } from './providers/provider-registry';
|
|
23
22
|
import { SaveComponentWidget } from './components/save-button';
|
|
24
23
|
import { ChatModelHandler } from './chat-model-handler';
|
|
25
|
-
import { CommandIds,
|
|
26
|
-
import { anthropicProvider, googleProvider, mistralProvider, openaiProvider, genericProvider } from './providers/built-in-providers';
|
|
24
|
+
import { CommandIds, IAISettingsModel, IChatModelHandler } from './tokens';
|
|
27
25
|
import { AICompletionProvider } from './completion';
|
|
28
26
|
import { clearItem, createModelSelectItem, createToolSelectItem, stopItem, CompletionStatusWidget, UsageWidget } from './components';
|
|
29
27
|
import { AISettingsModel } from './models/settings-model';
|
|
30
|
-
import { loadSkillsFromPaths, SkillRegistry } from './skills';
|
|
31
28
|
import { DiffManager } from './diff-manager';
|
|
32
|
-
import { ToolRegistry } from './tools/tool-registry';
|
|
33
|
-
import { createDiscoverCommandsTool, createExecuteCommandTool } from './tools/commands';
|
|
34
|
-
import { createDiscoverSkillsTool, createLoadSkillTool } from './tools/skills';
|
|
35
|
-
import { createBrowserFetchTool } from './tools/web';
|
|
36
29
|
import { AISettingsWidget } from './widgets/ai-settings';
|
|
37
30
|
import { MainAreaChat } from './widgets/main-area-chat';
|
|
38
31
|
var Private;
|
|
@@ -451,14 +444,33 @@ const plugin = {
|
|
|
451
444
|
: model.agentManager.rejectToolCall(toolCallId);
|
|
452
445
|
}
|
|
453
446
|
if (chatComponentsFactory) {
|
|
454
|
-
chatComponentsFactory.
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
447
|
+
chatComponentsFactory.groupedToolCallCallbacks = {
|
|
448
|
+
...chatComponentsFactory.groupedToolCallCallbacks,
|
|
449
|
+
toolCallPermissionDecision
|
|
450
|
+
};
|
|
451
|
+
chatComponentsFactory.queueMessageCallbacks = {
|
|
452
|
+
...chatComponentsFactory.queueMessageCallbacks,
|
|
453
|
+
removeQueuedMessage: (targetId, messageId) => {
|
|
454
|
+
const model = tracker.find(chat => chat.model.name === targetId)?.model;
|
|
455
|
+
if (!model) {
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
model.removeQueuedMessage(messageId);
|
|
459
|
+
},
|
|
460
|
+
reorderQueuedMessages: (targetId, messageIds) => {
|
|
461
|
+
const model = tracker.find(chat => chat.model.name === targetId)?.model;
|
|
462
|
+
if (!model) {
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
model.reorderQueuedMessages(messageIds);
|
|
466
|
+
},
|
|
467
|
+
editQueuedMessage: (targetId, messageId, newBody) => {
|
|
468
|
+
const model = tracker.find(chat => chat.model.name === targetId)?.model;
|
|
469
|
+
if (!model) {
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
model.editQueuedMessage(messageId, newBody);
|
|
460
473
|
}
|
|
461
|
-
model.removeQueuedMessage(messageId);
|
|
462
474
|
};
|
|
463
475
|
}
|
|
464
476
|
return tracker;
|
|
@@ -1293,4 +1305,3 @@ export default [
|
|
|
1293
1305
|
];
|
|
1294
1306
|
// Export extension points for other extensions to use
|
|
1295
1307
|
export * from './tokens';
|
|
1296
|
-
export * from './icons';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { IAIConfig, IMCPServerConfig, IProviderConfig } from '@jupyternaut/agent';
|
|
1
2
|
import { VDomModel } from '@jupyterlab/ui-components';
|
|
2
3
|
import { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
3
|
-
import {
|
|
4
|
+
import type { IAISettingsModel } from '../tokens';
|
|
4
5
|
export declare class AISettingsModel extends VDomModel implements IAISettingsModel {
|
|
5
6
|
private _config;
|
|
6
7
|
private _settingRegistry;
|
|
@@ -38,3 +39,4 @@ export declare namespace AISettingsModel {
|
|
|
38
39
|
settingRegistry: ISettingRegistry;
|
|
39
40
|
}
|
|
40
41
|
}
|
|
42
|
+
//# sourceMappingURL=settings-model.d.ts.map
|