@zhin.js/process-monitor 3.0.5 → 3.0.6

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,9 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { defineCommand } from '@zhin.js/command';
3
+ import { formatProcessStatus } from "../lib/monitor.js";
4
+ export default defineCommand({
5
+ description: '查看进程监控状态(PID、运行时长、重启统计)',
6
+ execute() {
7
+ return formatProcessStatus();
8
+ },
9
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/process-monitor",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "description": "进程监控与重启通知插件 (Plugin Runtime)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -14,7 +14,7 @@
14
14
  "./package.json": "./package.json"
15
15
  },
16
16
  "files": [
17
- "plugin.ts",
17
+ "plugin.js",
18
18
  "schema.json",
19
19
  "commands",
20
20
  "tools",
@@ -38,9 +38,9 @@
38
38
  "directory": "plugins/features/process-monitor"
39
39
  },
40
40
  "dependencies": {
41
- "@zhin.js/command": "1.0.3",
41
+ "@zhin.js/command": "1.0.4",
42
42
  "@zhin.js/plugin-runtime": "1.1.1",
43
- "@zhin.js/tool": "1.0.3"
43
+ "@zhin.js/tool": "1.0.4"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^26.1.0",
@@ -57,7 +57,7 @@
57
57
  "zhin": {
58
58
  "protocol": 1,
59
59
  "type": "plugin",
60
- "entry": "./plugin.ts",
60
+ "entry": "./plugin.js",
61
61
  "engine": "^1.0.0",
62
62
  "runtime": "trusted",
63
63
  "features": [
package/plugin.js ADDED
@@ -0,0 +1,20 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { definePlugin } from '@zhin.js/plugin-runtime';
3
+ import { resolveProcessMonitorConfig, startProcessMonitor, } from "./lib/monitor.js";
4
+ /**
5
+ * Process monitor Plugin Runtime cutover:
6
+ * - setup() owns file-backed restart detection + signal cleanup
7
+ * - commands/process-status for chat status
8
+ * - tools/process-status kept as agent tool surface
9
+ */
10
+ export default definePlugin({
11
+ name: 'process-monitor',
12
+ metadata: {
13
+ displayName: 'Process Monitor',
14
+ },
15
+ setup(context) {
16
+ const config = resolveProcessMonitorConfig(context.config.get());
17
+ const dispose = startProcessMonitor(config);
18
+ context.lifecycle.add(dispose);
19
+ },
20
+ });
@@ -0,0 +1,12 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { defineAgentTool } from '@zhin.js/tool';
3
+ import { formatProcessStatus } from "../lib/monitor.js";
4
+ export default defineAgentTool({
5
+ description: '查看进程监控状态,包括 PID、运行时长、内存、重启和崩溃统计',
6
+ inputSchema: {
7
+ type: 'object',
8
+ properties: {},
9
+ },
10
+ approval: 'never',
11
+ execute: () => formatProcessStatus(),
12
+ });
package/plugin.ts DELETED
@@ -1,24 +0,0 @@
1
- import { definePlugin } from '@zhin.js/plugin-runtime';
2
- import {
3
- resolveProcessMonitorConfig,
4
- startProcessMonitor,
5
- type ProcessMonitorConfig,
6
- } from './src/monitor.js';
7
-
8
- /**
9
- * Process monitor Plugin Runtime cutover:
10
- * - setup() owns file-backed restart detection + signal cleanup
11
- * - commands/process-status for chat status
12
- * - tools/process-status kept as agent tool surface
13
- */
14
- export default definePlugin<ProcessMonitorConfig>({
15
- name: 'process-monitor',
16
- metadata: {
17
- displayName: 'Process Monitor',
18
- },
19
- setup(context) {
20
- const config = resolveProcessMonitorConfig(context.config.get());
21
- const dispose = startProcessMonitor(config);
22
- context.lifecycle.add(dispose);
23
- },
24
- });