@signetai/connector-kimi 0.202.3
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/README.md +23 -0
- package/bin/install.js +5 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25593 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @signetai/connector-kimi
|
|
2
|
+
|
|
3
|
+
Signet connector for [Kimi CLI / Kimi Code](https://github.com/MoonshotAI/kimi-cli).
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
- Merges Signet lifecycle hooks into Kimi's `config.toml` as `[[hooks]]` entries (`SessionStart`, `UserPromptSubmit`, `SessionEnd`) — existing user config and hooks are preserved, installs are idempotent.
|
|
8
|
+
- Registers the Signet MCP stdio server in Kimi's `mcp.json` (`mcpServers.signet`).
|
|
9
|
+
- Makes Signet workspace skills available in Kimi's selected home.
|
|
10
|
+
|
|
11
|
+
Current Kimi uses `KIMI_SHARE_DIR` (default `~/.kimi`). Legacy Kimi Code 0.x
|
|
12
|
+
uses `KIMI_CODE_HOME` (default `~/.kimi-code`). The connector prefers explicit
|
|
13
|
+
environment overrides, then an existing current or legacy home.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
signet-connector-kimi install
|
|
19
|
+
signet-connector-kimi status
|
|
20
|
+
signet-connector-kimi uninstall
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Or via the Signet CLI: `signet setup` / `signet connector install kimi`.
|
package/bin/install.js
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signet Connector for Kimi CLI / Kimi Code
|
|
3
|
+
*
|
|
4
|
+
* Integrates Signet's memory system with Kimi's lifecycle hooks.
|
|
5
|
+
*
|
|
6
|
+
* Kimi facts (from the official Kimi Code docs):
|
|
7
|
+
* - Current config home: ~/.kimi/ (env override KIMI_SHARE_DIR).
|
|
8
|
+
* - Legacy Kimi Code 0.x uses ~/.kimi-code/ (env override KIMI_CODE_HOME).
|
|
9
|
+
* - Hooks: [[hooks]] array-of-tables in the selected config.toml.
|
|
10
|
+
* Allowed fields: event (required), matcher (optional regex),
|
|
11
|
+
* command (required), timeout (optional). Extra fields break config load.
|
|
12
|
+
* - Hook payload arrives as JSON on STDIN (snake_case fields).
|
|
13
|
+
* - For UserPromptSubmit, hook STDOUT text is appended to the model context;
|
|
14
|
+
* SessionStart STDOUT is also appended. SessionEnd is observation-only.
|
|
15
|
+
* - MCP servers: JSON file mcp.json in the selected Kimi home, with shape
|
|
16
|
+
* {"mcpServers": {"signet": {"command": ..., "args": [...]}}} for stdio.
|
|
17
|
+
*
|
|
18
|
+
* Usage:
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import { KimiConnector } from '@signetai/connector-kimi';
|
|
21
|
+
*
|
|
22
|
+
* const connector = new KimiConnector();
|
|
23
|
+
* await connector.install('~/.agents');
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
import { BaseConnector, type InstallResult, type UninstallResult } from "@signetai/connector-base";
|
|
27
|
+
export interface KimiMcpStdioConfig {
|
|
28
|
+
readonly command: string;
|
|
29
|
+
readonly args: readonly string[];
|
|
30
|
+
}
|
|
31
|
+
export interface KimiHookEntry {
|
|
32
|
+
readonly event: "SessionStart" | "UserPromptSubmit" | "SessionEnd";
|
|
33
|
+
readonly command: string;
|
|
34
|
+
readonly timeout: number;
|
|
35
|
+
}
|
|
36
|
+
export declare function buildKimiHookEntries(signetArgs: readonly string[], remoteDaemonUrl?: string | null): KimiHookEntry[];
|
|
37
|
+
/** Remove every Signet-owned Kimi [[hooks]] block (and its marker comment)
|
|
38
|
+
* from config.toml content. User-owned hooks and other sections are kept. */
|
|
39
|
+
export declare function removeSignetKimiHookBlocks(content: string): string;
|
|
40
|
+
export declare class KimiConnector extends BaseConnector {
|
|
41
|
+
readonly name = "Kimi";
|
|
42
|
+
readonly harnessId = "kimi";
|
|
43
|
+
protected getKimiHome(): string;
|
|
44
|
+
getConfigPath(): string;
|
|
45
|
+
protected getMcpJsonPath(): string;
|
|
46
|
+
install(basePath: string): Promise<InstallResult>;
|
|
47
|
+
uninstall(): Promise<UninstallResult>;
|
|
48
|
+
isInstalled(): boolean;
|
|
49
|
+
}
|
|
50
|
+
export default KimiConnector;
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAKH,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAmB,MAAM,wBAAwB,CAAC;AAuBlH,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC;AA0ED,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,kBAAkB,GAAG,YAAY,CAAC;IACnE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CACzB;AAmBD,wBAAgB,oBAAoB,CACnC,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,eAAe,GAAE,MAAM,GAAG,IAA+B,GACvD,aAAa,EAAE,CAuBjB;AAwBD;8EAC8E;AAC9E,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA+BlE;AAqFD,qBAAa,aAAc,SAAQ,aAAa;IAC/C,QAAQ,CAAC,IAAI,UAAU;IACvB,QAAQ,CAAC,SAAS,UAAU;IAE5B,SAAS,CAAC,WAAW,IAAI,MAAM;IAa/B,aAAa,IAAI,MAAM;IAIvB,SAAS,CAAC,cAAc,IAAI,MAAM;IAI5B,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IA2CjD,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC;IA0B3C,WAAW,IAAI,OAAO;CActB;AAED,eAAe,aAAa,CAAC"}
|