@kkcode-app/agent 1.1.0 → 1.1.1

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 CHANGED
@@ -115,10 +115,11 @@ OpenCode 1 or 2, and incrementally registers the matching plugin entry in the
115
115
  global `opencode.json(c)`. Existing JSONC comments and unrelated plugins are
116
116
  preserved. Restart OpenCode after first-time registration.
117
117
 
118
- The npm package contains two native plugin entrypoints: OpenCode 1 resolves
119
- `./server`, while OpenCode 2 loads the default `{ id, setup }` entrypoint. Both
120
- map runtime events to the same five KKCode notification types, so the phone and
121
- Go notification service do not need version-specific configuration.
118
+ The npm package exposes one shared entrypoint (`""`, `./plugin` and `./server`
119
+ all resolve to the same file). Its default export carries both shapes:
120
+ OpenCode 1 loads `server()`, OpenCode 2 loads `setup`. Both map runtime events
121
+ to the same five KKCode notification types, so the phone and Go notification
122
+ service do not need version-specific configuration.
122
123
 
123
124
  ## How it works
124
125
 
package/dist/entry.js ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * [INPUT]: 依赖 plugin.ts 的 OpenCode 2 `{ id, setup }` 实现与 plugin-v1.ts 的 OpenCode 1 函数入口
3
+ * [OUTPUT]: 默认导出同时满足 OpenCode 1 `{ id, server() }` 与 OpenCode 2 `{ id, setup }` 的合并入口对象
4
+ * [POS]: @kkcode-app/agent 的唯一包入口;exports "." / "./plugin" / "./server" 全部指向此文件,
5
+ * 因为 OpenCode 2 的包解析器优先解析 "./server" 子路径(Bun.resolveSync),
6
+ * 两代加载器必须拿到同一个默认导出,不能分别指向两个文件
7
+ * [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
8
+ */
9
+ import v1 from "./plugin-v1.js";
10
+ import v2 from "./plugin.js";
11
+ export default { id: v2.id, setup: v2.setup, server: v1 };
12
+ //# sourceMappingURL=entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry.js","sourceRoot":"","sources":["../src/entry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,aAAa,CAAC;AAE7B,eAAe,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC"}
package/dist/plugin-v1.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * [INPUT]: 依赖 OpenCode 1 PluginInput/client 与 notification-core 共享上报内核
3
3
  * [OUTPUT]: 默认导出 OpenCode 1 函数插件,处理 idle/error/permission/question 事件
4
- * [POS]: @kkcode-app/agent 的 ./server 与 ./plugin 兼容入口;不承载 OpenCode 2 setup API
4
+ * [POS]: OpenCode 1 插件实现模块,由包入口 entry.ts 以 { id, server } 组合导出;自身不是 exports 解析目标
5
5
  * [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
6
6
  */
7
7
  import { compactText, debugLog, errorSummary, reportNotification, } from "./notification-core.js";
package/dist/plugin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * [INPUT]: 依赖 OpenCode 2 Promise plugin context 的 location/session/event API 与 notification-core
3
3
  * [OUTPUT]: 默认导出 `{ id, setup }` OpenCode 2 插件,按 execution/permission/Form 事件上报推送
4
- * [POS]: @kkcode-app/agent 默认插件入口;OpenCode 1 由独立 ./server export 加载 plugin-v1.ts
4
+ * [POS]: OpenCode 2 插件实现模块,与 plugin-v1.ts 一起由包入口 entry.ts 组合导出;自身不是 exports 解析目标
5
5
  * [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
6
6
  */
7
7
  import { basename, normalize } from "node:path";
package/package.json CHANGED
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "name": "@kkcode-app/agent",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Connect OpenCode to KKCode and send actionable iPhone notifications.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "exports": {
8
- ".": "./src/plugin.ts",
9
- "./plugin": "./src/plugin-v1.ts",
10
- "./server": "./src/plugin-v1.ts"
8
+ ".": "./src/entry.ts",
9
+ "./plugin": "./src/entry.ts",
10
+ "./server": "./src/entry.ts"
11
11
  },
12
12
  "bin": {
13
13
  "kkcode": "dist/index.js"
14
14
  },
15
15
  "files": [
16
16
  "dist",
17
+ "src/entry.ts",
17
18
  "src/plugin.ts",
18
19
  "src/plugin-v1.ts",
19
20
  "src/notification-core.ts",
package/src/entry.ts ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * [INPUT]: 依赖 plugin.ts 的 OpenCode 2 `{ id, setup }` 实现与 plugin-v1.ts 的 OpenCode 1 函数入口
3
+ * [OUTPUT]: 默认导出同时满足 OpenCode 1 `{ id, server() }` 与 OpenCode 2 `{ id, setup }` 的合并入口对象
4
+ * [POS]: @kkcode-app/agent 的唯一包入口;exports "." / "./plugin" / "./server" 全部指向此文件,
5
+ * 因为 OpenCode 2 的包解析器优先解析 "./server" 子路径(Bun.resolveSync),
6
+ * 两代加载器必须拿到同一个默认导出,不能分别指向两个文件
7
+ * [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
8
+ */
9
+
10
+ import v1 from "./plugin-v1.js";
11
+ import v2 from "./plugin.js";
12
+
13
+ export default { id: v2.id, setup: v2.setup, server: v1 };
package/src/plugin-v1.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * [INPUT]: 依赖 OpenCode 1 PluginInput/client 与 notification-core 共享上报内核
3
3
  * [OUTPUT]: 默认导出 OpenCode 1 函数插件,处理 idle/error/permission/question 事件
4
- * [POS]: @kkcode-app/agent 的 ./server 与 ./plugin 兼容入口;不承载 OpenCode 2 setup API
4
+ * [POS]: OpenCode 1 插件实现模块,由包入口 entry.ts 以 { id, server } 组合导出;自身不是 exports 解析目标
5
5
  * [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
6
6
  */
7
7
 
package/src/plugin.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * [INPUT]: 依赖 OpenCode 2 Promise plugin context 的 location/session/event API 与 notification-core
3
3
  * [OUTPUT]: 默认导出 `{ id, setup }` OpenCode 2 插件,按 execution/permission/Form 事件上报推送
4
- * [POS]: @kkcode-app/agent 默认插件入口;OpenCode 1 由独立 ./server export 加载 plugin-v1.ts
4
+ * [POS]: OpenCode 2 插件实现模块,与 plugin-v1.ts 一起由包入口 entry.ts 组合导出;自身不是 exports 解析目标
5
5
  * [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
6
6
  */
7
7