@syncended/dsh-automations 0.3.0 → 0.3.1

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.
Files changed (2) hide show
  1. package/lib/client.js +13 -2
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -40,6 +40,7 @@ window.__ModuleLoader__.load({
40
40
  const MIN_TIMEOUT_MS = 1000;
41
41
  const MAX_TIMEOUT_MS = 86400000;
42
42
  const JOB_ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,62}$/;
43
+ let formInstanceSerial = 0;
43
44
 
44
45
  const BROWSER_TIMEZONE = (() => {
45
46
  try {
@@ -600,6 +601,11 @@ window.__ModuleLoader__.load({
600
601
  return h("span", { className: "dsh-auto-status dsh-auto-status-" + props.status }, props.status);
601
602
  }
602
603
 
604
+ function nextFormInstancePrefix(reactFormId) {
605
+ formInstanceSerial += 1;
606
+ return "dsh-auto-form-" + formInstanceSerial + "-" + reactFormId;
607
+ }
608
+
603
609
  function JobForm(props) {
604
610
  const { meta, draft, editing, saving, error, onChange, onIdTouched, onSubmit, onCancel } = props;
605
611
  const providers = meta && Array.isArray(meta.providers) ? meta.providers : [];
@@ -611,8 +617,12 @@ window.__ModuleLoader__.load({
611
617
  : ["workspace-write"];
612
618
  const agentPresets = meta && Array.isArray(meta.agentPresets) ? meta.agentPresets : [];
613
619
  const creating = editing === null;
614
- const formPrefix = "dsh-auto-form-" + String(useId()).replace(/[^A-Za-z0-9_-]/g, "");
615
- const fieldId = (name) => formPrefix + "-" + name;
620
+ const reactFormId = String(useId()).replace(/[^A-Za-z0-9_-]/g, "");
621
+ const formPrefixRef = useRef(null);
622
+ if (formPrefixRef.current === null) {
623
+ formPrefixRef.current = nextFormInstancePrefix(reactFormId);
624
+ }
625
+ const fieldId = (name) => formPrefixRef.current + "-" + name;
616
626
 
617
627
  return h(
618
628
  "form",
@@ -1878,6 +1888,7 @@ window.__ModuleLoader__.load({
1878
1888
  exports.agentPresetDisplayLabel = agentPresetDisplayLabel;
1879
1889
  exports.permissionPresetPresentation = permissionPresetPresentation;
1880
1890
  exports.PermissionPresetPicker = PermissionPresetPicker;
1891
+ exports.__testing = Object.freeze({ nextFormInstancePrefix });
1881
1892
  exports.inject = inject;
1882
1893
  exports.apply = apply;
1883
1894
  return module.exports;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncended/dsh-automations",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Durable cron automations for DeepSeek Harness",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",