@camstack/addon-training 0.1.7 → 0.1.9

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.
@@ -1,4 +1,4 @@
1
- import "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-gU49KvnZ.mjs";
1
+ import "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-DyaOKSDv.mjs";
2
2
  //#region \0virtual:mf-localSharedImportMap:__mfe_internal__addon_training_page
3
3
  var e = {
4
4
  "@camstack/sdk": {
@@ -18,7 +18,7 @@ var e = {
18
18
  },
19
19
  "@camstack/types": {
20
20
  name: "@camstack/types",
21
- version: "1.2.340",
21
+ version: "1.2.341",
22
22
  scope: ["default"],
23
23
  loaded: !1,
24
24
  from: "addon_training_page",
@@ -33,7 +33,7 @@ var e = {
33
33
  },
34
34
  "@camstack/ui-library": {
35
35
  name: "@camstack/ui-library",
36
- version: "1.2.260",
36
+ version: "1.2.261",
37
37
  scope: ["default"],
38
38
  loaded: !1,
39
39
  from: "addon_training_page",
@@ -36,7 +36,7 @@ async function r() {
36
36
  }
37
37
  },
38
38
  "@camstack/types": {
39
- version: "1.2.340",
39
+ version: "1.2.341",
40
40
  scope: "default",
41
41
  shareConfig: {
42
42
  singleton: !0,
@@ -81,7 +81,7 @@ async function r() {
81
81
  }
82
82
  },
83
83
  "@camstack/ui-library": {
84
- version: "1.2.260",
84
+ version: "1.2.261",
85
85
  scope: "default",
86
86
  shareConfig: {
87
87
  singleton: !0,
@@ -128,6 +128,26 @@ function deleteModalEntry(config, entryId) {
128
128
  }
129
129
  };
130
130
  }
131
+ /**
132
+ * Mint a stable id for every persisted entry that lacks one. Operator-typed
133
+ * empty ids (legacy settings UI) must never stay empty — createEntry always
134
+ * generates; this heals rows that bypassed it.
135
+ */
136
+ function ensureModalEntryIds(config, newId) {
137
+ let changed = false;
138
+ const entries = config.entries.map((entry) => {
139
+ if (entry.id.trim() !== "") return entry;
140
+ changed = true;
141
+ return {
142
+ ...entry,
143
+ id: newId()
144
+ };
145
+ });
146
+ return changed ? {
147
+ ...config,
148
+ entries
149
+ } : config;
150
+ }
131
151
  //#endregion
132
152
  //#region src/providers/modal/dockerfile.ts
133
153
  var ALLOWED = new Set([
@@ -88507,10 +88527,10 @@ var TrainingModalAddon = class extends require_dist.BaseAddon {
88507
88527
  });
88508
88528
  }
88509
88529
  async onInitialize() {
88510
- if (this.config.entries.length === 0) {
88511
- const migrated = migrateLegacyModalConfig(this.config, () => (0, node_crypto.randomUUID)());
88512
- if (migrated.entries.length > 0) await this.updateGlobalSettings(migrated);
88513
- }
88530
+ let next = this.config;
88531
+ if (next.entries.length === 0) next = migrateLegacyModalConfig(next, () => (0, node_crypto.randomUUID)());
88532
+ next = ensureModalEntryIds(next, () => (0, node_crypto.randomUUID)());
88533
+ if (next !== this.config) await this.updateGlobalSettings(next);
88514
88534
  this.ledgerState = this.state(LEDGER_KEY, LedgerSchema, {});
88515
88535
  const peer = this.ctx.peerBytes;
88516
88536
  if (peer === void 0) throw new Error("training-modal needs the peer-bytes facility");
@@ -88611,8 +88631,9 @@ var TrainingModalAddon = class extends require_dist.BaseAddon {
88611
88631
  key: "entries",
88612
88632
  label: "Entries",
88613
88633
  itemIdKey: "id",
88634
+ /** Create only via trainingProvider.createEntry (auto id). */
88635
+ maxRows: 0,
88614
88636
  emptyMessage: "No Modal entries yet — add one from Training → Providers.",
88615
- addLabel: "Add entry",
88616
88637
  rowTitleTemplate: "{name}",
88617
88638
  defaultItem: {
88618
88639
  id: "",
@@ -88627,11 +88648,6 @@ var TrainingModalAddon = class extends require_dist.BaseAddon {
88627
88648
  failedDatasetGraceHours: 24
88628
88649
  },
88629
88650
  itemFields: [
88630
- {
88631
- type: "text",
88632
- key: "id",
88633
- label: "Entry id"
88634
- },
88635
88651
  {
88636
88652
  type: "text",
88637
88653
  key: "name",
@@ -156,6 +156,26 @@ function deleteModalEntry(config, entryId) {
156
156
  }
157
157
  };
158
158
  }
159
+ /**
160
+ * Mint a stable id for every persisted entry that lacks one. Operator-typed
161
+ * empty ids (legacy settings UI) must never stay empty — createEntry always
162
+ * generates; this heals rows that bypassed it.
163
+ */
164
+ function ensureModalEntryIds(config, newId) {
165
+ let changed = false;
166
+ const entries = config.entries.map((entry) => {
167
+ if (entry.id.trim() !== "") return entry;
168
+ changed = true;
169
+ return {
170
+ ...entry,
171
+ id: newId()
172
+ };
173
+ });
174
+ return changed ? {
175
+ ...config,
176
+ entries
177
+ } : config;
178
+ }
159
179
  //#endregion
160
180
  //#region src/providers/modal/dockerfile.ts
161
181
  var ALLOWED = new Set([
@@ -88535,10 +88555,10 @@ var TrainingModalAddon = class extends BaseAddon {
88535
88555
  });
88536
88556
  }
88537
88557
  async onInitialize() {
88538
- if (this.config.entries.length === 0) {
88539
- const migrated = migrateLegacyModalConfig(this.config, () => randomUUID());
88540
- if (migrated.entries.length > 0) await this.updateGlobalSettings(migrated);
88541
- }
88558
+ let next = this.config;
88559
+ if (next.entries.length === 0) next = migrateLegacyModalConfig(next, () => randomUUID());
88560
+ next = ensureModalEntryIds(next, () => randomUUID());
88561
+ if (next !== this.config) await this.updateGlobalSettings(next);
88542
88562
  this.ledgerState = this.state(LEDGER_KEY, LedgerSchema, {});
88543
88563
  const peer = this.ctx.peerBytes;
88544
88564
  if (peer === void 0) throw new Error("training-modal needs the peer-bytes facility");
@@ -88639,8 +88659,9 @@ var TrainingModalAddon = class extends BaseAddon {
88639
88659
  key: "entries",
88640
88660
  label: "Entries",
88641
88661
  itemIdKey: "id",
88662
+ /** Create only via trainingProvider.createEntry (auto id). */
88663
+ maxRows: 0,
88642
88664
  emptyMessage: "No Modal entries yet — add one from Training → Providers.",
88643
- addLabel: "Add entry",
88644
88665
  rowTitleTemplate: "{name}",
88645
88666
  defaultItem: {
88646
88667
  id: "",
@@ -88655,11 +88676,6 @@ var TrainingModalAddon = class extends BaseAddon {
88655
88676
  failedDatasetGraceHours: 24
88656
88677
  },
88657
88678
  itemFields: [
88658
- {
88659
- type: "text",
88660
- key: "id",
88661
- label: "Entry id"
88662
- },
88663
88679
  {
88664
88680
  type: "text",
88665
88681
  key: "name",
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-gU49KvnZ.mjs";
1
+ import { n as e, t } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-DyaOKSDv.mjs";
2
2
  export { t as get, e as init };
@@ -2762,7 +2762,7 @@ async function or(e) {
2762
2762
  }
2763
2763
  }
2764
2764
  async function sr() {
2765
- return ir ||= or(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-B3xXUcaU.mjs")).catch((e) => {
2765
+ return ir ||= or(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-BiodS83V.mjs")).catch((e) => {
2766
2766
  throw ir = void 0, e;
2767
2767
  }), ir;
2768
2768
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-training",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Cloud training for CamStack: fine-tune the root detector on your own frames, on your own GPU-cloud account",
5
5
  "keywords": [
6
6
  "camstack",