@agen-ai/agent-runtime 0.3.0 → 0.4.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 +182 -24
- package/dist/adapterValidation.d.ts +1 -1
- package/dist/adapterValidation.js +162 -95
- package/dist/contractErrors.d.ts +15 -2
- package/dist/contractErrors.js +39 -1
- package/dist/hostBindings/index.d.ts +4 -0
- package/dist/hostBindings/index.js +9 -0
- package/dist/hostBindings/lifetime.d.ts +25 -0
- package/dist/hostBindings/lifetime.js +147 -0
- package/dist/hostBindings/opening.d.ts +12 -0
- package/dist/hostBindings/opening.js +24 -0
- package/dist/hostBindings/schema.d.ts +9 -0
- package/dist/hostBindings/schema.js +169 -0
- package/dist/hostBindings/types.d.ts +71 -0
- package/dist/hostBindings/types.js +0 -0
- package/dist/hostBindings/validation.d.ts +14 -0
- package/dist/hostBindings/validation.js +107 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/internal/objectShape.d.ts +2 -0
- package/dist/internal/objectShape.js +7 -0
- package/dist/outputValidation.js +1 -0
- package/dist/sessionCleanup.d.ts +9 -0
- package/dist/sessionCleanup.js +17 -0
- package/dist/sessionValidation.d.ts +12 -2
- package/dist/sessionValidation.js +134 -305
- package/dist/sessions.d.ts +28 -4
- package/dist/testing/conformance.d.ts +3 -3
- package/dist/testing/conformance.js +24 -30
- package/dist/testing/fakeProvider.js +56 -45
- package/dist/turnExecution/execution.d.ts +26 -0
- package/dist/turnExecution/execution.js +214 -0
- package/dist/turnExecution/receipts.d.ts +6 -0
- package/dist/turnExecution/receipts.js +39 -0
- package/dist/turnExecution/requests.d.ts +19 -0
- package/dist/turnExecution/requests.js +56 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./artifacts.js";
|
|
|
5
5
|
export * from "./contractErrors.js";
|
|
6
6
|
export * from "./evidence.js";
|
|
7
7
|
export * from "./foundation.js";
|
|
8
|
+
export * from "./hostBindings/index.js";
|
|
8
9
|
export * from "./interactionValidation.js";
|
|
9
10
|
export * from "./outputs.js";
|
|
10
11
|
export * from "./providerCatalog.js";
|
|
@@ -12,5 +13,6 @@ export * from "./providerDriver.js";
|
|
|
12
13
|
export * from "./providerInstanceRegistry.js";
|
|
13
14
|
export * from "./readiness.js";
|
|
14
15
|
export * from "./sessions.js";
|
|
16
|
+
export { createAgentProviderSessionCleanupError, isAgentProviderSessionCleanupErrorFor } from "./sessionCleanup.js";
|
|
15
17
|
export * from "./text.js";
|
|
16
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./artifacts.js";
|
|
|
5
5
|
export * from "./contractErrors.js";
|
|
6
6
|
export * from "./evidence.js";
|
|
7
7
|
export * from "./foundation.js";
|
|
8
|
+
export * from "./hostBindings/index.js";
|
|
8
9
|
export * from "./interactionValidation.js";
|
|
9
10
|
export * from "./outputs.js";
|
|
10
11
|
export * from "./providerCatalog.js";
|
|
@@ -12,4 +13,9 @@ export * from "./providerDriver.js";
|
|
|
12
13
|
export * from "./providerInstanceRegistry.js";
|
|
13
14
|
export * from "./readiness.js";
|
|
14
15
|
export * from "./sessions.js";
|
|
16
|
+
import { createAgentProviderSessionCleanupError, isAgentProviderSessionCleanupErrorFor } from "./sessionCleanup.js";
|
|
15
17
|
export * from "./text.js";
|
|
18
|
+
export {
|
|
19
|
+
createAgentProviderSessionCleanupError,
|
|
20
|
+
isAgentProviderSessionCleanupErrorFor
|
|
21
|
+
};
|
package/dist/outputValidation.js
CHANGED
|
@@ -123,6 +123,7 @@ function isEventCapabilitySupported(capabilities, event) {
|
|
|
123
123
|
case "turn.state_changed":
|
|
124
124
|
case "turn.completed":
|
|
125
125
|
case "progress.updated":
|
|
126
|
+
case "runtime.retrying":
|
|
126
127
|
case "runtime.warning":
|
|
127
128
|
case "runtime.error":
|
|
128
129
|
case "provider.diagnostic":
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AgentProviderSessionCleanupError } from "./contractErrors.js";
|
|
2
|
+
import type { AgentProviderSessionContext } from "./sessions.js";
|
|
3
|
+
/** Retain provider cleanup for the exact input received by a create/resume/branch port. */
|
|
4
|
+
export declare function createAgentProviderSessionCleanupError(input: ConstructorParameters<typeof AgentProviderSessionCleanupError>[0] & Readonly<{
|
|
5
|
+
openingInput: AgentProviderSessionContext;
|
|
6
|
+
}>): AgentProviderSessionCleanupError;
|
|
7
|
+
export declare function associateAgentSessionCleanupError<Error extends AgentProviderSessionCleanupError>(error: Error, openingInput: object): Error;
|
|
8
|
+
export declare function isAgentProviderSessionCleanupErrorFor(error: unknown, openingInput: object): error is AgentProviderSessionCleanupError;
|
|
9
|
+
//# sourceMappingURL=sessionCleanup.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AgentProviderSessionCleanupError } from "./contractErrors.js";
|
|
2
|
+
const openingOwners = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function createAgentProviderSessionCleanupError(input) {
|
|
4
|
+
return associateAgentSessionCleanupError(new AgentProviderSessionCleanupError(input), input.openingInput);
|
|
5
|
+
}
|
|
6
|
+
function associateAgentSessionCleanupError(error, openingInput) {
|
|
7
|
+
openingOwners.set(error, openingInput);
|
|
8
|
+
return error;
|
|
9
|
+
}
|
|
10
|
+
function isAgentProviderSessionCleanupErrorFor(error, openingInput) {
|
|
11
|
+
return error instanceof AgentProviderSessionCleanupError && openingOwners.get(error) === openingInput;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
associateAgentSessionCleanupError,
|
|
15
|
+
createAgentProviderSessionCleanupError,
|
|
16
|
+
isAgentProviderSessionCleanupErrorFor
|
|
17
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type AgentCapabilities, type AgentSessionBinding, type AgentSessionId } from "@agen-ai/agent-protocol";
|
|
1
|
+
import { type AgentCapabilities, type AgentProviderKey, type AgentSessionBinding, type AgentSessionId } from "@agen-ai/agent-protocol";
|
|
2
|
+
import { type AgentHostBindingLease } from "./hostBindings/lifetime.js";
|
|
2
3
|
import { type MaybePromise } from "./foundation.js";
|
|
3
4
|
import type { AgentProviderSession, AgentSessionBindingCreatedObserver } from "./sessions.js";
|
|
4
5
|
export declare function validateAgentProviderSession(input: {
|
|
@@ -7,13 +8,22 @@ export declare function validateAgentProviderSession(input: {
|
|
|
7
8
|
readonly candidate: AgentProviderSession;
|
|
8
9
|
readonly expectedBinding?: AgentSessionBinding;
|
|
9
10
|
readonly sourceBinding?: AgentSessionBinding;
|
|
11
|
+
readonly hostBindingLease?: AgentHostBindingLease;
|
|
10
12
|
}): AgentProviderSession;
|
|
11
|
-
export declare function closeRejectedAgentProviderSession(session: AgentProviderSession | null, error: unknown
|
|
13
|
+
export declare function closeRejectedAgentProviderSession(session: AgentProviderSession | null, error: unknown, hostBinding?: Readonly<{
|
|
14
|
+
providerKey: AgentProviderKey;
|
|
15
|
+
lease: AgentHostBindingLease;
|
|
16
|
+
}>, opening?: Readonly<{
|
|
17
|
+
providerKey: AgentProviderKey;
|
|
18
|
+
input: object;
|
|
19
|
+
}>): Promise<never>;
|
|
12
20
|
export declare function openIdentityCreatingAgentProviderSession(input: {
|
|
13
21
|
readonly capabilities: AgentCapabilities;
|
|
14
22
|
readonly sessionId: AgentSessionId;
|
|
15
23
|
readonly observer: AgentSessionBindingCreatedObserver;
|
|
16
24
|
readonly sourceBinding?: AgentSessionBinding;
|
|
25
|
+
readonly hostBindingLease?: AgentHostBindingLease;
|
|
26
|
+
readonly openingInput?: object;
|
|
17
27
|
readonly open: (observer: AgentSessionBindingCreatedObserver) => MaybePromise<AgentProviderSession>;
|
|
18
28
|
}): Promise<AgentProviderSession>;
|
|
19
29
|
//# sourceMappingURL=sessionValidation.d.ts.map
|