@moostjs/event-wf 0.6.25 → 0.6.27

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
@@ -17,43 +17,35 @@ import { Controller, Moost } from 'moost'
17
17
  @Controller()
18
18
  class MyWorkflows {
19
19
  @Step('greet')
20
- greet(@WorkflowParam('input') input: string) {
21
- return `Hello, ${input}!`
20
+ greet(
21
+ @WorkflowParam('context') ctx: { greeting: string },
22
+ @WorkflowParam('input') input?: string,
23
+ ) {
24
+ ctx.greeting = `Hello, ${input}!`
22
25
  }
23
26
 
24
27
  @Workflow('my-flow')
25
- @WorkflowSchema([{ step: 'greet' }])
28
+ @WorkflowSchema(['greet'])
26
29
  myFlow() {}
27
30
  }
28
31
 
29
32
  const app = new Moost()
30
33
  const wf = new MoostWf()
31
- app.adapter(wf).controllers(MyWorkflows).init()
34
+ app.adapter(wf)
35
+ app.registerControllers(MyWorkflows)
36
+ await app.init()
32
37
 
33
38
  // Start a workflow
34
- const result = await wf.start('my-flow', {}, 'World')
39
+ const result = await wf.start('my-flow', { greeting: '' }, { input: 'World' })
40
+ console.log(result.state.context.greeting) // 'Hello, World!'
35
41
  ```
36
42
 
37
- ## AI Agent Skills
43
+ ## AI Agent Skill
38
44
 
39
- This package includes skill files for AI coding agents (Claude Code, Cursor, Windsurf, Codex, OpenCode). Install them to give your agent deep knowledge of the `@moostjs/event-wf` API:
45
+ Install the unified Moost skill for AI coding agents (Claude Code, Cursor, etc.):
40
46
 
41
47
  ```bash
42
- # Project-local (recommended — version-locked, commits with your repo)
43
- npx moostjs-event-wf-skill
44
-
45
- # Global (available across all your projects)
46
- npx moostjs-event-wf-skill --global
47
- ```
48
-
49
- To auto-install on `npm install`, add a postinstall script to your `package.json`:
50
-
51
- ```json
52
- {
53
- "scripts": {
54
- "postinstall": "moostjs-event-wf-skill --postinstall"
55
- }
56
- }
48
+ npx skills add moostjs/moostjs
57
49
  ```
58
50
 
59
51
  ## [Official Documentation](https://moost.org/wf/)
package/dist/index.cjs CHANGED
@@ -93,7 +93,7 @@ function getWfMate() {
93
93
  switch (name) {
94
94
  case "state": return (0, moost.Resolve)(() => (0, _wooksjs_event_wf.useWfState)(), "Workflow-State");
95
95
  case "resume": return (0, moost.Resolve)(() => (0, _wooksjs_event_wf.useWfState)().resume, "Workflow-Resume");
96
- case "indexes": return (0, moost.Resolve)(() => (0, _wooksjs_event_wf.useWfState)().indexes, "Workflow-Indexes");
96
+ case "indexes": return (0, moost.Resolve)(() => (0, _wooksjs_event_wf.useWfState)().indexes(), "Workflow-Indexes");
97
97
  case "schemaId": return (0, moost.Resolve)(() => (0, _wooksjs_event_wf.useWfState)().schemaId, "Workflow-SchemaId");
98
98
  case "stepId": return (0, moost.Resolve)(() => (0, _wooksjs_event_wf.useWfState)().stepId(), "Workflow-StepId");
99
99
  case "context": return (0, moost.Resolve)(() => (0, _wooksjs_event_wf.useWfState)().ctx(), "Workflow-Context");
@@ -115,7 +115,6 @@ function _define_property(obj, key, value) {
115
115
  return obj;
116
116
  }
117
117
  const LOGGER_TITLE = "moost-wf";
118
- const CONTEXT_TYPE = "WF";
119
118
  /**
120
119
  * Moost adapter for workflow events. Wraps `@wooksjs/event-wf` to register
121
120
  * `@Step` and `@Workflow` handlers with full Moost DI and interceptor support.
@@ -214,7 +213,6 @@ const CONTEXT_TYPE = "WF";
214
213
  const path = typeof schemaId === "string" ? schemaId : typeof opts.method === "string" ? opts.method : "";
215
214
  const targetPath = `${`${opts.prefix || ""}/${path}`.replaceAll(/\/\/+/g, "/")}${path.endsWith("//") ? "/" : ""}`;
216
215
  fn = (0, moost.defineMoostEventHandler)({
217
- contextType: CONTEXT_TYPE,
218
216
  loggerTitle: LOGGER_TITLE,
219
217
  getIterceptorHandler: opts.getIterceptorHandler,
220
218
  getControllerInstance: opts.getInstance,
package/dist/index.mjs CHANGED
@@ -92,7 +92,7 @@ function getWfMate() {
92
92
  switch (name) {
93
93
  case "state": return Resolve(() => useWfState$1(), "Workflow-State");
94
94
  case "resume": return Resolve(() => useWfState$1().resume, "Workflow-Resume");
95
- case "indexes": return Resolve(() => useWfState$1().indexes, "Workflow-Indexes");
95
+ case "indexes": return Resolve(() => useWfState$1().indexes(), "Workflow-Indexes");
96
96
  case "schemaId": return Resolve(() => useWfState$1().schemaId, "Workflow-SchemaId");
97
97
  case "stepId": return Resolve(() => useWfState$1().stepId(), "Workflow-StepId");
98
98
  case "context": return Resolve(() => useWfState$1().ctx(), "Workflow-Context");
@@ -114,7 +114,6 @@ function _define_property(obj, key, value) {
114
114
  return obj;
115
115
  }
116
116
  const LOGGER_TITLE = "moost-wf";
117
- const CONTEXT_TYPE = "WF";
118
117
  /**
119
118
  * Moost adapter for workflow events. Wraps `@wooksjs/event-wf` to register
120
119
  * `@Step` and `@Workflow` handlers with full Moost DI and interceptor support.
@@ -213,7 +212,6 @@ const CONTEXT_TYPE = "WF";
213
212
  const path = typeof schemaId === "string" ? schemaId : typeof opts.method === "string" ? opts.method : "";
214
213
  const targetPath = `${`${opts.prefix || ""}/${path}`.replaceAll(/\/\/+/g, "/")}${path.endsWith("//") ? "/" : ""}`;
215
214
  fn = defineMoostEventHandler({
216
- contextType: CONTEXT_TYPE,
217
215
  loggerTitle: LOGGER_TITLE,
218
216
  getIterceptorHandler: opts.getIterceptorHandler,
219
217
  getControllerInstance: opts.getInstance,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moostjs/event-wf",
3
- "version": "0.6.25",
3
+ "version": "0.6.27",
4
4
  "description": "@moostjs/event-wf",
5
5
  "keywords": [
6
6
  "composables",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@prostojs/wf": "^0.2.1",
42
- "@wooksjs/event-wf": "^0.7.17"
42
+ "@wooksjs/event-wf": "^0.7.19"
43
43
  },
44
44
  "devDependencies": {
45
45
  "vitest": "3.2.4"
@@ -47,9 +47,9 @@
47
47
  "peerDependencies": {
48
48
  "@prostojs/infact": "^0.4.1",
49
49
  "@prostojs/mate": "^0.4.0",
50
- "@wooksjs/event-core": "^0.7.17",
51
- "wooks": "^0.7.17",
52
- "moost": "^0.6.25"
50
+ "@wooksjs/event-core": "^0.7.19",
51
+ "wooks": "^0.7.19",
52
+ "moost": "^0.6.27"
53
53
  },
54
54
  "scripts": {
55
55
  "pub": "pnpm publish --access public",