@fleetagent/pi-coding-agent 0.0.10 → 0.0.11
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 +21 -0
- 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 +16 -3
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/bash-executor.d.ts +2 -0
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +1 -0
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +86 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +3 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +27 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +55 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/pi-agent.d.ts.map +1 -1
- package/dist/core/pi-agent.js +1 -0
- package/dist/core/pi-agent.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +5 -0
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +115 -0
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/resource-loader.d.ts +15 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +332 -40
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/rules.d.ts +6 -0
- package/dist/core/rules.d.ts.map +1 -1
- package/dist/core/rules.js +216 -0
- package/dist/core/rules.js.map +1 -1
- package/dist/core/skills.d.ts +6 -0
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +216 -0
- package/dist/core/skills.js.map +1 -1
- package/dist/core/source-info.d.ts +2 -0
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js +6 -0
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +5 -5
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +5 -5
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +2 -2
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +2 -2
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +2 -2
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +3 -2
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +9 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +14 -0
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +3 -2
- package/dist/core/tools/write.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +7 -5
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +21 -9
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/extensions.md +82 -3
- package/docs/usage.md +2 -0
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -11,6 +11,7 @@ import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities,
|
|
|
11
11
|
import { spawn, spawnSync } from "child_process";
|
|
12
12
|
import { APP_NAME, APP_TITLE, getAgentDir, getAuthPath, getDebugLogPath, getDocsPath, getShareViewerUrl, PACKAGE_NAME, VERSION, } from "../../config.js";
|
|
13
13
|
import { parseSkillBlock } from "../../core/agent-session.js";
|
|
14
|
+
import { executeBashWithOperations } from "../../core/bash-executor.js";
|
|
14
15
|
import { FooterDataProvider } from "../../core/footer-data-provider.js";
|
|
15
16
|
import { KeybindingsManager } from "../../core/keybindings.js";
|
|
16
17
|
import { createCompactionSummaryMessage } from "../../core/messages.js";
|
|
@@ -21,6 +22,7 @@ import { BUILT_IN_PROVIDER_DISPLAY_NAMES } from "../../core/provider-display-nam
|
|
|
21
22
|
import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
|
|
22
23
|
import { LocalSessionManager } from "../../core/session-manager.js";
|
|
23
24
|
import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
25
|
+
import { getSourceBackendIcon } from "../../core/source-info.js";
|
|
24
26
|
import { isInstallTelemetryEnabled } from "../../core/telemetry.js";
|
|
25
27
|
import { getChangelogPath, getNewEntries, parseChangelog } from "../../utils/changelog.js";
|
|
26
28
|
import { copyToClipboard } from "../../utils/clipboard.js";
|
|
@@ -265,7 +267,8 @@ export class InteractiveMode {
|
|
|
265
267
|
if (!sourceTag) {
|
|
266
268
|
return description;
|
|
267
269
|
}
|
|
268
|
-
|
|
270
|
+
const backendIcon = getSourceBackendIcon(sourceInfo);
|
|
271
|
+
return description ? `[${backendIcon} ${sourceTag}] ${description}` : `[${backendIcon} ${sourceTag}]`;
|
|
269
272
|
}
|
|
270
273
|
getBuiltInCommandConflictDiagnostics(extensionRunner) {
|
|
271
274
|
const builtinNames = new Set(BUILTIN_SLASH_COMMANDS.map((command) => command.name));
|
|
@@ -914,7 +917,8 @@ export class InteractiveMode {
|
|
|
914
917
|
if (sourceInfo) {
|
|
915
918
|
const shortPath = this.getShortPath(p, sourceInfo);
|
|
916
919
|
const { label, scopeLabel } = this.getDisplaySourceInfo(sourceInfo);
|
|
917
|
-
const
|
|
920
|
+
const backendIcon = getSourceBackendIcon(sourceInfo);
|
|
921
|
+
const labelText = scopeLabel ? `${backendIcon} ${label} (${scopeLabel})` : `${backendIcon} ${label}`;
|
|
918
922
|
return `${labelText} ${shortPath}`;
|
|
919
923
|
}
|
|
920
924
|
return this.formatDisplayPath(p);
|
|
@@ -1017,8 +1021,10 @@ export class InteractiveMode {
|
|
|
1017
1021
|
const contextFiles = this.session.resourceLoader.getAgentsFiles().agentsFiles;
|
|
1018
1022
|
if (contextFiles.length > 0) {
|
|
1019
1023
|
this.chatContainer.addChild(new Spacer(1));
|
|
1024
|
+
const contextBackendInfo = this.session.getToolBackendInfo?.();
|
|
1025
|
+
const contextBackendIcon = contextBackendInfo?.type === "ssh" ? "☁" : "🖥";
|
|
1020
1026
|
const contextList = contextFiles
|
|
1021
|
-
.map((f) => theme.fg("dim", ` ${this.formatDisplayPath(f.path)}`))
|
|
1027
|
+
.map((f) => theme.fg("dim", ` ${f.path.startsWith(getAgentDir()) ? "🖥" : contextBackendIcon} ${this.formatDisplayPath(f.path)}`))
|
|
1022
1028
|
.join("\n");
|
|
1023
1029
|
const contextCompactList = formatCompactList(contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)), { sort: false });
|
|
1024
1030
|
addLoadedSection("Context", contextCompactList, contextList);
|
|
@@ -1027,8 +1033,8 @@ export class InteractiveMode {
|
|
|
1027
1033
|
if (skills.length > 0) {
|
|
1028
1034
|
const groups = this.buildScopeGroups(skills.map((skill) => ({ path: skill.filePath, sourceInfo: skill.sourceInfo })));
|
|
1029
1035
|
const skillList = this.formatScopeGroups(groups, {
|
|
1030
|
-
formatPath: (item) => this.formatDisplayPath(item.path)
|
|
1031
|
-
formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo)
|
|
1036
|
+
formatPath: (item) => `${getSourceBackendIcon(item.sourceInfo)} ${this.formatDisplayPath(item.path)}`,
|
|
1037
|
+
formatPackagePath: (item) => `${getSourceBackendIcon(item.sourceInfo)} ${this.getShortPath(item.path, item.sourceInfo)}`,
|
|
1032
1038
|
});
|
|
1033
1039
|
const skillCompactList = formatCompactList(skills.map((skill) => skill.name));
|
|
1034
1040
|
addLoadedSection("Skills", skillCompactList, skillList);
|
|
@@ -1037,8 +1043,8 @@ export class InteractiveMode {
|
|
|
1037
1043
|
if (rules.length > 0) {
|
|
1038
1044
|
const groups = this.buildScopeGroups(rules.map((rule) => ({ path: rule.filePath, sourceInfo: rule.sourceInfo })));
|
|
1039
1045
|
const ruleList = this.formatScopeGroups(groups, {
|
|
1040
|
-
formatPath: (item) => this.formatDisplayPath(item.path)
|
|
1041
|
-
formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo)
|
|
1046
|
+
formatPath: (item) => `${getSourceBackendIcon(item.sourceInfo)} ${this.formatDisplayPath(item.path)}`,
|
|
1047
|
+
formatPackagePath: (item) => `${getSourceBackendIcon(item.sourceInfo)} ${this.getShortPath(item.path, item.sourceInfo)}`,
|
|
1042
1048
|
});
|
|
1043
1049
|
const ruleCompactList = formatCompactList(rules.map((rule) => rule.name));
|
|
1044
1050
|
addLoadedSection("Rules", ruleCompactList, ruleList);
|
|
@@ -1050,11 +1056,11 @@ export class InteractiveMode {
|
|
|
1050
1056
|
const templateList = this.formatScopeGroups(groups, {
|
|
1051
1057
|
formatPath: (item) => {
|
|
1052
1058
|
const template = templateByPath.get(item.path);
|
|
1053
|
-
return template ? `/${template.name}` : this.formatDisplayPath(item.path)
|
|
1059
|
+
return `${getSourceBackendIcon(item.sourceInfo)} ${template ? `/${template.name}` : this.formatDisplayPath(item.path)}`;
|
|
1054
1060
|
},
|
|
1055
1061
|
formatPackagePath: (item) => {
|
|
1056
1062
|
const template = templateByPath.get(item.path);
|
|
1057
|
-
return template ? `/${template.name}` : this.formatDisplayPath(item.path)
|
|
1063
|
+
return `${getSourceBackendIcon(item.sourceInfo)} ${template ? `/${template.name}` : this.formatDisplayPath(item.path)}`;
|
|
1058
1064
|
},
|
|
1059
1065
|
});
|
|
1060
1066
|
const promptCompactList = formatCompactList(templates.map((template) => `/${template.name}`));
|
|
@@ -1277,6 +1283,12 @@ export class InteractiveMode {
|
|
|
1277
1283
|
ui: this.createExtensionUIContext(),
|
|
1278
1284
|
hasUI: true,
|
|
1279
1285
|
cwd: this.activeSession.getCwd(),
|
|
1286
|
+
toolOperations: this.session.getToolOperations(),
|
|
1287
|
+
getToolBackendInfo: () => this.session.getToolBackendInfo(),
|
|
1288
|
+
execToolBackend: (command, options) => {
|
|
1289
|
+
const operations = this.session.getToolOperations();
|
|
1290
|
+
return executeBashWithOperations(command, options?.cwd ?? operations.cwd, operations, options);
|
|
1291
|
+
},
|
|
1280
1292
|
session: this.activeSession,
|
|
1281
1293
|
modelRegistry: this.session.modelRegistry,
|
|
1282
1294
|
model: this.session.model,
|