@rslsp1/fa-app-tools 9.1.0 → 9.4.4

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/szenen.mjs CHANGED
@@ -9,13 +9,19 @@ import {
9
9
  ELEMENT_VERSION_SCHEMA_FILE,
10
10
  FLOW_EXECUTION_PATH,
11
11
  GENERAL_POLICY_SUBTYPE,
12
+ KEINE_BILDER,
13
+ LOAD_MORE_PAGE_SIZE,
12
14
  MANUAL_MODEL_ID,
13
15
  MANUAL_NODE_STATE,
14
16
  MANUAL_PROVIDER,
15
17
  MANUAL_VISIBILITY_BASIS,
16
18
  MAX_PROPOSAL_TITLE_LENGTH,
19
+ PAUSE_SEKUNDEN_OPTIONEN,
20
+ PAUSE_SEKUNDEN_VORGABE,
17
21
  PROBE_VERSION_ID,
22
+ PROMPT_AUSZUG_ZEICHEN,
18
23
  PROMPT_RULE_EFFECT,
24
+ PROMPT_RUN_DETAIL_FIELDS,
19
25
  REFERENCE_FIELD,
20
26
  RULES_WITHOUT_CAPABILITY_EFFECT,
21
27
  RULE_SCOPES,
@@ -34,6 +40,9 @@ import {
34
40
  UPLOAD_MAX_BYTES,
35
41
  UnsupportedSchemaError,
36
42
  acceptProposalTitle,
43
+ annotateElementsFromEvents,
44
+ annotateRunsFromEvents,
45
+ areaForFokus,
37
46
  areasFor,
38
47
  assessDerivationResponse,
39
48
  batchesForPromptRun,
@@ -73,6 +82,7 @@ import {
73
82
  collectImageBatches,
74
83
  collectImageGenerationOrders,
75
84
  collectImageJobs,
85
+ collectPromptRunTags,
76
86
  collectPromptRuns,
77
87
  collectSceneDerivationRecoveries,
78
88
  collectSceneDerivations,
@@ -103,6 +113,7 @@ import {
103
113
  deriveLineage,
104
114
  describableContent,
105
115
  describeTargetModelFailure,
116
+ detailFehlt,
106
117
  diagnosticOfFinding,
107
118
  diagnosticOfSchemaError,
108
119
  draftRevisionOf,
@@ -119,6 +130,7 @@ import {
119
130
  formatSeedListe,
120
131
  freezeDraftChain,
121
132
  freezeSceneWorkingState,
133
+ fuehreQueueAus,
122
134
  generationBatchIdOf,
123
135
  gesamtHerkunft,
124
136
  getSzenenSchemas,
@@ -130,18 +142,24 @@ import {
130
142
  isOk,
131
143
  isProjectionCurrent,
132
144
  isSzenenItemId,
145
+ istGueltigePause,
146
+ istOffen,
133
147
  istSzenenSnapshotDatei,
134
148
  istZipDatei,
135
149
  itemIdForRun,
136
150
  itemsAusBestand,
137
151
  jobsForPromptRun,
152
+ labelsOf,
138
153
  ladeVorschauen,
139
154
  leseBilderAusZip,
155
+ letztesErzeugtesBild,
140
156
  linkFor,
157
+ listElementsPageOver,
141
158
  locatorAus,
142
159
  locatorTeile,
143
160
  logRevisionOf,
144
161
  manualEntryOf,
162
+ mergeRunTags,
145
163
  mergeSnapshotAndPending,
146
164
  mergeSzenenBatchOrigin,
147
165
  mimeTypAus,
@@ -150,12 +168,18 @@ import {
150
168
  noticeFor,
151
169
  ordersForPromptRun,
152
170
  ordneSeedsZu,
171
+ pageOf,
172
+ pagePromptRuns,
173
+ pageRequestFrom,
153
174
  parseDerivationResponse,
154
175
  parseRunResponse,
155
176
  parseSeedListe,
156
177
  parseSzenenSnapshot,
157
178
  preferredHeadRevisionOf,
158
179
  promptDiagnosticsOf,
180
+ promptRunPageForTransport,
181
+ promptRunPageFromTransport,
182
+ promptRunTagsOf,
159
183
  publishedHeadsOf,
160
184
  recoveriesForRun,
161
185
  recoveryStatusOf,
@@ -168,6 +192,7 @@ import {
168
192
  resolveTargetModelOver,
169
193
  resolverFromQueries,
170
194
  roundOfRun,
195
+ roundsOf,
171
196
  rulesWithoutPromptEffect,
172
197
  runPromptDerivation,
173
198
  runPublishChecks,
@@ -176,6 +201,7 @@ import {
176
201
  scenePolicyFingerprint,
177
202
  scopeOfPath,
178
203
  seedFehlerText,
204
+ selectImageJobs,
179
205
  selectPromptRuns,
180
206
  selectableTargetModels,
181
207
  showChain,
@@ -184,6 +210,7 @@ import {
184
210
  sortScenePolicies,
185
211
  sourceOf,
186
212
  szenenSnapshotFilename,
213
+ tagRefsAus,
187
214
  typAusBytes,
188
215
  unclassifiedPublishRules,
189
216
  unsupportedReason,
@@ -192,7 +219,7 @@ import {
192
219
  validateElementVersion,
193
220
  validatePayload,
194
221
  withReference
195
- } from "./chunk-33L6XAHI.mjs";
222
+ } from "./chunk-KF5ZVSKJ.mjs";
196
223
  import {
197
224
  ContractViolation,
198
225
  STYLE_PAYLOAD,
@@ -526,6 +553,14 @@ function createMemoryViewPort(options = {}) {
526
553
  const ids = options.ids ?? defaultIds;
527
554
  const elements = createHfElementStore({ channel: createInMemoryEventChannel() });
528
555
  const laeufe = [...options.runs ?? []];
556
+ const laufTags = new Map(
557
+ Object.entries(options.runTags ?? {}).map(
558
+ ([runId, labels]) => [runId, labels.map((l) => ({ l, v: l, cat: null }))]
559
+ )
560
+ );
561
+ const annotationen = new Map(
562
+ Object.entries(options.runAnnotations ?? {})
563
+ );
529
564
  const items = /* @__PURE__ */ new Map();
530
565
  const versionMedien = /* @__PURE__ */ new Map();
531
566
  const itemMedien = /* @__PURE__ */ new Map();
@@ -649,6 +684,38 @@ function createMemoryViewPort(options = {}) {
649
684
  // Server. Ein eigener Filter waere eine zweite Wahrheit.
650
685
  async listAllRuns(filter) {
651
686
  return ok(selectPromptRuns(laeufe, filter));
687
+ },
688
+ /**
689
+ * Die direkten Tags eines Laufs setzen — der vollstaendige Satz.
690
+ *
691
+ * Ohne Vokabelpruefung, und das ist hier richtig: Der Speicherhost hat
692
+ * keine Vokabel. Die Regel „nur bestehende Tags" gehoert dorthin, wo die
693
+ * Tabelle steht (`libraryService.resolveTagLabels`), nicht in eine zweite
694
+ * Fassung davon.
695
+ */
696
+ async setRunTags(runId, labels) {
697
+ if (!laeufe.some((l) => l.run_id === runId)) {
698
+ return { kind: "error", message: `Lauf ${runId} ist unbekannt.`, retryable: false };
699
+ }
700
+ const satz = labels.map((l) => ({ l, v: l, cat: null }));
701
+ laufTags.set(runId, satz);
702
+ return done(satz);
703
+ },
704
+ // Der Seitenschnitt — dieselbe reine Funktion wie im Client und im Server.
705
+ async listRunsPage(input) {
706
+ try {
707
+ return ok(pagePromptRuns(laeufe, {
708
+ ...input,
709
+ tags: input.tags ?? laufTags,
710
+ ...annotationen.size > 0 && !input.annotations ? { annotations: annotationen } : {}
711
+ }));
712
+ } catch (error) {
713
+ return {
714
+ kind: "error",
715
+ message: error instanceof Error ? error.message : String(error),
716
+ retryable: false
717
+ };
718
+ }
652
719
  }
653
720
  };
654
721
  const itemPort = {
@@ -1049,8 +1116,21 @@ function createMemoryViewPort(options = {}) {
1049
1116
  return done(null);
1050
1117
  }
1051
1118
  };
1119
+ const elementeMitAnnotationen = options.elementAnnotations ? {
1120
+ ...elements,
1121
+ async listElementsPage(filter, page) {
1122
+ const seite = await listElementsPageOver((f) => elements.listElements(f), filter, page);
1123
+ if (seite.kind !== "ok") return seite;
1124
+ const annotations = {};
1125
+ for (const element of seite.value.items) {
1126
+ const annotation = options.elementAnnotations[element.element_id];
1127
+ if (annotation) annotations[element.element_id] = annotation;
1128
+ }
1129
+ return ok({ ...seite.value, annotations });
1130
+ }
1131
+ } : elements;
1052
1132
  const port = {
1053
- elements,
1133
+ elements: elementeMitAnnotationen,
1054
1134
  context: {
1055
1135
  // Ein Host ohne Kontextgraph liefert `[eigener, null]` — das ist dort
1056
1136
  // nicht die verkürzte Vererbung, sondern die vollständige.
@@ -1058,7 +1138,17 @@ function createMemoryViewPort(options = {}) {
1058
1138
  return ok(contextId === null ? [null] : [contextId, null]);
1059
1139
  }
1060
1140
  },
1061
- runs
1141
+ runs,
1142
+ // Die Vorschlagsliste des Tag-Editors — nur, wenn der Test eine Vokabel
1143
+ // vorgibt. Weglassen statt leere Liste: `tagVocabulary: false` ist eine
1144
+ // andere Aussage als „die Vokabel ist leer".
1145
+ ...options.tagVocabulary ? {
1146
+ tags: {
1147
+ async listTags() {
1148
+ return ok(options.tagVocabulary.map((l) => ({ l, v: l, cat: null })));
1149
+ }
1150
+ }
1151
+ } : {}
1062
1152
  };
1063
1153
  if (options.items !== false) port.items = itemPort;
1064
1154
  if (options.media !== false) port.media = mediaPort;
@@ -1880,13 +1970,19 @@ export {
1880
1970
  ELEMENT_VERSION_SCHEMA_FILE,
1881
1971
  FLOW_EXECUTION_PATH,
1882
1972
  GENERAL_POLICY_SUBTYPE,
1973
+ KEINE_BILDER,
1974
+ LOAD_MORE_PAGE_SIZE,
1883
1975
  MANUAL_MODEL_ID,
1884
1976
  MANUAL_NODE_STATE,
1885
1977
  MANUAL_PROVIDER,
1886
1978
  MANUAL_VISIBILITY_BASIS,
1887
1979
  MCP_CLIENT_PROVIDER,
1980
+ PAUSE_SEKUNDEN_OPTIONEN,
1981
+ PAUSE_SEKUNDEN_VORGABE,
1888
1982
  PROBE_VERSION_ID,
1983
+ PROMPT_AUSZUG_ZEICHEN,
1889
1984
  PROMPT_RULE_EFFECT,
1985
+ PROMPT_RUN_DETAIL_FIELDS,
1890
1986
  REFERENCE_FIELD,
1891
1987
  RULES_WITHOUT_CAPABILITY_EFFECT,
1892
1988
  RULE_SCOPES,
@@ -1908,6 +2004,9 @@ export {
1908
2004
  UPLOAD_MAX_BYTES,
1909
2005
  UnsupportedSchemaError,
1910
2006
  VersionDagError,
2007
+ annotateElementsFromEvents,
2008
+ annotateRunsFromEvents,
2009
+ areaForFokus,
1911
2010
  areasFor,
1912
2011
  assessDerivationResponse,
1913
2012
  batchesForPromptRun,
@@ -1952,6 +2051,7 @@ export {
1952
2051
  collectImageGenerationOrders,
1953
2052
  collectImageJobs,
1954
2053
  collectPromptOperations,
2054
+ collectPromptRunTags,
1955
2055
  collectPromptRuns,
1956
2056
  collectProviderChecks,
1957
2057
  collectSceneDerivationRecoveries,
@@ -1987,6 +2087,7 @@ export {
1987
2087
  deriveLineage,
1988
2088
  describableContent,
1989
2089
  describeTargetModelFailure,
2090
+ detailFehlt,
1990
2091
  diagnosticOfFinding,
1991
2092
  diagnosticOfSchemaError,
1992
2093
  differentialSteps,
@@ -2007,6 +2108,7 @@ export {
2007
2108
  formatSeedListe,
2008
2109
  freezeDraftChain,
2009
2110
  freezeSceneWorkingState,
2111
+ fuehreQueueAus,
2010
2112
  generationBatchIdOf,
2011
2113
  gesamtHerkunft,
2012
2114
  getSzenenSchemas,
@@ -2018,18 +2120,24 @@ export {
2018
2120
  isOk,
2019
2121
  isProjectionCurrent,
2020
2122
  isSzenenItemId,
2123
+ istGueltigePause,
2124
+ istOffen,
2021
2125
  istSzenenSnapshotDatei,
2022
2126
  istZipDatei,
2023
2127
  itemIdForRun,
2024
2128
  itemsAusBestand,
2025
2129
  jobsForPromptRun,
2130
+ labelsOf,
2026
2131
  ladeVorschauen,
2027
2132
  leseBilderAusZip,
2133
+ letztesErzeugtesBild,
2028
2134
  linkFor,
2135
+ listElementsPageOver,
2029
2136
  locatorAus,
2030
2137
  locatorTeile,
2031
2138
  logRevisionOf,
2032
2139
  manualEntryOf,
2140
+ mergeRunTags,
2033
2141
  mergeSnapshotAndPending,
2034
2142
  mergeSzenenBatchOrigin,
2035
2143
  mimeTypAus,
@@ -2038,6 +2146,9 @@ export {
2038
2146
  noticeFor,
2039
2147
  ordersForPromptRun,
2040
2148
  ordneSeedsZu,
2149
+ pageOf,
2150
+ pagePromptRuns,
2151
+ pageRequestFrom,
2041
2152
  parseDerivationResponse,
2042
2153
  parseRunResponse,
2043
2154
  parseSeedListe,
@@ -2046,6 +2157,9 @@ export {
2046
2157
  preferredVersionId,
2047
2158
  preparePromptOperation,
2048
2159
  promptDiagnosticsOf,
2160
+ promptRunPageForTransport,
2161
+ promptRunPageFromTransport,
2162
+ promptRunTagsOf,
2049
2163
  publishedHeadsOf,
2050
2164
  recoveriesForRun,
2051
2165
  recoveryStatusOf,
@@ -2060,6 +2174,7 @@ export {
2060
2174
  resolverFromQueries,
2061
2175
  responseContractOf,
2062
2176
  roundOfRun,
2177
+ roundsOf,
2063
2178
  rulesWithoutPromptEffect,
2064
2179
  runElementStoreContract,
2065
2180
  runOfOperation,
@@ -2072,6 +2187,7 @@ export {
2072
2187
  scenePolicyFingerprint,
2073
2188
  scopeOfPath,
2074
2189
  seedFehlerText,
2190
+ selectImageJobs,
2075
2191
  selectPromptRuns,
2076
2192
  selectableTargetModels,
2077
2193
  showChain,
@@ -2080,6 +2196,7 @@ export {
2080
2196
  sortScenePolicies,
2081
2197
  sourceOf,
2082
2198
  szenenSnapshotFilename,
2199
+ tagRefsAus,
2083
2200
  totalModelCalls,
2084
2201
  typAusBytes,
2085
2202
  unclassifiedPublishRules,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rslsp1/fa-app-tools",
3
- "version": "9.1.0",
3
+ "version": "9.4.4",
4
4
  "description": "Shared tools and hooks for Fine Art flow apps",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -29,7 +29,8 @@
29
29
  "build": "node scripts/sync-szenen-styles.js && tsup",
30
30
  "prepublishOnly": "npm run build",
31
31
  "test": "vitest run",
32
- "mutation:szenen": "stryker run stryker.szenen.conf.mjs"
32
+ "mutation:szenen": "stryker run stryker.szenen.conf.mjs",
33
+ "mutation:runintegrity": "stryker run stryker.runintegrity.conf.mjs"
33
34
  },
34
35
  "peerDependencies": {
35
36
  "react": ">=18"