@oh-my-pi/pi-coding-agent 16.2.13 → 16.3.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 +108 -7
- package/dist/cli.js +6033 -5982
- package/dist/types/advisor/config.d.ts +4 -2
- package/dist/types/collab/host.d.ts +16 -0
- package/dist/types/collab/protocol.d.ts +9 -3
- package/dist/types/commit/model-selection.d.ts +5 -0
- package/dist/types/config/model-resolver.d.ts +12 -10
- package/dist/types/config/settings-schema.d.ts +28 -5
- package/dist/types/edit/modes/patch.d.ts +11 -0
- package/dist/types/eval/agent-bridge.d.ts +5 -1
- package/dist/types/exec/bash-executor.d.ts +1 -0
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +86 -2
- package/dist/types/extensibility/skills.d.ts +2 -1
- package/dist/types/mnemopi/state.d.ts +12 -0
- package/dist/types/modes/components/agent-hub.d.ts +9 -5
- package/dist/types/modes/components/status-line/component.test.d.ts +1 -0
- package/dist/types/modes/components/usage-row.d.ts +1 -1
- package/dist/types/modes/controllers/command-controller.d.ts +0 -1
- package/dist/types/modes/controllers/extension-ui-controller.d.ts +6 -0
- package/dist/types/modes/controllers/streaming-reveal.d.ts +17 -1
- package/dist/types/modes/controllers/tool-args-reveal.d.ts +30 -3
- package/dist/types/modes/interactive-mode.d.ts +12 -7
- package/dist/types/modes/rpc/rpc-client.d.ts +5 -0
- package/dist/types/modes/rpc/rpc-mode.d.ts +64 -1
- package/dist/types/modes/session-teardown.d.ts +63 -0
- package/dist/types/modes/session-teardown.test.d.ts +1 -0
- package/dist/types/modes/theme/theme.d.ts +9 -4
- package/dist/types/modes/types.d.ts +2 -3
- package/dist/types/modes/utils/copy-targets.d.ts +2 -0
- package/dist/types/plan-mode/approved-plan-prompt.test.d.ts +1 -0
- package/dist/types/sdk.d.ts +9 -0
- package/dist/types/session/agent-session.d.ts +46 -13
- package/dist/types/session/exit-diagnostics.d.ts +48 -0
- package/dist/types/session/session-loader.d.ts +5 -0
- package/dist/types/task/executor.d.ts +12 -5
- package/dist/types/task/parallel.d.ts +1 -0
- package/dist/types/task/render.test.d.ts +1 -0
- package/dist/types/thinking.d.ts +2 -0
- package/dist/types/tools/checkpoint.d.ts +8 -0
- package/dist/types/tools/eval-render.d.ts +1 -0
- package/dist/types/tools/fetch.d.ts +11 -1
- package/dist/types/tools/index.d.ts +3 -1
- package/dist/types/tools/irc.d.ts +1 -0
- package/dist/types/tools/output-meta.d.ts +7 -0
- package/dist/types/tools/output-schema-validator.d.ts +7 -4
- package/dist/types/tools/path-utils.d.ts +16 -0
- package/dist/types/tools/render-utils.d.ts +4 -1
- package/dist/types/utils/git.d.ts +47 -2
- package/dist/types/web/search/provider.d.ts +7 -0
- package/dist/types/web/search/types.d.ts +1 -1
- package/package.json +12 -12
- package/src/advisor/config.ts +4 -2
- package/src/cli/bench-cli.ts +7 -2
- package/src/collab/guest.ts +94 -5
- package/src/collab/host.ts +80 -3
- package/src/collab/protocol.ts +9 -2
- package/src/commit/model-selection.ts +8 -2
- package/src/config/keybindings.ts +3 -1
- package/src/config/model-discovery.ts +66 -2
- package/src/config/model-registry.ts +7 -3
- package/src/config/model-resolver.ts +51 -23
- package/src/config/settings-schema.ts +44 -14
- package/src/edit/hashline/diff.ts +13 -2
- package/src/edit/index.ts +58 -8
- package/src/edit/modes/patch.ts +53 -18
- package/src/edit/streaming.ts +7 -6
- package/src/eval/__tests__/agent-bridge.test.ts +57 -1
- package/src/eval/agent-bridge.ts +15 -5
- package/src/exec/bash-executor.ts +7 -12
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +534 -16
- package/src/extensibility/skills.ts +29 -6
- package/src/goals/guided-setup.ts +4 -3
- package/src/internal-urls/docs-index.generated.txt +1 -1
- package/src/lsp/client.ts +11 -14
- package/src/main.ts +38 -10
- package/src/mnemopi/state.ts +43 -7
- package/src/modes/acp/acp-agent.ts +1 -1
- package/src/modes/components/agent-hub.ts +10 -2
- package/src/modes/components/agent-transcript-viewer.ts +39 -7
- package/src/modes/components/assistant-message.ts +16 -10
- package/src/modes/components/chat-transcript-builder.ts +11 -1
- package/src/modes/components/custom-editor.test.ts +20 -0
- package/src/modes/components/hook-selector.ts +44 -25
- package/src/modes/components/model-selector.ts +1 -1
- package/src/modes/components/status-line/component.test.ts +44 -0
- package/src/modes/components/status-line/component.ts +9 -1
- package/src/modes/components/status-line/segments.ts +3 -3
- package/src/modes/components/usage-row.ts +16 -2
- package/src/modes/controllers/command-controller.ts +6 -21
- package/src/modes/controllers/event-controller.ts +11 -9
- package/src/modes/controllers/extension-ui-controller.ts +84 -3
- package/src/modes/controllers/input-controller.ts +16 -13
- package/src/modes/controllers/selector-controller.ts +3 -8
- package/src/modes/controllers/streaming-reveal.ts +75 -53
- package/src/modes/controllers/tool-args-reveal.ts +340 -10
- package/src/modes/interactive-mode.ts +122 -79
- package/src/modes/rpc/rpc-client.ts +21 -0
- package/src/modes/rpc/rpc-mode.ts +197 -46
- package/src/modes/session-teardown.test.ts +219 -0
- package/src/modes/session-teardown.ts +82 -0
- package/src/modes/setup-wizard/scenes/theme.ts +2 -2
- package/src/modes/skill-command.ts +7 -20
- package/src/modes/theme/theme.ts +29 -15
- package/src/modes/types.ts +2 -3
- package/src/modes/utils/copy-targets.ts +12 -0
- package/src/modes/utils/ui-helpers.ts +19 -2
- package/src/plan-mode/approved-plan-prompt.test.ts +36 -0
- package/src/prompts/advisor/system.md +1 -1
- package/src/prompts/agents/tester.md +6 -2
- package/src/prompts/skills/autoload.md +8 -0
- package/src/prompts/skills/user-invocation.md +11 -0
- package/src/prompts/steering/parent-irc.md +5 -0
- package/src/prompts/system/irc-incoming.md +2 -0
- package/src/prompts/system/mid-run-todo-nudge.md +3 -0
- package/src/prompts/system/plan-mode-approved.md +7 -10
- package/src/prompts/system/plan-mode-compact-instructions.md +2 -1
- package/src/prompts/system/plan-mode-reference.md +3 -4
- package/src/prompts/system/rewind-report.md +6 -0
- package/src/prompts/system/subagent-system-prompt.md +3 -0
- package/src/prompts/tools/irc.md +2 -1
- package/src/prompts/tools/job.md +2 -2
- package/src/prompts/tools/rewind.md +3 -2
- package/src/prompts/tools/task.md +4 -0
- package/src/sdk.ts +18 -4
- package/src/session/agent-session.ts +660 -114
- package/src/session/exit-diagnostics.ts +202 -0
- package/src/session/session-context.ts +25 -13
- package/src/session/session-loader.ts +58 -25
- package/src/session/session-manager.ts +0 -1
- package/src/session/session-persistence.ts +30 -4
- package/src/session/settings-stream-fn.ts +14 -0
- package/src/slash-commands/builtin-registry.ts +35 -3
- package/src/system-prompt.ts +15 -1
- package/src/task/executor.ts +31 -8
- package/src/task/index.ts +31 -9
- package/src/task/isolation-runner.ts +18 -2
- package/src/task/parallel.ts +7 -2
- package/src/task/render.test.ts +121 -0
- package/src/task/render.ts +48 -2
- package/src/task/worktree.ts +12 -13
- package/src/task/yield-assembly.ts +8 -5
- package/src/thinking.ts +5 -0
- package/src/tools/ask.ts +188 -9
- package/src/tools/ast-edit.ts +7 -0
- package/src/tools/ast-grep.ts +11 -0
- package/src/tools/bash.ts +6 -30
- package/src/tools/checkpoint.ts +15 -1
- package/src/tools/eval-render.ts +15 -0
- package/src/tools/fetch.ts +82 -18
- package/src/tools/gh.ts +1 -1
- package/src/tools/grep.ts +45 -27
- package/src/tools/index.ts +3 -1
- package/src/tools/irc.ts +24 -9
- package/src/tools/output-meta.ts +50 -0
- package/src/tools/output-schema-validator.ts +152 -15
- package/src/tools/path-utils.ts +55 -10
- package/src/tools/read.ts +1 -1
- package/src/tools/render-utils.ts +5 -3
- package/src/tools/yield.ts +41 -1
- package/src/utils/commit-message-generator.ts +2 -2
- package/src/utils/git.ts +271 -29
- package/src/utils/thinking-display.ts +13 -0
- package/src/web/search/index.ts +9 -28
- package/src/web/search/provider.ts +26 -1
- package/src/web/search/providers/duckduckgo.ts +1 -1
- package/src/web/search/types.ts +5 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as fs from "node:fs/promises";
|
|
2
2
|
import * as os from "node:os";
|
|
3
|
-
import { getProjectDir } from "@oh-my-pi/pi-utils";
|
|
3
|
+
import { getProjectDir, prompt } from "@oh-my-pi/pi-utils";
|
|
4
4
|
import {
|
|
5
5
|
isValidManagedSkillName,
|
|
6
6
|
MANAGED_SKILLS_PROVIDER_ID,
|
|
@@ -11,6 +11,8 @@ import type { SourceMeta } from "../capability/types";
|
|
|
11
11
|
import type { SkillsSettings } from "../config/settings";
|
|
12
12
|
import { type Skill as CapabilitySkill, loadCapability } from "../discovery";
|
|
13
13
|
import { compareSkillOrder, scanSkillsFromDir } from "../discovery/helpers";
|
|
14
|
+
import autoloadTemplate from "../prompts/skills/autoload.md" with { type: "text" };
|
|
15
|
+
import userInvocationTemplate from "../prompts/skills/user-invocation.md" with { type: "text" };
|
|
14
16
|
import type { SkillPromptDetails } from "../session/messages";
|
|
15
17
|
import { expandTilde } from "../tools/path-utils";
|
|
16
18
|
export interface Skill {
|
|
@@ -461,18 +463,39 @@ function startsWithLocalExecutionPrefix(trimmedStart: string): boolean {
|
|
|
461
463
|
return next === 32 /* space */ || next === 9 /* tab */ || next === 10 /* LF */ || next === 13 /* CR */;
|
|
462
464
|
}
|
|
463
465
|
|
|
466
|
+
export type SkillInvocationKind = "user" | "autoload";
|
|
467
|
+
|
|
464
468
|
export async function buildSkillPromptMessage(
|
|
465
|
-
skill: Pick<Skill, "name" | "filePath">,
|
|
469
|
+
skill: Pick<Skill, "name" | "filePath" | "baseDir">,
|
|
466
470
|
args: string,
|
|
471
|
+
invocation: SkillInvocationKind = "user",
|
|
467
472
|
): Promise<BuiltSkillPromptMessage> {
|
|
468
473
|
const content = await Bun.file(skill.filePath).text();
|
|
469
474
|
const body = content.replace(/^---\n[\s\S]*?\n---\n/, "").trim();
|
|
470
|
-
const metaLines = [`Skill: ${skill.filePath}`];
|
|
471
475
|
const trimmedArgs = args.trim();
|
|
472
|
-
|
|
473
|
-
|
|
476
|
+
let message: string;
|
|
477
|
+
if (invocation === "user") {
|
|
478
|
+
// User-invoked skills announce themselves and expose their skill directory
|
|
479
|
+
// so the model resolves the skill's own relative paths (scripts/, templates/).
|
|
480
|
+
message = prompt
|
|
481
|
+
.render(userInvocationTemplate, {
|
|
482
|
+
name: skill.name,
|
|
483
|
+
body,
|
|
484
|
+
baseDir: skill.baseDir,
|
|
485
|
+
userArgs: trimmedArgs || undefined,
|
|
486
|
+
})
|
|
487
|
+
.trim();
|
|
488
|
+
} else {
|
|
489
|
+
// Autoload skills are hidden, non-user context — they MUST NOT claim the
|
|
490
|
+
// user invoked them; this keeps the minimal provenance-only format.
|
|
491
|
+
message = prompt
|
|
492
|
+
.render(autoloadTemplate, {
|
|
493
|
+
body,
|
|
494
|
+
filePath: skill.filePath,
|
|
495
|
+
userArgs: trimmedArgs || undefined,
|
|
496
|
+
})
|
|
497
|
+
.trim();
|
|
474
498
|
}
|
|
475
|
-
const message = `${body}\n\n---\n\n${metaLines.join("\n")}`;
|
|
476
499
|
return {
|
|
477
500
|
message,
|
|
478
501
|
details: {
|
|
@@ -5,7 +5,7 @@ import { extractTextContent, extractToolCall, parseJsonPayload } from "../commit
|
|
|
5
5
|
import guidedGoalInterviewPrompt from "../prompts/goals/guided-goal-interview.md" with { type: "text" };
|
|
6
6
|
import guidedGoalSystemPrompt from "../prompts/goals/guided-goal-system.md" with { type: "text" };
|
|
7
7
|
import type { AgentSession } from "../session/agent-session";
|
|
8
|
-
import { shouldDisableReasoning, toReasoningEffort } from "../thinking";
|
|
8
|
+
import { concreteThinkingLevel, shouldDisableReasoning, toReasoningEffort } from "../thinking";
|
|
9
9
|
|
|
10
10
|
const RESPOND_TOOL_NAME = "respond";
|
|
11
11
|
|
|
@@ -92,6 +92,7 @@ export async function runGuidedGoalTurn(
|
|
|
92
92
|
// never sent verbatim to the plan/slow provider. Deobfuscated again below before display/use.
|
|
93
93
|
const obfuscator = session.obfuscator;
|
|
94
94
|
const promptText = obfuscator?.hasSecrets() ? obfuscator.obfuscate(userPrompt) : userPrompt;
|
|
95
|
+
const thinkingLevel = concreteThinkingLevel(resolved.thinkingLevel);
|
|
95
96
|
const response = await instrumentedCompleteSimple(
|
|
96
97
|
resolved.model,
|
|
97
98
|
{
|
|
@@ -102,8 +103,8 @@ export async function runGuidedGoalTurn(
|
|
|
102
103
|
{
|
|
103
104
|
apiKey: session.modelRegistry.resolver(resolved.model, session.sessionId),
|
|
104
105
|
signal: options.signal,
|
|
105
|
-
reasoning: toReasoningEffort(
|
|
106
|
-
disableReasoning: shouldDisableReasoning(
|
|
106
|
+
reasoning: toReasoningEffort(thinkingLevel),
|
|
107
|
+
disableReasoning: shouldDisableReasoning(thinkingLevel),
|
|
107
108
|
toolChoice: { type: "tool", name: RESPOND_TOOL_NAME },
|
|
108
109
|
},
|
|
109
110
|
{ telemetry: resolveTelemetry(session.agent.telemetry, session.sessionId), oneshotKind: "guided_goal_setup" },
|