@objectstack/runtime 10.2.0 → 11.0.0

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/dist/index.d.cts CHANGED
@@ -98,6 +98,7 @@ declare const StandaloneStackConfigSchema: z.ZodObject<{
98
98
  environmentId: z.ZodOptional<z.ZodString>;
99
99
  artifactPath: z.ZodOptional<z.ZodString>;
100
100
  projectRoot: z.ZodOptional<z.ZodString>;
101
+ dev: z.ZodOptional<z.ZodBoolean>;
101
102
  }, z.core.$strip>;
102
103
  type StandaloneStackConfig = z.input<typeof StandaloneStackConfigSchema>;
103
104
  interface StandaloneStackResult {
@@ -1013,6 +1014,49 @@ declare class HttpDispatcher {
1013
1014
  * engine access.
1014
1015
  */
1015
1016
  private buildMcpBridge;
1017
+ /**
1018
+ * [ADR-0066 D4] Shared capability gate for an action invocation. Returns a
1019
+ * human-readable error string when the caller's `systemPermissions` don't
1020
+ * cover the action's declared `requiredPermissions`, or `null` when allowed.
1021
+ * System/engine self-invocation (`isSystem`) bypasses; an action without
1022
+ * `requiredPermissions` is ungated. Single-sourced so the REST `/actions/...`
1023
+ * route and the MCP `run_action` bridge enforce the SAME declaration.
1024
+ */
1025
+ private actionPermissionError;
1026
+ /**
1027
+ * Whether an action has a headless invocation path (so MCP can run it).
1028
+ * Mirrors the supported-type set of the (now cloud-side) action-tools
1029
+ * bridge: `script` needs a handler binding (`target`) or an inline `body`;
1030
+ * `flow` needs a `target` and an automation service. UI-only types
1031
+ * (`url`, `modal`, `form`) and `api` have no server dispatch here.
1032
+ */
1033
+ private isHeadlessInvokableAction;
1034
+ /** True when an action is destructive by author signal/heuristic (HITL hint). */
1035
+ private actionLooksDestructive;
1036
+ /** Project an action's declarative metadata into a lean MCP summary. */
1037
+ private summarizeAction;
1038
+ /** Map an ObjectStack field type to a JSON-Schema primitive (conservative). */
1039
+ private jsonTypeOf;
1040
+ /** Resolve an action's params into LLM-facing summaries (field-backed types resolved). */
1041
+ private summarizeActionParams;
1042
+ /** Slim engine facade matching the ActionContext.engine shape handlers expect. */
1043
+ private buildActionEngineFacade;
1044
+ /**
1045
+ * Resolve + invoke a business action by its declarative name for the MCP
1046
+ * `run_action` tool. Enforces the ADR-0066 D4 capability gate and RLS as the
1047
+ * caller, loads the subject record under RLS for row-context actions, and
1048
+ * dispatches through the framework's `engine.executeAction` (script/body) or
1049
+ * automation flow runner (flow). Throws on denial / not-found / handler
1050
+ * failure so the tool surfaces a clean tool-error. No service-ai dependency.
1051
+ */
1052
+ private invokeBusinessAction;
1053
+ /**
1054
+ * Find an action's declarative definition by name across object metadata,
1055
+ * optionally scoped to a single object. Returns the action plus its owning
1056
+ * object name, or `null`. Throws when the name is ambiguous across objects
1057
+ * and no `objectName` was supplied (so `run_action` can ask for one).
1058
+ */
1059
+ private resolveActionByName;
1016
1060
  /**
1017
1061
  * Generate a `sys_api_key` and return the raw secret EXACTLY ONCE
1018
1062
  * (`POST /keys`). This is the only mint path — the raw key is never stored
package/dist/index.d.ts CHANGED
@@ -98,6 +98,7 @@ declare const StandaloneStackConfigSchema: z.ZodObject<{
98
98
  environmentId: z.ZodOptional<z.ZodString>;
99
99
  artifactPath: z.ZodOptional<z.ZodString>;
100
100
  projectRoot: z.ZodOptional<z.ZodString>;
101
+ dev: z.ZodOptional<z.ZodBoolean>;
101
102
  }, z.core.$strip>;
102
103
  type StandaloneStackConfig = z.input<typeof StandaloneStackConfigSchema>;
103
104
  interface StandaloneStackResult {
@@ -1013,6 +1014,49 @@ declare class HttpDispatcher {
1013
1014
  * engine access.
1014
1015
  */
1015
1016
  private buildMcpBridge;
1017
+ /**
1018
+ * [ADR-0066 D4] Shared capability gate for an action invocation. Returns a
1019
+ * human-readable error string when the caller's `systemPermissions` don't
1020
+ * cover the action's declared `requiredPermissions`, or `null` when allowed.
1021
+ * System/engine self-invocation (`isSystem`) bypasses; an action without
1022
+ * `requiredPermissions` is ungated. Single-sourced so the REST `/actions/...`
1023
+ * route and the MCP `run_action` bridge enforce the SAME declaration.
1024
+ */
1025
+ private actionPermissionError;
1026
+ /**
1027
+ * Whether an action has a headless invocation path (so MCP can run it).
1028
+ * Mirrors the supported-type set of the (now cloud-side) action-tools
1029
+ * bridge: `script` needs a handler binding (`target`) or an inline `body`;
1030
+ * `flow` needs a `target` and an automation service. UI-only types
1031
+ * (`url`, `modal`, `form`) and `api` have no server dispatch here.
1032
+ */
1033
+ private isHeadlessInvokableAction;
1034
+ /** True when an action is destructive by author signal/heuristic (HITL hint). */
1035
+ private actionLooksDestructive;
1036
+ /** Project an action's declarative metadata into a lean MCP summary. */
1037
+ private summarizeAction;
1038
+ /** Map an ObjectStack field type to a JSON-Schema primitive (conservative). */
1039
+ private jsonTypeOf;
1040
+ /** Resolve an action's params into LLM-facing summaries (field-backed types resolved). */
1041
+ private summarizeActionParams;
1042
+ /** Slim engine facade matching the ActionContext.engine shape handlers expect. */
1043
+ private buildActionEngineFacade;
1044
+ /**
1045
+ * Resolve + invoke a business action by its declarative name for the MCP
1046
+ * `run_action` tool. Enforces the ADR-0066 D4 capability gate and RLS as the
1047
+ * caller, loads the subject record under RLS for row-context actions, and
1048
+ * dispatches through the framework's `engine.executeAction` (script/body) or
1049
+ * automation flow runner (flow). Throws on denial / not-found / handler
1050
+ * failure so the tool surfaces a clean tool-error. No service-ai dependency.
1051
+ */
1052
+ private invokeBusinessAction;
1053
+ /**
1054
+ * Find an action's declarative definition by name across object metadata,
1055
+ * optionally scoped to a single object. Returns the action plus its owning
1056
+ * object name, or `null`. Throws when the name is ambiguous across objects
1057
+ * and no `objectName` was supplied (so `run_action` can ask for one).
1058
+ */
1059
+ private resolveActionByName;
1016
1060
  /**
1017
1061
  * Generate a `sys_api_key` and return the raw secret EXACTLY ONCE
1018
1062
  * (`POST /keys`). This is the only mint path — the raw key is never stored