@vnejs/contracts.core.scenario 0.1.5 → 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/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.5",
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/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 };