@harperfast/harper 5.2.0-alpha.5 → 5.2.0-alpha.6

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 (173) hide show
  1. package/agent/agent.ts +152 -10
  2. package/agent/bestPractices.ts +58 -0
  3. package/agent/mcpTools.ts +122 -0
  4. package/agent/operations.ts +10 -1
  5. package/agent/registryTools.ts +117 -0
  6. package/agent/session.ts +16 -7
  7. package/agent/tools/fsTools.ts +74 -27
  8. package/agent/tools/inspectorTool.ts +459 -0
  9. package/agent/toolset.ts +27 -7
  10. package/agent/types.ts +2 -0
  11. package/components/Application.ts +566 -85
  12. package/components/OptionsWatcher.ts +62 -2
  13. package/components/Scope.ts +31 -8
  14. package/components/componentLoader.ts +5 -1
  15. package/components/componentSecrets.ts +514 -55
  16. package/components/deploymentRecorder.ts +7 -6
  17. package/components/gitCredentialHelper.js +115 -0
  18. package/components/gitCredentialServer.ts +251 -0
  19. package/components/mcp/tools/application.ts +197 -23
  20. package/components/mcp/tools/operations.ts +1 -1
  21. package/components/mcp/tools/schemas/derive.ts +6 -2
  22. package/components/operations.js +21 -19
  23. package/components/operationsValidation.js +86 -21
  24. package/components/secretOperations.ts +110 -30
  25. package/config/harperConfigEnvVars.ts +90 -5
  26. package/config-root.schema.json +4 -0
  27. package/dist/agent/agent.d.ts +24 -3
  28. package/dist/agent/agent.js +172 -10
  29. package/dist/agent/agent.js.map +1 -1
  30. package/dist/agent/bestPractices.d.ts +24 -0
  31. package/dist/agent/bestPractices.js +60 -0
  32. package/dist/agent/bestPractices.js.map +1 -0
  33. package/dist/agent/mcpTools.d.ts +24 -0
  34. package/dist/agent/mcpTools.js +115 -0
  35. package/dist/agent/mcpTools.js.map +1 -0
  36. package/dist/agent/operations.js +10 -1
  37. package/dist/agent/operations.js.map +1 -1
  38. package/dist/agent/registryTools.d.ts +45 -0
  39. package/dist/agent/registryTools.js +113 -0
  40. package/dist/agent/registryTools.js.map +1 -0
  41. package/dist/agent/session.js +16 -7
  42. package/dist/agent/session.js.map +1 -1
  43. package/dist/agent/tools/fsTools.js +70 -28
  44. package/dist/agent/tools/fsTools.js.map +1 -1
  45. package/dist/agent/tools/inspectorTool.d.ts +40 -0
  46. package/dist/agent/tools/inspectorTool.js +428 -0
  47. package/dist/agent/tools/inspectorTool.js.map +1 -0
  48. package/dist/agent/toolset.d.ts +16 -6
  49. package/dist/agent/toolset.js +17 -7
  50. package/dist/agent/toolset.js.map +1 -1
  51. package/dist/agent/types.d.ts +2 -0
  52. package/dist/components/Application.d.ts +73 -18
  53. package/dist/components/Application.js +475 -64
  54. package/dist/components/Application.js.map +1 -1
  55. package/dist/components/OptionsWatcher.d.ts +1 -1
  56. package/dist/components/OptionsWatcher.js +65 -2
  57. package/dist/components/OptionsWatcher.js.map +1 -1
  58. package/dist/components/Scope.d.ts +8 -6
  59. package/dist/components/Scope.js +22 -6
  60. package/dist/components/Scope.js.map +1 -1
  61. package/dist/components/componentLoader.js +5 -1
  62. package/dist/components/componentLoader.js.map +1 -1
  63. package/dist/components/componentSecrets.d.ts +33 -7
  64. package/dist/components/componentSecrets.js +473 -59
  65. package/dist/components/componentSecrets.js.map +1 -1
  66. package/dist/components/deploymentRecorder.d.ts +2 -2
  67. package/dist/components/deploymentRecorder.js +1 -1
  68. package/dist/components/deploymentRecorder.js.map +1 -1
  69. package/dist/components/gitCredentialHelper.d.ts +1 -0
  70. package/dist/components/gitCredentialHelper.js +113 -0
  71. package/dist/components/gitCredentialHelper.js.map +1 -0
  72. package/dist/components/gitCredentialServer.d.ts +33 -0
  73. package/dist/components/gitCredentialServer.js +236 -0
  74. package/dist/components/gitCredentialServer.js.map +1 -0
  75. package/dist/components/mcp/tools/application.d.ts +19 -0
  76. package/dist/components/mcp/tools/application.js +180 -22
  77. package/dist/components/mcp/tools/application.js.map +1 -1
  78. package/dist/components/mcp/tools/operations.d.ts +13 -0
  79. package/dist/components/mcp/tools/operations.js +1 -0
  80. package/dist/components/mcp/tools/operations.js.map +1 -1
  81. package/dist/components/mcp/tools/schemas/derive.js +6 -2
  82. package/dist/components/mcp/tools/schemas/derive.js.map +1 -1
  83. package/dist/components/operations.js +23 -21
  84. package/dist/components/operations.js.map +1 -1
  85. package/dist/components/operationsValidation.js +84 -21
  86. package/dist/components/operationsValidation.js.map +1 -1
  87. package/dist/components/secretOperations.d.ts +33 -11
  88. package/dist/components/secretOperations.js +90 -26
  89. package/dist/components/secretOperations.js.map +1 -1
  90. package/dist/config/harperConfigEnvVars.d.ts +21 -0
  91. package/dist/config/harperConfigEnvVars.js +95 -5
  92. package/dist/config/harperConfigEnvVars.js.map +1 -1
  93. package/dist/index.d.ts +4 -0
  94. package/dist/index.js +14 -1
  95. package/dist/index.js.map +1 -1
  96. package/dist/resources/Resource.d.ts +19 -0
  97. package/dist/resources/Resource.js +93 -2
  98. package/dist/resources/Resource.js.map +1 -1
  99. package/dist/resources/Table.d.ts +9 -0
  100. package/dist/resources/Table.js +256 -50
  101. package/dist/resources/Table.js.map +1 -1
  102. package/dist/resources/analytics/read.js +28 -25
  103. package/dist/resources/analytics/read.js.map +1 -1
  104. package/dist/resources/defineResource.d.ts +180 -0
  105. package/dist/resources/defineResource.js +505 -0
  106. package/dist/resources/defineResource.js.map +1 -0
  107. package/dist/resources/defineTable.d.ts +221 -0
  108. package/dist/resources/defineTable.js +227 -0
  109. package/dist/resources/defineTable.js.map +1 -0
  110. package/dist/resources/jsonSchemaTypes.d.ts +2 -0
  111. package/dist/resources/jsonSchemaTypes.js +12 -4
  112. package/dist/resources/jsonSchemaTypes.js.map +1 -1
  113. package/dist/resources/openApi.js +69 -13
  114. package/dist/resources/openApi.js.map +1 -1
  115. package/dist/resources/search.js +6 -8
  116. package/dist/resources/search.js.map +1 -1
  117. package/dist/server/graphqlQuerying.js +4 -2
  118. package/dist/server/graphqlQuerying.js.map +1 -1
  119. package/dist/server/http.d.ts +12 -0
  120. package/dist/server/http.js +35 -15
  121. package/dist/server/http.js.map +1 -1
  122. package/dist/server/serverHelpers/serverUtilities.js +8 -5
  123. package/dist/server/serverHelpers/serverUtilities.js.map +1 -1
  124. package/dist/server/serverHelpers/uwsServer.js +23 -0
  125. package/dist/server/serverHelpers/uwsServer.js.map +1 -1
  126. package/dist/utility/errors/hdbError.d.ts +21 -0
  127. package/dist/utility/errors/hdbError.js +23 -1
  128. package/dist/utility/errors/hdbError.js.map +1 -1
  129. package/dist/validation/configValidator.js +22 -6
  130. package/dist/validation/configValidator.js.map +1 -1
  131. package/index.ts +33 -0
  132. package/npm-shrinkwrap.json +9197 -15066
  133. package/package.json +3 -1
  134. package/resources/DESIGN.md +42 -15
  135. package/resources/Resource.ts +99 -2
  136. package/resources/Table.ts +275 -71
  137. package/resources/analytics/read.ts +30 -25
  138. package/resources/defineResource.ts +651 -0
  139. package/resources/defineTable.ts +407 -0
  140. package/resources/jsonSchemaTypes.ts +12 -4
  141. package/resources/openApi.ts +68 -16
  142. package/resources/search.ts +5 -8
  143. package/server/graphqlQuerying.ts +4 -2
  144. package/server/http.ts +40 -16
  145. package/server/serverHelpers/serverUtilities.ts +19 -6
  146. package/server/serverHelpers/uwsServer.ts +24 -0
  147. package/studio/web/assets/{Chat-Cv_2paZE.js → Chat-CTjtL8Z4.js} +2 -2
  148. package/studio/web/assets/{Chat-Cv_2paZE.js.map → Chat-CTjtL8Z4.js.map} +1 -1
  149. package/studio/web/assets/{FloatingChat-CPyPIcVR.js → FloatingChat-CafHR4Ur.js} +4 -4
  150. package/studio/web/assets/{FloatingChat-CPyPIcVR.js.map → FloatingChat-CafHR4Ur.js.map} +1 -1
  151. package/studio/web/assets/{applications-C0jT2vdZ.js → applications-Buh_q0Vj.js} +2 -2
  152. package/studio/web/assets/{applications-C0jT2vdZ.js.map → applications-Buh_q0Vj.js.map} +1 -1
  153. package/studio/web/assets/{index-D_GKOkhn.js → index-0hXeECkS.js} +6 -6
  154. package/studio/web/assets/{index-D_GKOkhn.js.map → index-0hXeECkS.js.map} +1 -1
  155. package/studio/web/assets/{index.lazy-CAmCIA65.js → index.lazy-B00B7VBT.js} +4 -4
  156. package/studio/web/assets/{index.lazy-CAmCIA65.js.map → index.lazy-B00B7VBT.js.map} +1 -1
  157. package/studio/web/assets/{profile-CaF-4aZe.js → profile-Cg2wwYPn.js} +2 -2
  158. package/studio/web/assets/{profile-CaF-4aZe.js.map → profile-Cg2wwYPn.js.map} +1 -1
  159. package/studio/web/assets/{setComponentFile-DLW1DHCt.js → setComponentFile-DCaDIvyB.js} +2 -2
  160. package/studio/web/assets/{setComponentFile-DLW1DHCt.js.map → setComponentFile-DCaDIvyB.js.map} +1 -1
  161. package/studio/web/assets/{setup-TGCErIhq.js → setup-CAVcAQjK.js} +2 -2
  162. package/studio/web/assets/{setup-TGCErIhq.js.map → setup-CAVcAQjK.js.map} +1 -1
  163. package/studio/web/assets/{status-DG0Maoao.js → status-BRXorNdD.js} +2 -2
  164. package/studio/web/assets/{status-DG0Maoao.js.map → status-BRXorNdD.js.map} +1 -1
  165. package/studio/web/assets/{swagger-ui-react-8T4SgQ1m.js → swagger-ui-react-Dy1D62vO.js} +2 -2
  166. package/studio/web/assets/{swagger-ui-react-8T4SgQ1m.js.map → swagger-ui-react-Dy1D62vO.js.map} +1 -1
  167. package/studio/web/assets/{tsMode-DJ6Sl24Q.js → tsMode-A8gbL74v.js} +2 -2
  168. package/studio/web/assets/{tsMode-DJ6Sl24Q.js.map → tsMode-A8gbL74v.js.map} +1 -1
  169. package/studio/web/assets/{useEntityRestURL-JO2mfWTQ.js → useEntityRestURL-cDodrVcQ.js} +2 -2
  170. package/studio/web/assets/{useEntityRestURL-JO2mfWTQ.js.map → useEntityRestURL-cDodrVcQ.js.map} +1 -1
  171. package/studio/web/index.html +1 -1
  172. package/utility/errors/hdbError.ts +32 -0
  173. package/validation/configValidator.ts +23 -6
@@ -1,5 +1,17 @@
1
- /** A per-component secrets view: read-only name→value map exposed as `import { secrets } from 'harper'`. */
2
- export type SecretsView = Readonly<Record<string, string>>;
1
+ /**
2
+ * Subscribe to a secret's current value and any subsequent changes (#1776). Yields the current value
3
+ * first, then on each change; `undefined` means the component has no access right now (never granted,
4
+ * revoked, or deleted) — the same thing `secrets[name]` reads as. The stream stays open across that,
5
+ * so a re-grant/re-add resumes on the same iterator.
6
+ */
7
+ export type SecretSubscribe = (name: string) => AsyncIterableIterator<string | undefined>;
8
+ /**
9
+ * A per-component secrets view: read-only name→value map exposed as `import { secrets } from 'harper'`,
10
+ * plus the reserved, non-enumerable `subscribe(name)` method for live change subscription.
11
+ */
12
+ export type SecretsView = Readonly<Record<string, string>> & {
13
+ readonly subscribe: SecretSubscribe;
14
+ };
3
15
  export type UnsatisfiedReason = 'missing' | 'ungranted' | 'custody-unavailable';
4
16
  /** A declared-but-unsatisfied env expectation — metadata only, never values. */
5
17
  export interface UnsatisfiedDeclaration {
@@ -39,12 +51,26 @@ export declare function materializeGlobalSecrets(): Promise<void>;
39
51
  export declare function processComponentEnv(componentName: string, envConfig: unknown): void;
40
52
  /** Declared-but-unsatisfied env expectations for a component — metadata only, for status surfaces. */
41
53
  export declare function getUnsatisfiedEnv(componentName: string): UnsatisfiedDeclaration[];
54
+ /** Close every live subscription owned by a component (component reload/unload). */
55
+ export declare function closeComponentSubscriptions(componentName: string): void;
56
+ /** A Scope of this identity is now open — hold its live secret subscriptions until it releases. */
57
+ export declare function retainComponentSubscriptions(componentName: string): void;
58
+ /** A Scope of this identity closed — end the identity's subscriptions once the last holder is gone. */
59
+ export declare function releaseComponentSubscriptions(componentName: string): void;
42
60
  /**
43
- * The secrets view for a component: scoped-tier rows granted to it, plus its DECLARED names
44
- * resolved from process.env (global-tier materialized values, env literals, or real env vars).
45
- * The superset lets app code use `secrets.FOO` uniformly, and lets ops later tighten a secret from
46
- * global to granted without breaking the app. Values are decrypted eagerly at load; the object is
47
- * frozen and enumerable (`Object.keys`, spread).
61
+ * The secrets view for a component: scoped-tier rows granted to it, plus its DECLARED names resolved
62
+ * from process.env (global-tier materialized values, env literals, or real env vars). The superset
63
+ * lets app code use `secrets.FOO` uniformly, and lets ops later tighten a secret from global to
64
+ * granted without breaking the app.
65
+ *
66
+ * It is a LIVE view (#1776): a Proxy that resolves each read from the current snapshot, so a scoped
67
+ * secret's rotation/revoke is reflected by a fresh `secrets.FOO` read under every loader — including a
68
+ * view captured once by the vm/compartment loader or held as `const v = scope.secrets` (only a
69
+ * value destructured out, `const { FOO } = secrets`, is a point-in-time copy). Declared global names
70
+ * still resolve from `process.env` (reload-only). Read-only and null-prototype, so Object.prototype
71
+ * members can't masquerade as secrets and the view can't be mutated. `subscribe` is a reserved,
72
+ * non-enumerable method (skipped by Object.keys/spread); a secret literally named `subscribe` is
73
+ * shadowed by it — logged once when observed.
48
74
  */
49
75
  export declare function getSecretsForComponent(componentName: string): SecretsView;
50
76
  /** Run `fn` with `secrets` bound to the named component (no-op when name is undefined). */