@bevel-software/platform-core-backend 0.13.6 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/core/create-core-server.d.ts.map +1 -1
  2. package/dist/core/create-core-server.js +2 -1
  3. package/dist/core/create-core-server.js.map +1 -1
  4. package/dist/core/create-core-services.d.ts +2 -0
  5. package/dist/core/create-core-services.d.ts.map +1 -1
  6. package/dist/core/create-core-services.js +9 -0
  7. package/dist/core/create-core-services.js.map +1 -1
  8. package/dist/core-config.d.ts.map +1 -1
  9. package/dist/core-config.js +12 -5
  10. package/dist/core-config.js.map +1 -1
  11. package/dist/modules/access-model/kb-read-filter.d.ts +12 -0
  12. package/dist/modules/access-model/kb-read-filter.d.ts.map +1 -1
  13. package/dist/modules/access-model/kb-read-filter.js +15 -0
  14. package/dist/modules/access-model/kb-read-filter.js.map +1 -1
  15. package/dist/modules/connection-probe/connection-probe.contract.d.ts +43 -0
  16. package/dist/modules/connection-probe/connection-probe.contract.d.ts.map +1 -0
  17. package/dist/modules/connection-probe/connection-probe.contract.js +2 -0
  18. package/dist/modules/connection-probe/connection-probe.contract.js.map +1 -0
  19. package/dist/modules/connection-probe/connection-probe.service.d.ts +94 -0
  20. package/dist/modules/connection-probe/connection-probe.service.d.ts.map +1 -0
  21. package/dist/modules/connection-probe/connection-probe.service.js +684 -0
  22. package/dist/modules/connection-probe/connection-probe.service.js.map +1 -0
  23. package/dist/modules/connection-probe/index.d.ts +3 -0
  24. package/dist/modules/connection-probe/index.d.ts.map +1 -0
  25. package/dist/modules/connection-probe/index.js +3 -0
  26. package/dist/modules/connection-probe/index.js.map +1 -0
  27. package/dist/modules/diff/diff.routes.d.ts.map +1 -1
  28. package/dist/modules/diff/diff.routes.js +3 -5
  29. package/dist/modules/diff/diff.routes.js.map +1 -1
  30. package/dist/modules/kb-fs/mutex.d.ts +37 -0
  31. package/dist/modules/kb-fs/mutex.d.ts.map +1 -1
  32. package/dist/modules/kb-fs/mutex.js +48 -5
  33. package/dist/modules/kb-fs/mutex.js.map +1 -1
  34. package/dist/modules/secrets-vault/db-secrets-vault.service.js +1 -1
  35. package/dist/modules/secrets-vault/db-secrets-vault.service.js.map +1 -1
  36. package/dist/modules/secrets-vault/secrets-vault.routes.d.ts +6 -0
  37. package/dist/modules/secrets-vault/secrets-vault.routes.d.ts.map +1 -1
  38. package/dist/modules/secrets-vault/secrets-vault.routes.js +31 -1
  39. package/dist/modules/secrets-vault/secrets-vault.routes.js.map +1 -1
  40. package/dist/modules/tool-manuals/mcp-json-discovery.d.ts.map +1 -1
  41. package/dist/modules/tool-manuals/mcp-json-discovery.js +10 -1
  42. package/dist/modules/tool-manuals/mcp-json-discovery.js.map +1 -1
  43. package/dist/modules/tool-manuals/mcp-server-edit.service.d.ts.map +1 -1
  44. package/dist/modules/tool-manuals/mcp-server-edit.service.js +10 -4
  45. package/dist/modules/tool-manuals/mcp-server-edit.service.js.map +1 -1
  46. package/dist/modules/tool-manuals/tool-manuals.contract.d.ts +83 -0
  47. package/dist/modules/tool-manuals/tool-manuals.contract.d.ts.map +1 -1
  48. package/dist/modules/tool-manuals/tool-manuals.service.d.ts +9 -1
  49. package/dist/modules/tool-manuals/tool-manuals.service.d.ts.map +1 -1
  50. package/dist/modules/tool-manuals/tool-manuals.service.js +181 -13
  51. package/dist/modules/tool-manuals/tool-manuals.service.js.map +1 -1
  52. package/dist/modules/workflow/git/git.service.d.ts +18 -1
  53. package/dist/modules/workflow/git/git.service.d.ts.map +1 -1
  54. package/dist/modules/workflow/git/git.service.js +98 -6
  55. package/dist/modules/workflow/git/git.service.js.map +1 -1
  56. package/dist/modules/workflow/workflow.routes.d.ts +2 -1
  57. package/dist/modules/workflow/workflow.routes.d.ts.map +1 -1
  58. package/dist/modules/workflow/workflow.routes.js +98 -9
  59. package/dist/modules/workflow/workflow.routes.js.map +1 -1
  60. package/dist/modules/workflow/workflow.service.d.ts +81 -8
  61. package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
  62. package/dist/modules/workflow/workflow.service.js +220 -43
  63. package/dist/modules/workflow/workflow.service.js.map +1 -1
  64. package/dist/modules/workspace/workspace.routes.d.ts.map +1 -1
  65. package/dist/modules/workspace/workspace.routes.js +2 -5
  66. package/dist/modules/workspace/workspace.routes.js.map +1 -1
  67. package/dist/modules/workspace/workspace.service.d.ts +5 -1
  68. package/dist/modules/workspace/workspace.service.d.ts.map +1 -1
  69. package/dist/modules/workspace/workspace.service.js +21 -4
  70. package/dist/modules/workspace/workspace.service.js.map +1 -1
  71. package/dist/shared/token-crypto.d.ts +17 -2
  72. package/dist/shared/token-crypto.d.ts.map +1 -1
  73. package/dist/shared/token-crypto.js +25 -8
  74. package/dist/shared/token-crypto.js.map +1 -1
  75. package/package.json +3 -3
  76. package/src/__tests__/core-config.admin.test.ts +21 -0
  77. package/src/core/create-core-server.ts +3 -0
  78. package/src/core/create-core-services.ts +11 -0
  79. package/src/core-config.ts +14 -7
  80. package/src/modules/access-model/kb-read-filter.ts +22 -0
  81. package/src/modules/connection-probe/__tests__/connection-probe.service.test.ts +685 -0
  82. package/src/modules/connection-probe/connection-probe.contract.ts +44 -0
  83. package/src/modules/connection-probe/connection-probe.service.ts +734 -0
  84. package/src/modules/connection-probe/index.ts +2 -0
  85. package/src/modules/diff/diff.routes.ts +9 -5
  86. package/src/modules/kb-fs/__tests__/mutex.test.ts +107 -0
  87. package/src/modules/kb-fs/mutex.ts +50 -5
  88. package/src/modules/secrets-vault/__tests__/connect-pending.route.test.ts +12 -0
  89. package/src/modules/secrets-vault/__tests__/oauth-return-to.route.test.ts +10 -3
  90. package/src/modules/secrets-vault/__tests__/tool-owner-gate.route.test.ts +26 -0
  91. package/src/modules/secrets-vault/db-secrets-vault.service.ts +1 -1
  92. package/src/modules/secrets-vault/secrets-vault.routes.ts +35 -1
  93. package/src/modules/tool-manuals/__tests__/mcp-json-discovery.test.ts +11 -0
  94. package/src/modules/tool-manuals/__tests__/tool-manuals.health-check.test.ts +104 -0
  95. package/src/modules/tool-manuals/__tests__/tool-manuals.service.test.ts +56 -0
  96. package/src/modules/tool-manuals/mcp-json-discovery.ts +13 -1
  97. package/src/modules/tool-manuals/mcp-server-edit.service.ts +13 -4
  98. package/src/modules/tool-manuals/tool-manuals.contract.ts +89 -0
  99. package/src/modules/tool-manuals/tool-manuals.service.ts +196 -14
  100. package/src/modules/workflow/__tests__/workflow.routes.history-read-gate.test.ts +139 -0
  101. package/src/modules/workflow/__tests__/workflow.service.branch-in-use.test.ts +337 -0
  102. package/src/modules/workflow/__tests__/workflow.service.deleted-branch-sweep.test.ts +7 -1
  103. package/src/modules/workflow/__tests__/workflow.service.facade.test.ts +95 -8
  104. package/src/modules/workflow/git/__tests__/git.service.history-guards.test.ts +86 -0
  105. package/src/modules/workflow/git/git.service.ts +115 -7
  106. package/src/modules/workflow/workflow.routes.ts +104 -4
  107. package/src/modules/workflow/workflow.service.ts +245 -55
  108. package/src/modules/workspace/workspace.routes.ts +8 -4
  109. package/src/modules/workspace/workspace.service.ts +21 -3
  110. package/src/shared/__tests__/token-crypto.test.ts +34 -0
  111. package/src/shared/token-crypto.ts +28 -10
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Does this tool's stored credential actually WORK?
3
+ *
4
+ * The Secrets Vault can only answer "is there a value here", and the UI read
5
+ * that as "is this working" — so a mistyped key rendered as **Connected** while
6
+ * the provider's rejection reached nothing but a `console.warn`. A probe makes
7
+ * a real authenticated call and reports what the provider said.
8
+ *
9
+ * The verdict is deliberately NOT persisted. A stored verdict is evidence with
10
+ * a date on it, and evidence from yesterday is precisely the stale claim this
11
+ * feature exists to stop the badge from making: the credential can be revoked,
12
+ * rotated, or expire between the check and the render, and a row in a table
13
+ * cannot know that. So a verdict lives exactly as long as the page that asked
14
+ * for it, and "Connected" means "a call succeeded moments ago", not "a call
15
+ * succeeded once".
16
+ */
17
+ export type ProbeStatus = 'ok' | 'failed' | 'unverifiable';
18
+
19
+ /** One probe's answer. */
20
+ export interface ProbeVerdict {
21
+ status: ProbeStatus;
22
+ /**
23
+ * The provider's own words when it rejected the credential, or why we
24
+ * couldn't tell. `null` only when the status is `ok`.
25
+ */
26
+ detail: string | null;
27
+ /** When the call was made — the "checked just now" the UI shows. */
28
+ checkedAt: Date;
29
+ }
30
+
31
+ export interface IConnectionProbeService {
32
+ /**
33
+ * Test one tool's credential for one user and return the verdict.
34
+ *
35
+ * `null` when no tool has that slug OR the caller can't read it — the same
36
+ * fail-closed pair the tool contract uses everywhere, so a 404 never confirms
37
+ * that a tool the caller can't see exists.
38
+ *
39
+ * Everything else — an unreachable provider, a tool with nothing to call, a
40
+ * variable that isn't set — comes back as a verdict rather than an error,
41
+ * because "we couldn't tell" is an answer the UI has to render.
42
+ */
43
+ probe(userId: string, userEmail: string, slug: string): Promise<ProbeVerdict | null>;
44
+ }