Commit Graph

15 Commits

  • feat(ai): compat entrypoint, core-only root barrel (phase 5)
    The root barrel is now core-only and side-effect free: types,
    createModels/createProvider, auth substrate, lazyStream/lazyApi, faux,
    utils. Generated catalogs, api-registry, env-api-keys, images, global
    stream functions, and per-API lazy wrappers leave the root.
    
    New @earendil-works/pi-ai/compat preserves the old surface verbatim as
    a strict superset of the root: api-dispatch stream/complete with env
    key injection, the builtin registration side effect (skip-if-present so
    it cannot clobber earlier overrides), deprecated getModel/getModels/
    getProviders aliases of the new getBuiltin* reads in providers/all,
    lazy api wrappers + setBedrockProviderModule, and image generation.
    Compat dies with the coding-agent ModelManager migration.
    
    Packaging: exports map gains ./compat, ./providers/*, ./api/*;
    sideEffects array lists only the effectful modules.
    
    Old-global imports across agent/coding-agent/examples and pi-ai tests
    switch to /compat (path-only; compat is a superset). The coding-agent
    extension loader resolves the pi-ai ROOT specifier to compat, so
    existing user extensions using the old global API keep working at
    runtime until compat is removed. vitest configs alias /compat to src;
    browser smoke imports old globals from /compat.
  • fix(coding-agent): remove process-cwd tool singletons and use tool-name allowlists
    - switch SDK/CLI tool selection to name-based allowlists
    - apply allowlists across built-in, extension, and SDK tools
    - remove ambient process.cwd defaults from core tooling and resource helpers
    - update tests, examples, and TUI callers for explicit cwd plumbing
    - add regression coverage for extension tool filtering
    
    closes #3452
    closes #2835
  • fix(ai,coding-agent): make pi-ai browser-safe and move OAuth runtime exports
    - add browser smoke bundling check to root check + pre-commit
    
    - lazy-load Bedrock provider registration to avoid browser graph traversal
    
    - remove top-level OAuth runtime exports from @mariozechner/pi-ai
    
    - add @mariozechner/pi-ai/oauth subpath export and update coding-agent imports
    
    - move proxy dispatcher init to coding-agent CLI (Node-only)
    
    - document Bedrock/OAuth browser limitations
    
    closes #1814
  • feat(coding-agent): package deduplication and collision detection
    - Package deduplication: same package in global+project, project wins
    - Collision detection for skills, prompts, and themes with ResourceCollision type
    - PathMetadata tracking with parent directory lookup for file paths
    - Display improvements: section headers, sorted groups, accent colors for packages
    - pi list shows full paths below package names
    - Extension loader discovers files in directories without index.ts
    - In-memory SettingsManager properly tracks project settings
    
    fixes #645
  • feat(coding-agent): ResourceLoader, package management, and /reload command (#645)
    - Add ResourceLoader interface and DefaultResourceLoader implementation
    - Add PackageManager for npm/git extension sources with install/remove/update
    - Add session.reload() and session.bindExtensions() APIs
    - Add /reload command in interactive mode
    - Add CLI flags: --skill, --theme, --prompt-template, --no-themes, --no-prompt-templates
    - Add pi install/remove/update commands for extension management
    - Refactor settings.json to use arrays for skills, prompts, themes
    - Remove legacy SkillsSettings source flags and filters
    - Update SDK examples and documentation for ResourceLoader pattern
    - Add theme registration and loadThemeFromPath for dynamic themes
    - Add getShellEnv to include bin dir in PATH for bash commands
  • fix(ai): ensure maxTokens > thinkingBudget for Claude thinking models
    Claude requires max_tokens > thinking.budget_tokens. When caller specifies
    a small maxTokens (e.g. compaction with ~13k tokens) and reasoning is enabled
    with high budget (16k tokens), the constraint was violated.
    
    Fix: In mapOptionsForApi, add thinkingBudget on top of caller's maxTokens
    (capped at model.maxTokens). If still not enough room, reduce thinkingBudget
    to leave space for output.
    
    Applied to both anthropic-messages and google-gemini-cli APIs.
    
    Also adds test utilities for OAuth credential resolution and tests for
    compaction with thinking models.
    
    fixes #413
  • Add tree navigation tests and shared test utilities
    - Add test/utilities.ts with shared helpers (API_KEY, userMsg, assistantMsg, createTestSession)
    - Add agent-session-tree-navigation.test.ts with e2e tests for tree navigation
    - Add getChildren() method to SessionManager
    - Add summaryEntry to navigateTree return type
    - Update existing tests to use shared utilities