@gaia-ai/plugin-opencode 0.5.4
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/LICENSE +21 -0
- package/README.md +5 -0
- package/dist/src/index.d.ts +15 -0
- package/dist/src/index.js +42 -0
- package/package.json +24 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 keytec GmbH
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type AgentFootprint, type AgentPlugin, type GaiaAgent } from '@gaia-ai/core';
|
|
2
|
+
export interface OpencodeAgentOptions {
|
|
3
|
+
model?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class OpencodeAgent implements GaiaAgent {
|
|
6
|
+
private readonly options;
|
|
7
|
+
readonly id = "opencode";
|
|
8
|
+
constructor(options: OpencodeAgentOptions);
|
|
9
|
+
launchCommand(prompt: string): string;
|
|
10
|
+
getRunLog(): Promise<string>;
|
|
11
|
+
parseFootprint(_log: string): AgentFootprint;
|
|
12
|
+
}
|
|
13
|
+
/** Config-facing factory: `opencodeAgent({ model: 'provider/model' })`. */
|
|
14
|
+
export declare function opencodeAgent(options?: OpencodeAgentOptions): AgentPlugin;
|
|
15
|
+
export default opencodeAgent;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { emptyAgentFootprint, shellQuote, } from '@gaia-ai/core';
|
|
2
|
+
export class OpencodeAgent {
|
|
3
|
+
options;
|
|
4
|
+
id = 'opencode';
|
|
5
|
+
constructor(options) {
|
|
6
|
+
this.options = options;
|
|
7
|
+
}
|
|
8
|
+
launchCommand(prompt) {
|
|
9
|
+
if (prompt === '') {
|
|
10
|
+
return 'opencode';
|
|
11
|
+
}
|
|
12
|
+
// Interactive TUI with the initial prompt — mirrors the claude plugin
|
|
13
|
+
// (`claude '<prompt>' … --dangerously-skip-permissions`). `opencode run`
|
|
14
|
+
// would be the non-interactive print mode, which leaves the herdr pane
|
|
15
|
+
// without an attachable session.
|
|
16
|
+
const parts = ['opencode', '--prompt', shellQuote(prompt)];
|
|
17
|
+
if (this.options.model) {
|
|
18
|
+
parts.push('--model', this.options.model);
|
|
19
|
+
}
|
|
20
|
+
parts.push('--auto');
|
|
21
|
+
return parts.join(' ');
|
|
22
|
+
}
|
|
23
|
+
async getRunLog() {
|
|
24
|
+
return '';
|
|
25
|
+
}
|
|
26
|
+
parseFootprint(_log) {
|
|
27
|
+
return emptyAgentFootprint();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** Config-facing factory: `opencodeAgent({ model: 'provider/model' })`. */
|
|
31
|
+
export function opencodeAgent(options = {}) {
|
|
32
|
+
const agent = new OpencodeAgent(options);
|
|
33
|
+
return {
|
|
34
|
+
kind: 'agent',
|
|
35
|
+
id: 'opencode',
|
|
36
|
+
requiredModules: [],
|
|
37
|
+
async createAgent() {
|
|
38
|
+
return agent;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export default opencodeAgent;
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gaia-ai/plugin-opencode",
|
|
3
|
+
"version": "0.5.4",
|
|
4
|
+
"description": "GAIA agent plugin for the OpenCode CLI.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./dist/src/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/src"
|
|
12
|
+
],
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://git.key-tec.de/keytec/gaia.git",
|
|
19
|
+
"directory": "conductor/plugins/opencode"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"@gaia-ai/core": "^0.5.4"
|
|
23
|
+
}
|
|
24
|
+
}
|