@vnejs/contracts.core.scenario 0.1.4 → 0.1.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,34 @@
1
+ /**
2
+ * Declarative .vne command surface contributed by a plugin contract.
3
+ * Tooling (editor, validation) aggregates these; not registered in VNE at runtime.
4
+ */
5
+ export type ScenarioCommandEntry = {
6
+ /**
7
+ * Named actions after `$ <module>` / `% <block>`.
8
+ * Keys are stable identifiers; values are the literals used in scenario lines
9
+ * (typically the same object as EXEC_ACTIONS).
10
+ */
11
+ actions?: Record<string, string>;
12
+ };
13
+ export type ScenarioCommandsManifest = {
14
+ /** Handlers registered via LINE_EXEC_REG `{ module }` → `$ <name> …` */
15
+ modules?: Record<string, ScenarioCommandEntry>;
16
+ /** Handlers registered via LINE_EXEC_REG `{ block }` → `% <name> …` */
17
+ blocks?: Record<string, ScenarioCommandEntry>;
18
+ };
19
+ /** Commands owned by plugins.core.scenario */
20
+ export declare const SCENARIO_COMMANDS: {
21
+ readonly modules: {
22
+ readonly scenario: {
23
+ readonly actions: {
24
+ readonly ANCHOR: "anchor";
25
+ readonly GOTO: "goto";
26
+ };
27
+ };
28
+ };
29
+ readonly blocks: {
30
+ /** `% option …` — no discrete actions; remainder is freeform payload */
31
+ readonly option: {};
32
+ };
33
+ };
34
+ export type ScenarioCommands = typeof SCENARIO_COMMANDS;
@@ -0,0 +1,13 @@
1
+ import { EXEC_ACTIONS } from "./const.js";
2
+ /** Commands owned by plugins.core.scenario */
3
+ export const SCENARIO_COMMANDS = {
4
+ modules: {
5
+ scenario: {
6
+ actions: EXEC_ACTIONS,
7
+ },
8
+ },
9
+ blocks: {
10
+ /** `% option …` — no discrete actions; remainder is freeform payload */
11
+ option: {},
12
+ },
13
+ };
package/dist/const.d.ts CHANGED
@@ -11,6 +11,14 @@ export declare const LINE_PREFIXES: {
11
11
  readonly MODULE: "$";
12
12
  readonly BLOCK: "%";
13
13
  };
14
+ export declare const EXEC_ACTIONS: {
15
+ readonly ANCHOR: "anchor";
16
+ readonly GOTO: "goto";
17
+ };
18
+ export declare const LOGS_ACTIONS: {
19
+ readonly GOTO: "goto";
20
+ readonly GOTO_MISSING: "goto_missing";
21
+ };
14
22
  export declare const CONSTANTS: {
15
23
  readonly OTHER_MODULE: "other";
16
24
  readonly LINE_KEYWORDS: {
@@ -25,5 +33,13 @@ export declare const CONSTANTS: {
25
33
  readonly MODULE: "$";
26
34
  readonly BLOCK: "%";
27
35
  };
36
+ readonly EXEC_ACTIONS: {
37
+ readonly ANCHOR: "anchor";
38
+ readonly GOTO: "goto";
39
+ };
40
+ readonly LOGS_ACTIONS: {
41
+ readonly GOTO: "goto";
42
+ readonly GOTO_MISSING: "goto_missing";
43
+ };
28
44
  };
29
45
  export type Constants = typeof CONSTANTS;
package/dist/const.js CHANGED
@@ -11,8 +11,18 @@ export const LINE_PREFIXES = {
11
11
  MODULE: "$",
12
12
  BLOCK: "%",
13
13
  };
14
+ export const EXEC_ACTIONS = {
15
+ ANCHOR: "anchor",
16
+ GOTO: "goto",
17
+ };
18
+ export const LOGS_ACTIONS = {
19
+ GOTO: "goto",
20
+ GOTO_MISSING: "goto_missing",
21
+ };
14
22
  export const CONSTANTS = {
15
23
  OTHER_MODULE,
16
24
  LINE_KEYWORDS,
17
25
  LINE_PREFIXES,
26
+ EXEC_ACTIONS,
27
+ LOGS_ACTIONS,
18
28
  };
package/dist/events.d.ts CHANGED
@@ -1,16 +1,12 @@
1
1
  export declare const SUBSCRIBE_EVENTS: {
2
2
  readonly EXEC: "vne:scenario:exec";
3
- readonly EXEC_REG: "vne:scenario:exec_reg";
4
3
  readonly EXEC_DELAY: "vne:scenario:exec_delay";
5
- readonly EXEC_AWAIT: "vne:scenario:exec_await";
6
4
  readonly NEXT: "vne:scenario:next";
7
5
  readonly LABEL_GET: "vne:scenario:label_get";
8
6
  readonly LINE_LOAD: "vne:scenario:line_load";
9
7
  readonly LINE_GET: "vne:scenario:line_get";
10
- readonly LINE_REG: "vne:scenario:line_reg";
11
8
  readonly LINE_LOAD_REG: "vne:scenario:line_load_reg";
12
9
  readonly LINE_EXEC_REG: "vne:scenario:line_exec_reg";
13
- readonly LINE_NEXT_REG: "vne:scenario:line_next_reg";
14
10
  readonly LINES_GET: "vne:scenario:lines_get";
15
11
  };
16
12
  export type SubscribeEvents = typeof SUBSCRIBE_EVENTS;
package/dist/events.js CHANGED
@@ -1,15 +1,11 @@
1
1
  export const SUBSCRIBE_EVENTS = {
2
2
  EXEC: "vne:scenario:exec",
3
- EXEC_REG: "vne:scenario:exec_reg",
4
3
  EXEC_DELAY: "vne:scenario:exec_delay",
5
- EXEC_AWAIT: "vne:scenario:exec_await",
6
4
  NEXT: "vne:scenario:next",
7
5
  LABEL_GET: "vne:scenario:label_get",
8
6
  LINE_LOAD: "vne:scenario:line_load",
9
7
  LINE_GET: "vne:scenario:line_get",
10
- LINE_REG: "vne:scenario:line_reg",
11
8
  LINE_LOAD_REG: "vne:scenario:line_load_reg",
12
9
  LINE_EXEC_REG: "vne:scenario:line_exec_reg",
13
- LINE_NEXT_REG: "vne:scenario:line_next_reg",
14
10
  LINES_GET: "vne:scenario:lines_get",
15
11
  };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import "@vnejs/module";
2
2
  import "@vnejs/shared";
3
+ import { SCENARIO_COMMANDS } from "./commands.js";
3
4
  import { CONSTANTS } from "./const.js";
4
5
  import { SUBSCRIBE_EVENTS } from "./events.js";
5
6
  import type { ModuleGlobalStateScenario } from "./module-global-state.js";
@@ -11,6 +12,8 @@ export declare const PLUGIN_NAME: "SCENARIO";
11
12
  export type PluginName = typeof PLUGIN_NAME;
12
13
  export { CONSTANTS };
13
14
  export type { Constants } from "./const.js";
15
+ export { SCENARIO_COMMANDS };
16
+ export type { ScenarioCommandEntry, ScenarioCommands, ScenarioCommandsManifest } from "./commands.js";
14
17
  export { SUBSCRIBE_EVENTS };
15
18
  export type { SubscribeEvents } from "./events.js";
16
19
  export { PARAMS };
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import "@vnejs/module";
2
2
  import "@vnejs/shared";
3
+ import { SCENARIO_COMMANDS } from "./commands.js";
3
4
  import { CONSTANTS } from "./const.js";
4
5
  import { SUBSCRIBE_EVENTS } from "./events.js";
5
6
  import { DEFAULT_MODULE_GLOBAL_STATE_SCENARIO } from "./module-global-state.js";
@@ -7,5 +8,6 @@ import { PARAMS } from "./params.js";
7
8
  export { DEFAULT_MODULE_GLOBAL_STATE_SCENARIO };
8
9
  export const PLUGIN_NAME = "SCENARIO";
9
10
  export { CONSTANTS };
11
+ export { SCENARIO_COMMANDS };
10
12
  export { SUBSCRIBE_EVENTS };
11
13
  export { PARAMS };
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@vnejs/contracts.core.scenario",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Contracts for @vnejs/plugins.core.scenario",
5
+ "type": "module",
5
6
  "main": "dist/index.js",
6
7
  "types": "dist/index.d.ts",
7
8
  "exports": {
@@ -0,0 +1,36 @@
1
+ import { EXEC_ACTIONS } from "./const.js";
2
+
3
+ /**
4
+ * Declarative .vne command surface contributed by a plugin contract.
5
+ * Tooling (editor, validation) aggregates these; not registered in VNE at runtime.
6
+ */
7
+ export type ScenarioCommandEntry = {
8
+ /**
9
+ * Named actions after `$ <module>` / `% <block>`.
10
+ * Keys are stable identifiers; values are the literals used in scenario lines
11
+ * (typically the same object as EXEC_ACTIONS).
12
+ */
13
+ actions?: Record<string, string>;
14
+ };
15
+
16
+ export type ScenarioCommandsManifest = {
17
+ /** Handlers registered via LINE_EXEC_REG `{ module }` → `$ <name> …` */
18
+ modules?: Record<string, ScenarioCommandEntry>;
19
+ /** Handlers registered via LINE_EXEC_REG `{ block }` → `% <name> …` */
20
+ blocks?: Record<string, ScenarioCommandEntry>;
21
+ };
22
+
23
+ /** Commands owned by plugins.core.scenario */
24
+ export const SCENARIO_COMMANDS = {
25
+ modules: {
26
+ scenario: {
27
+ actions: EXEC_ACTIONS,
28
+ },
29
+ },
30
+ blocks: {
31
+ /** `% option …` — no discrete actions; remainder is freeform payload */
32
+ option: {},
33
+ },
34
+ } as const satisfies ScenarioCommandsManifest;
35
+
36
+ export type ScenarioCommands = typeof SCENARIO_COMMANDS;
package/src/const.ts CHANGED
@@ -14,10 +14,22 @@ export const LINE_PREFIXES = {
14
14
  BLOCK: "%",
15
15
  } as const;
16
16
 
17
+ export const EXEC_ACTIONS = {
18
+ ANCHOR: "anchor",
19
+ GOTO: "goto",
20
+ } as const;
21
+
22
+ export const LOGS_ACTIONS = {
23
+ GOTO: "goto",
24
+ GOTO_MISSING: "goto_missing",
25
+ } as const;
26
+
17
27
  export const CONSTANTS = {
18
28
  OTHER_MODULE,
19
29
  LINE_KEYWORDS,
20
30
  LINE_PREFIXES,
31
+ EXEC_ACTIONS,
32
+ LOGS_ACTIONS,
21
33
  } as const;
22
34
 
23
35
  export type Constants = typeof CONSTANTS;
package/src/events.ts CHANGED
@@ -1,16 +1,12 @@
1
1
  export const SUBSCRIBE_EVENTS = {
2
2
  EXEC: "vne:scenario:exec",
3
- EXEC_REG: "vne:scenario:exec_reg",
4
3
  EXEC_DELAY: "vne:scenario:exec_delay",
5
- EXEC_AWAIT: "vne:scenario:exec_await",
6
4
  NEXT: "vne:scenario:next",
7
5
  LABEL_GET: "vne:scenario:label_get",
8
6
  LINE_LOAD: "vne:scenario:line_load",
9
7
  LINE_GET: "vne:scenario:line_get",
10
- LINE_REG: "vne:scenario:line_reg",
11
8
  LINE_LOAD_REG: "vne:scenario:line_load_reg",
12
9
  LINE_EXEC_REG: "vne:scenario:line_exec_reg",
13
- LINE_NEXT_REG: "vne:scenario:line_next_reg",
14
10
  LINES_GET: "vne:scenario:lines_get",
15
11
  } as const;
16
12
 
package/src/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import "@vnejs/module";
2
2
  import "@vnejs/shared";
3
3
 
4
+ import { SCENARIO_COMMANDS } from "./commands.js";
4
5
  import { CONSTANTS } from "./const.js";
5
6
  import { SUBSCRIBE_EVENTS } from "./events.js";
6
7
  import type { ModuleGlobalStateScenario } from "./module-global-state.js";
@@ -15,6 +16,8 @@ export type PluginName = typeof PLUGIN_NAME;
15
16
 
16
17
  export { CONSTANTS };
17
18
  export type { Constants } from "./const.js";
19
+ export { SCENARIO_COMMANDS };
20
+ export type { ScenarioCommandEntry, ScenarioCommands, ScenarioCommandsManifest } from "./commands.js";
18
21
  export { SUBSCRIBE_EVENTS };
19
22
  export type { SubscribeEvents } from "./events.js";
20
23
  export { PARAMS };