@bakers-build/addon-kimi 0.0.0-stage → 0.1.0-next.38

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 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 CHANGED
@@ -1,3 +1,5 @@
1
- # Temporary Holding Version
1
+ # @bakers-build/addon-kimi
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ bakers.build agent plugin for the Kimi Code CLI.
4
+
5
+ Part of the bakers.build CLI. Install the meta package `@bakers-build/bakers` to get the `bakers` CLI with all addons. Source: https://git.key-tec.de/bakers-build/bakers-build (bakers-cli/).
@@ -0,0 +1,20 @@
1
+ import { type AgentFootprint, type AgentPlugin, type AgentRunIdentity, type BbAgent } from '@bakers-build/conductor/contract';
2
+ export interface KimiAgentOptions {
3
+ model?: string;
4
+ effort?: string;
5
+ args?: string[];
6
+ }
7
+ export declare class KimiAgent implements BbAgent {
8
+ readonly id = "kimi";
9
+ readonly launchWarnings?: readonly string[];
10
+ private readonly args;
11
+ private readonly model;
12
+ private readonly overrides;
13
+ constructor(options?: KimiAgentOptions);
14
+ launchCommand(prompt: string, _run?: AgentRunIdentity): string;
15
+ getRunLog(_worktreePath: string, _run?: AgentRunIdentity): Promise<string>;
16
+ parseFootprint(_log: string): AgentFootprint;
17
+ }
18
+ /** Config-facing factory: `kimiAgent({ model: 'moonshot-v1' })`. */
19
+ export declare function kimiAgent(options?: KimiAgentOptions): AgentPlugin;
20
+ export default kimiAgent;
@@ -0,0 +1,61 @@
1
+ import { emptyAgentFootprint, resolveAgentCliOptions, } from '@bakers-build/conductor/contract';
2
+ import { shellQuote } from '@bakers-build/core';
3
+ const KIMI_RESERVED = ['-p', '--prompt', '--output-format'];
4
+ const KIMI_KNOWN = [
5
+ { kind: 'model', flags: ['--model', '-m'] },
6
+ ];
7
+ export class KimiAgent {
8
+ id = 'kimi';
9
+ launchWarnings;
10
+ args;
11
+ model;
12
+ overrides;
13
+ constructor(options = {}) {
14
+ const cli = resolveAgentCliOptions(options, KIMI_RESERVED, KIMI_KNOWN);
15
+ this.args = cli.args;
16
+ this.model = cli.model;
17
+ this.overrides = cli.overrides;
18
+ if (cli.effort !== undefined) {
19
+ this.launchWarnings = ['effort is unsupported and ignored'];
20
+ }
21
+ }
22
+ launchCommand(prompt, _run) {
23
+ if (prompt === '') {
24
+ return 'kimi';
25
+ }
26
+ const parts = ['kimi', '-p', shellQuote(prompt)];
27
+ if (this.model !== undefined && !this.overrides.model) {
28
+ parts.push('--model', shellQuote(this.model));
29
+ }
30
+ parts.push('--output-format', 'text');
31
+ parts.push(...this.args.map(shellQuote));
32
+ return parts.join(' ');
33
+ }
34
+ // Unconverted (BB-473): this addon has no run-log reader at all yet —
35
+ // getRunLog always returns '' regardless of input, so there is nothing a
36
+ // run identity could select between. The `run` param is accepted only for
37
+ // structural compatibility with the widened `BbAgent` interface. No test
38
+ // is added for this method per the ticket (no reader to select from).
39
+ async getRunLog(_worktreePath, _run) {
40
+ return '';
41
+ }
42
+ parseFootprint(_log) {
43
+ // Kimi transcript footprint parsing is not implemented yet (getRunLog
44
+ // returns '' too); an empty footprint is the honest result until it is.
45
+ return emptyAgentFootprint();
46
+ }
47
+ }
48
+ /** Config-facing factory: `kimiAgent({ model: 'moonshot-v1' })`. */
49
+ export function kimiAgent(options = {}) {
50
+ const agent = new KimiAgent(options);
51
+ return {
52
+ kind: 'agent',
53
+ id: 'kimi',
54
+ requiredModules: [],
55
+ async createAgent() {
56
+ return agent;
57
+ },
58
+ };
59
+ }
60
+ // Default export lets config auto-pick this factory without `export:`.
61
+ export default kimiAgent;
@@ -0,0 +1,4 @@
1
+ import type { Preset } from '@bakers-build/conductor/contract';
2
+ import { type KimiAgentOptions } from './index.js';
3
+ export declare const agents: Preset<Partial<KimiAgentOptions> | undefined>['agents'];
4
+ export declare const scopes: Preset['scopes'];
@@ -0,0 +1,15 @@
1
+ import kimiAgent from './index.js';
2
+ export const agents = (acc, opts) => {
3
+ const model = opts?.model;
4
+ return [
5
+ ...acc,
6
+ {
7
+ alias: 'kimi',
8
+ description: 'General coding with the locally configured Kimi model.',
9
+ ...(model !== undefined ? { model } : {}),
10
+ agent: kimiAgent(opts),
11
+ },
12
+ ];
13
+ };
14
+ // Agents are per machine: list this addon in ~/.bakers/machine.config.js addons[].
15
+ export const scopes = ['machine'];
package/package.json CHANGED
@@ -1,6 +1,26 @@
1
1
  {
2
2
  "name": "@bakers-build/addon-kimi",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0-next.38",
4
+ "description": "bakers.build agent plugin for the Kimi Code CLI.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "exports": {
8
+ ".": "./dist/src/index.js",
9
+ "./preset": "./dist/src/preset.js"
10
+ },
11
+ "files": [
12
+ "dist/src"
13
+ ],
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://git.key-tec.de/bakers-build/bakers-build.git",
20
+ "directory": "bakers-cli/addons/kimi"
21
+ },
22
+ "peerDependencies": {
23
+ "@bakers-build/conductor": "^0.1.0-next.38",
24
+ "@bakers-build/core": "^0.1.0-next.38"
25
+ }
26
+ }