@agentskit/adapters 0.13.13 → 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.
- package/README.md +33 -3
- package/dist/catalog/index.cjs +197 -60
- package/dist/catalog/index.cjs.map +1 -1
- package/dist/catalog/index.d.cts +1 -1
- package/dist/catalog/index.d.ts +1 -1
- package/dist/catalog/index.js +2 -1
- package/dist/catalog/index.js.map +1 -1
- package/dist/{chunk-77QS3QRT.js → chunk-4KZTWGRB.js} +249 -119
- package/dist/chunk-4KZTWGRB.js.map +1 -0
- package/dist/chunk-627FHZZY.js +101 -0
- package/dist/chunk-627FHZZY.js.map +1 -0
- package/dist/chunk-6CIB2QCH.js +81 -0
- package/dist/chunk-6CIB2QCH.js.map +1 -0
- package/dist/createAdapter-C-pKR1aO.d.cts +19 -0
- package/dist/createAdapter-C-pKR1aO.d.ts +19 -0
- package/dist/createAdapter.cjs +138 -15
- package/dist/createAdapter.cjs.map +1 -1
- package/dist/createAdapter.d.cts +1 -1
- package/dist/createAdapter.d.ts +1 -1
- package/dist/createAdapter.js +2 -1
- package/dist/index.cjs +1090 -319
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -13
- package/dist/index.d.ts +33 -13
- package/dist/index.js +686 -191
- package/dist/index.js.map +1 -1
- package/package.json +11 -6
- package/dist/chunk-6FPLWOVE.js +0 -26
- package/dist/chunk-6FPLWOVE.js.map +0 -1
- package/dist/chunk-77QS3QRT.js.map +0 -1
- package/dist/createAdapter-Dfnf3Iio.d.cts +0 -14
- package/dist/createAdapter-Dfnf3Iio.d.ts +0 -14
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as GenericAdapterConfig } from './createAdapter-
|
|
2
|
-
export { C as CreateAdapterConfig, c as createAdapter } from './createAdapter-
|
|
1
|
+
import { G as GenericAdapterConfig } from './createAdapter-C-pKR1aO.cjs';
|
|
2
|
+
export { C as CreateAdapterConfig, c as createAdapter } from './createAdapter-C-pKR1aO.cjs';
|
|
3
3
|
import * as _agentskit_core from '@agentskit/core';
|
|
4
4
|
import { AdapterFactory, AdapterRequest, DataRegion, AdapterCapabilities, StreamChunk, EmbedFn } from '@agentskit/core';
|
|
5
5
|
export { DataRegion } from '@agentskit/core';
|
|
@@ -284,10 +284,15 @@ interface BedrockConfig {
|
|
|
284
284
|
/**
|
|
285
285
|
* Minimal structural type for `BedrockRuntimeClient` so we don't take a hard
|
|
286
286
|
* dep on `@aws-sdk/client-bedrock-runtime`.
|
|
287
|
+
*
|
|
288
|
+
* Second options argument is optional so existing one-argument injected
|
|
289
|
+
* clients remain structurally valid.
|
|
287
290
|
*/
|
|
288
291
|
interface BedrockRuntimeClientLike {
|
|
289
292
|
send(command: {
|
|
290
293
|
input: BedrockInvokeInput;
|
|
294
|
+
}, options?: {
|
|
295
|
+
abortSignal?: AbortSignal;
|
|
291
296
|
}): Promise<{
|
|
292
297
|
body?: AsyncIterable<{
|
|
293
298
|
chunk?: {
|
|
@@ -349,7 +354,13 @@ interface WebLlmEngineLike {
|
|
|
349
354
|
content?: string;
|
|
350
355
|
};
|
|
351
356
|
}>;
|
|
352
|
-
}
|
|
357
|
+
}> | Promise<AsyncIterable<{
|
|
358
|
+
choices: Array<{
|
|
359
|
+
delta?: {
|
|
360
|
+
content?: string;
|
|
361
|
+
};
|
|
362
|
+
}>;
|
|
363
|
+
}>>;
|
|
353
364
|
};
|
|
354
365
|
};
|
|
355
366
|
}
|
|
@@ -731,20 +742,25 @@ declare function withDeprecationPolicy<F extends AdapterFactory>(factory: F, opt
|
|
|
731
742
|
} & DeprecationPolicy): F;
|
|
732
743
|
|
|
733
744
|
/**
|
|
734
|
-
*
|
|
735
|
-
* means bouncing the runtime — unacceptable for 24/7 production.
|
|
745
|
+
* Opt-in credential rotation primitives.
|
|
736
746
|
*
|
|
737
|
-
*
|
|
738
|
-
*
|
|
739
|
-
*
|
|
740
|
-
*
|
|
741
|
-
*
|
|
747
|
+
* These utilities do **not** automatically wire into stock adapters. Built-in
|
|
748
|
+
* factories (openai, anthropic, bedrock, vertex, …) still take a plain
|
|
749
|
+
* `apiKey` / `accessToken` string (or a caller-supplied resolver) at
|
|
750
|
+
* construction. Use `createRotatingCredentials` / `refreshCredentials` only
|
|
751
|
+
* when you explicitly opt in — e.g. custom wrappers that call `current()` on
|
|
752
|
+
* every request, or adapters you implement that expose
|
|
753
|
+
* `CredentialRefreshable.refreshCredentials`.
|
|
742
754
|
*
|
|
743
|
-
*
|
|
755
|
+
* Without that opt-in, rotating a provider key still means reconstructing the
|
|
756
|
+
* adapter (or restarting the process). The helpers stay exported so production
|
|
757
|
+
* apps can build that layer without re-inventing the holder + audit event shape.
|
|
758
|
+
*
|
|
759
|
+
* Closes issue #799 (primitives only; adapter adoption is opt-in).
|
|
744
760
|
*/
|
|
745
761
|
type CredentialResolver = () => string | Promise<string>;
|
|
746
762
|
interface RotatingCredentials {
|
|
747
|
-
/** Resolve the current secret.
|
|
763
|
+
/** Resolve the current secret. Opt-in adapters call this on every request. */
|
|
748
764
|
current: CredentialResolver;
|
|
749
765
|
/** Replace the in-memory secret. Returns the new value. */
|
|
750
766
|
rotate: (next: string) => Promise<string>;
|
|
@@ -761,7 +777,8 @@ interface CredentialRotationEvent {
|
|
|
761
777
|
}
|
|
762
778
|
interface CredentialRefreshable {
|
|
763
779
|
/**
|
|
764
|
-
*
|
|
780
|
+
* Opt-in adapters that support credential rotation expose this method.
|
|
781
|
+
* Stock AgentsKit adapters do not implement it unless documented otherwise.
|
|
765
782
|
* Calling it replaces the in-memory secret. The next request uses
|
|
766
783
|
* the new value; in-flight requests are unaffected.
|
|
767
784
|
*/
|
|
@@ -775,6 +792,9 @@ declare function createRotatingCredentials(initial: string, options: {
|
|
|
775
792
|
* `CredentialRefreshable`. A no-op (with a debug log) if the adapter
|
|
776
793
|
* doesn't support rotation, so callers can run the rotation playbook
|
|
777
794
|
* across a heterogeneous set of adapters without branching.
|
|
795
|
+
*
|
|
796
|
+
* Most stock adapters do **not** implement `refreshCredentials` — this
|
|
797
|
+
* remains an opt-in primitive unless an adapter documents support.
|
|
778
798
|
*/
|
|
779
799
|
declare function refreshCredentials(adapter: unknown, next: string, options?: {
|
|
780
800
|
id?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as GenericAdapterConfig } from './createAdapter-
|
|
2
|
-
export { C as CreateAdapterConfig, c as createAdapter } from './createAdapter-
|
|
1
|
+
import { G as GenericAdapterConfig } from './createAdapter-C-pKR1aO.js';
|
|
2
|
+
export { C as CreateAdapterConfig, c as createAdapter } from './createAdapter-C-pKR1aO.js';
|
|
3
3
|
import * as _agentskit_core from '@agentskit/core';
|
|
4
4
|
import { AdapterFactory, AdapterRequest, DataRegion, AdapterCapabilities, StreamChunk, EmbedFn } from '@agentskit/core';
|
|
5
5
|
export { DataRegion } from '@agentskit/core';
|
|
@@ -284,10 +284,15 @@ interface BedrockConfig {
|
|
|
284
284
|
/**
|
|
285
285
|
* Minimal structural type for `BedrockRuntimeClient` so we don't take a hard
|
|
286
286
|
* dep on `@aws-sdk/client-bedrock-runtime`.
|
|
287
|
+
*
|
|
288
|
+
* Second options argument is optional so existing one-argument injected
|
|
289
|
+
* clients remain structurally valid.
|
|
287
290
|
*/
|
|
288
291
|
interface BedrockRuntimeClientLike {
|
|
289
292
|
send(command: {
|
|
290
293
|
input: BedrockInvokeInput;
|
|
294
|
+
}, options?: {
|
|
295
|
+
abortSignal?: AbortSignal;
|
|
291
296
|
}): Promise<{
|
|
292
297
|
body?: AsyncIterable<{
|
|
293
298
|
chunk?: {
|
|
@@ -349,7 +354,13 @@ interface WebLlmEngineLike {
|
|
|
349
354
|
content?: string;
|
|
350
355
|
};
|
|
351
356
|
}>;
|
|
352
|
-
}
|
|
357
|
+
}> | Promise<AsyncIterable<{
|
|
358
|
+
choices: Array<{
|
|
359
|
+
delta?: {
|
|
360
|
+
content?: string;
|
|
361
|
+
};
|
|
362
|
+
}>;
|
|
363
|
+
}>>;
|
|
353
364
|
};
|
|
354
365
|
};
|
|
355
366
|
}
|
|
@@ -731,20 +742,25 @@ declare function withDeprecationPolicy<F extends AdapterFactory>(factory: F, opt
|
|
|
731
742
|
} & DeprecationPolicy): F;
|
|
732
743
|
|
|
733
744
|
/**
|
|
734
|
-
*
|
|
735
|
-
* means bouncing the runtime — unacceptable for 24/7 production.
|
|
745
|
+
* Opt-in credential rotation primitives.
|
|
736
746
|
*
|
|
737
|
-
*
|
|
738
|
-
*
|
|
739
|
-
*
|
|
740
|
-
*
|
|
741
|
-
*
|
|
747
|
+
* These utilities do **not** automatically wire into stock adapters. Built-in
|
|
748
|
+
* factories (openai, anthropic, bedrock, vertex, …) still take a plain
|
|
749
|
+
* `apiKey` / `accessToken` string (or a caller-supplied resolver) at
|
|
750
|
+
* construction. Use `createRotatingCredentials` / `refreshCredentials` only
|
|
751
|
+
* when you explicitly opt in — e.g. custom wrappers that call `current()` on
|
|
752
|
+
* every request, or adapters you implement that expose
|
|
753
|
+
* `CredentialRefreshable.refreshCredentials`.
|
|
742
754
|
*
|
|
743
|
-
*
|
|
755
|
+
* Without that opt-in, rotating a provider key still means reconstructing the
|
|
756
|
+
* adapter (or restarting the process). The helpers stay exported so production
|
|
757
|
+
* apps can build that layer without re-inventing the holder + audit event shape.
|
|
758
|
+
*
|
|
759
|
+
* Closes issue #799 (primitives only; adapter adoption is opt-in).
|
|
744
760
|
*/
|
|
745
761
|
type CredentialResolver = () => string | Promise<string>;
|
|
746
762
|
interface RotatingCredentials {
|
|
747
|
-
/** Resolve the current secret.
|
|
763
|
+
/** Resolve the current secret. Opt-in adapters call this on every request. */
|
|
748
764
|
current: CredentialResolver;
|
|
749
765
|
/** Replace the in-memory secret. Returns the new value. */
|
|
750
766
|
rotate: (next: string) => Promise<string>;
|
|
@@ -761,7 +777,8 @@ interface CredentialRotationEvent {
|
|
|
761
777
|
}
|
|
762
778
|
interface CredentialRefreshable {
|
|
763
779
|
/**
|
|
764
|
-
*
|
|
780
|
+
* Opt-in adapters that support credential rotation expose this method.
|
|
781
|
+
* Stock AgentsKit adapters do not implement it unless documented otherwise.
|
|
765
782
|
* Calling it replaces the in-memory secret. The next request uses
|
|
766
783
|
* the new value; in-flight requests are unaffected.
|
|
767
784
|
*/
|
|
@@ -775,6 +792,9 @@ declare function createRotatingCredentials(initial: string, options: {
|
|
|
775
792
|
* `CredentialRefreshable`. A no-op (with a debug log) if the adapter
|
|
776
793
|
* doesn't support rotation, so callers can run the rotation playbook
|
|
777
794
|
* across a heterogeneous set of adapters without branching.
|
|
795
|
+
*
|
|
796
|
+
* Most stock adapters do **not** implement `refreshCredentials` — this
|
|
797
|
+
* remains an opt-in primitive unless an adapter documents support.
|
|
778
798
|
*/
|
|
779
799
|
declare function refreshCredentials(adapter: unknown, next: string, options?: {
|
|
780
800
|
id?: string;
|