@punica/editor 1.6.21 → 1.7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punica/editor",
3
- "version": "1.6.21",
3
+ "version": "1.7.0",
4
4
  "description": "Punica Editor",
5
5
  "private": false,
6
6
  "type": "module",
@@ -87,9 +87,11 @@ declare module 'punica' {
87
87
  resources: ResourcesApi;
88
88
 
89
89
  /**
90
- * Minimal in-memory secrets API.
90
+ * Secrets store (host-injected) plus `resolve()`, which asks the Secret
91
+ * Manager for a managed entry by name — the provider-routed read that
92
+ * substrate and host code must use for a real credential.
91
93
  */
92
- secrets: SecretsApi;
94
+ secrets: SecretsFacade;
93
95
 
94
96
  /**
95
97
  * LLM provider interface. Hosts decide whether this is backed by local
@@ -9,10 +9,14 @@ declare module 'punica' {
9
9
  }
10
10
 
11
11
  /**
12
- * Minimal secrets API (v1 MVP).
12
+ * The raw key→value store a host injects via
13
+ * `punica.runtime.setSecretsProvider(...)`.
13
14
  *
14
15
  * Notes:
15
- * - In-memory only (no vault/persistence).
16
+ * - Synchronous, and keyed by whatever string the caller passes — it knows
17
+ * nothing about the Secret Manager's names, providers or index.
18
+ * - A host that registers no provider gets an in-memory default, so the API
19
+ * being present says nothing about persistence.
16
20
  * - Intended primarily for preventing secrets from leaking in trace exports
17
21
  * and enabling simple { secretRef } resolution for capabilities.
18
22
  */
@@ -22,5 +26,25 @@ declare module 'punica' {
22
26
  delete(name: SecretName): boolean;
23
27
  list(): SecretRecord[];
24
28
  }
29
+
30
+ /**
31
+ * What `punica.runtime.secrets` actually is: the store above, plus the
32
+ * substrate-level resolution the store cannot do on its own.
33
+ *
34
+ * `resolve()` is not a second `get()`. `get()` takes a raw store key;
35
+ * `resolve()` takes a **Secret Manager entry name** and asks the Secret
36
+ * Manager for it, so a secret the user keeps in HashiCorp Vault resolves
37
+ * exactly like a local one. That round trip is async and goes through an
38
+ * extension, which is why it cannot live on the synchronous host-injected
39
+ * `SecretsApi`.
40
+ *
41
+ * Substrate and host code that needs a managed credential — MCP
42
+ * `${secret.NAME}` placeholders, the Electron renderer's remote-LLM token —
43
+ * must use this rather than reading the local provider's private value key.
44
+ * See `punica-editor/docs/secrets-contract.md`.
45
+ */
46
+ export interface SecretsFacade extends SecretsApi {
47
+ resolve(name: SecretName): Promise<string | null>;
48
+ }
25
49
  }
26
50
  }