@zhin.js/plugin-repeater 1.1.22 → 1.1.23

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/lib/runtime.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import type { RepeaterEngine } from './engine.js';
2
- export declare const repeaterEngineToken: import("zhin.js").Token<RepeaterEngine>;
2
+ export declare const repeaterEngineToken: import("zhin.js").PluginStore<RepeaterEngine, unknown>;
3
3
  //# sourceMappingURL=runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,mBAAmB,yCAG/B,CAAC"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,mBAAmB,wDAG/B,CAAC"}
package/lib/runtime.js CHANGED
@@ -1,3 +1,3 @@
1
- import { createToken } from 'zhin.js';
2
- export const repeaterEngineToken = createToken('zhin.repeater.engine', 'Generation-owned Repeater engine');
1
+ import { definePluginStore } from 'zhin.js';
2
+ export const repeaterEngineToken = definePluginStore('zhin.repeater.engine', 'Conversation repeat streak and cooldown state');
3
3
  //# sourceMappingURL=runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAC5C,sBAAsB,EACtB,kCAAkC,CACnC,CAAC"}
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAClD,sBAAsB,EACtB,+CAA+C,CAChD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/plugin-repeater",
3
- "version": "1.1.22",
3
+ "version": "1.1.23",
4
4
  "description": "Repeater plugin for Zhin.js — auto-repeat when group members echo the same content (Plugin Runtime)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -40,13 +40,13 @@
40
40
  },
41
41
  "license": "MIT",
42
42
  "dependencies": {
43
- "@zhin.js/core": "1.1.57",
44
- "@zhin.js/skill": "1.1.14"
43
+ "@zhin.js/core": "1.1.58",
44
+ "@zhin.js/skill": "1.1.15"
45
45
  },
46
46
  "devDependencies": {
47
47
  "typescript": "^6.0.3",
48
48
  "vitest": "^4.1.10",
49
- "zhin.js": "1.1.22"
49
+ "zhin.js": "1.1.23"
50
50
  },
51
51
  "repository": {
52
52
  "type": "git",
@@ -83,9 +83,9 @@
83
83
  "plugins": []
84
84
  },
85
85
  "peerDependencies": {
86
- "@zhin.js/command": "^1.1.15",
87
- "@zhin.js/middleware": "^1.1.14",
88
- "zhin.js": "^1.1.22"
86
+ "@zhin.js/command": "^1.1.16",
87
+ "@zhin.js/middleware": "^1.1.15",
88
+ "zhin.js": "^1.1.23"
89
89
  },
90
90
  "peerDependenciesMeta": {
91
91
  "@zhin.js/command": {
package/plugin.js CHANGED
@@ -8,8 +8,6 @@ export default definePlugin({
8
8
  displayName: 'Repeater',
9
9
  },
10
10
  setup(context) {
11
- const engine = new RepeaterEngine();
12
- context.resources.provide(repeaterEngineToken, engine);
13
- return () => engine.dispose();
11
+ repeaterEngineToken.provide(context, () => new RepeaterEngine());
14
12
  },
15
13
  });
package/src/runtime.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { createToken } from 'zhin.js';
1
+ import { definePluginStore } from 'zhin.js';
2
2
  import type { RepeaterEngine } from './engine.js';
3
3
 
4
- export const repeaterEngineToken = createToken<RepeaterEngine>(
4
+ export const repeaterEngineToken = definePluginStore<RepeaterEngine>(
5
5
  'zhin.repeater.engine',
6
- 'Generation-owned Repeater engine',
6
+ 'Conversation repeat streak and cooldown state',
7
7
  );