@jupyternaut/persona 0.0.0 → 0.20.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/mention.d.ts +9 -0
- package/lib/chat-commands/mention.js +30 -0
- package/lib/completion/completion-provider.d.ts +86 -0
- package/lib/completion/completion-provider.js +246 -0
- package/lib/completion/index.d.ts +2 -0
- package/lib/completion/index.js +1 -0
- package/lib/components/completion-status.d.ts +26 -0
- package/lib/components/completion-status.js +52 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +1 -0
- package/lib/diff-manager.d.ts +25 -0
- package/lib/diff-manager.js +60 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +522 -0
- package/lib/models/settings-model.d.ts +36 -0
- package/lib/models/settings-model.js +356 -0
- package/lib/persona-registry.d.ts +15 -0
- package/lib/persona-registry.js +29 -0
- package/lib/persona.d.ts +66 -0
- package/lib/persona.js +414 -0
- package/lib/process-attachments.d.ts +5 -0
- package/lib/process-attachments.js +287 -0
- package/lib/tokens.d.ts +101 -0
- package/lib/tokens.js +20 -0
- package/lib/widgets/ai-settings.d.ts +54 -0
- package/lib/widgets/ai-settings.js +572 -0
- package/lib/widgets/provider-config-dialog.d.ts +16 -0
- package/lib/widgets/provider-config-dialog.js +384 -0
- package/package.json +111 -7
- package/schema/settings-model.json +287 -0
- package/src/chat-commands/mention.tsx +46 -0
- package/src/completion/completion-provider.ts +350 -0
- package/src/completion/index.ts +1 -0
- package/src/components/completion-status.tsx +93 -0
- package/src/components/index.ts +1 -0
- package/src/diff-manager.ts +81 -0
- package/src/index.ts +710 -0
- package/src/models/settings-model.ts +415 -0
- package/src/persona-registry.ts +46 -0
- package/src/persona.ts +610 -0
- package/src/process-attachments.ts +369 -0
- package/src/tokens.ts +121 -0
- package/src/widgets/ai-settings.tsx +1308 -0
- package/src/widgets/provider-config-dialog.tsx +997 -0
- package/style/base.css +14 -0
- package/style/index.css +1 -0
- package/style/index.js +1 -0
- package/README.md +0 -3
- package/index.js +0 -1
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jupyter.lab.shortcuts": [],
|
|
3
|
+
"jupyter.lab.setting-icon": "@jupyternaut/agent:jupyternaut",
|
|
4
|
+
"title": "Jupyternaut Persona",
|
|
5
|
+
"description": "Configuration for Jupyternaut persona extension providers, models, and behavior",
|
|
6
|
+
"jupyter.lab.menus": {
|
|
7
|
+
"main": [
|
|
8
|
+
{
|
|
9
|
+
"id": "jp-mainmenu-settings",
|
|
10
|
+
"items": [
|
|
11
|
+
{
|
|
12
|
+
"type": "separator",
|
|
13
|
+
"rank": 110
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"command": "@jupyternaut/persona:open-settings",
|
|
17
|
+
"rank": 110
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"type": "separator",
|
|
21
|
+
"rank": 110
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"type": "object",
|
|
28
|
+
"properties": {
|
|
29
|
+
"useSecretsManager": {
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
"title": "Use secrets manager",
|
|
32
|
+
"description": "Whether to use or not the secrets manager. If not, secrets will be stored in plain text in settings",
|
|
33
|
+
"default": true
|
|
34
|
+
},
|
|
35
|
+
"providers": {
|
|
36
|
+
"title": "AI Providers",
|
|
37
|
+
"description": "List of configured AI providers",
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"properties": {
|
|
42
|
+
"id": { "type": "string" },
|
|
43
|
+
"name": { "type": "string" },
|
|
44
|
+
"provider": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "Provider identifier"
|
|
47
|
+
},
|
|
48
|
+
"model": { "type": "string" },
|
|
49
|
+
"apiKey": { "type": "string" },
|
|
50
|
+
"baseURL": { "type": "string" },
|
|
51
|
+
"headers": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"additionalProperties": { "type": "string" }
|
|
54
|
+
},
|
|
55
|
+
"parameters": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"description": "Provider-specific parameters",
|
|
58
|
+
"properties": {
|
|
59
|
+
"temperature": {
|
|
60
|
+
"type": "number",
|
|
61
|
+
"description": "Temperature (0.0 = deterministic, 2.0 = very creative)",
|
|
62
|
+
"minimum": 0,
|
|
63
|
+
"maximum": 2,
|
|
64
|
+
"default": 0.7
|
|
65
|
+
},
|
|
66
|
+
"maxOutputTokens": {
|
|
67
|
+
"type": "number",
|
|
68
|
+
"description": "Maximum tokens for chat responses",
|
|
69
|
+
"minimum": 1
|
|
70
|
+
},
|
|
71
|
+
"maxTurns": {
|
|
72
|
+
"type": "number",
|
|
73
|
+
"description": "Maximum number of tool execution turns",
|
|
74
|
+
"minimum": 1,
|
|
75
|
+
"maximum": 100,
|
|
76
|
+
"default": 25
|
|
77
|
+
},
|
|
78
|
+
"contextWindow": {
|
|
79
|
+
"type": "number",
|
|
80
|
+
"description": "Model context window size in tokens (used for context usage estimation)",
|
|
81
|
+
"minimum": 1
|
|
82
|
+
},
|
|
83
|
+
"supportsFillInMiddle": {
|
|
84
|
+
"type": "boolean",
|
|
85
|
+
"description": "Whether the model supports fill-in-middle completion"
|
|
86
|
+
},
|
|
87
|
+
"useFilterText": {
|
|
88
|
+
"type": "boolean",
|
|
89
|
+
"description": "Whether to use filter text for completions"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"customSettings": {
|
|
94
|
+
"type": "object",
|
|
95
|
+
"description": "Provider-specific advanced settings. Available sections depend on provider capabilities.",
|
|
96
|
+
"properties": {
|
|
97
|
+
"webSearch": {
|
|
98
|
+
"type": "object",
|
|
99
|
+
"description": "Provider-hosted web search settings.",
|
|
100
|
+
"properties": {
|
|
101
|
+
"enabled": {
|
|
102
|
+
"type": "boolean",
|
|
103
|
+
"description": "Enable provider-hosted web search for this provider."
|
|
104
|
+
},
|
|
105
|
+
"searchContextSize": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"enum": ["low", "medium", "high"],
|
|
108
|
+
"description": "Web search context size for providers that support it."
|
|
109
|
+
},
|
|
110
|
+
"externalWebAccess": {
|
|
111
|
+
"type": "boolean",
|
|
112
|
+
"description": "Use external web access for providers that support it."
|
|
113
|
+
},
|
|
114
|
+
"allowedDomains": {
|
|
115
|
+
"type": "array",
|
|
116
|
+
"items": { "type": "string" },
|
|
117
|
+
"description": "Allowed domains for web search."
|
|
118
|
+
},
|
|
119
|
+
"blockedDomains": {
|
|
120
|
+
"type": "array",
|
|
121
|
+
"items": { "type": "string" },
|
|
122
|
+
"description": "Blocked domains for providers that support it."
|
|
123
|
+
},
|
|
124
|
+
"maxUses": {
|
|
125
|
+
"type": "integer",
|
|
126
|
+
"minimum": 1,
|
|
127
|
+
"description": "Maximum number of web searches."
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"additionalProperties": true
|
|
131
|
+
},
|
|
132
|
+
"webFetch": {
|
|
133
|
+
"type": "object",
|
|
134
|
+
"description": "Provider-hosted web fetch settings.",
|
|
135
|
+
"properties": {
|
|
136
|
+
"enabled": {
|
|
137
|
+
"type": "boolean",
|
|
138
|
+
"description": "Enable provider-hosted web fetch for this provider."
|
|
139
|
+
},
|
|
140
|
+
"maxUses": {
|
|
141
|
+
"type": "integer",
|
|
142
|
+
"minimum": 1,
|
|
143
|
+
"description": "Maximum number of web fetches."
|
|
144
|
+
},
|
|
145
|
+
"allowedDomains": {
|
|
146
|
+
"type": "array",
|
|
147
|
+
"items": { "type": "string" },
|
|
148
|
+
"description": "Allowed domains for web fetch."
|
|
149
|
+
},
|
|
150
|
+
"blockedDomains": {
|
|
151
|
+
"type": "array",
|
|
152
|
+
"items": { "type": "string" },
|
|
153
|
+
"description": "Blocked domains for web fetch."
|
|
154
|
+
},
|
|
155
|
+
"maxContentTokens": {
|
|
156
|
+
"type": "integer",
|
|
157
|
+
"minimum": 1,
|
|
158
|
+
"description": "Maximum fetched content tokens."
|
|
159
|
+
},
|
|
160
|
+
"citationsEnabled": {
|
|
161
|
+
"type": "boolean",
|
|
162
|
+
"description": "Enable citations in Anthropic web fetch results."
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"additionalProperties": true
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"additionalProperties": true
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"required": ["id", "name", "provider", "model"],
|
|
172
|
+
"additionalProperties": true
|
|
173
|
+
},
|
|
174
|
+
"default": []
|
|
175
|
+
},
|
|
176
|
+
"defaultProvider": {
|
|
177
|
+
"title": "Default Chat Provider",
|
|
178
|
+
"description": "ID of the default provider to use for chat",
|
|
179
|
+
"type": "string",
|
|
180
|
+
"default": ""
|
|
181
|
+
},
|
|
182
|
+
"activeCompleterProvider": {
|
|
183
|
+
"title": "Active Completion Provider",
|
|
184
|
+
"description": "ID of the provider to use for completions (if different from chat)",
|
|
185
|
+
"type": "string"
|
|
186
|
+
},
|
|
187
|
+
"useSameProviderForChatAndCompleter": {
|
|
188
|
+
"title": "Use Same Provider",
|
|
189
|
+
"description": "Use the same provider for both chat and completions",
|
|
190
|
+
"type": "boolean",
|
|
191
|
+
"default": true
|
|
192
|
+
},
|
|
193
|
+
"contextAwareness": {
|
|
194
|
+
"title": "Context Awareness",
|
|
195
|
+
"description": "Enable context-aware responses",
|
|
196
|
+
"type": "boolean",
|
|
197
|
+
"default": true
|
|
198
|
+
},
|
|
199
|
+
"codeExecution": {
|
|
200
|
+
"title": "Code Execution",
|
|
201
|
+
"description": "Enable code execution capabilities",
|
|
202
|
+
"type": "boolean",
|
|
203
|
+
"default": false
|
|
204
|
+
},
|
|
205
|
+
"toolsEnabled": {
|
|
206
|
+
"title": "Tools Enabled",
|
|
207
|
+
"description": "Allow AI to use tools like notebook operations and file management",
|
|
208
|
+
"type": "boolean",
|
|
209
|
+
"default": true
|
|
210
|
+
},
|
|
211
|
+
"commandsRequiringApproval": {
|
|
212
|
+
"title": "Commands Requiring Approval",
|
|
213
|
+
"description": "List of commands that require user approval before AI can execute them",
|
|
214
|
+
"type": "array",
|
|
215
|
+
"items": { "type": "string" },
|
|
216
|
+
"default": [
|
|
217
|
+
"notebook:restart-run-all",
|
|
218
|
+
"notebook:run-cell",
|
|
219
|
+
"notebook:run-cell-and-select-next",
|
|
220
|
+
"notebook:run-cell-and-insert-below",
|
|
221
|
+
"notebook:run-all-cells",
|
|
222
|
+
"notebook:run-all-above",
|
|
223
|
+
"notebook:run-all-below",
|
|
224
|
+
"console:execute",
|
|
225
|
+
"console:execute-forced",
|
|
226
|
+
"fileeditor:run-code",
|
|
227
|
+
"kernelmenu:run",
|
|
228
|
+
"kernelmenu:restart-and-run-all",
|
|
229
|
+
"runmenu:run-all",
|
|
230
|
+
"jupyterlab-ai-commands:run-cell"
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
"commandsAutoRenderMimeBundles": {
|
|
234
|
+
"title": "Commands Auto-Rendering MIME Bundles",
|
|
235
|
+
"description": "List of execute_command command IDs whose outputs can auto-render MIME bundles in chat",
|
|
236
|
+
"type": "array",
|
|
237
|
+
"items": { "type": "string" },
|
|
238
|
+
"default": ["jupyterlab-ai-commands:execute-in-kernel"]
|
|
239
|
+
},
|
|
240
|
+
"trustedMimeTypesForAutoRender": {
|
|
241
|
+
"title": "Trusted MIME Types for Auto-Render",
|
|
242
|
+
"description": "MIME types to mark as trusted when auto-rendering execute_command outputs in chat",
|
|
243
|
+
"type": "array",
|
|
244
|
+
"items": { "type": "string" },
|
|
245
|
+
"default": ["text/html"]
|
|
246
|
+
},
|
|
247
|
+
"systemPrompt": {
|
|
248
|
+
"title": "System Prompt",
|
|
249
|
+
"description": "Instructions that define how the AI should behave and respond",
|
|
250
|
+
"type": "string",
|
|
251
|
+
"default": "You are Jupyternaut, an AI coding assistant built specifically for the JupyterLab environment.\n\n## Your Core Mission\nYou're designed to be a capable partner for data science, research, and development work in Jupyter notebooks. You can help with everything from quick code snippets to complex multi-notebook projects.\n\n## Your Capabilities\n**📁 File & Project Management:**\n- Create, read, edit, and organize files and notebooks in any language\n- Manage project structure and navigate file systems\n- Help with version control and project organization\n\n**📊 Notebook Operations:**\n- Create new notebooks and manage existing ones\n- Add, edit, delete, and run cells (both code and markdown)\n- Help with notebook structure and organization\n- Retrieve and analyze cell outputs and execution results\n\n**⚡ Kernel Management:**\n- Start new kernels with specified language or kernel name\n- Execute code directly in a kernel using jupyterlab-ai-commands execution commands (not console), without creating cells\n- List running kernels and monitor their status\n- Manage kernel lifecycle (start, monitor, shutdown)\n\n**🧠 Coding & Development:**\n- Write, debug, and optimize code in any language supported by Jupyter kernels (Python, R, Julia, JavaScript, C++, and more)\n- Explain complex algorithms and data structures\n- Help with data analysis, visualization, and machine learning\n- Support for libraries and packages across different languages\n- Code reviews and best practices recommendations\n\n**💡 Adaptive Assistance:**\n- Understand context from the user's current work environment\n- Provide suggestions tailored to the user's specific use case\n- Help with both quick fixes and long-term project planning\n\n## How You Work\nYou interact with the user's JupyterLab environment primarily through the command system:\n- Use 'discover_commands' to find available JupyterLab commands\n- Use 'execute_command' to perform operations\n- For file and notebook operations, use commands from the jupyterlab-ai-commands extension (prefixed with 'jupyterlab-ai-commands:')\n- These commands provide comprehensive file and notebook manipulation: create, read, edit files/notebooks, manage cells, run code, etc.\n- You can make systematic changes across multiple files and perform complex multi-step operations\n- Skills are available via the skills tools: discover_skills (list) and load_skill (load instructions/resources)\n\n## Tool & Skill Use Policy\n- When tools or skills are available and the task requires actions or environment-specific facts, use them instead of guessing\n- Never guess command IDs. Always use discover_commands with a relevant query before execute_command, unless you already discovered the command earlier in this conversation\n- If a preloaded skills snapshot is provided in the system prompt, use it instead of calling discover_skills to list skills\n- Only call discover_skills if the user explicitly asks for the latest list or you need to verify a skill not in the snapshot\n- When a skill is relevant, call load_skill with the skill name to load instructions; if it returns a non-empty resources array, load each listed resource with load_skill before proceeding\n- If you're unsure how to perform a request, discover relevant commands (discover_commands with task keywords)\n- Use a relevant skill even when the user doesn't explicitly mention it\n- Prefer the single most relevant tool or skill; if multiple could apply, ask a brief clarifying question\n- Ask for missing required inputs before calling a tool or skill\n- Before calling a tool or skill, briefly state why you're calling it, then make the tool call in the same response\n- Never end your response after only announcing what you are about to do: whenever you say you will use a tool or perform an action, the corresponding tool call must be part of that same response\n\n## Code Execution Strategy\nWhen asked to run code or perform computations, choose the most appropriate approach:\n- **For quick computations or one-off code execution**: Use the kernel execution commands from jupyterlab-ai-commands to run code directly (no notebook/console). Discover these commands first with query 'jupyterlab-ai-commands' and use the returned command IDs. This is ideal for calculations, data lookups, or testing code snippets.\n- **For work that should be saved**: Create or use notebooks when the user needs a persistent record of their work, wants to iterate on code, or is building something they'll return to later.\n\nThis means if the user asks you to \"calculate the factorial of 100\" or \"check what library version is installed\", run that directly with the jupyterlab-ai-commands kernel execution command rather than creating a new notebook file.\n\n## Notebook State and Cell Identity\nWhen working with an existing notebook, use the notebook's current structure and kernel state as the source of truth.\n- Before changing notebook content or structure, inspect the notebook and any target cells with the relevant notebook commands you have discovered.\n- If the user may have edited the notebook, or if a previous command could have changed it, refresh your view before continuing rather than relying on earlier results.\n- Treat variables from previously executed cells as part of the active kernel state. When the user asks you to work with existing data or variables, use them by name instead of recreating them unless the user asks you to redefine them or the kernel state is unavailable.\n- Be explicit about the kind of cell reference you are using. A visible execution count (for example In [6]), a notebook position, and an internal cell ID or UUID are different identifiers and may not match.\n- When the user identifies a cell by execution count, relative position, or content, verify the target cell from the current notebook contents before editing it or inserting cells relative to it.\n- For relative insertions, anchor the change to the confirmed target cell rather than to empty placeholder or trailing cells unless the user explicitly refers to those cells.\n\n## Your Approach\n- **Context-aware**: You understand the user is working in a data science/research environment\n- **Practical**: You focus on actionable solutions that work in the user's current setup\n- **Educational**: You explain your reasoning and teach best practices along the way\n- **Collaborative**: You are a pair programming partner, not just a code generator\n\n## Communication Style & Agent Behavior\nIMPORTANT: Follow this message flow pattern for better user experience:\n\n1. FIRST: Explain what you're going to do and your approach\n2. THEN: Execute tools (these will show automatically with step numbers)\n3. FINALLY: Provide a concise summary of what was accomplished\n\nExample flow:\n- \"I'll help you create a notebook with example cells. Let me first create the file structure, then add Python and Markdown cells.\"\n- [Tool executions happen with automatic step display]\n- \"Successfully created your notebook with 3 cells: a title, code example, and visualization cell.\"\n\nGuidelines:\n- Start responses with your plan/approach before tool execution\n- Let the system handle tool execution display (don't duplicate details)\n- End with a brief summary of accomplishments\n- Use natural, conversational tone throughout\n\n- **Conversational**: You maintain a friendly, natural conversation flow throughout the interaction\n- **Progress Updates**: You write brief progress messages between tool uses that appear directly in the conversation\n- **No Filler**: You avoid empty acknowledgments like \"Sounds good!\" or \"Okay, I will...\" - you get straight to work\n- **Purposeful Communication**: You start with what you're doing, use tools, then share what you found and what's next\n- **Active Narration**: You actively write progress updates like \"Looking at the current code structure...\" or \"Found the issue in the notebook...\" between tool calls\n- **Checkpoint Updates**: After several operations, you summarize what you've accomplished and what remains\n- **Natural Flow**: Your explanations and progress reports appear as normal conversation text, not just in tool blocks\n\n## IMPORTANT: Always write progress messages between tools that explain what you're doing and what you found. These should be conversational updates that help the user follow along with your work.\n\n## Technical Communication\n- Code is formatted in proper markdown blocks with syntax highlighting\n- Mathematical notation uses LaTeX formatting: \\(equations\\) and \\[display math\\]\n- You provide context for your actions and explain your reasoning as you work\n- When creating or modifying multiple files, you give brief summaries of changes\n- You keep users informed of progress while staying focused on the task\n\n## Multi-Step Task Handling\nWhen users request complex tasks, you use the command system to accomplish them:\n- For file and notebook operations, use discover_commands with query 'jupyterlab-ai-commands' to find the curated set of AI commands (~22 commands)\n- For other JupyterLab operations (terminal, launcher, UI), use specific keywords like 'terminal', 'launcher', etc.\n- IMPORTANT: Always use 'jupyterlab-ai-commands' as the query for file/notebook tasks - this returns a focused set instead of 100+ generic commands\n- For example, to create a notebook with cells:\n 1. discover_commands with query 'jupyterlab-ai-commands' to find available file/notebook commands\n 2. execute_command with 'jupyterlab-ai-commands:create-notebook' and required arguments\n 3. execute_command with 'jupyterlab-ai-commands:add-cell' multiple times to add cells\n 4. execute_command with 'jupyterlab-ai-commands:set-cell-content' to add content to cells\n 5. execute_command with 'jupyterlab-ai-commands:run-cell' when appropriate\n\n## Kernel Preference for Notebooks and Consoles\nWhen creating notebooks or consoles for a specific programming language, use the 'kernelPreference' argument:\nOnly create consoles when the user explicitly asks for one; otherwise prefer the jupyterlab-ai-commands kernel execution commands for running code.\n- To specify by language: { \"kernelPreference\": { \"language\": \"python\" } } or { \"kernelPreference\": { \"language\": \"julia\" } }\n- To specify by kernel name: { \"kernelPreference\": { \"name\": \"python3\" } } or { \"kernelPreference\": { \"name\": \"julia-1.10\" } }\n- Example: execute_command with commandId=\"notebook:create-new\" and args={ \"kernelPreference\": { \"language\": \"python\" } }\n- Example: execute_command with commandId=\"console:create\" and args={ \"kernelPreference\": { \"name\": \"python3\" } }\n- Common kernel names: \"python3\" (Python), \"julia-1.10\" (Julia), \"ir\" (R), \"xpython\" (xeus-python)\n- If unsure of exact kernel name, prefer using \"language\" which will match any kernel supporting that language\n\nAlways think through multi-step tasks and use commands to fully complete the user's request rather than stopping after just one action.\n\nYou are ready to help users build something great!"
|
|
252
|
+
},
|
|
253
|
+
"completionSystemPrompt": {
|
|
254
|
+
"title": "Completion System Prompt",
|
|
255
|
+
"description": "Instructions that define how the AI should generate code completions",
|
|
256
|
+
"type": "string",
|
|
257
|
+
"default": "You are an AI code completion assistant. Complete the given code fragment with appropriate code.\nRules:\n- Return only the completion text, no explanations or comments\n- Do not include code block markers (``` or similar)\n- Make completions contextually relevant to the surrounding code and notebook context\n- Follow the language-specific conventions and style guidelines for the detected programming language\n- Keep completions concise but functional\n- Do not repeat the existing code that comes before the cursor\n- Use variables, imports, functions, and other definitions from previous notebook cells when relevant"
|
|
258
|
+
},
|
|
259
|
+
"showCellDiff": {
|
|
260
|
+
"title": "Show Cell Diff",
|
|
261
|
+
"description": "Show diff view when AI modifies cell content",
|
|
262
|
+
"type": "boolean",
|
|
263
|
+
"default": true
|
|
264
|
+
},
|
|
265
|
+
"showFileDiff": {
|
|
266
|
+
"title": "Show File Diff",
|
|
267
|
+
"description": "Show diff view when AI modifies file content",
|
|
268
|
+
"type": "boolean",
|
|
269
|
+
"default": true
|
|
270
|
+
},
|
|
271
|
+
"diffDisplayMode": {
|
|
272
|
+
"title": "Diff Display Mode",
|
|
273
|
+
"description": "How to display cell diffs (split or unified view)",
|
|
274
|
+
"type": "string",
|
|
275
|
+
"enum": ["split", "unified"],
|
|
276
|
+
"default": "split"
|
|
277
|
+
},
|
|
278
|
+
"skillsPaths": {
|
|
279
|
+
"title": "Skills Paths",
|
|
280
|
+
"description": "Paths to directories containing agent skills, relative to the server root. Skills are loaded from all paths; the first occurrence of a skill name takes priority.",
|
|
281
|
+
"type": "array",
|
|
282
|
+
"items": { "type": "string" },
|
|
283
|
+
"default": [".agents/skills", "_agents/skills"]
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"additionalProperties": false
|
|
287
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Avatar,
|
|
3
|
+
ChatCommand,
|
|
4
|
+
IChatCommandProvider,
|
|
5
|
+
IInputModel
|
|
6
|
+
} from '@jupyter/chat';
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
|
|
10
|
+
import { DEFAULT_PERSONA } from '../tokens';
|
|
11
|
+
|
|
12
|
+
export class MentionCommandProvider implements IChatCommandProvider {
|
|
13
|
+
public id: string = '@jupyternaut/persona:mention';
|
|
14
|
+
|
|
15
|
+
async listCommandCompletions(
|
|
16
|
+
inputModel: IInputModel
|
|
17
|
+
): Promise<ChatCommand[]> {
|
|
18
|
+
const match = inputModel.currentWord?.match(this._regex)?.[0];
|
|
19
|
+
if (!match) {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (this._command.name.startsWith(match)) {
|
|
24
|
+
return [this._command];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async onSubmit(inputModel: IInputModel): Promise<void> {
|
|
31
|
+
const input = inputModel.value;
|
|
32
|
+
const match = input.match(this._regex)?.[0];
|
|
33
|
+
if (this._command.name === match) {
|
|
34
|
+
inputModel.addMention?.(DEFAULT_PERSONA);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private _command: ChatCommand = {
|
|
39
|
+
name: `@${DEFAULT_PERSONA.mention_name}`,
|
|
40
|
+
providerId: this.id,
|
|
41
|
+
icon: <Avatar user={DEFAULT_PERSONA} />,
|
|
42
|
+
spaceOnAccept: true
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
private _regex: RegExp = /@([\w-]*)/g;
|
|
46
|
+
}
|