29 Commits

Author SHA1 Message Date
can1357 e9888367d1 refactor: migrated packages to internal utility modules and removed external dependencies
- Implemented in-house, zero-dependency utility modules in `pi-utils` covering DOM manipulation, markdown parsing, templating, browser automation helpers, and terminal buffers.
- Migrated packages across the repository to consume the new internal utilities and `omptype` schema validators instead of external dependencies.
- Removed multiple external runtime and development dependencies including Zod, Marked, LRU cache, Turndown, and Puppeteer browser packages.
2026-08-05 13:39:09 +02:00
can1357 1a8caad23e chore: update docs + rename reset to clear 2026-08-03 18:37:23 +02:00
can1357 ebd5e3f86f chore: update stale docs 2026-08-03 16:39:23 +02:00
can1357 0e556ee32a docs(marketplace): document plugin mcpServers manifest pointer and correct stale extensions note 2026-07-28 10:59:35 +02:00
Larry Gordon ed457a9d4f feat(extensions): let tool_call handlers revise tool input
A `tool_call` handler (extension or hook) could previously only block a
tool. It can now also return `input` to replace the arguments the tool
executes with, so a handler can normalize or rewrite a built-in's input
without reimplementing the tool.

The returned object is the raw execution input passed to the tool's
`execute` (the handler owns its correctness), not the normalized
`event.input` view, which may carry derived gate-only fields (e.g.
hashline `edit` `path`/`paths`) that are not real parameters. It is
ignored when `block` is set, and not applied to `computer` tool calls
whose event input is a synthetic actions view rather than the real
params. When multiple handlers set `input`, the last one wins.

Honored in both the extension and hook tool wrappers; documented in
docs/extensions.md, docs/hooks.md, and docs/skills/authoring-hooks.md.
2026-07-25 23:16:04 -07:00
roboomp 8a61515819 fix(extensions): isolated self-scheduled callbacks from killing the session
Extension-scheduled setInterval/setTimeout/detached callbacks ran outside
the handler-dispatch try/catch, so a throw surfaced as a process-level
uncaughtException and the global postmortem handler tore down the whole
session instead of isolating the misbehaving extension.

- Added ManagedTimers backing sanctioned ctx.setInterval/setTimeout/clearTimer:
  callbacks run with handler-dispatch isolation (throw/rejection logged and
  routed through onError), handles are unref'd, and all are cleared on
  session_shutdown.
- Wired the helpers into ExtensionRunner.createContext and the runner-less
  command-context fallback; onSession now inherits the runner context.
- Documented in-process no-isolation behavior and the managed timers in
  docs/extensions.md and docs/skills/authoring-extensions.md.

Fixes #5664
2026-07-16 07:17:10 +00:00
can1357 5c9fe0bfa0 Merge PR #2134: fix(coding-agent): submit /agents create form and hook editor on Ctrl+Q (@roboomp) 2026-06-21 17:06:15 +02:00
ben c93774f892 fix(coding-agent): implement session stop hook semantics 2026-06-17 12:26:52 +02:00
ben b7ac4b4c43 fix(coding-agent): use session stop extension event 2026-06-17 12:26:01 +02:00
ben 8e45ed9016 fix(coding-agent): add subagent stop extension event 2026-06-17 12:26:00 +02:00
can1357 d5b3c78132 chore: update docs 2026-06-17 04:37:39 +02:00
can1357 15184332b8 Merge PR #1173: feat(marketplace): prefer .omp-plugin/marketplace.json catalog path 2026-06-15 19:46:14 +02:00
can1357 371846167b docs: update docs 2026-06-12 14:43:35 +02:00
can1357 08a941a14e feat: added standalone snapcompact package and model-specific frame shaping
- Added a new @oh-my-pi/snapcompact package and redirected compaction call sites to it.
- Added provider-aware snapcompact shape resolution for model-specific mixed-frame behavior.
- Added optional image detail support by extending ImageContent and passing hints through OpenAI providers.
- Added native snapcompact render options, including 5x8/8x8 font loading and palette/geometry controls.
2026-06-10 21:50:03 +02:00
roboomp b91b6aa0da fix(coding-agent): submit /agents create form and hook editor on Ctrl+Q
Windows Terminal does not deliver a distinct Ctrl+Enter event, so the agent
dashboard's new-agent description form (`AgentDashboard#handleInput` in
the `createInput` branch) and the hook editor's hook-style mode
(`HookEditorComponent#handleHookStyleInput`) could not be submitted: both
branches only matched Ctrl+Enter encodings, and the user-reported Ctrl+Enter
press registers as plain \r — same as Enter — so it fell straight through to
the newline branch. Fix #1903 already added Ctrl+Q as the Windows-friendly
default for `app.message.followUp`, but the create form and hook editor
hardcoded their own Ctrl+Enter check that bypassed that keybinding.

Routes both submit checks through a new `matchesAppFollowUp` helper that
delegates to `app.message.followUp`, falling back to a Ctrl+Q/Ctrl+Enter
literal match for component tests that don't install the app keybindings
manager. Updated hint text in both components to surface Ctrl+Q alongside
Ctrl+Enter. Added regression tests asserting Ctrl+Q submits after typing a
multi-line description (the exact Windows Terminal scenario).

Fixes #2118
2026-06-08 20:42:50 +00:00
roboomp 070422bb95 fix(ai): corrected Zhipu API key placeholder
Zhipu Coding Plan keys are formatted '<id>.<secret>' (no 'sk-' prefix),
so the OAuth login prompt's 'sk-...' placeholder misled users into
thinking their pasted key was malformed.

Also extended the SECRET_PATTERNS redaction example in
docs/skills/authoring-hooks.md with the Zhipu shape and a comment noting
the list is not exhaustive, so hook authors referencing the example do
not silently miss Zhipu keys.

Fixes #2106
2026-06-08 11:18:31 +00:00
can1357 40ed8852b5 feat(coding-agent): added app.display.reset bound to Ctrl+L
- Added `TUI.resetDisplay()` to force an immediate full-frame replay including native scrollback.
- Moved the persistent model selector default from Ctrl+L to Alt+M, preserving existing user remaps.
- Reserved Alt+M so extensions cannot shadow the model selector shortcut.
2026-06-06 17:19:57 +02:00
roboomp 590799b0af fix(extensions): reserved ctrl+q so extensions can't shadow the follow-up default
ExtensionRunner#getShortcuts() accepted ctrl+q because #RESERVED_SHORTCUTS
predated the new default, and InputController registers extension
shortcuts before the followUp keybinding, so the editor's custom-key
map silently overwrote the extension handler. Now ctrl+q is reserved
alongside the other built-in chords and the extension authoring docs
list it as such.

Addresses code review on #1905.
2026-06-05 05:34:06 +00:00
David Marshall 2c27d2df15 Merge remote-tracking branch 'origin/main' into feat/marketplace-omp-plugin-path
# Conflicts:
#	docs/marketplace.md
2026-06-03 12:50:46 -05:00
can1357 1dba122c53 chore: updated docs 2026-05-31 04:36:14 +02:00
David Marshall 587f68a899 feat(marketplace): prefer .omp-plugin/marketplace.json catalog path
Adds .omp-plugin/marketplace.json as the preferred catalog location for omp
marketplaces. fetchMarketplace now searches .omp-plugin/marketplace.json
first and falls back to .claude-plugin/marketplace.json so existing
Claude Code-compatible marketplaces keep loading.

Docs and authoring skill updated to reflect the new preferred path.

Co-Authored-By: omp <noreply@oh-my-pi.dev>
2026-05-28 22:03:19 -05:00
SuperHedge 70e873aa8d Fix review custom instructions submission 2026-05-25 20:48:46 +02:00
can1357 2867e1f4e3 feat(deps): added pi.zod exports and removed TypeBox package exports
- Added canonical `pi.zod` schema API exports and removed TypeBox package exports/imports.
- Migrated Tool schema typing from TypeBox to shared `TSchema`/Zod flow with legacy TypeBox compatibility.
- Updated AI provider adapters and MCP/agent builders to convert tool params through `toolWireSchema()`.
- Reworked schema validation from AJV to Zod-safe parsing with `fromTypeBox`, `toolWireSchema`, and meta schema checks.
2026-05-15 14:46:54 +02:00
can1357 9865a4ce6c docs: update docs 2026-04-30 06:47:01 +02:00
can1357 80dac4a6c9 fix(docs): align skill examples with extension APIs 2026-04-23 23:04:19 +02:00
metaphorics b99d7c4186 fix(examples): correct API refs, add pi.sendMessage, self-contained marketplace
- hello-extension/README.md: pi.registerCommand → pi.commands.register
- hello-extension/index.ts: add pi.sendMessage() call in /hello handler
- authoring-extensions.md: remove undefined initialize() reference
- mini-marketplace: replace ../hello-extension with self-contained ./my-plugin
  to satisfy the documented ./ path constraint for relative sources
2026-04-23 22:59:23 +02:00
metaphorics 74b91a9fa4 fix(skills): use pi.commands.register() per DeepWiki API 2026-04-23 22:59:23 +02:00
metaphorics d80fc82eda fix(examples): add @ts-nocheck to example files (no local node_modules) 2026-04-23 22:59:23 +02:00
metaphorics d093dd5b92 docs(skills): add extension/hook/marketplace authoring guides + examples 2026-04-23 22:59:23 +02:00