@vellumai/credential-executor 0.10.3-dev.202606292136.ce8bf33 → 0.10.3-dev.202606292252.adea010
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 +1 -1
- package/src/managed-main.ts +19 -15
package/package.json
CHANGED
package/src/managed-main.ts
CHANGED
|
@@ -122,7 +122,7 @@ function buildHandlers(
|
|
|
122
122
|
apiKeyRef: ApiKeyRef,
|
|
123
123
|
assistantIdRef: AssistantIdRef,
|
|
124
124
|
secureKeyBackend: SecureKeyBackend,
|
|
125
|
-
):
|
|
125
|
+
): RpcHandlerRegistry {
|
|
126
126
|
// -- Grant stores ----------------------------------------------------------
|
|
127
127
|
const persistentGrantStore = new PersistentGrantStore(
|
|
128
128
|
getCesGrantsDir("managed"),
|
|
@@ -411,7 +411,7 @@ function buildHandlers(
|
|
|
411
411
|
return { results };
|
|
412
412
|
}) as (typeof handlers)[string];
|
|
413
413
|
|
|
414
|
-
return
|
|
414
|
+
return handlers;
|
|
415
415
|
}
|
|
416
416
|
|
|
417
417
|
// ---------------------------------------------------------------------------
|
|
@@ -668,10 +668,12 @@ async function main(): Promise<void> {
|
|
|
668
668
|
// `unregister` miss a tool registered in an earlier session and orphan its
|
|
669
669
|
// bundle.
|
|
670
670
|
//
|
|
671
|
-
// The in-memory temporary-grant store is
|
|
672
|
-
//
|
|
673
|
-
//
|
|
674
|
-
//
|
|
671
|
+
// The in-memory temporary-grant store is also process-scoped, and (unlike
|
|
672
|
+
// before) is NOT cleared between sessions: ephemeral approvals are shared
|
|
673
|
+
// across all of a daemon's connections for the process lifetime. Its own
|
|
674
|
+
// semantics keep this safe — `allow_once` is consumed on first use,
|
|
675
|
+
// `allow_10m` expires by wall-clock TTL, `allow_conversation` is cleared when
|
|
676
|
+
// its conversation ends (see the serve loop below).
|
|
675
677
|
//
|
|
676
678
|
// The mutable refs carry the handshake-provided API key and assistant ID;
|
|
677
679
|
// handlers read them at call time. These don't vary across a daemon's
|
|
@@ -680,7 +682,7 @@ async function main(): Promise<void> {
|
|
|
680
682
|
// at call time for audit attribution).
|
|
681
683
|
const apiKeyRef: ApiKeyRef = { current: "" };
|
|
682
684
|
const assistantIdRef: AssistantIdRef = { current: "" };
|
|
683
|
-
const
|
|
685
|
+
const handlers = buildHandlers(
|
|
684
686
|
apiKeyRef,
|
|
685
687
|
assistantIdRef,
|
|
686
688
|
secureKeyBackend,
|
|
@@ -780,14 +782,16 @@ async function main(): Promise<void> {
|
|
|
780
782
|
|
|
781
783
|
rpcConnected = false;
|
|
782
784
|
|
|
783
|
-
//
|
|
784
|
-
//
|
|
785
|
-
//
|
|
786
|
-
//
|
|
787
|
-
//
|
|
788
|
-
//
|
|
789
|
-
|
|
790
|
-
|
|
785
|
+
// Temporary grants are process-shared: they are NOT cleared when a session
|
|
786
|
+
// ends. CES is moving to a model where the assistant daemon's multiple
|
|
787
|
+
// processes each hold their own connection, so an ephemeral approval
|
|
788
|
+
// (`allow_once` / `allow_10m` / `allow_conversation`) granted on one
|
|
789
|
+
// connection must remain usable by the others rather than being scoped to a
|
|
790
|
+
// single session. The store's own semantics keep this safe across a
|
|
791
|
+
// reconnect: `allow_once` is consumed on first use, `allow_10m` is bounded
|
|
792
|
+
// by its wall-clock TTL, and `allow_conversation` is cleared when its
|
|
793
|
+
// conversation ends.
|
|
794
|
+
//
|
|
791
795
|
// A signal-driven end means the process is shutting down; exit the loop.
|
|
792
796
|
// Any other end reason (the assistant disconnected, its stream closed,
|
|
793
797
|
// or the transport errored) means we keep the sidecar up and await a
|