66 * LICENSE file in the root directory of this source tree.
77 */
88
9+ // Import and re-export types from the Protocol Constitution (@objectstack/spec)
10+ import type { Action } from '@objectstack/spec' ;
911import { FieldConfig } from "./field" ;
1012import { HookAPI } from "./hook" ; // Reuse the restricted API interface
1113
14+ /**
15+ * Re-export Protocol Types from the Constitution
16+ */
17+ export type { Action as SpecAction } ;
18+
19+ /**
20+ * RUNTIME-SPECIFIC TYPES
21+ * The following types extend the Protocol Action definition with runtime execution capabilities
22+ */
23+
1224/**
1325 * Defines the scope of the action.
1426 * - `record`: Acts on a specific record instance (e.g. "Approve Order").
@@ -24,6 +36,8 @@ export type ActionInputDefinition = Record<string, FieldConfig>;
2436
2537/**
2638 * Context passed to the action handler execution.
39+ *
40+ * RUNTIME TYPE: Used during action execution.
2741 */
2842export interface ActionContext < BaseT = any , InputT = any > {
2943 /** The object this action belongs to. */
@@ -58,11 +72,19 @@ export interface ActionContext<BaseT = any, InputT = any> {
5872}
5973
6074/**
75+ * Runtime Action Configuration
76+ *
6177 * The configuration of an Action visible to the Metadata engine (YAML/JSON side).
78+ * Compatible with Protocol Action but adds runtime-specific options.
6279 */
6380export interface ActionConfig {
81+ /** Display label */
6482 label ?: string ;
83+
84+ /** Description */
6585 description ?: string ;
86+
87+ /** Icon name */
6688 icon ?: string ;
6789
6890 /**
@@ -93,6 +115,8 @@ export interface ActionConfig {
93115
94116/**
95117 * The full implementation definition (Code side).
118+ *
119+ * RUNTIME TYPE: Includes the handler function for execution.
96120 */
97121export interface ActionDefinition < BaseT = any , InputT = any , ReturnT = any > extends ActionConfig {
98122 /**
0 commit comments