@wildo-ai/platform-core-shared 1.0.1 → 1.1.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 (77) hide show
  1. package/LICENSE +34 -0
  2. package/dist/esm/.builder.pid +9 -0
  3. package/dist/esm/core/resources/resources-operations.custom.shared.definitions.d.ts +1 -1
  4. package/dist/esm/core/resources/resources-operations.custom.shared.definitions.d.ts.map +1 -1
  5. package/dist/esm/core/resources/resources-operations.custom.shared.definitions.js +6 -1
  6. package/dist/esm/core/resources/resources-operations.custom.shared.definitions.js.map +1 -1
  7. package/dist/esm/core/resources/resources-relationships.custom.shared.definitions.d.ts +20 -0
  8. package/dist/esm/core/resources/resources-relationships.custom.shared.definitions.d.ts.map +1 -1
  9. package/dist/esm/core/resources/resources-relationships.custom.shared.definitions.js +93 -3
  10. package/dist/esm/core/resources/resources-relationships.custom.shared.definitions.js.map +1 -1
  11. package/dist/esm/core/resources/resources-types.custom.shared.schemas.d.ts +4 -1
  12. package/dist/esm/core/resources/resources-types.custom.shared.schemas.d.ts.map +1 -1
  13. package/dist/esm/core/resources/resources-types.custom.shared.schemas.js +7 -1
  14. package/dist/esm/core/resources/resources-types.custom.shared.schemas.js.map +1 -1
  15. package/dist/esm/index.d.ts +14 -8
  16. package/dist/esm/index.d.ts.map +1 -1
  17. package/dist/esm/index.js +16 -1
  18. package/dist/esm/index.js.map +1 -1
  19. package/dist/esm/runtime/application-backend-env.contracts.d.ts +212 -15
  20. package/dist/esm/runtime/application-backend-env.contracts.d.ts.map +1 -1
  21. package/dist/esm/runtime/application-backend-env.contracts.js +256 -20
  22. package/dist/esm/runtime/application-backend-env.contracts.js.map +1 -1
  23. package/dist/esm/runtime/application-worker-env.contracts.d.ts +82 -0
  24. package/dist/esm/runtime/application-worker-env.contracts.d.ts.map +1 -0
  25. package/dist/esm/runtime/application-worker-env.contracts.js +106 -0
  26. package/dist/esm/runtime/application-worker-env.contracts.js.map +1 -0
  27. package/dist/esm/runtime/runtime-topology.contracts.d.ts +10 -3
  28. package/dist/esm/runtime/runtime-topology.contracts.d.ts.map +1 -1
  29. package/dist/esm/runtime/runtime-topology.contracts.js +8 -5
  30. package/dist/esm/runtime/runtime-topology.contracts.js.map +1 -1
  31. package/dist/esm/security/authorizations/roles.custom.shared.definitions.d.ts.map +1 -1
  32. package/dist/esm/security/authorizations/roles.custom.shared.definitions.js +1 -1
  33. package/dist/esm/security/authorizations/roles.custom.shared.definitions.js.map +1 -1
  34. package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.resources-config.schemas.d.ts +830 -0
  35. package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.resources-config.schemas.d.ts.map +1 -0
  36. package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.resources-config.schemas.js +58 -0
  37. package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.resources-config.schemas.js.map +1 -0
  38. package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.schemas.d.ts +834 -0
  39. package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.schemas.d.ts.map +1 -0
  40. package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.schemas.js +27 -0
  41. package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.schemas.js.map +1 -0
  42. package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.resources-config.schemas.d.ts +342 -0
  43. package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.resources-config.schemas.d.ts.map +1 -0
  44. package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.resources-config.schemas.js +38 -0
  45. package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.resources-config.schemas.js.map +1 -0
  46. package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.schemas.d.ts +343 -0
  47. package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.schemas.d.ts.map +1 -0
  48. package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.schemas.js +38 -0
  49. package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.schemas.js.map +1 -0
  50. package/dist/esm/wildo-applications/wildo-applications.custom.shared.resources-config.schemas.d.ts.map +1 -1
  51. package/dist/esm/wildo-applications/wildo-applications.custom.shared.resources-config.schemas.js +30 -1
  52. package/dist/esm/wildo-applications/wildo-applications.custom.shared.resources-config.schemas.js.map +1 -1
  53. package/dist/esm/wildo-applications/wildo-applications.custom.shared.schemas.d.ts +2 -2
  54. package/dist/esm/wildo-applications/wildo-applications.custom.shared.schemas.d.ts.map +1 -1
  55. package/dist/esm/wildo-applications/wildo-applications.custom.shared.schemas.js +35 -2
  56. package/dist/esm/wildo-applications/wildo-applications.custom.shared.schemas.js.map +1 -1
  57. package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.resources-config.schemas.d.ts.map +1 -1
  58. package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.resources-config.schemas.js +1 -1
  59. package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.resources-config.schemas.js.map +1 -1
  60. package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.schemas.d.ts +1 -1
  61. package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.schemas.d.ts.map +1 -1
  62. package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.schemas.js +1 -1
  63. package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.schemas.js.map +1 -1
  64. package/dist/esm/workbench/workbench-resources-types.custom.shared.schemas.d.ts +57 -0
  65. package/dist/esm/workbench/workbench-resources-types.custom.shared.schemas.d.ts.map +1 -0
  66. package/dist/esm/workbench/workbench-resources-types.custom.shared.schemas.js +59 -0
  67. package/dist/esm/workbench/workbench-resources-types.custom.shared.schemas.js.map +1 -0
  68. package/dist/esm/workbench/workbench-resources.custom.shared.resources-config.schemas.d.ts +79 -0
  69. package/dist/esm/workbench/workbench-resources.custom.shared.resources-config.schemas.d.ts.map +1 -0
  70. package/dist/esm/workbench/workbench-resources.custom.shared.resources-config.schemas.js +198 -0
  71. package/dist/esm/workbench/workbench-resources.custom.shared.resources-config.schemas.js.map +1 -0
  72. package/dist/esm/workbench/workbench-resources.custom.shared.schemas.d.ts +65 -0
  73. package/dist/esm/workbench/workbench-resources.custom.shared.schemas.d.ts.map +1 -0
  74. package/dist/esm/workbench/workbench-resources.custom.shared.schemas.js +120 -0
  75. package/dist/esm/workbench/workbench-resources.custom.shared.schemas.js.map +1 -0
  76. package/dist/tsconfig.build.tsbuildinfo +1 -1
  77. package/package.json +21 -15
@@ -1 +1 @@
1
- {"version":3,"file":"wildo-applications-versions.custom.shared.schemas.js","sourceRoot":"","sources":["../../../src/wildo-applications-versions/wildo-applications-versions.custom.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,4EAA4E;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAErB,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE;IACtD,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE,CAAC,iBAAiB,EAAE;IACvG,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE,CAAC,iBAAiB,EAAE,EAAE,kBAAkB;IAC1F,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE;IACpD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE;IACxD,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;IAC1F,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;CAC1E,CAAC,CAAC"}
1
+ {"version":3,"file":"wildo-applications-versions.custom.shared.schemas.js","sourceRoot":"","sources":["../../../../src/wildo-applications-versions/wildo-applications-versions.custom.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,4EAA4E;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAErB,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE;IACtD,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE,CAAC,iBAAiB,EAAE;IACvG,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE,CAAC,iBAAiB,EAAE,EAAE,kBAAkB;IAC1F,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE;IACpD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE;IACxD,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;IAC1F,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;CAC1E,CAAC,CAAC","sourcesContent":["/**\n * Wildo Application Version Schema\n * \n * Represents a version/snapshot of a WildoApplication.\n * Each version is linked to a git commit and can be deployed to environments.\n * \n * ═══════════════════════════════════════════════════════════════════════════\n * RATIONALE: Why this type is defined in wildo-ai-application, not engine\n * ═══════════════════════════════════════════════════════════════════════════\n * \n * 1. Wildo_Application_Version_Schema\n * - APP-FACTORY-SPECIFIC: Tracks versions of applications being built.\n * Regular runtime apps don't version themselves in this way.\n * - Fields like `gitBranch`, `gitCommitHash` link to the generated code\n * repository - part of the code-generation pipeline.\n * - The `wildoApplicationId` FK is specific to the app-factory paradigm.\n * - Supports the publish/deploy workflow where users create versions\n * of their application definitions.\n * \n * FRAMEWORK CANDIDATES: None. Version tracking of generated applications\n * is unique to the app-factory.\n * ═══════════════════════════════════════════════════════════════════════════\n */\n\nimport { z } from 'zod';\n\n// Initialize Zod decorators early (lazy init will also happen on first use)\nimport { initZodDecorators } from '@wildo-ai/zod-decorators';\ninitZodDecorators(z);\n\nexport const Wildo_Application_Version_Schema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n wildoApplicationId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n version: z.string().isDBIndexed().isSummaryField().excludeFromUpdate(), // Version lookups\n gitBranch: z.string().isDBIndexed().isSummaryField(),\n gitCommitHash: z.string().isDBIndexed().isSummaryField(),\n createdAt: z.date().isDBIndexed().isSummaryField().excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n});\nexport type Wildo_Application_Version = z.infer<typeof Wildo_Application_Version_Schema>;\n"]}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * The workbench's own resource vocabulary.
3
+ *
4
+ * A SEPARATE enum and factory map from `CustomShared_ResourceType`, deliberately. That map has six
5
+ * consumers, two of which must not receive these: `platform-apps-manager` (which would register
6
+ * resources it has no use for, and whose INIT lifecycle applies migrations) and the companion's i18n
7
+ * labelling planner, which enumerates `Object.keys(...)` and would generate labels for them.
8
+ *
9
+ * These resources are INTROSPECTION-backed: nothing is stored, nothing is migrated, and only the
10
+ * companion can serve them.
11
+ */
12
+ export declare enum WorkbenchShared_ResourceType {
13
+ APPLICATION_MODULES = "workbenchApplicationModules",
14
+ /**
15
+ * Every relationship edge the application's resources declare — how its domain is wired.
16
+ *
17
+ * Projected from a DIFFERENT behavior (`resources-registry`) than the modules beside it, which is
18
+ * what makes it the surface that proves the adapter generalizes: one binding shape, two behaviors,
19
+ * two row shapes, no adapter change.
20
+ */
21
+ RESOURCE_RELATIONSHIPS = "workbenchResourceRelationships"
22
+ }
23
+ /**
24
+ * The field each resource is ADDRESSED BY — and it must be a field the rows actually carry.
25
+ *
26
+ * `workbenchApplicationModules` is identified by `moduleId`, not by a composed
27
+ * `workbenchApplicationModuleId`. The convention-shaped name was declared here first and no row ever
28
+ * carried it: the schema marks `moduleId` as the primary key, the behavior emits `moduleId`, and
29
+ * `identityFields: ['moduleId']` composes the id from it. Nothing anywhere produced the other name,
30
+ * so every consumer that addresses a row THROUGH this map looked for a field that did not exist.
31
+ *
32
+ * READ still worked, which is what kept it hidden: the adapter filters by `identityFields`, so
33
+ * `GET …/workbench-application-modules/engine` answered 200 while the frontend list refused every
34
+ * row click with "could not resolve resource id from list item" — the id it was told to read was
35
+ * absent from the item.
36
+ *
37
+ * Its sibling is the contrast that settles the rule rather than an inconsistency: an edge has no
38
+ * natural key, so `workbenchResourceRelationshipId` is SYNTHESIZED from three fields and is a real
39
+ * declared field of the schema, present on every row. Both entries now name something real; one
40
+ * happens to be the source's own key and the other is composed.
41
+ */
42
+ export declare const WorkbenchShared_ResourceFieldIdentifier: {
43
+ [key in WorkbenchShared_ResourceType]: string;
44
+ };
45
+ /**
46
+ * The frontend-service name the application-creation workbench identifies itself by.
47
+ *
48
+ * Shared because BOTH sides must agree and neither owns it alone: the workbench sends it as
49
+ * `VITE_FRONTEND_SERVICE_NAME` on every `/application-config` and `/i18n/labels` request, and the
50
+ * companion seeds an entry under exactly this key so the engine's `ApplicationConfigController` can
51
+ * answer instead of refusing with `app_configuration_unknown_frontend_service`.
52
+ *
53
+ * Two string literals in two packages would compile perfectly and fail at runtime with an error that
54
+ * names neither of them.
55
+ */
56
+ export declare const WORKBENCH_FRONTEND_SERVICE_NAME = "application-creation-workbench";
57
+ //# sourceMappingURL=workbench-resources-types.custom.shared.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workbench-resources-types.custom.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/workbench/workbench-resources-types.custom.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,oBAAY,4BAA4B;IACtC,mBAAmB,gCAAgC;IACnD;;;;;;OAMG;IACH,sBAAsB,mCAAmC;CAC1D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,uCAAuC,EAAE;KAAG,GAAG,IAAI,4BAA4B,GAAG,MAAM;CAGpG,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,+BAA+B,mCAAmC,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * The workbench's own resource vocabulary.
3
+ *
4
+ * A SEPARATE enum and factory map from `CustomShared_ResourceType`, deliberately. That map has six
5
+ * consumers, two of which must not receive these: `platform-apps-manager` (which would register
6
+ * resources it has no use for, and whose INIT lifecycle applies migrations) and the companion's i18n
7
+ * labelling planner, which enumerates `Object.keys(...)` and would generate labels for them.
8
+ *
9
+ * These resources are INTROSPECTION-backed: nothing is stored, nothing is migrated, and only the
10
+ * companion can serve them.
11
+ */
12
+ export var WorkbenchShared_ResourceType;
13
+ (function (WorkbenchShared_ResourceType) {
14
+ WorkbenchShared_ResourceType["APPLICATION_MODULES"] = "workbenchApplicationModules";
15
+ /**
16
+ * Every relationship edge the application's resources declare — how its domain is wired.
17
+ *
18
+ * Projected from a DIFFERENT behavior (`resources-registry`) than the modules beside it, which is
19
+ * what makes it the surface that proves the adapter generalizes: one binding shape, two behaviors,
20
+ * two row shapes, no adapter change.
21
+ */
22
+ WorkbenchShared_ResourceType["RESOURCE_RELATIONSHIPS"] = "workbenchResourceRelationships";
23
+ })(WorkbenchShared_ResourceType || (WorkbenchShared_ResourceType = {}));
24
+ /**
25
+ * The field each resource is ADDRESSED BY — and it must be a field the rows actually carry.
26
+ *
27
+ * `workbenchApplicationModules` is identified by `moduleId`, not by a composed
28
+ * `workbenchApplicationModuleId`. The convention-shaped name was declared here first and no row ever
29
+ * carried it: the schema marks `moduleId` as the primary key, the behavior emits `moduleId`, and
30
+ * `identityFields: ['moduleId']` composes the id from it. Nothing anywhere produced the other name,
31
+ * so every consumer that addresses a row THROUGH this map looked for a field that did not exist.
32
+ *
33
+ * READ still worked, which is what kept it hidden: the adapter filters by `identityFields`, so
34
+ * `GET …/workbench-application-modules/engine` answered 200 while the frontend list refused every
35
+ * row click with "could not resolve resource id from list item" — the id it was told to read was
36
+ * absent from the item.
37
+ *
38
+ * Its sibling is the contrast that settles the rule rather than an inconsistency: an edge has no
39
+ * natural key, so `workbenchResourceRelationshipId` is SYNTHESIZED from three fields and is a real
40
+ * declared field of the schema, present on every row. Both entries now name something real; one
41
+ * happens to be the source's own key and the other is composed.
42
+ */
43
+ export const WorkbenchShared_ResourceFieldIdentifier = {
44
+ [WorkbenchShared_ResourceType.APPLICATION_MODULES]: 'moduleId',
45
+ [WorkbenchShared_ResourceType.RESOURCE_RELATIONSHIPS]: 'workbenchResourceRelationshipId',
46
+ };
47
+ /**
48
+ * The frontend-service name the application-creation workbench identifies itself by.
49
+ *
50
+ * Shared because BOTH sides must agree and neither owns it alone: the workbench sends it as
51
+ * `VITE_FRONTEND_SERVICE_NAME` on every `/application-config` and `/i18n/labels` request, and the
52
+ * companion seeds an entry under exactly this key so the engine's `ApplicationConfigController` can
53
+ * answer instead of refusing with `app_configuration_unknown_frontend_service`.
54
+ *
55
+ * Two string literals in two packages would compile perfectly and fail at runtime with an error that
56
+ * names neither of them.
57
+ */
58
+ export const WORKBENCH_FRONTEND_SERVICE_NAME = 'application-creation-workbench';
59
+ //# sourceMappingURL=workbench-resources-types.custom.shared.schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workbench-resources-types.custom.shared.schemas.js","sourceRoot":"","sources":["../../../../src/workbench/workbench-resources-types.custom.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAN,IAAY,4BAUX;AAVD,WAAY,4BAA4B;IACtC,mFAAmD,CAAA;IACnD;;;;;;OAMG;IACH,yFAAyD,CAAA;AAC3D,CAAC,EAVW,4BAA4B,KAA5B,4BAA4B,QAUvC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAsD;IACxG,CAAC,4BAA4B,CAAC,mBAAmB,CAAC,EAAE,UAAU;IAC9D,CAAC,4BAA4B,CAAC,sBAAsB,CAAC,EAAE,iCAAiC;CACzF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,gCAAgC,CAAC","sourcesContent":["/**\n * The workbench's own resource vocabulary.\n *\n * A SEPARATE enum and factory map from `CustomShared_ResourceType`, deliberately. That map has six\n * consumers, two of which must not receive these: `platform-apps-manager` (which would register\n * resources it has no use for, and whose INIT lifecycle applies migrations) and the companion's i18n\n * labelling planner, which enumerates `Object.keys(...)` and would generate labels for them.\n *\n * These resources are INTROSPECTION-backed: nothing is stored, nothing is migrated, and only the\n * companion can serve them.\n */\nexport enum WorkbenchShared_ResourceType {\n APPLICATION_MODULES = 'workbenchApplicationModules',\n /**\n * Every relationship edge the application's resources declare — how its domain is wired.\n *\n * Projected from a DIFFERENT behavior (`resources-registry`) than the modules beside it, which is\n * what makes it the surface that proves the adapter generalizes: one binding shape, two behaviors,\n * two row shapes, no adapter change.\n */\n RESOURCE_RELATIONSHIPS = 'workbenchResourceRelationships',\n}\n\n/**\n * The field each resource is ADDRESSED BY — and it must be a field the rows actually carry.\n *\n * `workbenchApplicationModules` is identified by `moduleId`, not by a composed\n * `workbenchApplicationModuleId`. The convention-shaped name was declared here first and no row ever\n * carried it: the schema marks `moduleId` as the primary key, the behavior emits `moduleId`, and\n * `identityFields: ['moduleId']` composes the id from it. Nothing anywhere produced the other name,\n * so every consumer that addresses a row THROUGH this map looked for a field that did not exist.\n *\n * READ still worked, which is what kept it hidden: the adapter filters by `identityFields`, so\n * `GET …/workbench-application-modules/engine` answered 200 while the frontend list refused every\n * row click with \"could not resolve resource id from list item\" — the id it was told to read was\n * absent from the item.\n *\n * Its sibling is the contrast that settles the rule rather than an inconsistency: an edge has no\n * natural key, so `workbenchResourceRelationshipId` is SYNTHESIZED from three fields and is a real\n * declared field of the schema, present on every row. Both entries now name something real; one\n * happens to be the source's own key and the other is composed.\n */\nexport const WorkbenchShared_ResourceFieldIdentifier: { [key in WorkbenchShared_ResourceType]: string } = {\n [WorkbenchShared_ResourceType.APPLICATION_MODULES]: 'moduleId',\n [WorkbenchShared_ResourceType.RESOURCE_RELATIONSHIPS]: 'workbenchResourceRelationshipId',\n};\n\n/**\n * The frontend-service name the application-creation workbench identifies itself by.\n *\n * Shared because BOTH sides must agree and neither owns it alone: the workbench sends it as\n * `VITE_FRONTEND_SERVICE_NAME` on every `/application-config` and `/i18n/labels` request, and the\n * companion seeds an entry under exactly this key so the engine's `ApplicationConfigController` can\n * answer instead of refusing with `app_configuration_unknown_frontend_service`.\n *\n * Two string literals in two packages would compile perfectly and fail at runtime with an error that\n * names neither of them.\n */\nexport const WORKBENCH_FRONTEND_SERVICE_NAME = 'application-creation-workbench';\n"]}
@@ -0,0 +1,79 @@
1
+ import { CoreResourceOperation, ResourceRelationship } from '@wildo-ai/saas-models';
2
+ type WorkbenchApplicationModule_CoreOperations = CoreResourceOperation.READ | CoreResourceOperation.LIST;
3
+ /**
4
+ * The application's shared modules and the resources each owns.
5
+ *
6
+ * Rows are DERIVED per read from the companion's `resource-specifications` behavior; nothing is
7
+ * stored. `rowsPath` names where that behavior keeps them, because behaviors answer their own
8
+ * natural shape rather than a uniform envelope.
9
+ */
10
+ export declare const workbenchApplicationModules_ResourceConfiguration_InitializationFactory: (resourcesRelationships: ResourceRelationship[]) => import("@wildo-ai/saas-models").ResourceConfiguration<any, WorkbenchApplicationModule_CoreOperations, import("zod").ZodObject<{
11
+ moduleId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
12
+ resourceTypes: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodArray<import("zod").ZodString>>;
13
+ kind: import("zod").ZodNullable<import("zod").ZodString>;
14
+ contributions: import("zod").ZodArray<import("zod").ZodObject<{
15
+ contribution: import("zod").ZodString;
16
+ count: import("zod").ZodNumber;
17
+ }, import("zod/v4/core").$strip>>;
18
+ }, import("zod/v4/core").$strip>>;
19
+ /**
20
+ * APPLICATION-scoped, anchored by a STANDALONE relationship.
21
+ *
22
+ * The form the resource factory's own migration note prescribes: STANDALONE "keeps the rel inert for
23
+ * URL routing while declaring the structural ownership anchor", so the resource is reachable at a
24
+ * flat path rather than nested under `/applications/:id/`.
25
+ *
26
+ * APPLICATION rather than ORGANIZATIONS on purpose: these rows describe the application's own
27
+ * structure, so the application IS their scope. There is no tenant dimension to anchor on — the
28
+ * binding's `APPLICATION_STRUCTURE` stance above says the same thing from the data's side.
29
+ *
30
+ * This originally read as a consequence of API-key scoping, because the workbench browser was
31
+ * expected to authenticate with an application-scope key. `APP_PUBLIC` removed that requirement
32
+ * entirely (see the role note above), so the scope now rests on its own merits rather than on a
33
+ * credential's constraint. The tenant-scoping trade remains recorded in issue #118.
34
+ */
35
+ export declare const workbenchShared_ResourcesRelationships: ResourceRelationship[];
36
+ type WorkbenchResourceRelationship_CoreOperations = CoreResourceOperation.READ | CoreResourceOperation.LIST;
37
+ export declare const workbenchResourceRelationships_ResourceConfiguration_InitializationFactory: (resourcesRelationships: ResourceRelationship[]) => import("@wildo-ai/saas-models").ResourceConfiguration<any, WorkbenchResourceRelationship_CoreOperations, import("zod").ZodObject<{
38
+ workbenchResourceRelationshipId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
39
+ resourceType1: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>;
40
+ resourceType2: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>;
41
+ cardinality1: import("zod").ZodString;
42
+ cardinality2: import("zod").ZodString;
43
+ nature: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>;
44
+ foreignKeyField: import("zod").ZodString;
45
+ accessScopeStrategy: import("zod").ZodString;
46
+ parentResourceRequirement: import("zod").ZodString;
47
+ isPrimaryScope: import("zod").ZodBoolean;
48
+ allowCycle: import("zod").ZodBoolean;
49
+ isDisabled: import("zod").ZodBoolean;
50
+ primaryScope: import("zod").ZodOptional<import("zod").ZodString>;
51
+ }, import("zod/v4/core").$strip>>;
52
+ export declare const workbenchShared_ResourcesConfigurationsFactoryMap: {
53
+ workbenchApplicationModules: (resourcesRelationships: ResourceRelationship[]) => import("@wildo-ai/saas-models").ResourceConfiguration<any, WorkbenchApplicationModule_CoreOperations, import("zod").ZodObject<{
54
+ moduleId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
55
+ resourceTypes: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodArray<import("zod").ZodString>>;
56
+ kind: import("zod").ZodNullable<import("zod").ZodString>;
57
+ contributions: import("zod").ZodArray<import("zod").ZodObject<{
58
+ contribution: import("zod").ZodString;
59
+ count: import("zod").ZodNumber;
60
+ }, import("zod/v4/core").$strip>>;
61
+ }, import("zod/v4/core").$strip>>;
62
+ workbenchResourceRelationships: (resourcesRelationships: ResourceRelationship[]) => import("@wildo-ai/saas-models").ResourceConfiguration<any, WorkbenchResourceRelationship_CoreOperations, import("zod").ZodObject<{
63
+ workbenchResourceRelationshipId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
64
+ resourceType1: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>;
65
+ resourceType2: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>;
66
+ cardinality1: import("zod").ZodString;
67
+ cardinality2: import("zod").ZodString;
68
+ nature: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>;
69
+ foreignKeyField: import("zod").ZodString;
70
+ accessScopeStrategy: import("zod").ZodString;
71
+ parentResourceRequirement: import("zod").ZodString;
72
+ isPrimaryScope: import("zod").ZodBoolean;
73
+ allowCycle: import("zod").ZodBoolean;
74
+ isDisabled: import("zod").ZodBoolean;
75
+ primaryScope: import("zod").ZodOptional<import("zod").ZodString>;
76
+ }, import("zod/v4/core").$strip>>;
77
+ };
78
+ export {};
79
+ //# sourceMappingURL=workbench-resources.custom.shared.resources-config.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workbench-resources.custom.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/workbench/workbench-resources.custom.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,qBAAqB,EAMrB,oBAAoB,EAMrB,MAAM,uBAAuB,CAAC;AAa/B,KAAK,yCAAyC,GAC1C,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,CAAC;AA6D/B;;;;;;GAMG;AACH,eAAO,MAAM,uEAAuE,GACjF,wBAAwB,oBAAoB,EAAE;;;;;;;;iCA6C7C,CAAC;AAEL;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sCAAsC,EAAE,oBAAoB,EA+BxE,CAAC;AAmBF,KAAK,4CAA4C,GAC7C,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,CAAC;AAE/B,eAAO,MAAM,0EAA0E,GACpF,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;iCAmC7C,CAAC;AAEL,eAAO,MAAM,iDAAiD;0DA3JnC,oBAAoB,EAAE;;;;;;;;;6DAsHtB,oBAAoB,EAAE;;;;;;;;;;;;;;;CA0ChD,CAAC"}
@@ -0,0 +1,198 @@
1
+ import { CORE_APP_ROLES, CoreResourceOperation, CoreResourceType, IntrospectionTenancyStance, PersistenceAdapter, ResourceOperationRiskLevel, ResourceOperationVariantType, ResourceRelationshipAccessScopeStrategy, ResourceRelationshipCardinality, RelationshipNature, createResourceConfiguration_Initialization, createResourcesRelationship, } from '@wildo-ai/saas-models';
2
+ import { WorkbenchShared_ResourceFieldIdentifier, WorkbenchShared_ResourceType, } from './workbench-resources-types.custom.shared.schemas.js';
3
+ import { Workbench_ApplicationModule_Schema, Workbench_ResourceRelationship_Schema, } from './workbench-resources.custom.shared.schemas.js';
4
+ const WorkbenchApplicationModule_Operations = undefined;
5
+ /**
6
+ * Read-only over HTTP, and PUBLIC.
7
+ *
8
+ * `APP_PUBLIC` means what its enum comment says — accessible to everyone, no credential — and as of
9
+ * 2026-08-30 the runtime implements it: the authentication chain now admits an operation declaring
10
+ * this role instead of demanding a credential it never required. Before that it was declared,
11
+ * published as public by the OpenAPI generator, and refused at runtime.
12
+ *
13
+ * ## Why these rows are genuinely public
14
+ *
15
+ * They are a projection of the application's OWN SOURCE — module ids and the resource types each
16
+ * registers — carrying no tenant dimension, which is exactly what the binding's
17
+ * `APPLICATION_STRUCTURE` tenancy stance declares. There is no subject whose data could leak,
18
+ * because no subject's data is here.
19
+ *
20
+ * This is the same category as a public price list, a frontend application configuration or an i18n
21
+ * bundle: things every caller may read, which until now could only be served by escaping the
22
+ * resource system into a manual controller.
23
+ *
24
+ * ## What still confines them
25
+ *
26
+ * The companion asserts a loopback bind at startup and fails closed otherwise, so this surface is
27
+ * reachable only from the developer's own machine. `APP_PUBLIC` is the right declaration on its
28
+ * merits; the loopback bind is what makes the whole workbench local, and both remain true
29
+ * independently.
30
+ *
31
+ * If an introspected resource is ever added that projects something OTHER than the application's own
32
+ * structure, this role is wrong for it — the stance and the role must move together.
33
+ */
34
+ function createReadOnlyApiVariant() {
35
+ return {
36
+ variantType: ResourceOperationVariantType.API_CALL,
37
+ isDefault: true,
38
+ /*
39
+ * BOTH roles, because `APP_PUBLIC` alone does not mean "everyone" at runtime.
40
+ *
41
+ * The authorizer admits a public operation only when the caller is ALSO a public execution —
42
+ * `executionContext.isPublicExecution() && operationDeclaresPublicAccess(operation)`, and its
43
+ * comment states the reasoning: a public context has no principal, so there are no roles to
44
+ * examine. An AUTHENTICATED caller therefore falls past that carve-out to the ordinary role
45
+ * gate, where `APP_PUBLIC` is not among anyone's granted roles, and is refused.
46
+ *
47
+ * Measured on this exact resource, 2026-08-31: with no credential `GET
48
+ * /api/v1/workbench-application-modules` answers 200 with the eight modules; with a valid
49
+ * administrator bearer it answers 403 `authorizations_access_denied`. The workbench's own
50
+ * sidebar could not read the rows it exists to show, because its operator had logged in.
51
+ *
52
+ * `APP_USER` is the role every authenticated user carries, so declaring it beside `APP_PUBLIC`
53
+ * says what these rows have always meant — readable by anyone — for both kinds of caller. It
54
+ * widens nothing beyond the public declaration already made.
55
+ *
56
+ * Whether presenting a credential SHOULD be able to reduce access below what presenting none
57
+ * grants is an engine question — issue #153 — and this declaration is correct either way.
58
+ */
59
+ roles: [CORE_APP_ROLES.APP_PUBLIC, CORE_APP_ROLES.APP_USER],
60
+ riskLevel: ResourceOperationRiskLevel.LOW,
61
+ };
62
+ }
63
+ /**
64
+ * The application's shared modules and the resources each owns.
65
+ *
66
+ * Rows are DERIVED per read from the companion's `resource-specifications` behavior; nothing is
67
+ * stored. `rowsPath` names where that behavior keeps them, because behaviors answer their own
68
+ * natural shape rather than a uniform envelope.
69
+ */
70
+ export const workbenchApplicationModules_ResourceConfiguration_InitializationFactory = (resourcesRelationships) => createResourceConfiguration_Initialization({
71
+ mainSchema: Workbench_ApplicationModule_Schema,
72
+ resourceIdentifier: WorkbenchShared_ResourceType.APPLICATION_MODULES,
73
+ resourceFieldIdentifier: WorkbenchShared_ResourceFieldIdentifier[WorkbenchShared_ResourceType.APPLICATION_MODULES],
74
+ resourceRelationships: resourcesRelationships,
75
+ isSystemResource: false,
76
+ persistenceAdapter: PersistenceAdapter.INTROSPECTION,
77
+ introspectionBinding: {
78
+ behavior: 'resource-specifications',
79
+ rowsPath: 'moduleOwnership',
80
+ /*
81
+ * A single-field key, and it is NOT redundant.
82
+ *
83
+ * The behavior's rows carry `moduleId`, but every lookup addresses a row by the resource's
84
+ * `resourceFieldIdentifier` — `workbenchApplicationModuleId` — so a row that never carries
85
+ * that field can be listed and never found. Measured: `GET …/workbench-application-modules`
86
+ * answered 200 with 8 rows while `…/engine` answered 404, because the filter looked for a
87
+ * field the row did not have.
88
+ *
89
+ * Composing from `moduleId` copies the behavior's own key onto the field the framework
90
+ * addresses by, which keeps ONE identity rather than two names for it.
91
+ */
92
+ identityFields: ['moduleId'],
93
+ /*
94
+ * A module id and the resource types it registers describe the APPLICATION'S OWN STRUCTURE.
95
+ * There is no tenant dimension for a scope predicate to filter on — every caller who may read
96
+ * this resource at all sees the same rows, because they are a projection of the application's
97
+ * source rather than of anyone's data.
98
+ *
99
+ * Declared rather than left implicit: an unstated stance is indistinguishable from an
100
+ * overlooked one, which is the whole reason the field is required.
101
+ */
102
+ tenancy: IntrospectionTenancyStance.APPLICATION_STRUCTURE,
103
+ },
104
+ coreOperations: [CoreResourceOperation.READ, CoreResourceOperation.LIST],
105
+ customOperation: WorkbenchApplicationModule_Operations,
106
+ operationsConfiguration: {
107
+ [CoreResourceOperation.READ]: { variants: [createReadOnlyApiVariant()] },
108
+ [CoreResourceOperation.LIST]: { variants: [createReadOnlyApiVariant()] },
109
+ },
110
+ });
111
+ /**
112
+ * APPLICATION-scoped, anchored by a STANDALONE relationship.
113
+ *
114
+ * The form the resource factory's own migration note prescribes: STANDALONE "keeps the rel inert for
115
+ * URL routing while declaring the structural ownership anchor", so the resource is reachable at a
116
+ * flat path rather than nested under `/applications/:id/`.
117
+ *
118
+ * APPLICATION rather than ORGANIZATIONS on purpose: these rows describe the application's own
119
+ * structure, so the application IS their scope. There is no tenant dimension to anchor on — the
120
+ * binding's `APPLICATION_STRUCTURE` stance above says the same thing from the data's side.
121
+ *
122
+ * This originally read as a consequence of API-key scoping, because the workbench browser was
123
+ * expected to authenticate with an application-scope key. `APP_PUBLIC` removed that requirement
124
+ * entirely (see the role note above), so the scope now rests on its own merits rather than on a
125
+ * credential's constraint. The tenant-scoping trade remains recorded in issue #118.
126
+ */
127
+ export const workbenchShared_ResourcesRelationships = [
128
+ createResourcesRelationship(CoreResourceType.APPLICATION, WorkbenchShared_ResourceType.APPLICATION_MODULES, ResourceRelationshipCardinality.ONE, ResourceRelationshipCardinality.MANY, {
129
+ nature: RelationshipNature.COMPOSITION,
130
+ isPrimaryScope: true,
131
+ accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.STANDALONE,
132
+ contextPolicy: {},
133
+ }),
134
+ /*
135
+ * The same STANDALONE anchor for the relationships resource. Every INTROSPECTION resource needs
136
+ * one: `resourcePrimaryScope` is DERIVED from a relationship flagged `isPrimaryScope`, so a
137
+ * resource without one has no scope at all — and STANDALONE keeps it off the URL, which is what
138
+ * gives both resources a flat route instead of `/applications/:id/...`.
139
+ */
140
+ createResourcesRelationship(CoreResourceType.APPLICATION, WorkbenchShared_ResourceType.RESOURCE_RELATIONSHIPS, ResourceRelationshipCardinality.ONE, ResourceRelationshipCardinality.MANY, {
141
+ nature: RelationshipNature.COMPOSITION,
142
+ isPrimaryScope: true,
143
+ accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.STANDALONE,
144
+ contextPolicy: {},
145
+ }),
146
+ ];
147
+ /**
148
+ * Every relationship edge the observed application declares.
149
+ *
150
+ * ## Why this resource exists as the SECOND surface
151
+ *
152
+ * It projects a DIFFERENT behavior (`resources-registry`) from the modules beside it
153
+ * (`resource-specifications`), with a different row shape and no natural primary key. That is the
154
+ * point: it proves the introspection adapter generalizes across the companion's 23 behaviors rather
155
+ * than fitting the one it was built against — and the missing key is what surfaced
156
+ * `identityFields` as a real seam instead of a guess.
157
+ *
158
+ * Same tenancy stance and same PUBLIC role as its sibling, for the same reason: an edge between two
159
+ * resource types is a fact about the application's SOURCE, with no tenant dimension and no subject
160
+ * whose data could leak.
161
+ */
162
+ const WorkbenchResourceRelationship_Operations = undefined;
163
+ export const workbenchResourceRelationships_ResourceConfiguration_InitializationFactory = (resourcesRelationships) => createResourceConfiguration_Initialization({
164
+ mainSchema: Workbench_ResourceRelationship_Schema,
165
+ resourceIdentifier: WorkbenchShared_ResourceType.RESOURCE_RELATIONSHIPS,
166
+ resourceFieldIdentifier: WorkbenchShared_ResourceFieldIdentifier[WorkbenchShared_ResourceType.RESOURCE_RELATIONSHIPS],
167
+ resourceRelationships: resourcesRelationships,
168
+ isSystemResource: false,
169
+ persistenceAdapter: PersistenceAdapter.INTROSPECTION,
170
+ introspectionBinding: {
171
+ behavior: 'resources-registry',
172
+ rowsPath: 'resourceRelationships',
173
+ tenancy: IntrospectionTenancyStance.APPLICATION_STRUCTURE,
174
+ /*
175
+ * The two endpoints plus the joining field.
176
+ *
177
+ * The pair ALONE is unique across all 16 edges in the dogfood application — measured, not
178
+ * assumed — and is still not safe: the framework permits several edges between the same two
179
+ * resources (a junction carrying two roles, a self-relationship). `foreignKeyField` is what
180
+ * distinguishes those, so it earns its place in the key rather than padding it.
181
+ *
182
+ * If these three ever collide the source REFUSES the whole derivation and names both rows,
183
+ * because the alternative is a row that LIST shows and READ can never reach.
184
+ */
185
+ identityFields: ['resourceType1', 'resourceType2', 'foreignKeyField'],
186
+ },
187
+ coreOperations: [CoreResourceOperation.READ, CoreResourceOperation.LIST],
188
+ customOperation: WorkbenchResourceRelationship_Operations,
189
+ operationsConfiguration: {
190
+ [CoreResourceOperation.READ]: { variants: [createReadOnlyApiVariant()] },
191
+ [CoreResourceOperation.LIST]: { variants: [createReadOnlyApiVariant()] },
192
+ },
193
+ });
194
+ export const workbenchShared_ResourcesConfigurationsFactoryMap = {
195
+ [WorkbenchShared_ResourceType.APPLICATION_MODULES]: workbenchApplicationModules_ResourceConfiguration_InitializationFactory,
196
+ [WorkbenchShared_ResourceType.RESOURCE_RELATIONSHIPS]: workbenchResourceRelationships_ResourceConfiguration_InitializationFactory,
197
+ };
198
+ //# sourceMappingURL=workbench-resources.custom.shared.resources-config.schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workbench-resources.custom.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/workbench/workbench-resources.custom.shared.resources-config.schemas.ts"],"names":[],"mappings":"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","sourcesContent":["import {\n CORE_APP_ROLES,\n CoreResourceOperation,\n CoreResourceType,\n IntrospectionTenancyStance,\n PersistenceAdapter,\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n ResourceRelationship,\n ResourceRelationshipAccessScopeStrategy,\n ResourceRelationshipCardinality,\n RelationshipNature,\n createResourceConfiguration_Initialization,\n createResourcesRelationship,\n} from '@wildo-ai/saas-models';\n\nimport {\n WorkbenchShared_ResourceFieldIdentifier,\n WorkbenchShared_ResourceType,\n} from './workbench-resources-types.custom.shared.schemas';\nimport {\n Workbench_ApplicationModule_Schema,\n Workbench_ResourceRelationship_Schema,\n} from './workbench-resources.custom.shared.schemas';\n\nconst WorkbenchApplicationModule_Operations = undefined;\n\ntype WorkbenchApplicationModule_CoreOperations =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST;\n\n/**\n * Read-only over HTTP, and PUBLIC.\n *\n * `APP_PUBLIC` means what its enum comment says — accessible to everyone, no credential — and as of\n * 2026-08-30 the runtime implements it: the authentication chain now admits an operation declaring\n * this role instead of demanding a credential it never required. Before that it was declared,\n * published as public by the OpenAPI generator, and refused at runtime.\n *\n * ## Why these rows are genuinely public\n *\n * They are a projection of the application's OWN SOURCE — module ids and the resource types each\n * registers — carrying no tenant dimension, which is exactly what the binding's\n * `APPLICATION_STRUCTURE` tenancy stance declares. There is no subject whose data could leak,\n * because no subject's data is here.\n *\n * This is the same category as a public price list, a frontend application configuration or an i18n\n * bundle: things every caller may read, which until now could only be served by escaping the\n * resource system into a manual controller.\n *\n * ## What still confines them\n *\n * The companion asserts a loopback bind at startup and fails closed otherwise, so this surface is\n * reachable only from the developer's own machine. `APP_PUBLIC` is the right declaration on its\n * merits; the loopback bind is what makes the whole workbench local, and both remain true\n * independently.\n *\n * If an introspected resource is ever added that projects something OTHER than the application's own\n * structure, this role is wrong for it — the stance and the role must move together.\n */\nfunction createReadOnlyApiVariant() {\n return {\n variantType: ResourceOperationVariantType.API_CALL as const,\n isDefault: true as const,\n /*\n * BOTH roles, because `APP_PUBLIC` alone does not mean \"everyone\" at runtime.\n *\n * The authorizer admits a public operation only when the caller is ALSO a public execution —\n * `executionContext.isPublicExecution() && operationDeclaresPublicAccess(operation)`, and its\n * comment states the reasoning: a public context has no principal, so there are no roles to\n * examine. An AUTHENTICATED caller therefore falls past that carve-out to the ordinary role\n * gate, where `APP_PUBLIC` is not among anyone's granted roles, and is refused.\n *\n * Measured on this exact resource, 2026-08-31: with no credential `GET\n * /api/v1/workbench-application-modules` answers 200 with the eight modules; with a valid\n * administrator bearer it answers 403 `authorizations_access_denied`. The workbench's own\n * sidebar could not read the rows it exists to show, because its operator had logged in.\n *\n * `APP_USER` is the role every authenticated user carries, so declaring it beside `APP_PUBLIC`\n * says what these rows have always meant — readable by anyone — for both kinds of caller. It\n * widens nothing beyond the public declaration already made.\n *\n * Whether presenting a credential SHOULD be able to reduce access below what presenting none\n * grants is an engine question — issue #153 — and this declaration is correct either way.\n */\n roles: [CORE_APP_ROLES.APP_PUBLIC, CORE_APP_ROLES.APP_USER],\n riskLevel: ResourceOperationRiskLevel.LOW as const,\n };\n}\n\n/**\n * The application's shared modules and the resources each owns.\n *\n * Rows are DERIVED per read from the companion's `resource-specifications` behavior; nothing is\n * stored. `rowsPath` names where that behavior keeps them, because behaviors answer their own\n * natural shape rather than a uniform envelope.\n */\nexport const workbenchApplicationModules_ResourceConfiguration_InitializationFactory =\n (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n typeof WorkbenchApplicationModule_Operations,\n WorkbenchApplicationModule_CoreOperations,\n typeof Workbench_ApplicationModule_Schema\n >({\n mainSchema: Workbench_ApplicationModule_Schema,\n resourceIdentifier: WorkbenchShared_ResourceType.APPLICATION_MODULES,\n resourceFieldIdentifier:\n WorkbenchShared_ResourceFieldIdentifier[WorkbenchShared_ResourceType.APPLICATION_MODULES],\n resourceRelationships: resourcesRelationships,\n isSystemResource: false,\n persistenceAdapter: PersistenceAdapter.INTROSPECTION,\n introspectionBinding: {\n behavior: 'resource-specifications',\n rowsPath: 'moduleOwnership',\n /*\n * A single-field key, and it is NOT redundant.\n *\n * The behavior's rows carry `moduleId`, but every lookup addresses a row by the resource's\n * `resourceFieldIdentifier` — `workbenchApplicationModuleId` — so a row that never carries\n * that field can be listed and never found. Measured: `GET …/workbench-application-modules`\n * answered 200 with 8 rows while `…/engine` answered 404, because the filter looked for a\n * field the row did not have.\n *\n * Composing from `moduleId` copies the behavior's own key onto the field the framework\n * addresses by, which keeps ONE identity rather than two names for it.\n */\n identityFields: ['moduleId'],\n /*\n * A module id and the resource types it registers describe the APPLICATION'S OWN STRUCTURE.\n * There is no tenant dimension for a scope predicate to filter on — every caller who may read\n * this resource at all sees the same rows, because they are a projection of the application's\n * source rather than of anyone's data.\n *\n * Declared rather than left implicit: an unstated stance is indistinguishable from an\n * overlooked one, which is the whole reason the field is required.\n */\n tenancy: IntrospectionTenancyStance.APPLICATION_STRUCTURE,\n },\n coreOperations: [CoreResourceOperation.READ, CoreResourceOperation.LIST],\n customOperation: WorkbenchApplicationModule_Operations,\n operationsConfiguration: {\n [CoreResourceOperation.READ]: { variants: [createReadOnlyApiVariant()] },\n [CoreResourceOperation.LIST]: { variants: [createReadOnlyApiVariant()] },\n },\n });\n\n/**\n * APPLICATION-scoped, anchored by a STANDALONE relationship.\n *\n * The form the resource factory's own migration note prescribes: STANDALONE \"keeps the rel inert for\n * URL routing while declaring the structural ownership anchor\", so the resource is reachable at a\n * flat path rather than nested under `/applications/:id/`.\n *\n * APPLICATION rather than ORGANIZATIONS on purpose: these rows describe the application's own\n * structure, so the application IS their scope. There is no tenant dimension to anchor on — the\n * binding's `APPLICATION_STRUCTURE` stance above says the same thing from the data's side.\n *\n * This originally read as a consequence of API-key scoping, because the workbench browser was\n * expected to authenticate with an application-scope key. `APP_PUBLIC` removed that requirement\n * entirely (see the role note above), so the scope now rests on its own merits rather than on a\n * credential's constraint. The tenant-scoping trade remains recorded in issue #118.\n */\nexport const workbenchShared_ResourcesRelationships: ResourceRelationship[] = [\n createResourcesRelationship(\n CoreResourceType.APPLICATION,\n WorkbenchShared_ResourceType.APPLICATION_MODULES,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.COMPOSITION,\n isPrimaryScope: true,\n accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.STANDALONE,\n contextPolicy: {},\n },\n ),\n /*\n * The same STANDALONE anchor for the relationships resource. Every INTROSPECTION resource needs\n * one: `resourcePrimaryScope` is DERIVED from a relationship flagged `isPrimaryScope`, so a\n * resource without one has no scope at all — and STANDALONE keeps it off the URL, which is what\n * gives both resources a flat route instead of `/applications/:id/...`.\n */\n createResourcesRelationship(\n CoreResourceType.APPLICATION,\n WorkbenchShared_ResourceType.RESOURCE_RELATIONSHIPS,\n ResourceRelationshipCardinality.ONE,\n ResourceRelationshipCardinality.MANY,\n {\n nature: RelationshipNature.COMPOSITION,\n isPrimaryScope: true,\n accessScopeStrategy: ResourceRelationshipAccessScopeStrategy.STANDALONE,\n contextPolicy: {},\n },\n ),\n];\n\n/**\n * Every relationship edge the observed application declares.\n *\n * ## Why this resource exists as the SECOND surface\n *\n * It projects a DIFFERENT behavior (`resources-registry`) from the modules beside it\n * (`resource-specifications`), with a different row shape and no natural primary key. That is the\n * point: it proves the introspection adapter generalizes across the companion's 23 behaviors rather\n * than fitting the one it was built against — and the missing key is what surfaced\n * `identityFields` as a real seam instead of a guess.\n *\n * Same tenancy stance and same PUBLIC role as its sibling, for the same reason: an edge between two\n * resource types is a fact about the application's SOURCE, with no tenant dimension and no subject\n * whose data could leak.\n */\nconst WorkbenchResourceRelationship_Operations = undefined;\n\ntype WorkbenchResourceRelationship_CoreOperations =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST;\n\nexport const workbenchResourceRelationships_ResourceConfiguration_InitializationFactory =\n (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n typeof WorkbenchResourceRelationship_Operations,\n WorkbenchResourceRelationship_CoreOperations,\n typeof Workbench_ResourceRelationship_Schema\n >({\n mainSchema: Workbench_ResourceRelationship_Schema,\n resourceIdentifier: WorkbenchShared_ResourceType.RESOURCE_RELATIONSHIPS,\n resourceFieldIdentifier:\n WorkbenchShared_ResourceFieldIdentifier[WorkbenchShared_ResourceType.RESOURCE_RELATIONSHIPS],\n resourceRelationships: resourcesRelationships,\n isSystemResource: false,\n persistenceAdapter: PersistenceAdapter.INTROSPECTION,\n introspectionBinding: {\n behavior: 'resources-registry',\n rowsPath: 'resourceRelationships',\n tenancy: IntrospectionTenancyStance.APPLICATION_STRUCTURE,\n /*\n * The two endpoints plus the joining field.\n *\n * The pair ALONE is unique across all 16 edges in the dogfood application — measured, not\n * assumed — and is still not safe: the framework permits several edges between the same two\n * resources (a junction carrying two roles, a self-relationship). `foreignKeyField` is what\n * distinguishes those, so it earns its place in the key rather than padding it.\n *\n * If these three ever collide the source REFUSES the whole derivation and names both rows,\n * because the alternative is a row that LIST shows and READ can never reach.\n */\n identityFields: ['resourceType1', 'resourceType2', 'foreignKeyField'],\n },\n coreOperations: [CoreResourceOperation.READ, CoreResourceOperation.LIST],\n customOperation: WorkbenchResourceRelationship_Operations,\n operationsConfiguration: {\n [CoreResourceOperation.READ]: { variants: [createReadOnlyApiVariant()] },\n [CoreResourceOperation.LIST]: { variants: [createReadOnlyApiVariant()] },\n },\n });\n\nexport const workbenchShared_ResourcesConfigurationsFactoryMap = {\n [WorkbenchShared_ResourceType.APPLICATION_MODULES]:\n workbenchApplicationModules_ResourceConfiguration_InitializationFactory,\n [WorkbenchShared_ResourceType.RESOURCE_RELATIONSHIPS]:\n workbenchResourceRelationships_ResourceConfiguration_InitializationFactory,\n};\n"]}
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * An application's shared MODULE and the resources it owns — derived, never stored.
4
+ *
5
+ * The first resource backed by `PersistenceAdapter.INTROSPECTION`. Rows come from the companion's
6
+ * `resource-specifications` behavior, whose `moduleOwnership` is exactly this shape
7
+ * (`{ moduleId, resourceTypes }`), so nothing is reshaped on the way through: the binding names the
8
+ * behavior and the path, and the schema describes what that behavior already answers.
9
+ *
10
+ * ## Why `moduleId` is the primary key
11
+ *
12
+ * There is no store to mint a surrogate in. A derived row must be identified by something the SOURCE
13
+ * already guarantees unique, and a module id is that by construction — two modules with one id would
14
+ * be a defect in the application, not in this projection.
15
+ */
16
+ export declare const Workbench_ApplicationModule_Schema: z.ZodObject<{
17
+ moduleId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
18
+ resourceTypes: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodArray<z.ZodString>>;
19
+ kind: z.ZodNullable<z.ZodString>;
20
+ contributions: z.ZodArray<z.ZodObject<{
21
+ contribution: z.ZodString;
22
+ count: z.ZodNumber;
23
+ }, z.core.$strip>>;
24
+ }, z.core.$strip>;
25
+ export type Workbench_ApplicationModule = z.infer<typeof Workbench_ApplicationModule_Schema>;
26
+ /**
27
+ * One relationship edge between two of the observed application's resources.
28
+ *
29
+ * ## Where the shape comes from
30
+ *
31
+ * MEASURED against a live `resources-registry` derivation rather than transcribed from the engine's
32
+ * `ResourceRelationship` type: 16 edges, 12 keys present on all of them and `primaryScope` on 8. The
33
+ * engine type carries more than the behavior emits, and a schema written from the type would refuse
34
+ * every row for fields the projection never sends.
35
+ *
36
+ * ## Why the vocabularies are plain strings here
37
+ *
38
+ * `nature`, `cardinality*` and `accessScopeStrategy` ARE closed engine enums, and this is one of the
39
+ * documented exceptions rather than an oversight: these rows cross a subprocess boundary as JSON
40
+ * from the OBSERVED application's registry, which may be built against a different engine revision
41
+ * than the workbench. Binding to the enum would make a row the observed app can legitimately produce
42
+ * unparseable here — the workbench would refuse to show exactly the drift it exists to reveal. This
43
+ * is a projection of someone else's runtime, not an authored value the framework controls.
44
+ *
45
+ * `resolvedSemantics` is deliberately ABSENT. It is a deep nested object (handling modes, foreign-key
46
+ * persistence) that no current view reads, and copying it into the schema would freeze a shape whose
47
+ * consumer does not exist yet.
48
+ */
49
+ export declare const Workbench_ResourceRelationship_Schema: z.ZodObject<{
50
+ workbenchResourceRelationshipId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
51
+ resourceType1: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>;
52
+ resourceType2: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>;
53
+ cardinality1: z.ZodString;
54
+ cardinality2: z.ZodString;
55
+ nature: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>;
56
+ foreignKeyField: z.ZodString;
57
+ accessScopeStrategy: z.ZodString;
58
+ parentResourceRequirement: z.ZodString;
59
+ isPrimaryScope: z.ZodBoolean;
60
+ allowCycle: z.ZodBoolean;
61
+ isDisabled: z.ZodBoolean;
62
+ primaryScope: z.ZodOptional<z.ZodString>;
63
+ }, z.core.$strip>;
64
+ export type Workbench_ResourceRelationship = z.infer<typeof Workbench_ResourceRelationship_Schema>;
65
+ //# sourceMappingURL=workbench-resources.custom.shared.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workbench-resources.custom.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/workbench/workbench-resources.custom.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;iBAmC7C,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE7F;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;iBA0ChD,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC"}