@akonwi/kit 0.1.0

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.
@@ -0,0 +1,12 @@
1
+ export type ToastVariant = "error" | "warning" | "info";
2
+
3
+ export type ToastInput = {
4
+ variant: ToastVariant;
5
+ title: string;
6
+ lines: string[];
7
+ persistent?: boolean;
8
+ };
9
+
10
+ export type Toast = ToastInput & {
11
+ id: number;
12
+ };
package/docs/README.md ADDED
@@ -0,0 +1,14 @@
1
+ # Docs
2
+
3
+ This directory contains project documentation for Kit.
4
+
5
+ ## Structure
6
+
7
+ - `adrs/` — architecture and design decision records
8
+ - `features/` — feature-specific behavior, UX, and implementation notes
9
+
10
+ ## Conventions
11
+
12
+ - Put durable architecture and design decisions in `adrs/`.
13
+ - Put user- or feature-facing behavior docs in `features/`.
14
+ - Capture important decisions in docs instead of leaving them only in chat history.
@@ -0,0 +1,70 @@
1
+ # Plugins
2
+
3
+ Kit can load trusted TypeScript plugins that extend the app through the public `PluginAPI` capability surface.
4
+
5
+ ## Locations
6
+
7
+ Kit loads plugins from Kit-specific directories only:
8
+
9
+ 1. user plugins: `~/.kit/plugins/*.ts`
10
+ 2. project plugins: `.kit/plugins/*.ts`
11
+
12
+ Discovery is non-recursive. Only direct `.ts` files in those directories are loaded.
13
+
14
+ Project plugins load after user plugins. Built-in plugins load before both.
15
+
16
+ If an external plugin registers a command, tool, or debug section that already exists, Kit treats that as a plugin failure and reports it with a persistent toast.
17
+
18
+ Kit does **not** load plugins from `.agents/plugins/`. Plugins execute code and are Kit-specific functionality, while `.agents/` is reserved for compatibility-oriented resources such as prompts, skills, and MCP config.
19
+
20
+ ## Trust model
21
+
22
+ Plugins execute local code in the Kit process. Only use plugins from people and projects you trust.
23
+
24
+ A failed user/project plugin does not stop Kit from starting. Kit shows a persistent toast with the plugin file and error. Dismiss it manually after reviewing the failure.
25
+
26
+ ## Writing a plugin
27
+
28
+ A plugin is a TypeScript file with a default function export. Import public SDK types from `@akonwi/kit/plugin`; do not import from Kit source paths such as `src/plugins`.
29
+
30
+ ```ts
31
+ import type { PluginAPI } from "@akonwi/kit/plugin";
32
+
33
+ export default function MyPlugin(kit: PluginAPI) {
34
+ kit.registerCommand(
35
+ "hello-plugin",
36
+ { description: "Show a greeting from a plugin" },
37
+ async (ctx) => {
38
+ ctx.ui.toast({
39
+ title: "Hello plugin",
40
+ lines: ["Loaded from a Kit plugin."],
41
+ variant: "info",
42
+ });
43
+ },
44
+ );
45
+ }
46
+ ```
47
+
48
+ Plugin functions may return a disposer for resources not registered through Kit:
49
+
50
+ ```ts
51
+ import type { PluginAPI } from "@akonwi/kit/plugin";
52
+
53
+ export default function WatchPlugin(kit: PluginAPI) {
54
+ const timer = setInterval(() => {
55
+ kit.logger.log("tick");
56
+ }, 1000);
57
+
58
+ return () => clearInterval(timer);
59
+ }
60
+ ```
61
+
62
+ Registrations made through `kit` are cleaned up automatically on `/reload`.
63
+
64
+ ## Reloading
65
+
66
+ Use `/reload` after editing plugin files. Kit re-discovers plugin files and reloads them with cache busting so changed `.ts` contents are picked up.
67
+
68
+ Plugin modules are loaded synchronously, so top-level `await` is not supported in plugin files. Async command, event, and tool handlers are supported.
69
+
70
+ `@akonwi/kit/plugin` is a type-only SDK surface in v1. Use `import type`; value imports from `@akonwi/kit/plugin` are not part of the public runtime API.
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@akonwi/kit",
3
+ "version": "0.1.0",
4
+ "author": "Akonwi Ngoh <akonwi@gmail.com>",
5
+ "description": "Standalone kit app with Pi-core compatibility and a custom terminal shell.",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/akonwi/kit.git"
11
+ },
12
+ "homepage": "https://github.com/akonwi/kit#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/akonwi/kit/issues"
15
+ },
16
+ "bin": {
17
+ "kit": "dist/kit"
18
+ },
19
+ "exports": {
20
+ "./plugin": {
21
+ "types": "./dist/plugin.d.ts",
22
+ "default": "./dist/plugin.js"
23
+ }
24
+ },
25
+ "typesVersions": {
26
+ "*": {
27
+ "plugin": [
28
+ "dist/plugin.d.ts"
29
+ ]
30
+ }
31
+ },
32
+ "files": [
33
+ "dist/",
34
+ "docs/features/plugins.md",
35
+ "README.md"
36
+ ],
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "scripts": {
41
+ "check": "biome check --write .",
42
+ "lint:staged": "biome check --write --staged --unsafe .",
43
+ "dev": "bun --preload=@opentui/solid/preload src/app/main.tsx",
44
+ "start": "bun --preload=@opentui/solid/preload src/app/main.tsx",
45
+ "build": "bun run script/build.ts",
46
+ "pack:dry": "npm pack --dry-run",
47
+ "prepack": "bun run build",
48
+ "prepublishOnly": "bun run typecheck && bun test",
49
+ "test": "bun test",
50
+ "typecheck": "tsc --noEmit"
51
+ },
52
+ "dependencies": {
53
+ "@mariozechner/pi-agent-core": "^0.73.0",
54
+ "@mariozechner/pi-ai": "^0.73.0",
55
+ "@modelcontextprotocol/sdk": "^1.29.0",
56
+ "@opentui/core": "0.2.2",
57
+ "@opentui/solid": "0.2.2",
58
+ "@pierre/diffs": "^1.1.16",
59
+ "glob": "^10.5.0",
60
+ "ignore": "^7.0.5",
61
+ "solid-js": "1.9.12",
62
+ "web-tree-sitter": "0.25.10",
63
+ "yaml": "^2.8.3"
64
+ },
65
+ "devDependencies": {
66
+ "@types/bun": "latest",
67
+ "typescript": "^5.9.0"
68
+ },
69
+ "engines": {
70
+ "bun": ">=1.3.0"
71
+ }
72
+ }