@oh-my-pi/pi-coding-agent 3.35.0 → 3.36.0
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 +18 -0
- package/README.md +7 -2
- package/package.json +5 -5
- package/src/core/agent-session.ts +8 -8
- package/src/core/auth-storage.ts +293 -28
- package/src/core/model-registry.ts +7 -8
- package/src/core/sdk.ts +5 -4
- package/src/core/system-prompt.ts +1 -0
- package/src/core/title-generator.ts +3 -1
- package/src/core/tools/bash.ts +11 -3
- package/src/core/tools/calculator.ts +500 -0
- package/src/core/tools/index.test.ts +2 -0
- package/src/core/tools/index.ts +3 -0
- package/src/core/tools/renderers.ts +2 -0
- package/src/core/tools/web-search/auth.ts +13 -5
- package/src/core/tools/web-search/types.ts +11 -7
- package/src/modes/interactive/components/oauth-selector.ts +1 -2
- package/src/modes/interactive/interactive-mode.ts +7 -5
- package/src/prompts/tools/ask.md +11 -5
- package/src/prompts/tools/bash.md +1 -0
- package/src/prompts/tools/calculator.md +8 -0
|
@@ -1157,7 +1157,7 @@ export class InteractiveMode {
|
|
|
1157
1157
|
if (!hasUserMessages && !this.sessionManager.getSessionTitle()) {
|
|
1158
1158
|
const registry = this.session.modelRegistry;
|
|
1159
1159
|
const smolModel = this.settingsManager.getModelRole("smol");
|
|
1160
|
-
generateSessionTitle(text, registry, smolModel)
|
|
1160
|
+
generateSessionTitle(text, registry, smolModel, this.session.sessionId)
|
|
1161
1161
|
.then(async (title) => {
|
|
1162
1162
|
if (title) {
|
|
1163
1163
|
await this.sessionManager.setSessionTitle(title);
|
|
@@ -1484,11 +1484,14 @@ export class InteractiveMode {
|
|
|
1484
1484
|
}
|
|
1485
1485
|
|
|
1486
1486
|
private sendCompletionNotification(): void {
|
|
1487
|
+
if (this.isBackgrounded === false) return;
|
|
1487
1488
|
if (isNotificationSuppressed()) return;
|
|
1488
1489
|
const method = this.settingsManager.getNotificationOnComplete();
|
|
1489
1490
|
if (method === "off") return;
|
|
1490
1491
|
const protocol = method === "auto" ? detectNotificationProtocol() : method;
|
|
1491
|
-
|
|
1492
|
+
const title = this.sessionManager.getSessionTitle();
|
|
1493
|
+
const message = title ? `${title}: Complete` : "Complete";
|
|
1494
|
+
sendNotification(protocol, message);
|
|
1492
1495
|
}
|
|
1493
1496
|
|
|
1494
1497
|
/** Extract text content from a user message */
|
|
@@ -2610,9 +2613,7 @@ export class InteractiveMode {
|
|
|
2610
2613
|
private async showOAuthSelector(mode: "login" | "logout"): Promise<void> {
|
|
2611
2614
|
if (mode === "logout") {
|
|
2612
2615
|
const providers = this.session.modelRegistry.authStorage.list();
|
|
2613
|
-
const loggedInProviders = providers.filter(
|
|
2614
|
-
(p) => this.session.modelRegistry.authStorage.get(p)?.type === "oauth",
|
|
2615
|
-
);
|
|
2616
|
+
const loggedInProviders = providers.filter((p) => this.session.modelRegistry.authStorage.hasOAuth(p));
|
|
2616
2617
|
if (loggedInProviders.length === 0) {
|
|
2617
2618
|
this.showStatus("No OAuth providers logged in. Use /login first.");
|
|
2618
2619
|
return;
|
|
@@ -2633,6 +2634,7 @@ export class InteractiveMode {
|
|
|
2633
2634
|
await this.session.modelRegistry.authStorage.login(providerId as OAuthProvider, {
|
|
2634
2635
|
onAuth: (info: { url: string; instructions?: string }) => {
|
|
2635
2636
|
this.chatContainer.addChild(new Spacer(1));
|
|
2637
|
+
this.chatContainer.addChild(new Text(theme.fg("dim", info.url), 1, 0));
|
|
2636
2638
|
// Use OSC 8 hyperlink escape sequence for clickable link
|
|
2637
2639
|
const hyperlink = `\x1b]8;;${info.url}\x07Click here to login\x1b]8;;\x07`;
|
|
2638
2640
|
this.chatContainer.addChild(new Text(theme.fg("accent", hyperlink), 1, 0));
|
package/src/prompts/tools/ask.md
CHANGED
|
@@ -8,11 +8,6 @@ Use this tool to:
|
|
|
8
8
|
- Request user preferences (styling, naming conventions, architecture patterns)
|
|
9
9
|
- Offer meaningful choices about task direction
|
|
10
10
|
|
|
11
|
-
Do NOT use for:
|
|
12
|
-
- Questions resolvable by reading files or docs
|
|
13
|
-
- Permission for normal dev tasks (just proceed)
|
|
14
|
-
- Decisions you should make from codebase context
|
|
15
|
-
|
|
16
11
|
Tips:
|
|
17
12
|
- Place recommended option first with " (Recommended)" suffix
|
|
18
13
|
- 2-5 concise, distinct options
|
|
@@ -22,3 +17,14 @@ Tips:
|
|
|
22
17
|
question: "Which authentication method should this API use?"
|
|
23
18
|
options: [{"label": "JWT (Recommended)"}, {"label": "OAuth2"}, {"label": "Session cookies"}]
|
|
24
19
|
</example>
|
|
20
|
+
|
|
21
|
+
## Critical: Resolve before asking
|
|
22
|
+
|
|
23
|
+
**Exhaust all other options before asking.** Questions interrupt user flow.
|
|
24
|
+
|
|
25
|
+
1. **Unknown file location?** → Search with grep/find first. Only ask if search fails.
|
|
26
|
+
2. **Ambiguous syntax/format?** → Infer from context and codebase conventions. Make a reasonable choice.
|
|
27
|
+
3. **Missing details?** → Check docs, related files, commit history. Fill gaps yourself.
|
|
28
|
+
4. **Implementation approach?** → Choose based on codebase patterns. Ask only for genuinely novel architectural decisions.
|
|
29
|
+
|
|
30
|
+
If you can make a reasonable inference from the user's request, **do it**. Users communicate intent, not specifications—your job is to translate intent into correct implementation.
|
|
@@ -13,6 +13,7 @@ Do NOT use Bash for:
|
|
|
13
13
|
|
|
14
14
|
## Command structure
|
|
15
15
|
|
|
16
|
+
- Use `workdir` parameter to run commands in a specific directory instead of `cd dir && ...`
|
|
16
17
|
- Paths with spaces must use double quotes: `cd "/path/with spaces"`
|
|
17
18
|
- For sequential dependent operations, chain with `&&`: `mkdir foo && cd foo && touch bar`
|
|
18
19
|
- For parallel independent operations, make multiple tool calls in one message
|