@oh-my-pi/pi-coding-agent 16.2.8 → 16.2.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 +59 -0
- package/dist/cli.js +3160 -3096
- package/dist/types/config/settings-schema.d.ts +41 -13
- package/dist/types/extensibility/skills.d.ts +29 -0
- package/dist/types/modes/components/mcp-add-wizard.d.ts +8 -0
- package/dist/types/modes/components/todo-reminder.d.ts +3 -1
- package/dist/types/modes/controllers/mcp-command-controller.d.ts +9 -0
- package/dist/types/modes/controllers/tool-args-reveal.d.ts +5 -0
- package/dist/types/modes/interactive-mode.d.ts +0 -1
- package/dist/types/modes/skill-command.d.ts +1 -1
- package/dist/types/modes/types.d.ts +0 -1
- package/dist/types/session/agent-session.d.ts +1 -1
- package/dist/types/stt/asr-client.d.ts +7 -3
- package/dist/types/stt/index.d.ts +1 -0
- package/dist/types/stt/stt-controller.d.ts +2 -0
- package/dist/types/stt/submit-trigger.d.ts +30 -0
- package/dist/types/task/index.d.ts +1 -1
- package/dist/types/task/types.d.ts +6 -6
- package/dist/types/tiny/models.d.ts +22 -8
- package/package.json +14 -13
- package/scripts/bundle-dist.ts +23 -4
- package/scripts/generate-docs-index.ts +116 -24
- package/src/async/job-manager.ts +27 -3
- package/src/cli/grep-cli.ts +1 -1
- package/src/commit/agentic/agent.ts +1 -1
- package/src/commit/agentic/prompts/system.md +1 -1
- package/src/commit/agentic/tools/analyze-file.ts +2 -2
- package/src/config/model-discovery.ts +118 -76
- package/src/config/settings-schema.ts +15 -1
- package/src/debug/profiler.ts +7 -1
- package/src/extensibility/skills.ts +77 -0
- package/src/internal-urls/docs-index.generated.txt +2 -2
- package/src/lsp/config.ts +17 -3
- package/src/mcp/oauth-flow.ts +35 -8
- package/src/modes/acp/acp-agent.ts +6 -9
- package/src/modes/components/mcp-add-wizard.ts +43 -3
- package/src/modes/components/model-selector.ts +21 -9
- package/src/modes/components/todo-reminder.ts +5 -1
- package/src/modes/controllers/event-controller.ts +40 -15
- package/src/modes/controllers/mcp-command-controller.ts +84 -3
- package/src/modes/controllers/selector-controller.ts +57 -35
- package/src/modes/controllers/tool-args-reveal.ts +12 -0
- package/src/modes/interactive-mode.ts +5 -10
- package/src/modes/rpc/rpc-mode.ts +5 -8
- package/src/modes/skill-command.ts +8 -20
- package/src/modes/types.ts +0 -1
- package/src/prompts/agents/tester.md +107 -0
- package/src/prompts/system/orchestrate-notice.md +2 -2
- package/src/prompts/system/system-prompt.md +2 -5
- package/src/prompts/system/thinking-loop-redirect.md +10 -0
- package/src/prompts/system/workflow-notice.md +1 -1
- package/src/prompts/tools/task.md +2 -9
- package/src/session/agent-session.ts +53 -18
- package/src/stt/asr-client.ts +87 -27
- package/src/stt/downloader.ts +8 -2
- package/src/stt/index.ts +1 -0
- package/src/stt/stt-controller.ts +31 -2
- package/src/stt/submit-trigger.ts +74 -0
- package/src/task/agents.ts +4 -4
- package/src/task/executor.ts +2 -4
- package/src/task/index.ts +32 -10
- package/src/task/types.ts +5 -5
- package/src/tiny/models.ts +10 -0
- package/src/tools/ast-grep.ts +34 -12
- package/src/tools/grep.ts +11 -8
- package/src/utils/git.ts +22 -1
- package/src/prompts/agents/oracle.md +0 -54
|
@@ -384,6 +384,83 @@ export function getSkillSlashCommandName(skill: Pick<Skill, "name">): string {
|
|
|
384
384
|
return `skill:${skill.name}`;
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
+
/**
|
|
388
|
+
* Parsed `/skill:<name>` invocation: either at the start of the draft (the
|
|
389
|
+
* traditional slash-command position) or as a `/skill:<name>` token embedded
|
|
390
|
+
* mid-prompt. For the mid-prompt form the surrounding prose is threaded
|
|
391
|
+
* through as `args` so the skill sees the full user request.
|
|
392
|
+
*/
|
|
393
|
+
export interface ParsedSkillInvocation {
|
|
394
|
+
/** Bare skill name without the leading `skill:` prefix. */
|
|
395
|
+
name: string;
|
|
396
|
+
/** User-supplied arguments (everything outside the `/skill:<name>` token). */
|
|
397
|
+
args: string;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const MID_PROMPT_SKILL_RE = /(^|\s)\/skill:([^\s/]+)(\s|$)/;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Detect a `/skill:<name>` invocation in a user draft.
|
|
404
|
+
*
|
|
405
|
+
* Returns `undefined` when the text contains no skill token. Otherwise:
|
|
406
|
+
* - Leading form (`/skill:foo bar baz`): name=`foo`, args=`bar baz`.
|
|
407
|
+
* - Mid-prompt form (`fix the bug /skill:foo focus on auth`): name=`foo`,
|
|
408
|
+
* args=`fix the bug focus on auth` — the surrounding prose collapsed
|
|
409
|
+
* into a single args string.
|
|
410
|
+
*
|
|
411
|
+
* Mid-prompt detection is disabled when the draft itself starts with a
|
|
412
|
+
* different slash command (e.g. `/compact /skill:foo`) or a local-execution
|
|
413
|
+
* sigil — `!cmd` / `!!cmd` for the bash tool and `$ cmd` / `$$ cmd` for the
|
|
414
|
+
* python tool. Those handlers run after the skill-command dispatcher and
|
|
415
|
+
* their bodies routinely contain `/skill:<name>` references that are not
|
|
416
|
+
* meant as skill invocations.
|
|
417
|
+
*/
|
|
418
|
+
export function parseSkillInvocation(text: string): ParsedSkillInvocation | undefined {
|
|
419
|
+
const trimmedStart = text.trimStart();
|
|
420
|
+
if (trimmedStart.startsWith("/skill:")) {
|
|
421
|
+
const spaceIndex = trimmedStart.indexOf(" ");
|
|
422
|
+
const name =
|
|
423
|
+
spaceIndex === -1 ? trimmedStart.slice("/skill:".length) : trimmedStart.slice("/skill:".length, spaceIndex);
|
|
424
|
+
if (!name) return undefined;
|
|
425
|
+
const args = spaceIndex === -1 ? "" : trimmedStart.slice(spaceIndex + 1).trim();
|
|
426
|
+
return { name, args };
|
|
427
|
+
}
|
|
428
|
+
if (trimmedStart.startsWith("/")) return undefined;
|
|
429
|
+
if (startsWithLocalExecutionPrefix(trimmedStart)) return undefined;
|
|
430
|
+
const match = MID_PROMPT_SKILL_RE.exec(text);
|
|
431
|
+
if (!match) return undefined;
|
|
432
|
+
const leading = match[1] ?? "";
|
|
433
|
+
const trailing = match[3] ?? "";
|
|
434
|
+
const tokenStart = match.index + leading.length;
|
|
435
|
+
const tokenEnd = match.index + match[0].length - trailing.length;
|
|
436
|
+
const name = match[2] ?? "";
|
|
437
|
+
if (!name) return undefined;
|
|
438
|
+
const before = text.slice(0, tokenStart).trimEnd();
|
|
439
|
+
const after = text.slice(tokenEnd).trimStart();
|
|
440
|
+
const args = [before, after]
|
|
441
|
+
.filter(part => part.length > 0)
|
|
442
|
+
.join(" ")
|
|
443
|
+
.trim();
|
|
444
|
+
return { name, args };
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Whether the (already left-trimmed) draft begins with a TUI local-execution
|
|
449
|
+
* sigil that downstream branches will consume verbatim — `!`/`!!` for the bash
|
|
450
|
+
* tool and `$`/`$$` followed by ASCII whitespace for the python tool. Mirrors
|
|
451
|
+
* `pythonCommandPrefixLength` in `modes/controllers/input-controller` so the
|
|
452
|
+
* two checks agree without forcing a circular import.
|
|
453
|
+
*/
|
|
454
|
+
function startsWithLocalExecutionPrefix(trimmedStart: string): boolean {
|
|
455
|
+
if (trimmedStart.startsWith("!")) return true;
|
|
456
|
+
if (trimmedStart.charCodeAt(0) !== 36 /* $ */) return false;
|
|
457
|
+
if (trimmedStart.charCodeAt(1) === 123 /* { */) return false;
|
|
458
|
+
const sigilLength = trimmedStart.charCodeAt(1) === 36 /* $ */ ? 2 : 1;
|
|
459
|
+
const next = trimmedStart.charCodeAt(sigilLength);
|
|
460
|
+
if (Number.isNaN(next)) return true;
|
|
461
|
+
return next === 32 /* space */ || next === 9 /* tab */ || next === 10 /* LF */ || next === 13 /* CR */;
|
|
462
|
+
}
|
|
463
|
+
|
|
387
464
|
export async function buildSkillPromptMessage(
|
|
388
465
|
skill: Pick<Skill, "name" | "filePath">,
|
|
389
466
|
args: string,
|