@codex-infinity/pi-infinity 0.60.1 → 0.60.2
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/CHANGELOG.md +1 -0
- package/dist/core/agent-session.d.ts +14 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +57 -3
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +7 -3
- package/dist/core/exec.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +2 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +12 -10
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +55 -5
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/utils/child-process.d.ts +11 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +78 -0
- package/dist/utils/child-process.js.map +1 -0
- package/dist/utils/clipboard-native.d.ts +1 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -1
- package/dist/utils/clipboard-native.js.map +1 -1
- package/dist/utils/clipboard.d.ts +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +11 -1
- package/dist/utils/clipboard.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/custom-provider-qwen-cli/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +4 -4
|
@@ -1607,13 +1607,18 @@ export class InteractiveMode {
|
|
|
1607
1607
|
this.editor.setText("");
|
|
1608
1608
|
return;
|
|
1609
1609
|
}
|
|
1610
|
+
if (text.startsWith("/import")) {
|
|
1611
|
+
await this.handleImportCommand(text);
|
|
1612
|
+
this.editor.setText("");
|
|
1613
|
+
return;
|
|
1614
|
+
}
|
|
1610
1615
|
if (text === "/share") {
|
|
1611
1616
|
await this.handleShareCommand();
|
|
1612
1617
|
this.editor.setText("");
|
|
1613
1618
|
return;
|
|
1614
1619
|
}
|
|
1615
1620
|
if (text === "/copy") {
|
|
1616
|
-
this.handleCopyCommand();
|
|
1621
|
+
await this.handleCopyCommand();
|
|
1617
1622
|
this.editor.setText("");
|
|
1618
1623
|
return;
|
|
1619
1624
|
}
|
|
@@ -3285,13 +3290,58 @@ export class InteractiveMode {
|
|
|
3285
3290
|
const parts = text.split(/\s+/);
|
|
3286
3291
|
const outputPath = parts.length > 1 ? parts[1] : undefined;
|
|
3287
3292
|
try {
|
|
3288
|
-
|
|
3289
|
-
|
|
3293
|
+
if (outputPath?.endsWith(".jsonl")) {
|
|
3294
|
+
const filePath = this.session.exportToJsonl(outputPath);
|
|
3295
|
+
this.showStatus(`Session exported to: ${filePath}`);
|
|
3296
|
+
}
|
|
3297
|
+
else {
|
|
3298
|
+
const filePath = await this.session.exportToHtml(outputPath);
|
|
3299
|
+
this.showStatus(`Session exported to: ${filePath}`);
|
|
3300
|
+
}
|
|
3290
3301
|
}
|
|
3291
3302
|
catch (error) {
|
|
3292
3303
|
this.showError(`Failed to export session: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
3293
3304
|
}
|
|
3294
3305
|
}
|
|
3306
|
+
async handleImportCommand(text) {
|
|
3307
|
+
const parts = text.split(/\s+/);
|
|
3308
|
+
if (parts.length < 2 || !parts[1]) {
|
|
3309
|
+
this.showError("Usage: /import <path.jsonl>");
|
|
3310
|
+
return;
|
|
3311
|
+
}
|
|
3312
|
+
const inputPath = parts[1];
|
|
3313
|
+
const confirmed = await this.showExtensionConfirm("Import session", `Replace current session with ${inputPath}?`);
|
|
3314
|
+
if (!confirmed) {
|
|
3315
|
+
this.showStatus("Import cancelled");
|
|
3316
|
+
return;
|
|
3317
|
+
}
|
|
3318
|
+
try {
|
|
3319
|
+
// Stop loading animation
|
|
3320
|
+
if (this.loadingAnimation) {
|
|
3321
|
+
this.loadingAnimation.stop();
|
|
3322
|
+
this.loadingAnimation = undefined;
|
|
3323
|
+
}
|
|
3324
|
+
this.statusContainer.clear();
|
|
3325
|
+
// Clear UI state
|
|
3326
|
+
this.pendingMessagesContainer.clear();
|
|
3327
|
+
this.compactionQueuedMessages = [];
|
|
3328
|
+
this.streamingComponent = undefined;
|
|
3329
|
+
this.streamingMessage = undefined;
|
|
3330
|
+
this.pendingTools.clear();
|
|
3331
|
+
const success = await this.session.importFromJsonl(inputPath);
|
|
3332
|
+
if (!success) {
|
|
3333
|
+
this.showWarning("Import cancelled");
|
|
3334
|
+
return;
|
|
3335
|
+
}
|
|
3336
|
+
// Clear and re-render the chat
|
|
3337
|
+
this.chatContainer.clear();
|
|
3338
|
+
this.renderInitialMessages();
|
|
3339
|
+
this.showStatus(`Session imported from: ${inputPath}`);
|
|
3340
|
+
}
|
|
3341
|
+
catch (error) {
|
|
3342
|
+
this.showError(`Failed to import session: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
3343
|
+
}
|
|
3344
|
+
}
|
|
3295
3345
|
async handleShareCommand() {
|
|
3296
3346
|
// Check if gh is available and logged in
|
|
3297
3347
|
try {
|
|
@@ -3379,14 +3429,14 @@ export class InteractiveMode {
|
|
|
3379
3429
|
}
|
|
3380
3430
|
}
|
|
3381
3431
|
}
|
|
3382
|
-
handleCopyCommand() {
|
|
3432
|
+
async handleCopyCommand() {
|
|
3383
3433
|
const text = this.session.getLastAssistantText();
|
|
3384
3434
|
if (!text) {
|
|
3385
3435
|
this.showError("No agent messages to copy yet.");
|
|
3386
3436
|
return;
|
|
3387
3437
|
}
|
|
3388
3438
|
try {
|
|
3389
|
-
copyToClipboard(text);
|
|
3439
|
+
await copyToClipboard(text);
|
|
3390
3440
|
this.showStatus("Copied last agent message to clipboard");
|
|
3391
3441
|
}
|
|
3392
3442
|
catch (error) {
|