@wildo-ai/platform-core-shared 1.1.11 → 1.1.13

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 (142) hide show
  1. package/dist/esm/core/resources/resources-operations.custom.shared.definitions.d.ts.map +1 -1
  2. package/dist/esm/core/resources/resources-operations.custom.shared.definitions.js.map +1 -1
  3. package/dist/esm/core/resources/resources-relationships.custom.shared.definitions.d.ts.map +1 -1
  4. package/dist/esm/core/resources/resources-relationships.custom.shared.definitions.js.map +1 -1
  5. package/dist/esm/core/resources/resources-types.custom.shared.schemas.d.ts.map +1 -1
  6. package/dist/esm/core/resources/resources-types.custom.shared.schemas.js.map +1 -1
  7. package/dist/esm/dev-runtime/dependency-install-record.d.ts +111 -0
  8. package/dist/esm/dev-runtime/dependency-install-record.d.ts.map +1 -0
  9. package/dist/esm/dev-runtime/dependency-install-record.js +185 -0
  10. package/dist/esm/dev-runtime/dependency-install-record.js.map +1 -0
  11. package/dist/esm/dev-runtime/dev-runtime-command.d.ts +50 -0
  12. package/dist/esm/dev-runtime/dev-runtime-command.d.ts.map +1 -0
  13. package/dist/esm/dev-runtime/dev-runtime-command.js +147 -0
  14. package/dist/esm/dev-runtime/dev-runtime-command.js.map +1 -0
  15. package/dist/esm/dev-runtime/dev-runtime-processes.d.ts +47 -0
  16. package/dist/esm/dev-runtime/dev-runtime-processes.d.ts.map +1 -0
  17. package/dist/esm/dev-runtime/dev-runtime-processes.js +163 -0
  18. package/dist/esm/dev-runtime/dev-runtime-processes.js.map +1 -0
  19. package/dist/esm/dev-runtime/dev-runtime-signals.d.ts +54 -0
  20. package/dist/esm/dev-runtime/dev-runtime-signals.d.ts.map +1 -0
  21. package/dist/esm/dev-runtime/dev-runtime-signals.js +113 -0
  22. package/dist/esm/dev-runtime/dev-runtime-signals.js.map +1 -0
  23. package/dist/esm/dev-runtime/emitted-relative-specifiers.d.ts +14 -0
  24. package/dist/esm/dev-runtime/emitted-relative-specifiers.d.ts.map +1 -0
  25. package/dist/esm/dev-runtime/emitted-relative-specifiers.js +71 -0
  26. package/dist/esm/dev-runtime/emitted-relative-specifiers.js.map +1 -0
  27. package/dist/esm/dev-runtime/frontend-dev-runtime.d.ts +43 -0
  28. package/dist/esm/dev-runtime/frontend-dev-runtime.d.ts.map +1 -0
  29. package/dist/esm/dev-runtime/frontend-dev-runtime.js +42 -0
  30. package/dist/esm/dev-runtime/frontend-dev-runtime.js.map +1 -0
  31. package/dist/esm/dev-runtime/node-runtime-dev-supervisor.d.ts +233 -0
  32. package/dist/esm/dev-runtime/node-runtime-dev-supervisor.d.ts.map +1 -0
  33. package/dist/esm/dev-runtime/node-runtime-dev-supervisor.js +578 -0
  34. package/dist/esm/dev-runtime/node-runtime-dev-supervisor.js.map +1 -0
  35. package/dist/esm/dev-runtime/package-compile-loop.d.ts +125 -0
  36. package/dist/esm/dev-runtime/package-compile-loop.d.ts.map +1 -0
  37. package/dist/esm/dev-runtime/package-compile-loop.js +386 -0
  38. package/dist/esm/dev-runtime/package-compile-loop.js.map +1 -0
  39. package/dist/esm/dev-runtime.exports.d.ts +19 -0
  40. package/dist/esm/dev-runtime.exports.d.ts.map +1 -0
  41. package/dist/esm/dev-runtime.exports.js +19 -0
  42. package/dist/esm/dev-runtime.exports.js.map +1 -0
  43. package/dist/esm/index.d.ts +4 -0
  44. package/dist/esm/index.d.ts.map +1 -1
  45. package/dist/esm/index.js +4 -0
  46. package/dist/esm/index.js.map +1 -1
  47. package/dist/esm/runtime/application-backend-env.contracts.d.ts +9 -2
  48. package/dist/esm/runtime/application-backend-env.contracts.d.ts.map +1 -1
  49. package/dist/esm/runtime/application-backend-env.contracts.js +8 -1
  50. package/dist/esm/runtime/application-backend-env.contracts.js.map +1 -1
  51. package/dist/esm/runtime/application-worker-env.contracts.d.ts +11 -3
  52. package/dist/esm/runtime/application-worker-env.contracts.d.ts.map +1 -1
  53. package/dist/esm/runtime/application-worker-env.contracts.js +9 -0
  54. package/dist/esm/runtime/application-worker-env.contracts.js.map +1 -1
  55. package/dist/esm/runtime/backend-start-outcome.contracts.d.ts +27 -0
  56. package/dist/esm/runtime/backend-start-outcome.contracts.d.ts.map +1 -1
  57. package/dist/esm/runtime/backend-start-outcome.contracts.js +34 -0
  58. package/dist/esm/runtime/backend-start-outcome.contracts.js.map +1 -1
  59. package/dist/esm/runtime/frontend-settings-hub-wiring.contracts.d.ts +28 -0
  60. package/dist/esm/runtime/frontend-settings-hub-wiring.contracts.d.ts.map +1 -0
  61. package/dist/esm/runtime/frontend-settings-hub-wiring.contracts.js +35 -0
  62. package/dist/esm/runtime/frontend-settings-hub-wiring.contracts.js.map +1 -0
  63. package/dist/esm/runtime/http-server-env.contracts.d.ts +14 -1
  64. package/dist/esm/runtime/http-server-env.contracts.d.ts.map +1 -1
  65. package/dist/esm/runtime/http-server-env.contracts.js +13 -0
  66. package/dist/esm/runtime/http-server-env.contracts.js.map +1 -1
  67. package/dist/esm/runtime/local-dev-runtime-signals.contracts.d.ts +239 -0
  68. package/dist/esm/runtime/local-dev-runtime-signals.contracts.d.ts.map +1 -0
  69. package/dist/esm/runtime/local-dev-runtime-signals.contracts.js +256 -0
  70. package/dist/esm/runtime/local-dev-runtime-signals.contracts.js.map +1 -0
  71. package/dist/esm/runtime/runtime-topology.contracts.d.ts.map +1 -1
  72. package/dist/esm/runtime/runtime-topology.contracts.js.map +1 -1
  73. package/dist/esm/security/authorizations/roles.custom.shared.definitions.d.ts.map +1 -1
  74. package/dist/esm/security/authorizations/roles.custom.shared.definitions.js.map +1 -1
  75. package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.resources-config.schemas.d.ts +112 -104
  76. package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.resources-config.schemas.d.ts.map +1 -1
  77. package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.resources-config.schemas.js +4 -3
  78. package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.resources-config.schemas.js.map +1 -1
  79. package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.schemas.d.ts +112 -104
  80. package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.schemas.d.ts.map +1 -1
  81. package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.schemas.js.map +1 -1
  82. package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.resources-config.schemas.d.ts +24 -34
  83. package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.resources-config.schemas.d.ts.map +1 -1
  84. package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.resources-config.schemas.js +4 -3
  85. package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.resources-config.schemas.js.map +1 -1
  86. package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.schemas.d.ts +24 -34
  87. package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.schemas.d.ts.map +1 -1
  88. package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.schemas.js.map +1 -1
  89. package/dist/esm/wildo-applications/wildo-applications.custom.shared.resources-config.schemas.d.ts +3 -3
  90. package/dist/esm/wildo-applications/wildo-applications.custom.shared.resources-config.schemas.d.ts.map +1 -1
  91. package/dist/esm/wildo-applications/wildo-applications.custom.shared.resources-config.schemas.js +30 -42
  92. package/dist/esm/wildo-applications/wildo-applications.custom.shared.resources-config.schemas.js.map +1 -1
  93. package/dist/esm/wildo-applications/wildo-applications.custom.shared.schemas.d.ts +9 -9
  94. package/dist/esm/wildo-applications/wildo-applications.custom.shared.schemas.d.ts.map +1 -1
  95. package/dist/esm/wildo-applications/wildo-applications.custom.shared.schemas.js.map +1 -1
  96. package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.resources-config.schemas.d.ts.map +1 -1
  97. package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.resources-config.schemas.js.map +1 -1
  98. package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.schemas.d.ts +7 -7
  99. package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.schemas.d.ts.map +1 -1
  100. package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.schemas.js.map +1 -1
  101. package/dist/esm/workbench/creation-drive.custom.shared.schemas.d.ts +82 -0
  102. package/dist/esm/workbench/creation-drive.custom.shared.schemas.d.ts.map +1 -0
  103. package/dist/esm/workbench/creation-drive.custom.shared.schemas.js +73 -0
  104. package/dist/esm/workbench/creation-drive.custom.shared.schemas.js.map +1 -0
  105. package/dist/esm/workbench/creation-journey-timeline.custom.shared.schemas.d.ts +183 -0
  106. package/dist/esm/workbench/creation-journey-timeline.custom.shared.schemas.d.ts.map +1 -0
  107. package/dist/esm/workbench/creation-journey-timeline.custom.shared.schemas.js +188 -0
  108. package/dist/esm/workbench/creation-journey-timeline.custom.shared.schemas.js.map +1 -0
  109. package/dist/esm/workbench/workbench-aspect-resources.custom.shared.schemas.d.ts.map +1 -1
  110. package/dist/esm/workbench/workbench-aspect-resources.custom.shared.schemas.js +46 -0
  111. package/dist/esm/workbench/workbench-aspect-resources.custom.shared.schemas.js.map +1 -1
  112. package/dist/esm/workbench/workbench-creation-console.custom.shared.schemas.d.ts +170 -7
  113. package/dist/esm/workbench/workbench-creation-console.custom.shared.schemas.d.ts.map +1 -1
  114. package/dist/esm/workbench/workbench-creation-console.custom.shared.schemas.js +177 -7
  115. package/dist/esm/workbench/workbench-creation-console.custom.shared.schemas.js.map +1 -1
  116. package/dist/esm/workbench/workbench-creation-conversation.custom.shared.schemas.d.ts.map +1 -1
  117. package/dist/esm/workbench/workbench-creation-conversation.custom.shared.schemas.js.map +1 -1
  118. package/dist/esm/workbench/workbench-creation-dossier.custom.shared.schemas.d.ts.map +1 -1
  119. package/dist/esm/workbench/workbench-creation-dossier.custom.shared.schemas.js.map +1 -1
  120. package/dist/esm/workbench/workbench-creation-plane.custom.shared.resources-config.schemas.d.ts +480 -459
  121. package/dist/esm/workbench/workbench-creation-plane.custom.shared.resources-config.schemas.d.ts.map +1 -1
  122. package/dist/esm/workbench/workbench-creation-plane.custom.shared.resources-config.schemas.js +21 -16
  123. package/dist/esm/workbench/workbench-creation-plane.custom.shared.resources-config.schemas.js.map +1 -1
  124. package/dist/esm/workbench/workbench-creation-plane.custom.shared.schemas.d.ts +480 -278
  125. package/dist/esm/workbench/workbench-creation-plane.custom.shared.schemas.d.ts.map +1 -1
  126. package/dist/esm/workbench/workbench-creation-plane.custom.shared.schemas.js +316 -46
  127. package/dist/esm/workbench/workbench-creation-plane.custom.shared.schemas.js.map +1 -1
  128. package/dist/esm/workbench/workbench-domain-model.custom.shared.schemas.d.ts.map +1 -1
  129. package/dist/esm/workbench/workbench-domain-model.custom.shared.schemas.js.map +1 -1
  130. package/dist/esm/workbench/workbench-resources-types.custom.shared.schemas.d.ts +7 -0
  131. package/dist/esm/workbench/workbench-resources-types.custom.shared.schemas.d.ts.map +1 -1
  132. package/dist/esm/workbench/workbench-resources-types.custom.shared.schemas.js +13 -1
  133. package/dist/esm/workbench/workbench-resources-types.custom.shared.schemas.js.map +1 -1
  134. package/dist/esm/workbench/workbench-resources.custom.shared.resources-config.schemas.d.ts +287 -277
  135. package/dist/esm/workbench/workbench-resources.custom.shared.resources-config.schemas.d.ts.map +1 -1
  136. package/dist/esm/workbench/workbench-resources.custom.shared.resources-config.schemas.js.map +1 -1
  137. package/dist/esm/workbench/workbench-resources.custom.shared.schemas.d.ts +34 -29
  138. package/dist/esm/workbench/workbench-resources.custom.shared.schemas.d.ts.map +1 -1
  139. package/dist/esm/workbench/workbench-resources.custom.shared.schemas.js +9 -5
  140. package/dist/esm/workbench/workbench-resources.custom.shared.schemas.js.map +1 -1
  141. package/dist/tsconfig.build.tsbuildinfo +1 -1
  142. package/package.json +13 -8
@@ -1 +1 @@
1
- {"version":3,"file":"resources-operations.custom.shared.definitions.d.ts","sourceRoot":"","sources":["../../../../../src/core/resources/resources-operations.custom.shared.definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8CAA8C,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAapF,eAAO,MAAM,8CAA8C,EAAE,8CAA8C,CAAC,yBAAyB,CAYpI,CAAC"}
1
+ {"version":3,"file":"resources-operations.custom.shared.definitions.d.ts","sourceRoot":"","sources":["../../../../src/core/resources/resources-operations.custom.shared.definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8CAA8C,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAapF,eAAO,MAAM,8CAA8C,EAAE,8CAA8C,CAAC,yBAAyB,CAYpI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"resources-operations.custom.shared.definitions.js","sourceRoot":"","sources":["../../../../../src/core/resources/resources-operations.custom.shared.definitions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEpF,yBAAyB;AACzB,OAAO,EAAE,6DAA6D,EAAE,MAAM,oFAAoF,CAAC;AACnK,OAAO,EAAE,oEAAoE,EAAE,MAAM,sGAAsG,CAAC;AAC5L,OAAO,EACL,iFAAiF,EACjF,gFAAgF,GACjF,MAAM,wGAAwG,CAAC;AAChH,OAAO,EACL,sEAAsE,GACvE,MAAM,8FAA8F,CAAC;AAEtG,MAAM,CAAC,MAAM,8CAA8C,GAA8E;IACvI,gFAAgF;IAChF,yBAAyB;IACzB,gFAAgF;IAChF,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,EAAE,6DAA6D;IAC5G,CAAC,yBAAyB,CAAC,0BAA0B,CAAC,EAAE,oEAAoE;IAC5H,CAAC,yBAAyB,CAAC,yCAAyC,CAAC,EACnE,iFAAiF;IACnF,CAAC,yBAAyB,CAAC,wCAAwC,CAAC,EAClE,gFAAgF;IAClF,CAAC,yBAAyB,CAAC,6BAA6B,CAAC,EACvD,sEAAsE;CACzE,CAAC","sourcesContent":["import { ResourceConfiguration_InitializationFactoryMap } from '@wildo-ai/saas-models';\nimport { CustomShared_ResourceType } from './resources-types.custom.shared.schemas';\n\n// Application Management\nimport { wildoApplications_ResourceConfiguration_InitializationFactory } from '../../wildo-applications/wildo-applications.custom.shared.resources-config.schemas';\nimport { wildoApplicationVersions_ResourceConfiguration_InitializationFactory } from '../../wildo-applications-versions/wildo-applications-versions.custom.shared.resources-config.schemas';\nimport {\n wildoApplicationActorSystemExecutions_ResourceConfiguration_InitializationFactory,\n wildoApplicationFlowSystemExecutions_ResourceConfiguration_InitializationFactory,\n} from '../../wildo-application-executions/wildo-application-executions.custom.shared.resources-config.schemas';\nimport {\n wildoApplicationActorTasks_ResourceConfiguration_InitializationFactory,\n} from '../../wildo-application-tasks/wildo-application-tasks.custom.shared.resources-config.schemas';\n\nexport const customShared_ResourcesConfigurationsFactoryMap: ResourceConfiguration_InitializationFactoryMap<CustomShared_ResourceType> = {\n // ─────────────────────────────────────────────────────────────────────────────\n // Application Management\n // ─────────────────────────────────────────────────────────────────────────────\n [CustomShared_ResourceType.WILDO_APPLICATION]: wildoApplications_ResourceConfiguration_InitializationFactory,\n [CustomShared_ResourceType.WILDO_APPLICATION_VERSIONS]: wildoApplicationVersions_ResourceConfiguration_InitializationFactory,\n [CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS]:\n wildoApplicationActorSystemExecutions_ResourceConfiguration_InitializationFactory,\n [CustomShared_ResourceType.WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS]:\n wildoApplicationFlowSystemExecutions_ResourceConfiguration_InitializationFactory,\n [CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_TASKS]:\n wildoApplicationActorTasks_ResourceConfiguration_InitializationFactory,\n};\n"]}
1
+ {"version":3,"file":"resources-operations.custom.shared.definitions.js","sourceRoot":"","sources":["../../../../src/core/resources/resources-operations.custom.shared.definitions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEpF,yBAAyB;AACzB,OAAO,EAAE,6DAA6D,EAAE,MAAM,oFAAoF,CAAC;AACnK,OAAO,EAAE,oEAAoE,EAAE,MAAM,sGAAsG,CAAC;AAC5L,OAAO,EACL,iFAAiF,EACjF,gFAAgF,GACjF,MAAM,wGAAwG,CAAC;AAChH,OAAO,EACL,sEAAsE,GACvE,MAAM,8FAA8F,CAAC;AAEtG,MAAM,CAAC,MAAM,8CAA8C,GAA8E;IACvI,gFAAgF;IAChF,yBAAyB;IACzB,gFAAgF;IAChF,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,EAAE,6DAA6D;IAC5G,CAAC,yBAAyB,CAAC,0BAA0B,CAAC,EAAE,oEAAoE;IAC5H,CAAC,yBAAyB,CAAC,yCAAyC,CAAC,EACnE,iFAAiF;IACnF,CAAC,yBAAyB,CAAC,wCAAwC,CAAC,EAClE,gFAAgF;IAClF,CAAC,yBAAyB,CAAC,6BAA6B,CAAC,EACvD,sEAAsE;CACzE,CAAC","sourcesContent":["import { ResourceConfiguration_InitializationFactoryMap } from '@wildo-ai/saas-models';\nimport { CustomShared_ResourceType } from './resources-types.custom.shared.schemas';\n\n// Application Management\nimport { wildoApplications_ResourceConfiguration_InitializationFactory } from '../../wildo-applications/wildo-applications.custom.shared.resources-config.schemas';\nimport { wildoApplicationVersions_ResourceConfiguration_InitializationFactory } from '../../wildo-applications-versions/wildo-applications-versions.custom.shared.resources-config.schemas';\nimport {\n wildoApplicationActorSystemExecutions_ResourceConfiguration_InitializationFactory,\n wildoApplicationFlowSystemExecutions_ResourceConfiguration_InitializationFactory,\n} from '../../wildo-application-executions/wildo-application-executions.custom.shared.resources-config.schemas';\nimport {\n wildoApplicationActorTasks_ResourceConfiguration_InitializationFactory,\n} from '../../wildo-application-tasks/wildo-application-tasks.custom.shared.resources-config.schemas';\n\nexport const customShared_ResourcesConfigurationsFactoryMap: ResourceConfiguration_InitializationFactoryMap<CustomShared_ResourceType> = {\n // ─────────────────────────────────────────────────────────────────────────────\n // Application Management\n // ─────────────────────────────────────────────────────────────────────────────\n [CustomShared_ResourceType.WILDO_APPLICATION]: wildoApplications_ResourceConfiguration_InitializationFactory,\n [CustomShared_ResourceType.WILDO_APPLICATION_VERSIONS]: wildoApplicationVersions_ResourceConfiguration_InitializationFactory,\n [CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS]:\n wildoApplicationActorSystemExecutions_ResourceConfiguration_InitializationFactory,\n [CustomShared_ResourceType.WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS]:\n wildoApplicationFlowSystemExecutions_ResourceConfiguration_InitializationFactory,\n [CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_TASKS]:\n wildoApplicationActorTasks_ResourceConfiguration_InitializationFactory,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"resources-relationships.custom.shared.definitions.d.ts","sourceRoot":"","sources":["../../../../../src/core/resources/resources-relationships.custom.shared.definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmD,oBAAoB,EAA+G,MAAM,uBAAuB,CAAC;AAG3N;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,mCAAmC,EAAE,oBAAoB,EA4KrE,CAAC"}
1
+ {"version":3,"file":"resources-relationships.custom.shared.definitions.d.ts","sourceRoot":"","sources":["../../../../src/core/resources/resources-relationships.custom.shared.definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmD,oBAAoB,EAA+G,MAAM,uBAAuB,CAAC;AAG3N;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,mCAAmC,EAAE,oBAAoB,EA4KrE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"resources-relationships.custom.shared.definitions.js","sourceRoot":"","sources":["../../../../../src/core/resources/resources-relationships.custom.shared.definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,kBAAkB,EAAwB,+BAA+B,EAAE,gBAAgB,EAAE,qBAAqB,E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,eAAe,EAAE,wCAAwC;QACzD,yBAAyB,EAAE,iCAAiC,CAAC,QAAQ;QACrE,aAAa,EAAE,EAAE;KAClB,CACF;CACF,CAAC","sourcesContent":["import { createResourcesRelationship, RelationshipNature, ResourceRelationship, ResourceRelationshipCardinality, CoreResourceType, CoreResourceOperation, ResourceParentResourceRequirement } from \"@wildo-ai/saas-models\";\nimport { CustomShared_ResourceType } from \"./resources-types.custom.shared.schemas\";\n\n/**\n * ⚠️ APPLICATION-CHILD RETENTION (compliance decision, Paul — 2026-07-29).\n *\n * `wildoApplicationVersions`, `wildoApplicationActorSystemExecutions`,\n * `wildoApplicationFlowSystemExecutions` and `wildoApplicationActorTasks` are RETAINED AS AUDIT\n * MATERIAL when their `wildoApplication` is deleted — the deployment/execution history of an\n * application outlives the application record itself. Every `onParentDelete` below is therefore\n * DISABLED.\n *\n * This also FIXES A LATENT BUG rather than merely expressing a preference: these children declare no\n * core DELETE op (`wildoApplicationVersions` exposes READ/LIST/CREATE only), so the cascade would have\n * thrown `ErrorType.CONFIGURATION` inside the parent's delete transaction and ROLLED BACK the\n * application delete as soon as one child row existed. Surfaced by the startup\n * composition-cascade-deletability guard on a live apps-manager boot (2026-07-29) — it was invisible to\n * the engine's regression test, which only rebuilds the CORE registry.\n *\n * A COMPOSITION without `onParentDelete` is an explicitly supported combination: the children are left\n * behind by design choice. The nature stays COMPOSITION because these rows genuinely belong to their\n * application; only the dies-with-parent behaviour is declined.\n */\nexport const customShared_ResourcesRelationships: ResourceRelationship[] = [\n // ═══════════════════════════════════════════════════════════════════════════\n // APPLICATION MANAGEMENT\n // \n // WildoApplication is a resource (not a scope). It represents applications\n // created by users using the wildo-ai-application (the app factory).\n // Primary scope for all resources is Organizations.\n // ═══════════════════════════════════════════════════════════════════════════\n \n // Organizations → WildoApplication (1:N)\n // Primary scope: Applications belong to organizations\n createResourcesRelationship(\n CoreResourceType.ORGANIZATIONS, CustomShared_ResourceType.WILDO_APPLICATION, \n ResourceRelationshipCardinality.ONE, ResourceRelationshipCardinality.MANY,\n { \n nature: RelationshipNature.COMPOSITION,\n isPrimaryScope: true,\n contextPolicy: {}\n }\n ),\n\n // Organizations → WildoApplicationVersions (1:N)\n // Primary scope: Versions belong to organizations\n createResourcesRelationship(\n CoreResourceType.ORGANIZATIONS, CustomShared_ResourceType.WILDO_APPLICATION_VERSIONS, \n ResourceRelationshipCardinality.ONE, ResourceRelationshipCardinality.MANY,\n { \n nature: RelationshipNature.COMPOSITION,\n isPrimaryScope: true,\n contextPolicy: {}\n }\n ),\n\n // WildoApplication → WildoApplicationVersions (1:N)\n // Parent relationship (NOT primary scope)\n createResourcesRelationship(\n CustomShared_ResourceType.WILDO_APPLICATION, CustomShared_ResourceType.WILDO_APPLICATION_VERSIONS, \n ResourceRelationshipCardinality.ONE, ResourceRelationshipCardinality.MANY,\n { \n nature: RelationshipNature.COMPOSITION,\n contextPolicy: {\n operationOverrides: {\n [CoreResourceOperation.LIST]: { enabled: false },\n [CoreResourceOperation.SEARCH]: { enabled: false },\n }\n },\n childOperations: {\n lifecycle: {\n onParentDelete: { enabled: false }, // RETAIN as audit material (compliance decision 2026-07-29) — see the note at the top of this file.\n }\n }\n }\n ),\n\n // Organizations → WildoApplicationActorSystemExecutions (1:N)\n createResourcesRelationship(\n CoreResourceType.ORGANIZATIONS,\n CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.COMPOSITION,\n isPrimaryScope: true,\n contextPolicy: {},\n }\n ),\n\n // WildoApplication → WildoApplicationActorSystemExecutions (1:N)\n createResourcesRelationship(\n CustomShared_ResourceType.WILDO_APPLICATION,\n CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.COMPOSITION,\n contextPolicy: {\n operationOverrides: {\n [CoreResourceOperation.LIST]: { enabled: false },\n [CoreResourceOperation.SEARCH]: { enabled: false },\n },\n },\n childOperations: {\n lifecycle: {\n onParentDelete: { enabled: false }, // RETAIN as audit material (compliance decision 2026-07-29) — see the note at the top of this file.\n },\n },\n }\n ),\n\n // Organizations → WildoApplicationFlowSystemExecutions (1:N)\n createResourcesRelationship(\n CoreResourceType.ORGANIZATIONS,\n CustomShared_ResourceType.WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.COMPOSITION,\n isPrimaryScope: true,\n contextPolicy: {},\n }\n ),\n\n // WildoApplication → WildoApplicationFlowSystemExecutions (1:N)\n createResourcesRelationship(\n CustomShared_ResourceType.WILDO_APPLICATION,\n CustomShared_ResourceType.WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.COMPOSITION,\n contextPolicy: {\n operationOverrides: {\n [CoreResourceOperation.LIST]: { enabled: false },\n [CoreResourceOperation.SEARCH]: { enabled: false },\n },\n },\n childOperations: {\n lifecycle: {\n onParentDelete: { enabled: false }, // RETAIN as audit material (compliance decision 2026-07-29) — see the note at the top of this file.\n },\n },\n }\n ),\n\n // Organizations → WildoApplicationActorTasks (1:N)\n createResourcesRelationship(\n CoreResourceType.ORGANIZATIONS,\n CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_TASKS,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.COMPOSITION,\n isPrimaryScope: true,\n contextPolicy: {},\n }\n ),\n\n // WildoApplication → WildoApplicationActorTasks (1:N)\n createResourcesRelationship(\n CustomShared_ResourceType.WILDO_APPLICATION,\n CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_TASKS,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.COMPOSITION,\n contextPolicy: {\n operationOverrides: {\n [CoreResourceOperation.LIST]: { enabled: false },\n [CoreResourceOperation.SEARCH]: { enabled: false },\n },\n },\n childOperations: {\n lifecycle: {\n onParentDelete: { enabled: false }, // RETAIN as audit material (compliance decision 2026-07-29) — see the note at the top of this file.\n },\n },\n }\n ),\n\n // ActorSystemExecution → WildoApplicationActorTasks (1:N reference)\n createResourcesRelationship(\n CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS,\n CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_TASKS,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.REFERENCE,\n foreignKeyField: 'wildoApplicationActorSystemExecutionId',\n parentResourceRequirement: ResourceParentResourceRequirement.OPTIONAL,\n contextPolicy: {},\n }\n ),\n];\n"]}
1
+ {"version":3,"file":"resources-relationships.custom.shared.definitions.js","sourceRoot":"","sources":["../../../../src/core/resources/resources-relationships.custom.shared.definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,kBAAkB,EAAwB,+BAA+B,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAC3N,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEpF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAA2B;IACzE,8EAA8E;IAC9E,yBAAyB;IACzB,GAAG;IACH,2EAA2E;IAC3E,qEAAqE;IACrE,oDAAoD;IACpD,8EAA8E;IAE9E,yCAAyC;IACzC,sDAAsD;IACtD,2BAA2B,CACzB,gBAAgB,CAAC,aAAa,EAAE,yBAAyB,CAAC,iBAAiB,EAC3E,+BAA+B,CAAC,GAAG,EAAE,+BAA+B,CAAC,IAAI,EACzE;QACE,MAAM,EAAE,kBAAkB,CAAC,WAAW;QACtC,c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B,CAAC,WAAW;QACtC,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,EAAE;KAClB,CACF;IAED,sDAAsD;IACtD,2BAA2B,CACzB,yBAAyB,CAAC,iBAAiB,EAC3C,yBAAyB,CAAC,6BAA6B,EACvD,+BAA+B,CAAC,GAAG,EACnC,+BAA+B,CAAC,IAAI,EACpC;QACE,MAAM,EAAE,kBAAkB,CAAC,WAAW;QACtC,aAAa,EAAE;YACb,kBAAkB,EAAE;gBAClB,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;gBAChD,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACnD;SACF;QACD,eAAe,EAAE;YACf,SAAS,EAAE;gBACT,cAAc,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,oGAAoG;aACzI;SACF;KACF,CACF;IAED,oEAAoE;IACpE,2BAA2B,CACzB,yBAAyB,CAAC,yCAAyC,EACnE,yBAAyB,CAAC,6BAA6B,EACvD,+BAA+B,CAAC,GAAG,EACnC,+BAA+B,CAAC,IAAI,EACpC;QACE,MAAM,EAAE,kBAAkB,CAAC,SAAS;QACpC,eAAe,EAAE,wCAAwC;QACzD,yBAAyB,EAAE,iCAAiC,CAAC,QAAQ;QACrE,aAAa,EAAE,EAAE;KAClB,CACF;CACF,CAAC","sourcesContent":["import { createResourcesRelationship, RelationshipNature, ResourceRelationship, ResourceRelationshipCardinality, CoreResourceType, CoreResourceOperation, ResourceParentResourceRequirement } from \"@wildo-ai/saas-models\";\nimport { CustomShared_ResourceType } from \"./resources-types.custom.shared.schemas\";\n\n/**\n * ⚠️ APPLICATION-CHILD RETENTION (compliance decision, Paul — 2026-07-29).\n *\n * `wildoApplicationVersions`, `wildoApplicationActorSystemExecutions`,\n * `wildoApplicationFlowSystemExecutions` and `wildoApplicationActorTasks` are RETAINED AS AUDIT\n * MATERIAL when their `wildoApplication` is deleted — the deployment/execution history of an\n * application outlives the application record itself. Every `onParentDelete` below is therefore\n * DISABLED.\n *\n * This also FIXES A LATENT BUG rather than merely expressing a preference: these children declare no\n * core DELETE op (`wildoApplicationVersions` exposes READ/LIST/CREATE only), so the cascade would have\n * thrown `ErrorType.CONFIGURATION` inside the parent's delete transaction and ROLLED BACK the\n * application delete as soon as one child row existed. Surfaced by the startup\n * composition-cascade-deletability guard on a live apps-manager boot (2026-07-29) — it was invisible to\n * the engine's regression test, which only rebuilds the CORE registry.\n *\n * A COMPOSITION without `onParentDelete` is an explicitly supported combination: the children are left\n * behind by design choice. The nature stays COMPOSITION because these rows genuinely belong to their\n * application; only the dies-with-parent behaviour is declined.\n */\nexport const customShared_ResourcesRelationships: ResourceRelationship[] = [\n // ═══════════════════════════════════════════════════════════════════════════\n // APPLICATION MANAGEMENT\n // \n // WildoApplication is a resource (not a scope). It represents applications\n // created by users using the wildo-ai-application (the app factory).\n // Primary scope for all resources is Organizations.\n // ═══════════════════════════════════════════════════════════════════════════\n \n // Organizations → WildoApplication (1:N)\n // Primary scope: Applications belong to organizations\n createResourcesRelationship(\n CoreResourceType.ORGANIZATIONS, CustomShared_ResourceType.WILDO_APPLICATION, \n ResourceRelationshipCardinality.ONE, ResourceRelationshipCardinality.MANY,\n { \n nature: RelationshipNature.COMPOSITION,\n isPrimaryScope: true,\n contextPolicy: {}\n }\n ),\n\n // Organizations → WildoApplicationVersions (1:N)\n // Primary scope: Versions belong to organizations\n createResourcesRelationship(\n CoreResourceType.ORGANIZATIONS, CustomShared_ResourceType.WILDO_APPLICATION_VERSIONS, \n ResourceRelationshipCardinality.ONE, ResourceRelationshipCardinality.MANY,\n { \n nature: RelationshipNature.COMPOSITION,\n isPrimaryScope: true,\n contextPolicy: {}\n }\n ),\n\n // WildoApplication → WildoApplicationVersions (1:N)\n // Parent relationship (NOT primary scope)\n createResourcesRelationship(\n CustomShared_ResourceType.WILDO_APPLICATION, CustomShared_ResourceType.WILDO_APPLICATION_VERSIONS, \n ResourceRelationshipCardinality.ONE, ResourceRelationshipCardinality.MANY,\n { \n nature: RelationshipNature.COMPOSITION,\n contextPolicy: {\n operationOverrides: {\n [CoreResourceOperation.LIST]: { enabled: false },\n [CoreResourceOperation.SEARCH]: { enabled: false },\n }\n },\n childOperations: {\n lifecycle: {\n onParentDelete: { enabled: false }, // RETAIN as audit material (compliance decision 2026-07-29) — see the note at the top of this file.\n }\n }\n }\n ),\n\n // Organizations → WildoApplicationActorSystemExecutions (1:N)\n createResourcesRelationship(\n CoreResourceType.ORGANIZATIONS,\n CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.COMPOSITION,\n isPrimaryScope: true,\n contextPolicy: {},\n }\n ),\n\n // WildoApplication → WildoApplicationActorSystemExecutions (1:N)\n createResourcesRelationship(\n CustomShared_ResourceType.WILDO_APPLICATION,\n CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.COMPOSITION,\n contextPolicy: {\n operationOverrides: {\n [CoreResourceOperation.LIST]: { enabled: false },\n [CoreResourceOperation.SEARCH]: { enabled: false },\n },\n },\n childOperations: {\n lifecycle: {\n onParentDelete: { enabled: false }, // RETAIN as audit material (compliance decision 2026-07-29) — see the note at the top of this file.\n },\n },\n }\n ),\n\n // Organizations → WildoApplicationFlowSystemExecutions (1:N)\n createResourcesRelationship(\n CoreResourceType.ORGANIZATIONS,\n CustomShared_ResourceType.WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.COMPOSITION,\n isPrimaryScope: true,\n contextPolicy: {},\n }\n ),\n\n // WildoApplication → WildoApplicationFlowSystemExecutions (1:N)\n createResourcesRelationship(\n CustomShared_ResourceType.WILDO_APPLICATION,\n CustomShared_ResourceType.WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.COMPOSITION,\n contextPolicy: {\n operationOverrides: {\n [CoreResourceOperation.LIST]: { enabled: false },\n [CoreResourceOperation.SEARCH]: { enabled: false },\n },\n },\n childOperations: {\n lifecycle: {\n onParentDelete: { enabled: false }, // RETAIN as audit material (compliance decision 2026-07-29) — see the note at the top of this file.\n },\n },\n }\n ),\n\n // Organizations → WildoApplicationActorTasks (1:N)\n createResourcesRelationship(\n CoreResourceType.ORGANIZATIONS,\n CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_TASKS,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.COMPOSITION,\n isPrimaryScope: true,\n contextPolicy: {},\n }\n ),\n\n // WildoApplication → WildoApplicationActorTasks (1:N)\n createResourcesRelationship(\n CustomShared_ResourceType.WILDO_APPLICATION,\n CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_TASKS,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.COMPOSITION,\n contextPolicy: {\n operationOverrides: {\n [CoreResourceOperation.LIST]: { enabled: false },\n [CoreResourceOperation.SEARCH]: { enabled: false },\n },\n },\n childOperations: {\n lifecycle: {\n onParentDelete: { enabled: false }, // RETAIN as audit material (compliance decision 2026-07-29) — see the note at the top of this file.\n },\n },\n }\n ),\n\n // ActorSystemExecution → WildoApplicationActorTasks (1:N reference)\n createResourcesRelationship(\n CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS,\n CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_TASKS,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.REFERENCE,\n foreignKeyField: 'wildoApplicationActorSystemExecutionId',\n parentResourceRequirement: ResourceParentResourceRequirement.OPTIONAL,\n contextPolicy: {},\n }\n ),\n];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"resources-types.custom.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/core/resources/resources-types.custom.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,oBAAY,yBAAyB;IAEnC,iBAAiB,qBAAqB;IACtC,0BAA0B,6BAA6B;IACvD,yCAAyC,0CAA0C;IACnF,wCAAwC,yCAAyC;IACjF,6BAA6B,+BAA+B;CAC7D;AAED,eAAO,MAAM,oCAAoC,EAAE;KAAG,GAAG,IAAI,yBAAyB,GAAG,MAAM;CAO9F,CAAC"}
1
+ {"version":3,"file":"resources-types.custom.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/core/resources/resources-types.custom.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,oBAAY,yBAAyB;IAEnC,iBAAiB,qBAAqB;IACtC,0BAA0B,6BAA6B;IACvD,yCAAyC,0CAA0C;IACnF,wCAAwC,yCAAyC;IACjF,6BAA6B,+BAA+B;CAC7D;AAED,eAAO,MAAM,oCAAoC,EAAE;KAAG,GAAG,IAAI,yBAAyB,GAAG,MAAM;CAO9F,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"resources-types.custom.shared.schemas.js","sourceRoot":"","sources":["../../../../../src/core/resources/resources-types.custom.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACnC,yBAAyB;IACzB,mEAAsC,CAAA;IACtC,oFAAuD,CAAA;IACvD,gHAAmF,CAAA;IACnF,8GAAiF,CAAA;IACjF,yFAA4D,CAAA;AAC9D,CAAC,EAPW,yBAAyB,KAAzB,yBAAyB,QAOpC;AAED,MAAM,CAAC,MAAM,oCAAoC,GAAmD;IAClG,yBAAyB;IACzB,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,EAAE,oBAAoB;IACnE,CAAC,yBAAyB,CAAC,0BAA0B,CAAC,EAAE,2BAA2B;IACnF,CAAC,yBAAyB,CAAC,yCAAyC,CAAC,EAAE,wCAAwC;IAC/G,CAAC,yBAAyB,CAAC,wCAAwC,CAAC,EAAE,uCAAuC;IAC7G,CAAC,yBAAyB,CAAC,6BAA6B,CAAC,EAAE,6BAA6B;CACzF,CAAC","sourcesContent":["/**\n * Shared platform resource types that still participate in the active\n * platform resource registry.\n *\n * Deprecated WAML meta-resources were intentionally removed from this enum:\n * they no longer have live resource configuration factories in the platform,\n * and the archived implementation remains in code archives for future reuse.\n */\nexport enum CustomShared_ResourceType {\n // Application management\n WILDO_APPLICATION = 'wildoApplication',\n WILDO_APPLICATION_VERSIONS = 'wildoApplicationVersions',\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS = 'wildoApplicationActorSystemExecutions',\n WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS = 'wildoApplicationFlowSystemExecutions',\n WILDO_APPLICATION_ACTOR_TASKS = 'wildoApplicationActorTasks',\n}\n\nexport const CustomShared_ResourceFieldIdentifier: { [key in CustomShared_ResourceType]: string } = {\n // Application management\n [CustomShared_ResourceType.WILDO_APPLICATION]: 'wildoApplicationId',\n [CustomShared_ResourceType.WILDO_APPLICATION_VERSIONS]: 'wildoApplicationVersionId',\n [CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS]: 'wildoApplicationActorSystemExecutionId',\n [CustomShared_ResourceType.WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS]: 'wildoApplicationFlowSystemExecutionId',\n [CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_TASKS]: 'wildoApplicationActorTaskId',\n};\n"]}
1
+ {"version":3,"file":"resources-types.custom.shared.schemas.js","sourceRoot":"","sources":["../../../../src/core/resources/resources-types.custom.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACnC,yBAAyB;IACzB,mEAAsC,CAAA;IACtC,oFAAuD,CAAA;IACvD,gHAAmF,CAAA;IACnF,8GAAiF,CAAA;IACjF,yFAA4D,CAAA;AAC9D,CAAC,EAPW,yBAAyB,KAAzB,yBAAyB,QAOpC;AAED,MAAM,CAAC,MAAM,oCAAoC,GAAmD;IAClG,yBAAyB;IACzB,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,EAAE,oBAAoB;IACnE,CAAC,yBAAyB,CAAC,0BAA0B,CAAC,EAAE,2BAA2B;IACnF,CAAC,yBAAyB,CAAC,yCAAyC,CAAC,EAAE,wCAAwC;IAC/G,CAAC,yBAAyB,CAAC,wCAAwC,CAAC,EAAE,uCAAuC;IAC7G,CAAC,yBAAyB,CAAC,6BAA6B,CAAC,EAAE,6BAA6B;CACzF,CAAC","sourcesContent":["/**\n * Shared platform resource types that still participate in the active\n * platform resource registry.\n *\n * Deprecated WAML meta-resources were intentionally removed from this enum:\n * they no longer have live resource configuration factories in the platform,\n * and the archived implementation remains in code archives for future reuse.\n */\nexport enum CustomShared_ResourceType {\n // Application management\n WILDO_APPLICATION = 'wildoApplication',\n WILDO_APPLICATION_VERSIONS = 'wildoApplicationVersions',\n WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS = 'wildoApplicationActorSystemExecutions',\n WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS = 'wildoApplicationFlowSystemExecutions',\n WILDO_APPLICATION_ACTOR_TASKS = 'wildoApplicationActorTasks',\n}\n\nexport const CustomShared_ResourceFieldIdentifier: { [key in CustomShared_ResourceType]: string } = {\n // Application management\n [CustomShared_ResourceType.WILDO_APPLICATION]: 'wildoApplicationId',\n [CustomShared_ResourceType.WILDO_APPLICATION_VERSIONS]: 'wildoApplicationVersionId',\n [CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_SYSTEM_EXECUTIONS]: 'wildoApplicationActorSystemExecutionId',\n [CustomShared_ResourceType.WILDO_APPLICATION_FLOW_SYSTEM_EXECUTIONS]: 'wildoApplicationFlowSystemExecutionId',\n [CustomShared_ResourceType.WILDO_APPLICATION_ACTOR_TASKS]: 'wildoApplicationActorTaskId',\n};\n"]}
@@ -0,0 +1,111 @@
1
+ import { LocalDevDependencyInstallPhase, type LocalDevDependencyInstallRecord } from '../runtime/local-dev-runtime-signals.contracts';
2
+ /**
3
+ * A dependency install is a STACK EVENT (#3552): the file-system half of {@link LocalDevDependencyInstallRecord_Schema},
4
+ * and the two decisions every dev-loop reader takes from it.
5
+ *
6
+ * The installer brackets its install with {@link withDependencyInstallRecord} (or {@link withDependencyInstallRecordSync}
7
+ * for a synchronous one). The readers are the runtime supervisors and the compile loops of BOTH dev loops: this package's
8
+ * `NodeRuntimeDevSupervisor` and `PackageCompileLoop` for an app-creator install, and the monorepo's
9
+ * `runtime-supervisor.mjs` and `local-dev-compile-observer.mjs` for a framework developer. The monorepo scripts are
10
+ * dependency-free and keep their own copy of {@link classifyDependencyInstall} and the two decisions in
11
+ * `scripts/dev-orchestrator/local-dev-protocol.mjs`; `dev-runtime-decisions.test.ts` runs both copies over the same cases.
12
+ */
13
+ /** Where the record lives in an application. */
14
+ export declare function dependencyInstallRecordPath(appRoot: string): string;
15
+ /** The record, or undefined when there is none or it is not one this protocol version reads. */
16
+ export declare function readDependencyInstallRecord(appRoot: string): LocalDevDependencyInstallRecord | undefined;
17
+ /** Where an install stands, and the instants a reader compares against. */
18
+ export interface DependencyInstallStatus {
19
+ readonly phase: LocalDevDependencyInstallPhase;
20
+ /** Identifies ONE install (`<pid>:<startedAt ms>`), so a reader acts once per install; `null` when there is none. */
21
+ readonly key: string | null;
22
+ readonly startedAtMs: number | null;
23
+ /**
24
+ * When the install is taken to have ended (`ENDED` only): its `finishedAt`; its deadline when it outlived it; its
25
+ * START when its writer died without finishing. The last is deliberately early: the end of a killed install cannot be
26
+ * known, and any later instant would make every compile that starts before it look stale, so a reader would restart
27
+ * it over and over. A watcher that compiled DURING a killed install is therefore not restarted by this rule, a
28
+ * residual of a writer that was SIGKILLed mid-install.
29
+ */
30
+ readonly endedAtMs: number | null;
31
+ }
32
+ /**
33
+ * Judge a record. Pure but for `isAlive`, which a test replaces. A record that does not parse is NONE: a reader that
34
+ * cannot read the signal behaves as it did before the signal existed, never holds the stack on it.
35
+ */
36
+ export declare function classifyDependencyInstall(record: LocalDevDependencyInstallRecord | undefined, nowMs: number, isAlive?: (pid: number) => boolean): DependencyInstallStatus;
37
+ /** What a runtime supervisor does about the application's dependency install. */
38
+ export declare enum RuntimeDependencyInstallDecision {
39
+ /** Nothing: no install, or this one was already acted on, or the runtime started after it. */
40
+ NONE = "NONE",
41
+ /** An install is running: start nothing, restart nothing, and do not count a crash against the budget. */
42
+ HOLD = "HOLD",
43
+ /** The install ended after the runtime started (or while it was down): relaunch it with a fresh crash budget. */
44
+ RELAUNCH = "RELAUNCH"
45
+ }
46
+ /**
47
+ * The supervisor's decision. `runtimeStartedAtMs` is when the current (or last) runtime child was started, `0` when none
48
+ * ever was. `handledInstallKey` is the install this supervisor already acted on: seed it, at the supervisor's own start,
49
+ * with the key of an install that had ALREADY ended, so a supervisor started after an install does not relaunch onto it.
50
+ */
51
+ export declare function decideRuntimeAfterDependencyInstall(input: {
52
+ readonly install: DependencyInstallStatus;
53
+ readonly runtimeStartedAtMs: number;
54
+ readonly handledInstallKey: string | null;
55
+ }): RuntimeDependencyInstallDecision;
56
+ /**
57
+ * The file pnpm rewrites at the END of every install in a workspace, application-relative. Its modification time is
58
+ * when the workspace's `node_modules` last finished changing, whoever ran the install.
59
+ */
60
+ export declare const PNPM_MODULES_MANIFEST_RELATIVE_PATH = "node_modules/.modules.yaml";
61
+ /** When pnpm last finished an install in the application, or null when it never did (or the file cannot be read). */
62
+ export declare function readNodeModulesInstalledAtMs(appRoot: string): number | null;
63
+ /**
64
+ * Whether a package's compile watcher must be restarted because an install ended after it last read the tree: its
65
+ * latest compilation (or, when it has none yet, its own start) began before the install ended.
66
+ *
67
+ * Two witnesses of an install's end, and the later wins. The RECORD names an install a Wildo tool ran (the foundation
68
+ * step, the CLI). pnpm's own {@link PNPM_MODULES_MANIFEST_RELATIVE_PATH} names EVERY install, including one a coding
69
+ * agent or a person ran by hand, which writes no record: reference run 42713670241 (2026-11-10) had a mid-run install
70
+ * leave the frontend library and the specifications on `TS6053 lib.dom.d.ts not found` / `TS2318 Cannot find global type
71
+ * 'Array'` — a live `tsc --watch` whose TypeScript lib vanished under it — and they never compiled again: the library's
72
+ * dist stayed 20 hours stale and blocked 80 build tasks. Nothing the watcher watches changes after such an install, so
73
+ * only the install's own end can wake it.
74
+ *
75
+ * A FAILED watcher is judged by its PROCESS start alone. The same run's frontend library watcher compiled ONE more cycle
76
+ * after the install ended, failed it again on the lib it had lost, and went silent: a compiler that saw its toolchain
77
+ * disappear keeps that state in memory, so a compile it runs after the install proves nothing. A READY watcher's
78
+ * post-install compile did read the whole tree, so for it the latest compile start counts too.
79
+ *
80
+ * Self-limiting: the restarted watcher starts after the install ended, so the rule does not fire for it again. Never
81
+ * while a recorded install is still in flight, which would only compile the half-installed tree once more. Driven by
82
+ * the reader's own timer (the observer's heartbeat, the compile loop's check), never by a later compile, which may not
83
+ * come.
84
+ */
85
+ export declare function compilerReadTreeBeforeDependencyInstallEnded(input: {
86
+ readonly install: DependencyInstallStatus;
87
+ /** {@link readNodeModulesInstalledAtMs}; omitted or null when unknown. */
88
+ readonly nodeModulesInstalledAtMs?: number | null;
89
+ readonly lastCompilationStartedAtMs: number | null;
90
+ readonly watcherStartedAtMs: number;
91
+ /** Whether the watcher's latest compile FAILED (see above). */
92
+ readonly compilerFailed?: boolean;
93
+ }): boolean;
94
+ /** The longest an install is trusted to run before readers stop holding for it, when the installer names no bound. */
95
+ export declare const DEFAULT_DEPENDENCY_INSTALL_DEADLINE_MS: number;
96
+ export interface DependencyInstallRecordOptions {
97
+ /** Who installs, recorded for a reader: `foundation`, `wildo update`, … */
98
+ readonly initiator: string;
99
+ /** The install's own bound; the deadline is this plus a minute of slack. Default {@link DEFAULT_DEPENDENCY_INSTALL_DEADLINE_MS}. */
100
+ readonly timeoutMs?: number;
101
+ /** Reports a record that could not be written. The install runs either way. */
102
+ readonly reportFailure?: (message: string, error: unknown) => void;
103
+ }
104
+ /**
105
+ * Run an install bracketed by the record. The record never fails the install: a write that fails is reported and the
106
+ * install runs as it would have without it. A throwing install is recorded as failed and rethrown.
107
+ */
108
+ export declare function withDependencyInstallRecord<T>(appRoot: string, options: DependencyInstallRecordOptions, install: () => Promise<T>): Promise<T>;
109
+ /** {@link withDependencyInstallRecord} for a synchronous install, whose result says whether it succeeded. */
110
+ export declare function withDependencyInstallRecordSync(appRoot: string, options: DependencyInstallRecordOptions, install: () => boolean): boolean;
111
+ //# sourceMappingURL=dependency-install-record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency-install-record.d.ts","sourceRoot":"","sources":["../../../src/dev-runtime/dependency-install-record.ts"],"names":[],"mappings":"AAGA,OAAO,EAKL,8BAA8B,EAE9B,KAAK,+BAA+B,EACrC,MAAM,gDAAgD,CAAC;AAIxD;;;;;;;;;;GAUG;AAEH,gDAAgD;AAChD,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,gGAAgG;AAChG,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,+BAA+B,GAAG,SAAS,CAOxG;AAED,2EAA2E;AAC3E,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,EAAE,8BAA8B,CAAC;IAC/C,qHAAqH;IACrH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAID;;;GAGG;AACH,wBAAgB,yBAAyB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S,CAAC,EAAE,MAAM,CAAC;IAC5B,+EAA+E;IAC/E,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACpE;AAsCD;;;GAGG;AACH,wBAAsB,2BAA2B,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,8BAA8B,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAUpJ;AAED,6GAA6G;AAC7G,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,8BAA8B,EAAE,OAAO,EAAE,MAAM,OAAO,GAAG,OAAO,CASzI"}
@@ -0,0 +1,185 @@
1
+ import { existsSync, readFileSync, statSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { APPLICATION_RUNTIME_SIGNALS_RELATIVE_DIRECTORY, LOCAL_DEV_DEPENDENCY_INSTALL_RECORD_FILE, LOCAL_DEV_DEPENDENCY_INSTALL_RECORD_KIND, LOCAL_DEV_RUNTIME_SIGNALS_PROTOCOL_VERSION, LocalDevDependencyInstallPhase, LocalDevDependencyInstallRecord_Schema, } from '../runtime/local-dev-runtime-signals.contracts.js';
4
+ import { isProcessAlive } from './dev-runtime-processes.js';
5
+ import { APPLICATION_ROOT_MARKER, writeRuntimeSignalRecord } from './dev-runtime-signals.js';
6
+ /**
7
+ * A dependency install is a STACK EVENT (#3552): the file-system half of {@link LocalDevDependencyInstallRecord_Schema},
8
+ * and the two decisions every dev-loop reader takes from it.
9
+ *
10
+ * The installer brackets its install with {@link withDependencyInstallRecord} (or {@link withDependencyInstallRecordSync}
11
+ * for a synchronous one). The readers are the runtime supervisors and the compile loops of BOTH dev loops: this package's
12
+ * `NodeRuntimeDevSupervisor` and `PackageCompileLoop` for an app-creator install, and the monorepo's
13
+ * `runtime-supervisor.mjs` and `local-dev-compile-observer.mjs` for a framework developer. The monorepo scripts are
14
+ * dependency-free and keep their own copy of {@link classifyDependencyInstall} and the two decisions in
15
+ * `scripts/dev-orchestrator/local-dev-protocol.mjs`; `dev-runtime-decisions.test.ts` runs both copies over the same cases.
16
+ */
17
+ /** Where the record lives in an application. */
18
+ export function dependencyInstallRecordPath(appRoot) {
19
+ return join(appRoot, APPLICATION_RUNTIME_SIGNALS_RELATIVE_DIRECTORY, LOCAL_DEV_DEPENDENCY_INSTALL_RECORD_FILE);
20
+ }
21
+ /** The record, or undefined when there is none or it is not one this protocol version reads. */
22
+ export function readDependencyInstallRecord(appRoot) {
23
+ try {
24
+ const parsed = LocalDevDependencyInstallRecord_Schema.safeParse(JSON.parse(readFileSync(dependencyInstallRecordPath(appRoot), 'utf8')));
25
+ return parsed.success ? parsed.data : undefined;
26
+ }
27
+ catch {
28
+ return undefined;
29
+ }
30
+ }
31
+ const NO_INSTALL = { phase: LocalDevDependencyInstallPhase.NONE, key: null, startedAtMs: null, endedAtMs: null };
32
+ /**
33
+ * Judge a record. Pure but for `isAlive`, which a test replaces. A record that does not parse is NONE: a reader that
34
+ * cannot read the signal behaves as it did before the signal existed, never holds the stack on it.
35
+ */
36
+ export function classifyDependencyInstall(record, nowMs, isAlive = isProcessAlive) {
37
+ if (record === undefined)
38
+ return NO_INSTALL;
39
+ const startedAtMs = Date.parse(record.startedAt);
40
+ const deadlineAtMs = Date.parse(record.deadlineAt);
41
+ if (!Number.isFinite(startedAtMs) || !Number.isFinite(deadlineAtMs))
42
+ return NO_INSTALL;
43
+ const key = `${record.pid}:${startedAtMs}`;
44
+ const finishedAtMs = record.finishedAt === null ? Number.NaN : Date.parse(record.finishedAt);
45
+ if (Number.isFinite(finishedAtMs))
46
+ return { phase: LocalDevDependencyInstallPhase.ENDED, key, startedAtMs, endedAtMs: finishedAtMs };
47
+ if (nowMs >= deadlineAtMs)
48
+ return { phase: LocalDevDependencyInstallPhase.ENDED, key, startedAtMs, endedAtMs: deadlineAtMs };
49
+ if (!isAlive(record.pid))
50
+ return { phase: LocalDevDependencyInstallPhase.ENDED, key, startedAtMs, endedAtMs: startedAtMs };
51
+ return { phase: LocalDevDependencyInstallPhase.IN_FLIGHT, key, startedAtMs, endedAtMs: null };
52
+ }
53
+ /** What a runtime supervisor does about the application's dependency install. */
54
+ export var RuntimeDependencyInstallDecision;
55
+ (function (RuntimeDependencyInstallDecision) {
56
+ /** Nothing: no install, or this one was already acted on, or the runtime started after it. */
57
+ RuntimeDependencyInstallDecision["NONE"] = "NONE";
58
+ /** An install is running: start nothing, restart nothing, and do not count a crash against the budget. */
59
+ RuntimeDependencyInstallDecision["HOLD"] = "HOLD";
60
+ /** The install ended after the runtime started (or while it was down): relaunch it with a fresh crash budget. */
61
+ RuntimeDependencyInstallDecision["RELAUNCH"] = "RELAUNCH";
62
+ })(RuntimeDependencyInstallDecision || (RuntimeDependencyInstallDecision = {}));
63
+ /**
64
+ * The supervisor's decision. `runtimeStartedAtMs` is when the current (or last) runtime child was started, `0` when none
65
+ * ever was. `handledInstallKey` is the install this supervisor already acted on: seed it, at the supervisor's own start,
66
+ * with the key of an install that had ALREADY ended, so a supervisor started after an install does not relaunch onto it.
67
+ */
68
+ export function decideRuntimeAfterDependencyInstall(input) {
69
+ const { install } = input;
70
+ if (install.phase === LocalDevDependencyInstallPhase.IN_FLIGHT)
71
+ return RuntimeDependencyInstallDecision.HOLD;
72
+ if (install.phase !== LocalDevDependencyInstallPhase.ENDED || install.key === input.handledInstallKey || install.endedAtMs === null) {
73
+ return RuntimeDependencyInstallDecision.NONE;
74
+ }
75
+ return input.runtimeStartedAtMs < install.endedAtMs ? RuntimeDependencyInstallDecision.RELAUNCH : RuntimeDependencyInstallDecision.NONE;
76
+ }
77
+ /**
78
+ * The file pnpm rewrites at the END of every install in a workspace, application-relative. Its modification time is
79
+ * when the workspace's `node_modules` last finished changing, whoever ran the install.
80
+ */
81
+ export const PNPM_MODULES_MANIFEST_RELATIVE_PATH = 'node_modules/.modules.yaml';
82
+ /** When pnpm last finished an install in the application, or null when it never did (or the file cannot be read). */
83
+ export function readNodeModulesInstalledAtMs(appRoot) {
84
+ try {
85
+ return statSync(join(appRoot, PNPM_MODULES_MANIFEST_RELATIVE_PATH)).mtimeMs;
86
+ }
87
+ catch {
88
+ return null;
89
+ }
90
+ }
91
+ /**
92
+ * Whether a package's compile watcher must be restarted because an install ended after it last read the tree: its
93
+ * latest compilation (or, when it has none yet, its own start) began before the install ended.
94
+ *
95
+ * Two witnesses of an install's end, and the later wins. The RECORD names an install a Wildo tool ran (the foundation
96
+ * step, the CLI). pnpm's own {@link PNPM_MODULES_MANIFEST_RELATIVE_PATH} names EVERY install, including one a coding
97
+ * agent or a person ran by hand, which writes no record: reference run 42713670241 (2026-11-10) had a mid-run install
98
+ * leave the frontend library and the specifications on `TS6053 lib.dom.d.ts not found` / `TS2318 Cannot find global type
99
+ * 'Array'` — a live `tsc --watch` whose TypeScript lib vanished under it — and they never compiled again: the library's
100
+ * dist stayed 20 hours stale and blocked 80 build tasks. Nothing the watcher watches changes after such an install, so
101
+ * only the install's own end can wake it.
102
+ *
103
+ * A FAILED watcher is judged by its PROCESS start alone. The same run's frontend library watcher compiled ONE more cycle
104
+ * after the install ended, failed it again on the lib it had lost, and went silent: a compiler that saw its toolchain
105
+ * disappear keeps that state in memory, so a compile it runs after the install proves nothing. A READY watcher's
106
+ * post-install compile did read the whole tree, so for it the latest compile start counts too.
107
+ *
108
+ * Self-limiting: the restarted watcher starts after the install ended, so the rule does not fire for it again. Never
109
+ * while a recorded install is still in flight, which would only compile the half-installed tree once more. Driven by
110
+ * the reader's own timer (the observer's heartbeat, the compile loop's check), never by a later compile, which may not
111
+ * come.
112
+ */
113
+ export function compilerReadTreeBeforeDependencyInstallEnded(input) {
114
+ const { install } = input;
115
+ if (install.phase === LocalDevDependencyInstallPhase.IN_FLIGHT)
116
+ return false;
117
+ const endedAtMs = Math.max(install.phase === LocalDevDependencyInstallPhase.ENDED && install.endedAtMs !== null ? install.endedAtMs : 0, input.nodeModulesInstalledAtMs ?? 0);
118
+ if (endedAtMs <= 0)
119
+ return false;
120
+ const watcherStartedAtMs = Number.isFinite(input.watcherStartedAtMs) ? input.watcherStartedAtMs : 0;
121
+ const lastReadAtMs = input.compilerFailed === true ? watcherStartedAtMs : Math.max(input.lastCompilationStartedAtMs ?? 0, watcherStartedAtMs);
122
+ return lastReadAtMs > 0 && lastReadAtMs < endedAtMs;
123
+ }
124
+ /** The longest an install is trusted to run before readers stop holding for it, when the installer names no bound. */
125
+ export const DEFAULT_DEPENDENCY_INSTALL_DEADLINE_MS = 30 * 60_000;
126
+ /** Start an install record; returns the closer. A root that is not an application gets no record (and a no-op closer). */
127
+ function openDependencyInstallRecord(appRoot, options) {
128
+ if (!existsSync(join(appRoot, APPLICATION_ROOT_MARKER)))
129
+ return () => undefined;
130
+ const path = dependencyInstallRecordPath(appRoot);
131
+ const started = new Date();
132
+ // Spelled out rather than `Omit<…>`: the record schema is loose (an index signature), and `Omit` over it drops every key.
133
+ const base = {
134
+ kind: LOCAL_DEV_DEPENDENCY_INSTALL_RECORD_KIND,
135
+ schemaVersion: LOCAL_DEV_RUNTIME_SIGNALS_PROTOCOL_VERSION,
136
+ pid: process.pid,
137
+ startedAt: started.toISOString(),
138
+ deadlineAt: new Date(started.getTime() + (options.timeoutMs ?? DEFAULT_DEPENDENCY_INSTALL_DEADLINE_MS) + 60_000).toISOString(),
139
+ initiator: options.initiator,
140
+ };
141
+ const write = (record) => {
142
+ try {
143
+ writeRuntimeSignalRecord(path, record);
144
+ }
145
+ catch (error) {
146
+ try {
147
+ options.reportFailure?.('The dependency-install record could not be written; the dev loop will not know about this install', error);
148
+ }
149
+ catch {
150
+ // Reporting is a courtesy.
151
+ }
152
+ }
153
+ };
154
+ write({ ...base, finishedAt: null, succeeded: null });
155
+ return (succeeded) => write({ ...base, finishedAt: new Date().toISOString(), succeeded });
156
+ }
157
+ /**
158
+ * Run an install bracketed by the record. The record never fails the install: a write that fails is reported and the
159
+ * install runs as it would have without it. A throwing install is recorded as failed and rethrown.
160
+ */
161
+ export async function withDependencyInstallRecord(appRoot, options, install) {
162
+ const close = openDependencyInstallRecord(appRoot, options);
163
+ let succeeded = false;
164
+ try {
165
+ const result = await install();
166
+ succeeded = true;
167
+ return result;
168
+ }
169
+ finally {
170
+ close(succeeded);
171
+ }
172
+ }
173
+ /** {@link withDependencyInstallRecord} for a synchronous install, whose result says whether it succeeded. */
174
+ export function withDependencyInstallRecordSync(appRoot, options, install) {
175
+ const close = openDependencyInstallRecord(appRoot, options);
176
+ let succeeded = false;
177
+ try {
178
+ succeeded = install();
179
+ return succeeded;
180
+ }
181
+ finally {
182
+ close(succeeded);
183
+ }
184
+ }
185
+ //# sourceMappingURL=dependency-install-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency-install-record.js","sourceRoot":"","sources":["../../../src/dev-runtime/dependency-install-record.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,8CAA8C,EAC9C,wCAAwC,EACxC,wCAAwC,EACxC,0CAA0C,EAC1C,8BAA8B,EAC9B,sCAAsC,GAEvC,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAE1F;;;;;;;;;;GAUG;AAEH,gDAAgD;AAChD,MAAM,UAAU,2BAA2B,CAAC,OAAe;IACzD,OAAO,IAAI,CAAC,OAAO,EAAE,8CAA8C,EAAE,wCAAwC,CAAC,CAAC;AACjH,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,2BAA2B,CAAC,OAAe;IACzD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,sCAAsC,CAAC,SAAS,CAAC,IAAI,CAAC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E,SAAS,EAAE,CAAC,CAAC;AAC5F,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAI,OAAe,EAAE,OAAuC,EAAE,OAAyB;IACtI,MAAM,KAAK,GAAG,2BAA2B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5D,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,EAAE,CAAC;QAC/B,SAAS,GAAG,IAAI,CAAC;QACjB,OAAO,MAAM,CAAC;IAChB,CAAC;YAAS,CAAC;QACT,KAAK,CAAC,SAAS,CAAC,CAAC;IACnB,CAAC;AACH,CAAC;AAED,6GAA6G;AAC7G,MAAM,UAAU,+BAA+B,CAAC,OAAe,EAAE,OAAuC,EAAE,OAAsB;IAC9H,MAAM,KAAK,GAAG,2BAA2B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5D,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,CAAC;QACH,SAAS,GAAG,OAAO,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;YAAS,CAAC;QACT,KAAK,CAAC,SAAS,CAAC,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["import { existsSync, readFileSync, statSync } from 'node:fs';\nimport { join } from 'node:path';\n\nimport {\n APPLICATION_RUNTIME_SIGNALS_RELATIVE_DIRECTORY,\n LOCAL_DEV_DEPENDENCY_INSTALL_RECORD_FILE,\n LOCAL_DEV_DEPENDENCY_INSTALL_RECORD_KIND,\n LOCAL_DEV_RUNTIME_SIGNALS_PROTOCOL_VERSION,\n LocalDevDependencyInstallPhase,\n LocalDevDependencyInstallRecord_Schema,\n type LocalDevDependencyInstallRecord,\n} from '../runtime/local-dev-runtime-signals.contracts';\nimport { isProcessAlive } from './dev-runtime-processes';\nimport { APPLICATION_ROOT_MARKER, writeRuntimeSignalRecord } from './dev-runtime-signals';\n\n/**\n * A dependency install is a STACK EVENT (#3552): the file-system half of {@link LocalDevDependencyInstallRecord_Schema},\n * and the two decisions every dev-loop reader takes from it.\n *\n * The installer brackets its install with {@link withDependencyInstallRecord} (or {@link withDependencyInstallRecordSync}\n * for a synchronous one). The readers are the runtime supervisors and the compile loops of BOTH dev loops: this package's\n * `NodeRuntimeDevSupervisor` and `PackageCompileLoop` for an app-creator install, and the monorepo's\n * `runtime-supervisor.mjs` and `local-dev-compile-observer.mjs` for a framework developer. The monorepo scripts are\n * dependency-free and keep their own copy of {@link classifyDependencyInstall} and the two decisions in\n * `scripts/dev-orchestrator/local-dev-protocol.mjs`; `dev-runtime-decisions.test.ts` runs both copies over the same cases.\n */\n\n/** Where the record lives in an application. */\nexport function dependencyInstallRecordPath(appRoot: string): string {\n return join(appRoot, APPLICATION_RUNTIME_SIGNALS_RELATIVE_DIRECTORY, LOCAL_DEV_DEPENDENCY_INSTALL_RECORD_FILE);\n}\n\n/** The record, or undefined when there is none or it is not one this protocol version reads. */\nexport function readDependencyInstallRecord(appRoot: string): LocalDevDependencyInstallRecord | undefined {\n try {\n const parsed = LocalDevDependencyInstallRecord_Schema.safeParse(JSON.parse(readFileSync(dependencyInstallRecordPath(appRoot), 'utf8')));\n return parsed.success ? parsed.data : undefined;\n } catch {\n return undefined;\n }\n}\n\n/** Where an install stands, and the instants a reader compares against. */\nexport interface DependencyInstallStatus {\n readonly phase: LocalDevDependencyInstallPhase;\n /** Identifies ONE install (`<pid>:<startedAt ms>`), so a reader acts once per install; `null` when there is none. */\n readonly key: string | null;\n readonly startedAtMs: number | null;\n /**\n * When the install is taken to have ended (`ENDED` only): its `finishedAt`; its deadline when it outlived it; its\n * START when its writer died without finishing. The last is deliberately early: the end of a killed install cannot be\n * known, and any later instant would make every compile that starts before it look stale, so a reader would restart\n * it over and over. A watcher that compiled DURING a killed install is therefore not restarted by this rule, a\n * residual of a writer that was SIGKILLed mid-install.\n */\n readonly endedAtMs: number | null;\n}\n\nconst NO_INSTALL: DependencyInstallStatus = { phase: LocalDevDependencyInstallPhase.NONE, key: null, startedAtMs: null, endedAtMs: null };\n\n/**\n * Judge a record. Pure but for `isAlive`, which a test replaces. A record that does not parse is NONE: a reader that\n * cannot read the signal behaves as it did before the signal existed, never holds the stack on it.\n */\nexport function classifyDependencyInstall(\n record: LocalDevDependencyInstallRecord | undefined,\n nowMs: number,\n isAlive: (pid: number) => boolean = isProcessAlive,\n): DependencyInstallStatus {\n if (record === undefined) return NO_INSTALL;\n const startedAtMs = Date.parse(record.startedAt);\n const deadlineAtMs = Date.parse(record.deadlineAt);\n if (!Number.isFinite(startedAtMs) || !Number.isFinite(deadlineAtMs)) return NO_INSTALL;\n const key = `${record.pid}:${startedAtMs}`;\n const finishedAtMs = record.finishedAt === null ? Number.NaN : Date.parse(record.finishedAt);\n if (Number.isFinite(finishedAtMs)) return { phase: LocalDevDependencyInstallPhase.ENDED, key, startedAtMs, endedAtMs: finishedAtMs };\n if (nowMs >= deadlineAtMs) return { phase: LocalDevDependencyInstallPhase.ENDED, key, startedAtMs, endedAtMs: deadlineAtMs };\n if (!isAlive(record.pid)) return { phase: LocalDevDependencyInstallPhase.ENDED, key, startedAtMs, endedAtMs: startedAtMs };\n return { phase: LocalDevDependencyInstallPhase.IN_FLIGHT, key, startedAtMs, endedAtMs: null };\n}\n\n/** What a runtime supervisor does about the application's dependency install. */\nexport enum RuntimeDependencyInstallDecision {\n /** Nothing: no install, or this one was already acted on, or the runtime started after it. */\n NONE = 'NONE',\n /** An install is running: start nothing, restart nothing, and do not count a crash against the budget. */\n HOLD = 'HOLD',\n /** The install ended after the runtime started (or while it was down): relaunch it with a fresh crash budget. */\n RELAUNCH = 'RELAUNCH',\n}\n\n/**\n * The supervisor's decision. `runtimeStartedAtMs` is when the current (or last) runtime child was started, `0` when none\n * ever was. `handledInstallKey` is the install this supervisor already acted on: seed it, at the supervisor's own start,\n * with the key of an install that had ALREADY ended, so a supervisor started after an install does not relaunch onto it.\n */\nexport function decideRuntimeAfterDependencyInstall(input: {\n readonly install: DependencyInstallStatus;\n readonly runtimeStartedAtMs: number;\n readonly handledInstallKey: string | null;\n}): RuntimeDependencyInstallDecision {\n const { install } = input;\n if (install.phase === LocalDevDependencyInstallPhase.IN_FLIGHT) return RuntimeDependencyInstallDecision.HOLD;\n if (install.phase !== LocalDevDependencyInstallPhase.ENDED || install.key === input.handledInstallKey || install.endedAtMs === null) {\n return RuntimeDependencyInstallDecision.NONE;\n }\n return input.runtimeStartedAtMs < install.endedAtMs ? RuntimeDependencyInstallDecision.RELAUNCH : RuntimeDependencyInstallDecision.NONE;\n}\n\n/**\n * The file pnpm rewrites at the END of every install in a workspace, application-relative. Its modification time is\n * when the workspace's `node_modules` last finished changing, whoever ran the install.\n */\nexport const PNPM_MODULES_MANIFEST_RELATIVE_PATH = 'node_modules/.modules.yaml';\n\n/** When pnpm last finished an install in the application, or null when it never did (or the file cannot be read). */\nexport function readNodeModulesInstalledAtMs(appRoot: string): number | null {\n try {\n return statSync(join(appRoot, PNPM_MODULES_MANIFEST_RELATIVE_PATH)).mtimeMs;\n } catch {\n return null;\n }\n}\n\n/**\n * Whether a package's compile watcher must be restarted because an install ended after it last read the tree: its\n * latest compilation (or, when it has none yet, its own start) began before the install ended.\n *\n * Two witnesses of an install's end, and the later wins. The RECORD names an install a Wildo tool ran (the foundation\n * step, the CLI). pnpm's own {@link PNPM_MODULES_MANIFEST_RELATIVE_PATH} names EVERY install, including one a coding\n * agent or a person ran by hand, which writes no record: reference run 42713670241 (2026-11-10) had a mid-run install\n * leave the frontend library and the specifications on `TS6053 lib.dom.d.ts not found` / `TS2318 Cannot find global type\n * 'Array'` — a live `tsc --watch` whose TypeScript lib vanished under it — and they never compiled again: the library's\n * dist stayed 20 hours stale and blocked 80 build tasks. Nothing the watcher watches changes after such an install, so\n * only the install's own end can wake it.\n *\n * A FAILED watcher is judged by its PROCESS start alone. The same run's frontend library watcher compiled ONE more cycle\n * after the install ended, failed it again on the lib it had lost, and went silent: a compiler that saw its toolchain\n * disappear keeps that state in memory, so a compile it runs after the install proves nothing. A READY watcher's\n * post-install compile did read the whole tree, so for it the latest compile start counts too.\n *\n * Self-limiting: the restarted watcher starts after the install ended, so the rule does not fire for it again. Never\n * while a recorded install is still in flight, which would only compile the half-installed tree once more. Driven by\n * the reader's own timer (the observer's heartbeat, the compile loop's check), never by a later compile, which may not\n * come.\n */\nexport function compilerReadTreeBeforeDependencyInstallEnded(input: {\n readonly install: DependencyInstallStatus;\n /** {@link readNodeModulesInstalledAtMs}; omitted or null when unknown. */\n readonly nodeModulesInstalledAtMs?: number | null;\n readonly lastCompilationStartedAtMs: number | null;\n readonly watcherStartedAtMs: number;\n /** Whether the watcher's latest compile FAILED (see above). */\n readonly compilerFailed?: boolean;\n}): boolean {\n const { install } = input;\n if (install.phase === LocalDevDependencyInstallPhase.IN_FLIGHT) return false;\n const endedAtMs = Math.max(\n install.phase === LocalDevDependencyInstallPhase.ENDED && install.endedAtMs !== null ? install.endedAtMs : 0,\n input.nodeModulesInstalledAtMs ?? 0,\n );\n if (endedAtMs <= 0) return false;\n const watcherStartedAtMs = Number.isFinite(input.watcherStartedAtMs) ? input.watcherStartedAtMs : 0;\n const lastReadAtMs = input.compilerFailed === true ? watcherStartedAtMs : Math.max(input.lastCompilationStartedAtMs ?? 0, watcherStartedAtMs);\n return lastReadAtMs > 0 && lastReadAtMs < endedAtMs;\n}\n\n/** The longest an install is trusted to run before readers stop holding for it, when the installer names no bound. */\nexport const DEFAULT_DEPENDENCY_INSTALL_DEADLINE_MS = 30 * 60_000;\n\nexport interface DependencyInstallRecordOptions {\n /** Who installs, recorded for a reader: `foundation`, `wildo update`, … */\n readonly initiator: string;\n /** The install's own bound; the deadline is this plus a minute of slack. Default {@link DEFAULT_DEPENDENCY_INSTALL_DEADLINE_MS}. */\n readonly timeoutMs?: number;\n /** Reports a record that could not be written. The install runs either way. */\n readonly reportFailure?: (message: string, error: unknown) => void;\n}\n\n/** Start an install record; returns the closer. A root that is not an application gets no record (and a no-op closer). */\nfunction openDependencyInstallRecord(appRoot: string, options: DependencyInstallRecordOptions): (succeeded: boolean) => void {\n if (!existsSync(join(appRoot, APPLICATION_ROOT_MARKER))) return () => undefined;\n const path = dependencyInstallRecordPath(appRoot);\n const started = new Date();\n // Spelled out rather than `Omit<…>`: the record schema is loose (an index signature), and `Omit` over it drops every key.\n const base: {\n readonly kind: typeof LOCAL_DEV_DEPENDENCY_INSTALL_RECORD_KIND;\n readonly schemaVersion: typeof LOCAL_DEV_RUNTIME_SIGNALS_PROTOCOL_VERSION;\n readonly pid: number;\n readonly startedAt: string;\n readonly deadlineAt: string;\n readonly initiator: string;\n } = {\n kind: LOCAL_DEV_DEPENDENCY_INSTALL_RECORD_KIND,\n schemaVersion: LOCAL_DEV_RUNTIME_SIGNALS_PROTOCOL_VERSION,\n pid: process.pid,\n startedAt: started.toISOString(),\n deadlineAt: new Date(started.getTime() + (options.timeoutMs ?? DEFAULT_DEPENDENCY_INSTALL_DEADLINE_MS) + 60_000).toISOString(),\n initiator: options.initiator,\n };\n const write = (record: LocalDevDependencyInstallRecord): void => {\n try {\n writeRuntimeSignalRecord(path, record);\n } catch (error) {\n try {\n options.reportFailure?.('The dependency-install record could not be written; the dev loop will not know about this install', error);\n } catch {\n // Reporting is a courtesy.\n }\n }\n };\n write({ ...base, finishedAt: null, succeeded: null });\n return (succeeded) => write({ ...base, finishedAt: new Date().toISOString(), succeeded });\n}\n\n/**\n * Run an install bracketed by the record. The record never fails the install: a write that fails is reported and the\n * install runs as it would have without it. A throwing install is recorded as failed and rethrown.\n */\nexport async function withDependencyInstallRecord<T>(appRoot: string, options: DependencyInstallRecordOptions, install: () => Promise<T>): Promise<T> {\n const close = openDependencyInstallRecord(appRoot, options);\n let succeeded = false;\n try {\n const result = await install();\n succeeded = true;\n return result;\n } finally {\n close(succeeded);\n }\n}\n\n/** {@link withDependencyInstallRecord} for a synchronous install, whose result says whether it succeeded. */\nexport function withDependencyInstallRecordSync(appRoot: string, options: DependencyInstallRecordOptions, install: () => boolean): boolean {\n const close = openDependencyInstallRecord(appRoot, options);\n let succeeded = false;\n try {\n succeeded = install();\n return succeeded;\n } finally {\n close(succeeded);\n }\n}\n"]}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * `wildo-dev-runtime` — the dev loop of an application created from the PUBLISHED framework (#3214, #3215, #3216,
3
+ * #3257).
4
+ *
5
+ * ```
6
+ * wildo-dev-runtime compile [--project tsconfig.build.json] [--dist dist/esm]
7
+ * Keep one package's dist current and publish its compile state (the shared library's and the specifications' `dev`).
8
+ * wildo-dev-runtime serve --entry dist/index.js --label <runtime> [--project tsconfig.build.json] [--dist dist] [--node-arg <arg>]...
9
+ * Compile a node runtime's package AND supervise its process: the backend's `dev` (`--label backend-api`), a minion's
10
+ * and a node worker's (`--label <its directory>`).
11
+ * wildo-dev-runtime frontend --command vite [--project tsconfig.library.json] [--dist dist/library]
12
+ * Keep the frontend's config library current AND run its dev server (the frontend's `dev`, #3226).
13
+ * ```
14
+ *
15
+ * Runs in the package directory (the generated `dev` scripts are run there by `pnpm`). The application root is found
16
+ * by the `wildo.saas.config.ts` walk; the package's name and its workspace dependencies come from its `package.json`.
17
+ * Exit 2 when it cannot run at all (no application root, an unknown verb), exit 1 when it refuses (another dev process
18
+ * already owns the package).
19
+ *
20
+ * A framework developer's application does not use this: its packages run the monorepo's own observer and supervisor
21
+ * (`scripts/dev-orchestrator/`), which publish the same records.
22
+ */
23
+ interface ParsedArguments {
24
+ readonly verb: string | undefined;
25
+ readonly values: Map<string, string>;
26
+ readonly nodeArguments: string[];
27
+ }
28
+ export declare function parseDevRuntimeArguments(argv: readonly string[]): ParsedArguments;
29
+ /** The workspace packages a package depends on (`workspace:` specifiers), in a stable order. */
30
+ export declare function readWorkspaceDependencyNames(manifest: {
31
+ readonly dependencies?: Record<string, string>;
32
+ readonly devDependencies?: Record<string, string>;
33
+ }): string[];
34
+ /**
35
+ * The two arguments `serve` cannot run without. Neither has a default.
36
+ *
37
+ * The LABEL in particular (#3257): it names the supervisor record, and that record is how a second supervisor of the
38
+ * same runtime is refused. Had it kept its old default of `backend-api`, a minion would have been refused as a second
39
+ * backend — or, started first, would have made the backend's own supervisor refuse.
40
+ */
41
+ export declare function readServeArguments(parsed: ParsedArguments): {
42
+ readonly entry: string;
43
+ readonly label: string;
44
+ } | {
45
+ readonly refusal: string;
46
+ };
47
+ /** Run one `wildo-dev-runtime` invocation to its end; resolves with the process exit code. */
48
+ export declare function runDevRuntimeCommand(argv: readonly string[]): Promise<number>;
49
+ export {};
50
+ //# sourceMappingURL=dev-runtime-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-runtime-command.d.ts","sourceRoot":"","sources":["../../../src/dev-runtime/dev-runtime-command.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,UAAU,eAAe;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,eAAe,CAajF;AAED,gGAAgG;AAChG,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE;IAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,MAAM,EAAE,CAMtK;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAM7I;AAED,8FAA8F;AAC9F,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA0FnF"}