dhti-cli 1.3.2 → 1.3.5
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/README.md +2 -1
- package/dist/commands/copilot.d.ts +2 -0
- package/dist/commands/copilot.js +11 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -116,7 +116,8 @@ You will see the new **patient context aware chatbot** in the patient summary pa
|
|
|
116
116
|
* [CDS Hooks Sandbox for testing](https://github.com/dermatologist/cds-hooks-sandbox)
|
|
117
117
|
|
|
118
118
|
## Presentations
|
|
119
|
-
⭐️ **Pitched at [Falling Walls Lab Illinois](https://falling-walls.com/falling-walls-lab-illinois) and released on 2025-09-12.**
|
|
119
|
+
* ⭐️ **Pitched at the [Falling Walls Lab Illinois](https://falling-walls.com/falling-walls-lab-illinois) and released on 2025-09-12.**
|
|
120
|
+
* ⭐️ **Version 1 will be introduced at the [Medical Informatics Europe Conference 2026 (Genoa, Italy)](https://mie2026.efmi.org/), taking place May 26-28, 2026.**
|
|
120
121
|
|
|
121
122
|
## 🔧 What problems do DHTI solve?
|
|
122
123
|
|
|
@@ -17,6 +17,7 @@ export default class Copilot extends Command {
|
|
|
17
17
|
run(): Promise<void>;
|
|
18
18
|
/**
|
|
19
19
|
* Clears the conversation history
|
|
20
|
+
* @returns void
|
|
20
21
|
*/
|
|
21
22
|
private clearConversationHistory;
|
|
22
23
|
/**
|
|
@@ -50,6 +51,7 @@ export default class Copilot extends Command {
|
|
|
50
51
|
/**
|
|
51
52
|
* Saves conversation history to file
|
|
52
53
|
* @param history - Array of conversation turns to save
|
|
54
|
+
* @returns void
|
|
53
55
|
*/
|
|
54
56
|
private saveConversationHistory;
|
|
55
57
|
}
|
package/dist/commands/copilot.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CopilotClient } from '@github/copilot-sdk';
|
|
2
1
|
import { Command, Flags } from '@oclif/core';
|
|
3
2
|
import chalk from 'chalk';
|
|
4
3
|
import fs from 'node:fs';
|
|
@@ -124,14 +123,20 @@ export default class Copilot extends Command {
|
|
|
124
123
|
systemMessageContent += 'Continue the conversation naturally based on this context.';
|
|
125
124
|
}
|
|
126
125
|
this.log(chalk.green('Initializing GitHub Copilot SDK...'));
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
127
127
|
let client = null;
|
|
128
128
|
let assistantResponse = '';
|
|
129
129
|
try {
|
|
130
|
+
// Dynamically import CopilotClient to avoid module resolution issues during manifest generation
|
|
131
|
+
const { CopilotClient } = await import('@github/copilot-sdk');
|
|
130
132
|
// Create copilot client
|
|
131
133
|
client = new CopilotClient();
|
|
132
134
|
// Create a session with streaming enabled
|
|
133
135
|
const session = await client.createSession({
|
|
134
136
|
model: flags.model,
|
|
137
|
+
onPermissionRequest: async () => ({
|
|
138
|
+
kind: 'approved',
|
|
139
|
+
}),
|
|
135
140
|
streaming: true,
|
|
136
141
|
systemMessage: {
|
|
137
142
|
content: systemMessageContent,
|
|
@@ -143,6 +148,7 @@ export default class Copilot extends Command {
|
|
|
143
148
|
this.log(chalk.blue('\n--- Copilot Response ---\n'));
|
|
144
149
|
// Handle streaming responses
|
|
145
150
|
let responseStarted = false;
|
|
151
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
146
152
|
session.on('assistant.message_delta', (event) => {
|
|
147
153
|
if (!responseStarted) {
|
|
148
154
|
responseStarted = true;
|
|
@@ -152,6 +158,7 @@ export default class Copilot extends Command {
|
|
|
152
158
|
assistantResponse += content;
|
|
153
159
|
});
|
|
154
160
|
// Handle session errors
|
|
161
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
155
162
|
session.on('session.error', (error) => {
|
|
156
163
|
this.warn(chalk.yellow(`Session error: ${error}`));
|
|
157
164
|
});
|
|
@@ -186,6 +193,7 @@ export default class Copilot extends Command {
|
|
|
186
193
|
}
|
|
187
194
|
this.saveConversationHistory(conversationHistory);
|
|
188
195
|
this.log(chalk.dim(`💾 Conversation saved (${conversationHistory.length} messages). Use --clear-history to reset.`));
|
|
196
|
+
this.log(chalk.yellow('🧹 Cleaning up session, please wait...'));
|
|
189
197
|
}
|
|
190
198
|
catch (error) {
|
|
191
199
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -204,6 +212,7 @@ export default class Copilot extends Command {
|
|
|
204
212
|
}
|
|
205
213
|
/**
|
|
206
214
|
* Clears the conversation history
|
|
215
|
+
* @returns void
|
|
207
216
|
*/
|
|
208
217
|
clearConversationHistory() {
|
|
209
218
|
try {
|
|
@@ -326,6 +335,7 @@ export default class Copilot extends Command {
|
|
|
326
335
|
/**
|
|
327
336
|
* Saves conversation history to file
|
|
328
337
|
* @param history - Array of conversation turns to save
|
|
338
|
+
* @returns void
|
|
329
339
|
*/
|
|
330
340
|
saveConversationHistory(history) {
|
|
331
341
|
try {
|
package/oclif.manifest.json
CHANGED