Commit Graph
114 Commits
Author SHA1 Message Date
Patrick Wozniak 634beb8378 fix(deps): bump protobufjs to 7.6.5
Resolve GHSA-j3f2-48v5-ccww so npm audit --audit-level=moderate passes in CI.
2026-08-02 10:31:24 +02:00
Patrick Wozniak b1a60da6b4 fix(models): store cache in agent directory
Resolve the Command Code model cache through the host's getAgentDir helper so pi, OMP, and PI_CODING_AGENT_DIR use their own agent state directory instead of the official Command Code client directory.
2026-08-02 01:37:34 +02:00
Patrick Wozniak 070ef3c07a fix(models): cache catalog for offline startup
Persist the last valid Command Code model catalog and use it when live model discovery fails. Keep first-time offline startup non-fatal, surface clear warnings, and cover cached model selection with unit and pi integration regression tests.
2026-08-02 01:16:39 +02:00
K2 811f908918 fix: allow extension to load when offline
The model fetch at startup throws and blocks pi from starting when
there's no network. Catch the error and register the provider with
an empty model list instead.
2026-07-23 11:19:04 +01:00
Patrick WozniakandGitHub 64d538a910 chore(release): publish 0.4.2
Release pi-commandcode-provider 0.4.2.
2026-07-05 03:13:30 +02:00
Patrick WozniakandGitHub e123e84116 fix(omp): avoid unsupported calculateCost import
Fix OMP installation by removing the unsupported calculateCost runtime import from pi-ai.
2026-07-05 03:10:02 +02:00
Patrick WozniakandGitHub 0f6fc17816 docs(release): document deployment process
Add a release/deployment skill and record contributors in the 0.4.1 changelog.
2026-06-16 16:35:25 +02:00
Patrick WozniakandGitHub c602e00da5 chore(release): publish 0.4.1
Bump package version to 0.4.1 and update the changelog.
2026-06-16 16:19:35 +02:00
PlumJamandGitHub 88d8706234 fix: resolve deprecation warning for apiKey value
Use the explicit $COMMANDCODE_API_KEY environment variable reference expected by newer pi versions while keeping compatibility with the legacy placeholder handling.
2026-06-16 14:08:11 +02:00
Patrick WozniakandGitHub f06982fc94 fix(deps): resolve npm audit findings
Update tsx and refresh the protobufjs lockfile entry to clear npm audit findings.
2026-06-16 14:02:46 +02:00
Patrick WozniakandGitHub a35c2b1e83 ci(release): remove publish workflow 2026-06-02 10:59:56 +02:00
Patrick WozniakandGitHub 6aac2bdbcf chore(release): publish 0.4.0 2026-06-02 10:44:39 +02:00
Patrick WozniakandGitHub 6b05595cf3 feat(core): add retry for transient HTTP and stream-level errors 2026-06-02 10:33:46 +02:00
Patrick Wozniak 221677b5ba fix(core): report retry timeouts clearly 2026-06-02 10:30:32 +02:00
Patrick Wozniak e760a760fe ci(gitleaks): allow test fixture files 2026-06-02 10:23:54 +02:00
jizhejiang 57bcdc7396 fix(core): address PR review on retry defaults and timeouts
Align provider maxRetries default with pi (0), treat maxRetryDelayMs 0 as
no cap, keep per-attempt timeout through stream reads, and fix gitleaks
test fixtures.
2026-06-02 16:15:19 +08:00
jizhejiang c3107dbc1c feat(core): add retry for transient HTTP and stream-level errors
Add retry mechanism driven by pi settings.json retry.provider config
(timeoutMs, maxRetries, maxRetryDelayMs).

HTTP-level retries handle 429/5xx with exponential backoff and jitter,
respecting Retry-After headers (seconds and HTTP-date formats).

Stream-level retries handle cases where the API returns 200 OK but
sends an error event in the stream body. Retries only when no content
has been emitted yet.

Per-attempt timeout via AbortController with automatic retry. Clean
abort propagation through the retry loop.
2026-06-02 11:38:10 +08:00
Patrick WozniakandGitHub f48291f252 chore(release): publish 0.3.1 (#11)
* chore(release): publish 0.3.1

* docs(release): document branch-protected PR workflow
2026-05-29 00:20:16 +02:00
Patrick WozniakandGitHub 21d712a1cc ci: harden PR security pipeline (#10)
Add comprehensive security scanning to CI/CD pipeline including CodeQL, Gitleaks, Semgrep custom rules, dependency review, and lifecycle script checks
2026-05-28 23:58:50 +02:00
Patrick Wozniak 17175abd28 Bump CLI version header to 0.29.0 for API parity 2026-05-28 22:50:54 +02:00
Patrick Wozniak 41fb9486af Release 0.3.0 2026-05-28 22:31:09 +02:00
Patrick WozniakandGitHub f31f763f35 Merge pull request #7 from skyscribe-yf/main
feat(stream,models): incremental reasoning streaming + live display pricing
2026-05-28 22:29:12 +02:00
Patrick Wozniak fe49146892 Merge remote-tracking branch 'origin/main' into fix/pr-7-review
# Conflicts:
#	index.ts
#	package.json
#	tests/test-pi-local.mjs
2026-05-28 22:07:51 +02:00
Patrick Wozniak 27abe72faa docs(readme): fix pricing test file reference
README pointed to tests/test-models.ts but pricing assertions live in
tests/test-pricing.ts.
2026-05-28 22:05:25 +02:00
Patrick Wozniak 5a62f60049 fix(models): correct DeepSeek V4 Flash cache rate, add xiaomi models
DeepSeek V4 Flash cache-read rate was /bin/bash.01/1M but docs list ~/bin/bash.028.
Added xiaomi/mimo-v2.5-pro and xiaomi/mimo-v2.5 to MODEL_COSTS so they
don't display as zero-cost models (pricing TBD, currently set to 0).
2026-05-28 22:05:20 +02:00
Patrick Wozniak 3caa4111e1 fix(models): correct DeepSeek V4 Pro discount as permanent
The Command Code docs state the 4x usage deal for DeepSeek V4 Pro is
permanent with no expiry date, not time-limited through May 31, 2026.
2026-05-28 22:05:08 +02:00
Patrick Wozniak 3fba807abf fix(stream): close thinking block before text or tool output
If upstream omits reasoning-end and starts emitting text-delta or
tool-call events, the thinking block remained open causing
thinking_start -> thinking_delta -> text_start -> ... -> thinking_end
ordering. Now endThinking() is called at the start of text-delta and
tool-call handlers so thinking_end always precedes text_start or
toolcall_start.

Adds 2 regression tests for the missing reasoning-end edge case.
2026-05-28 22:05:01 +02:00
Patrick WozniakandGitHub 98ee522fe6 Merge pull request #9 from AlexVagrant/main
feat: add OMP (Oh My Pi) provider compatibility
2026-05-28 22:00:28 +02:00
Fei Yan 52ed72aa37 perf(deps): move pi-coding-agent to optional peerDependencies
Reduces node_modules from 312MB to 154MB. The import is type-only
(import type { ExtensionAPI }) so the 163MB package was installed
but never executed at runtime. End users get the lean install;
contributors still get it via devDependencies during development.
2026-05-28 21:49:11 +08:00
wh.huajieyu e78875f532 refactor: clean up code formatting and update package dependencies
- Removed unnecessary blank lines and improved formatting for better readability in index.ts and converters.ts.
- Updated package-lock.json to downgrade several dependencies for compatibility, including @protobufjs/eventemitter, @protobufjs/fetch, and others.
- Enhanced error message in core.ts to clarify configuration options for the Command Code API key.
- Added a test to ensure the correct handling of environment variable values in test-stream.ts.
2026-05-28 06:23:28 -04:00
AlexVagrantandwh.huajieyu c2497ed098 feat: add OMP (Oh My Pi) provider compatibility
Support OMP as a host alongside pi:
- Convert OMP's array-format system prompts to string via systemPromptToText
- Guard against OMP passing the literal env-var name as the API key value
- Add ~/.omp/agent/auth.json to default auth path lookup
- Fix --list-models output to check both stdout and stderr
- Add OMP compatibility smoke test with isolated temp HOME and mock server
- Deduplicate usage section in README, add OMP install and usage docs
2026-05-28 04:12:35 -04:00
Fei Yan 96c452eefd chore: upgrade pi dependencies from @mariozechner 0.72.0 to @earendil-works 0.75.5
pi 0.75.5 renamed the npm namespace from @mariozechner/ to @earendil-works/.
Importing from the old namespace causes 'fetch failed' errors at startup.

Changes:
- index.ts: @mariozechner/pi-ai → @earendil-works/pi-ai
- index.ts: @mariozechner/pi-coding-agent → @earendil-works/pi-coding-agent
- package.json: bump deps from 0.72.0 to 0.75.5
- package-lock.json: regenerated with new packages (242 deps)
- tsc --noEmit: zero errors
2026-05-27 19:48:55 +08:00
Fei Yan 93864879b2 docs: add 0.2.0 changelog entry and pricing section to README
Document the incremental reasoning-delta streaming, live display pricing,
and dynamic model fetch in CHANGELOG.md. Add a Pricing section to
README.md explaining the MODEL_COSTS overlay and how to update prices.
2026-05-27 07:32:50 +08:00
Fei Yan e8f7410a0a test(pricing): verify MODEL_COSTS entries and promotional notes
Add tests/test-pricing.ts to assert that known models have non-zero
pricing, promotional deals are documented in comments, and Claude models
include cache pricing. Fix test-pi-local to match against combined
stdout+stderr since pi may output model listing to either stream.
2026-05-27 07:32:50 +08:00
Fei Yan 567e1e28a4 feat(models): add live display pricing for known Command Code models
The Provider API does not expose pricing yet. Overlay a static MODEL_COSTS
map on top of the dynamically fetched model list so pi can display per-model
costs. Models not in the table fall back to zero cost. When the Provider API
adds a cost field, the static table can be removed.
2026-05-27 07:32:50 +08:00
Fei Yan 0d96bf507a docs(changelog): add 0.2.0 entry and pricing section to README
Document the incremental reasoning-delta streaming, live display pricing,
and dynamic model fetch in CHANGELOG.md. Add a Pricing section to
README.md explaining the MODEL_COSTS overlay and how to update prices.
2026-05-27 07:32:43 +08:00
Patrick Wozniak b850558199 docs(contributing): add contribution and release guides 2026-05-26 23:26:52 +02:00
Patrick Wozniak cc05faa526 Release 0.1.1 2026-05-26 23:05:21 +02:00
Patrick WozniakandGitHub 5d4277876b Merge pull request #4 from ninehills/main
Update Command Code model discovery.

Closes #3.
2026-05-26 21:52:58 +02:00
Patrick Wozniak 5714e3863a Test dynamic Command Code model discovery 2026-05-26 21:51:54 +02:00
Patrick Wozniak 418f4c925b Fetch Command Code models at startup 2026-05-26 21:51:41 +02:00
Tao Yang 960d0d1f23 feat: extract models from command-code dist, load via models.json
- Add scripts/extract-models.ts to parse command-code npm dist file
- Generate models.json (21 models, 15 pricing entries) with contextWindow
  and maxOutputTokens pre-filled; no nulls or hardcoded fallbacks in index.ts
- Rewrite index.ts to load model list and costs from models.json
- Cap gateway model maxOutputTokens at 65536 (API limit for Baseten/Vercel)
- Add 'Update models' section to README documenting the generation flow
- Add npm run extract-models script
2026-05-25 16:37:08 +08:00
Patrick WozniakandGitHub b5b109c63c Update README.md 2026-05-05 14:58:48 +02:00
Patrick Wozniak b8853ab0d6 Add Command Code browser login fallback 2026-05-05 14:48:06 +02:00
Patrick Wozniak af2b316d84 style: configure prettier (no semicolons, trailing commas) 2026-05-05 14:02:41 +02:00
Patrick Wozniak e9853eb4a4 chore: add CI workflow (typecheck + prettier format check), tsconfig, and prettier formatting 2026-05-05 13:56:41 +02:00
Patrick Wozniak be6d17ea56 docs: add disclaimer, 4x DeepSeek V4 offer, and DeepSeek V4 model 2026-05-05 13:40:04 +02:00
Patrick Wozniak 66c695bfff fix: include src/ in npm publish files 2026-05-05 13:31:06 +02:00
Patrick Wozniak e283cd0677 chore: add README, LICENSE, publish workflow, and npm metadata for pi.dev/packages 2026-05-05 13:29:46 +02:00
Patrick Wozniak 3630b85298 Add pi CLI coverage with DeepSeek 2026-05-05 13:22:15 +02:00