@earendil-works/pi-coding-agent 0.79.0 → 0.79.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 +69 -0
- package/README.md +10 -8
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +2 -4
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/project-trust.d.ts +10 -0
- package/dist/cli/project-trust.d.ts.map +1 -0
- package/dist/cli/project-trust.js +48 -0
- package/dist/cli/project-trust.js.map +1 -0
- package/dist/cli/startup-ui.d.ts +17 -0
- package/dist/cli/startup-ui.d.ts.map +1 -0
- package/dist/cli/startup-ui.js +128 -0
- package/dist/cli/startup-ui.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +3 -1
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +9 -2
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/experimental.d.ts +2 -0
- package/dist/core/experimental.d.ts.map +1 -0
- package/dist/core/experimental.js +4 -0
- package/dist/core/experimental.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +6 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +3 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/model-resolver.d.ts +1 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +41 -5
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/project-trust.d.ts +15 -0
- package/dist/core/project-trust.d.ts.map +1 -0
- package/dist/core/project-trust.js +58 -0
- package/dist/core/project-trust.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +2 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +24 -26
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/resource-loader.d.ts +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +25 -25
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +11 -2
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +10 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +26 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/trust-manager.d.ts +28 -2
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +89 -20
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +32 -181
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +39 -34
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.js +103 -0
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +1 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +7 -1
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +20 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.d.ts +6 -3
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/trust-selector.js +23 -18
- package/dist/modes/interactive/components/trust-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +22 -12
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts +6 -2
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +66 -12
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/changelog.d.ts +1 -0
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +78 -0
- package/dist/utils/changelog.js.map +1 -1
- package/docs/extensions.md +11 -3
- package/docs/models.md +4 -3
- package/docs/packages.md +0 -2
- package/docs/prompt-templates.md +8 -1
- package/docs/security.md +13 -11
- package/docs/settings.md +9 -4
- package/docs/usage.md +12 -7
- 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/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -24,8 +24,8 @@ import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../cor
|
|
|
24
24
|
import { SessionManager } from "../../core/session-manager.js";
|
|
25
25
|
import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
26
26
|
import { isInstallTelemetryEnabled } from "../../core/telemetry.js";
|
|
27
|
-
import {
|
|
28
|
-
import { getChangelogPath, getNewEntries, parseChangelog } from "../../utils/changelog.js";
|
|
27
|
+
import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
|
|
28
|
+
import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
|
|
29
29
|
import { copyToClipboard } from "../../utils/clipboard.js";
|
|
30
30
|
import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
|
|
31
31
|
import { parseGitUrl } from "../../utils/git.js";
|
|
@@ -372,8 +372,13 @@ export class InteractiveMode {
|
|
|
372
372
|
}
|
|
373
373
|
setupAutocompleteProvider() {
|
|
374
374
|
let provider = this.createBaseAutocompleteProvider();
|
|
375
|
+
const triggerCharacters = [];
|
|
375
376
|
for (const wrapProvider of this.autocompleteProviderWrappers) {
|
|
376
377
|
provider = wrapProvider(provider);
|
|
378
|
+
triggerCharacters.push(...(provider.triggerCharacters ?? []));
|
|
379
|
+
}
|
|
380
|
+
if (triggerCharacters.length > 0) {
|
|
381
|
+
provider.triggerCharacters = [...new Set(triggerCharacters)];
|
|
377
382
|
}
|
|
378
383
|
this.autocompleteProvider = provider;
|
|
379
384
|
this.defaultEditor.setAutocompleteProvider(provider);
|
|
@@ -672,7 +677,7 @@ export class InteractiveMode {
|
|
|
672
677
|
if (newEntries.length > 0) {
|
|
673
678
|
this.settingsManager.setLastChangelogVersion(VERSION);
|
|
674
679
|
this.reportInstallTelemetry(VERSION);
|
|
675
|
-
return newEntries.map((e) => e.content).join("\n\n");
|
|
680
|
+
return newEntries.map((e) => normalizeChangelogLinks(e.content, e)).join("\n\n");
|
|
676
681
|
}
|
|
677
682
|
return undefined;
|
|
678
683
|
}
|
|
@@ -1280,6 +1285,7 @@ export class InteractiveMode {
|
|
|
1280
1285
|
modelRegistry: this.session.modelRegistry,
|
|
1281
1286
|
model: this.session.model,
|
|
1282
1287
|
isIdle: () => !this.session.isStreaming,
|
|
1288
|
+
isProjectTrusted: () => this.settingsManager.isProjectTrusted(),
|
|
1283
1289
|
signal: this.session.agent.signal,
|
|
1284
1290
|
abort: () => {
|
|
1285
1291
|
this.restoreQueuedMessagesToEditor({ abort: true });
|
|
@@ -2661,13 +2667,13 @@ export class InteractiveMode {
|
|
|
2661
2667
|
}
|
|
2662
2668
|
}
|
|
2663
2669
|
renderProjectTrustWarningIfNeeded() {
|
|
2664
|
-
if (this.settingsManager.isProjectTrusted() || !
|
|
2670
|
+
if (this.settingsManager.isProjectTrusted() || !hasTrustRequiringProjectResources(this.sessionManager.getCwd())) {
|
|
2665
2671
|
return;
|
|
2666
2672
|
}
|
|
2667
2673
|
if (this.chatContainer.children.length > 0) {
|
|
2668
2674
|
this.chatContainer.addChild(new Spacer(1));
|
|
2669
2675
|
}
|
|
2670
|
-
this.chatContainer.addChild(new Text(theme.fg("warning", "This project is not trusted. Project
|
|
2676
|
+
this.chatContainer.addChild(new Text(theme.fg("warning", "This project is not trusted. Project .pi resources and packages are ignored. Use /trust to save a trust decision, then restart pi."), 1, 0));
|
|
2671
2677
|
}
|
|
2672
2678
|
async getUserInput() {
|
|
2673
2679
|
const queuedInput = this.pendingUserInputs.shift();
|
|
@@ -3278,6 +3284,7 @@ export class InteractiveMode {
|
|
|
3278
3284
|
doubleEscapeAction: this.settingsManager.getDoubleEscapeAction(),
|
|
3279
3285
|
treeFilterMode: this.settingsManager.getTreeFilterMode(),
|
|
3280
3286
|
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
|
|
3287
|
+
defaultProjectTrust: this.settingsManager.getDefaultProjectTrust(),
|
|
3281
3288
|
editorPaddingX: this.settingsManager.getEditorPaddingX(),
|
|
3282
3289
|
autocompleteMaxVisible: this.settingsManager.getAutocompleteMaxVisible(),
|
|
3283
3290
|
quietStartup: this.settingsManager.getQuietStartup(),
|
|
@@ -3370,6 +3377,9 @@ export class InteractiveMode {
|
|
|
3370
3377
|
onQuietStartupChange: (enabled) => {
|
|
3371
3378
|
this.settingsManager.setQuietStartup(enabled);
|
|
3372
3379
|
},
|
|
3380
|
+
onDefaultProjectTrustChange: (defaultProjectTrust) => {
|
|
3381
|
+
this.settingsManager.setDefaultProjectTrust(defaultProjectTrust);
|
|
3382
|
+
},
|
|
3373
3383
|
onDoubleEscapeActionChange: (action) => {
|
|
3374
3384
|
this.settingsManager.setDoubleEscapeAction(action);
|
|
3375
3385
|
},
|
|
@@ -3489,7 +3499,7 @@ export class InteractiveMode {
|
|
|
3489
3499
|
if (this.autoTrustOnReloadCwd !== cwd) {
|
|
3490
3500
|
return false;
|
|
3491
3501
|
}
|
|
3492
|
-
if (!this.settingsManager.isProjectTrusted() || !
|
|
3502
|
+
if (!this.settingsManager.isProjectTrusted() || !hasTrustRequiringProjectResources(cwd)) {
|
|
3493
3503
|
return false;
|
|
3494
3504
|
}
|
|
3495
3505
|
const trustStore = new ProjectTrustStore(this.runtimeHost.services.agentDir);
|
|
@@ -3510,16 +3520,16 @@ export class InteractiveMode {
|
|
|
3510
3520
|
showTrustSelector() {
|
|
3511
3521
|
const cwd = this.sessionManager.getCwd();
|
|
3512
3522
|
const trustStore = new ProjectTrustStore(this.runtimeHost.services.agentDir);
|
|
3513
|
-
const savedDecision = trustStore.
|
|
3523
|
+
const savedDecision = trustStore.getEntry(cwd);
|
|
3514
3524
|
this.showSelector((done) => {
|
|
3515
3525
|
const selector = new TrustSelectorComponent({
|
|
3516
3526
|
cwd,
|
|
3517
3527
|
savedDecision,
|
|
3518
3528
|
projectTrusted: this.settingsManager.isProjectTrusted(),
|
|
3519
|
-
onSelect: (
|
|
3520
|
-
trustStore.
|
|
3529
|
+
onSelect: (selection) => {
|
|
3530
|
+
trustStore.setMany(selection.updates);
|
|
3521
3531
|
done();
|
|
3522
|
-
this.showStatus(`Saved trust decision: ${trusted ? "trusted" : "untrusted"}. Restart pi for this to take effect.`);
|
|
3532
|
+
this.showStatus(`Saved trust decision: ${selection.trusted ? "trusted" : "untrusted"}. Restart pi for this to take effect.`);
|
|
3523
3533
|
},
|
|
3524
3534
|
onCancel: () => {
|
|
3525
3535
|
done();
|
|
@@ -4487,7 +4497,7 @@ export class InteractiveMode {
|
|
|
4487
4497
|
const changelogMarkdown = allEntries.length > 0
|
|
4488
4498
|
? allEntries
|
|
4489
4499
|
.reverse()
|
|
4490
|
-
.map((e) => e.content)
|
|
4500
|
+
.map((e) => normalizeChangelogLinks(e.content, e))
|
|
4491
4501
|
.join("\n\n")
|
|
4492
4502
|
: "No changelog entries found.";
|
|
4493
4503
|
this.chatContainer.addChild(new Spacer(1));
|
|
@@ -4554,7 +4564,7 @@ export class InteractiveMode {
|
|
|
4554
4564
|
**Navigation**
|
|
4555
4565
|
| Key | Action |
|
|
4556
4566
|
|-----|--------|
|
|
4557
|
-
| \`${cursorUp}\` / \`${cursorDown}\` / \`${cursorLeft}\` / \`${cursorRight}\` | Move cursor / browse history
|
|
4567
|
+
| \`${cursorUp}\` / \`${cursorDown}\` / \`${cursorLeft}\` / \`${cursorRight}\` | Move cursor / browse history |
|
|
4558
4568
|
| \`${cursorWordLeft}\` / \`${cursorWordRight}\` | Move by word |
|
|
4559
4569
|
| \`${cursorLineStart}\` | Start of line |
|
|
4560
4570
|
| \`${cursorLineEnd}\` | End of line |
|