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