@leitwerk-dev/process-sdk 0.5.3 → 0.5.5

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.js CHANGED
@@ -43,6 +43,9 @@ var coreHostCapabilities = {
43
43
  )
44
44
  };
45
45
 
46
+ // src/define-process.ts
47
+ import { assertValidModelRequirements } from "@leitwerk-dev/protocol";
48
+
46
49
  // src/extension-api.ts
47
50
  var SafeLaunchPreparationError = class extends Error {
48
51
  /** @public */
@@ -2042,6 +2045,13 @@ function buildDefinedProcess(input) {
2042
2045
  };
2043
2046
  }
2044
2047
  function defineProcess(input) {
2048
+ if (input.modelRequirements !== void 0) assertValidModelRequirements(input.modelRequirements);
2049
+ for (const [turnId, turn] of Object.entries(input.turns)) {
2050
+ if ("modelRequirements" in turn && turn.modelRequirements !== void 0) {
2051
+ if (turn.kind !== "llm") throw new Error(`Model requirements require an LLM turn: ${turnId}`);
2052
+ assertValidModelRequirements(turn.modelRequirements);
2053
+ }
2054
+ }
2045
2055
  const compiled = buildDefinedProcess(input);
2046
2056
  const process2 = {
2047
2057
  id: input.id,
@@ -2054,6 +2064,7 @@ function defineProcess(input) {
2054
2064
  stateCodec: input.stateCodec,
2055
2065
  initialState: input.initialState,
2056
2066
  ...input.runtime ? { runtime: { ...input.runtime } } : {},
2067
+ ...input.modelRequirements ? { modelRequirements: structuredClone(input.modelRequirements) } : {},
2057
2068
  ...input.resolveStorageSize ? { resolveStorageSize: input.resolveStorageSize } : {},
2058
2069
  ...input.repositoryCredentials ? { repositoryCredentials: input.repositoryCredentials } : {},
2059
2070
  ...input.piConfig ? { piConfig: input.piConfig } : {},
@@ -3013,6 +3024,11 @@ var LlmConfigurationBuilder = class extends ExternalActionTurnBuilder {
3013
3024
  consumedProductNames = /* @__PURE__ */ new Set();
3014
3025
  optionalConsumedProductNames = /* @__PURE__ */ new Set();
3015
3026
  /** @public */
3027
+ modelRequirements(requirements) {
3028
+ this.configuration.modelRequirements = structuredClone(requirements);
3029
+ return this;
3030
+ }
3031
+ /** @public */
3016
3032
  executionPurpose(purpose) {
3017
3033
  if (purpose) this.configuration.executionPurpose = purpose;
3018
3034
  else delete this.configuration.executionPurpose;
@@ -3895,6 +3911,11 @@ var FlowProcessBuilder = class extends FlowComponentBuilder {
3895
3911
  * turn and reference only declared turns without repeats.
3896
3912
  */
3897
3913
  /** @public */
3914
+ modelRequirements(requirements) {
3915
+ this.configuration.modelRequirements = structuredClone(requirements);
3916
+ return this;
3917
+ }
3918
+ /** @public */
3898
3919
  happyPath(...turnIds) {
3899
3920
  this.configuration.happyPath = turnIds;
3900
3921
  return this;