pi-lean-host 0.1.1 → 0.2.1
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 +182 -62
- package/core/api-guide-types.ts +52 -1
- package/core/api-toggle.ts +20 -1
- package/core/auth.ts +186 -0
- package/core/guide-store.ts +0 -26
- package/core/helpers.ts +173 -57
- package/core/local-helpers.ts +2 -1
- package/core/parse-api-guide.ts +316 -55
- package/core/path-template.ts +30 -1
- package/core/secrets-command.ts +338 -0
- package/core/secrets-store.ts +180 -0
- package/core/ssrf-guard.ts +5 -0
- package/core/transport.ts +114 -26
- package/package.json +14 -1
- package/tools/api-fetch.ts +113 -26
- package/tools/api-guide.ts +13 -15
- package/tools/api-learn.ts +16 -19
- package/tools/api-probe.ts +528 -53
- package/tools/utils.ts +21 -0
package/tools/utils.ts
CHANGED
|
@@ -32,3 +32,24 @@ export function renderExpandedText(
|
|
|
32
32
|
text += `\n${theme.fg("muted", `… ${content.length - limit} more chars`)}`;
|
|
33
33
|
return text;
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Append the shared collapsed/expanded body footer to a render string:
|
|
38
|
+
* expanded shows the content preview; collapsed shows a "chars (expand)" hint.
|
|
39
|
+
*/
|
|
40
|
+
export function appendFooter(
|
|
41
|
+
text: string,
|
|
42
|
+
expanded: boolean,
|
|
43
|
+
result: AgentToolResult<unknown>,
|
|
44
|
+
theme: { fg: (c: ThemeColor, t: string) => string },
|
|
45
|
+
limit: number,
|
|
46
|
+
): string {
|
|
47
|
+
const content = contentText(result);
|
|
48
|
+
if (expanded) {
|
|
49
|
+
text += "\n";
|
|
50
|
+
text = renderExpandedText(text, theme, content, limit);
|
|
51
|
+
} else {
|
|
52
|
+
text += `\n${theme.fg("muted", `${content.length} chars (expand)`)}`;
|
|
53
|
+
}
|
|
54
|
+
return text;
|
|
55
|
+
}
|