mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-19 18:04:41 +00:00
refactor: convert custom-provider example to package with deps
- Move custom-provider.ts to custom-provider/index.ts - Add package.json with @anthropic-ai/sdk dependency - Extension now requires npm install before use
This commit is contained in:
parent
d4bd1a956b
commit
6aad6e30ce
4 changed files with 49 additions and 2 deletions
1
packages/coding-agent/examples/extensions/custom-provider/.gitignore
vendored
Normal file
1
packages/coding-agent/examples/extensions/custom-provider/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
node_modules/
|
||||||
|
|
@ -9,11 +9,14 @@
|
||||||
* - Two model definitions
|
* - Two model definitions
|
||||||
*
|
*
|
||||||
* Usage:
|
* Usage:
|
||||||
|
* # First install dependencies
|
||||||
|
* cd packages/coding-agent/examples/extensions/custom-provider && npm install
|
||||||
|
*
|
||||||
* # With OAuth (run /login custom-anthropic first)
|
* # With OAuth (run /login custom-anthropic first)
|
||||||
* pi -e ./custom-provider.ts
|
* pi -e ./packages/coding-agent/examples/extensions/custom-provider
|
||||||
*
|
*
|
||||||
* # With API key
|
* # With API key
|
||||||
* CUSTOM_ANTHROPIC_API_KEY=sk-ant-... pi -e ./custom-provider.ts
|
* CUSTOM_ANTHROPIC_API_KEY=sk-ant-... pi -e ./packages/coding-agent/examples/extensions/custom-provider
|
||||||
*
|
*
|
||||||
* Then use /model to select custom-anthropic/claude-sonnet-4-5
|
* Then use /model to select custom-anthropic/claude-sonnet-4-5
|
||||||
*/
|
*/
|
||||||
24
packages/coding-agent/examples/extensions/custom-provider/package-lock.json
generated
Normal file
24
packages/coding-agent/examples/extensions/custom-provider/package-lock.json
generated
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"name": "pi-extension-custom-provider",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "pi-extension-custom-provider",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"dependencies": {
|
||||||
|
"@anthropic-ai/sdk": "^0.52.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@anthropic-ai/sdk": {
|
||||||
|
"version": "0.52.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.52.0.tgz",
|
||||||
|
"integrity": "sha512-d4c+fg+xy9e46c8+YnrrgIQR45CZlAi7PwdzIfDXDM6ACxEZli1/fxhURsq30ZpMZy6LvSkr41jGq5aF5TD7rQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"bin": {
|
||||||
|
"anthropic-ai-sdk": "bin/cli"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"name": "pi-extension-custom-provider",
|
||||||
|
"private": true,
|
||||||
|
"version": "1.0.0",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"clean": "echo 'nothing to clean'",
|
||||||
|
"build": "echo 'nothing to build'",
|
||||||
|
"check": "echo 'nothing to check'"
|
||||||
|
},
|
||||||
|
"pi": {
|
||||||
|
"extensions": [
|
||||||
|
"./index.ts"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@anthropic-ai/sdk": "^0.52.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue