@spine-event-engine/server 2.0.0-snapshot.24 → 2.0.0-snapshot.25
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 +38 -11
- package/REFERENCE.md +201 -130
- package/dist/agent/agent-acceptance-receipts.d.ts +69 -0
- package/dist/agent/agent-acceptance-receipts.d.ts.map +1 -0
- package/dist/agent/agent-acceptance-receipts.js +198 -0
- package/dist/agent/agent-acceptance-receipts.js.map +1 -0
- package/dist/agent/agent-execution-capacity.d.ts +37 -9
- package/dist/agent/agent-execution-capacity.d.ts.map +1 -1
- package/dist/agent/agent-execution-capacity.js +73 -15
- package/dist/agent/agent-execution-capacity.js.map +1 -1
- package/dist/agent/agent-history.d.ts +15 -10
- package/dist/agent/agent-history.d.ts.map +1 -1
- package/dist/agent/agent-history.js +26 -14
- package/dist/agent/agent-history.js.map +1 -1
- package/dist/agent/agent-live-ai-audit.d.ts +95 -0
- package/dist/agent/agent-live-ai-audit.d.ts.map +1 -0
- package/dist/agent/agent-live-ai-audit.js +290 -0
- package/dist/agent/agent-live-ai-audit.js.map +1 -0
- package/dist/agent/agent-live-ai-runtime.d.ts +300 -0
- package/dist/agent/agent-live-ai-runtime.d.ts.map +1 -0
- package/dist/agent/agent-live-ai-runtime.js +611 -0
- package/dist/agent/agent-live-ai-runtime.js.map +1 -0
- package/dist/agent/agent-live-audit.d.ts +67 -0
- package/dist/agent/agent-live-audit.d.ts.map +1 -0
- package/dist/agent/agent-live-audit.js +121 -0
- package/dist/agent/agent-live-audit.js.map +1 -0
- package/dist/agent/agent-live-budget.d.ts +84 -0
- package/dist/agent/agent-live-budget.d.ts.map +1 -0
- package/dist/agent/agent-live-budget.js +161 -0
- package/dist/agent/agent-live-budget.js.map +1 -0
- package/dist/agent/agent-live-fault.d.ts +18 -0
- package/dist/agent/agent-live-fault.d.ts.map +1 -0
- package/dist/agent/{agent-execution-fault.js → agent-live-fault.js} +7 -7
- package/dist/agent/agent-live-fault.js.map +1 -0
- package/dist/agent/agent-live-inputs.d.ts +74 -0
- package/dist/agent/agent-live-inputs.d.ts.map +1 -0
- package/dist/{bus/saved-dispatcher-binding.js → agent/agent-live-inputs.js} +2 -14
- package/dist/agent/agent-live-inputs.js.map +1 -0
- package/dist/agent/agent-live-interaction-events.d.ts +46 -0
- package/dist/agent/agent-live-interaction-events.d.ts.map +1 -0
- package/dist/agent/agent-live-interaction-events.js +104 -0
- package/dist/agent/agent-live-interaction-events.js.map +1 -0
- package/dist/agent/agent-live-mcp-controls.d.ts +129 -0
- package/dist/agent/agent-live-mcp-controls.d.ts.map +1 -0
- package/dist/agent/agent-live-mcp-controls.js +228 -0
- package/dist/agent/agent-live-mcp-controls.js.map +1 -0
- package/dist/agent/agent-live-mcp-host.d.ts +88 -0
- package/dist/agent/agent-live-mcp-host.d.ts.map +1 -0
- package/dist/agent/{agent-mcp-host.js → agent-live-mcp-host.js} +1 -1
- package/dist/agent/agent-live-mcp-host.js.map +1 -0
- package/dist/agent/{agent-mcp-runtime.d.ts → agent-live-mcp-runtime.d.ts} +6 -6
- package/dist/agent/agent-live-mcp-runtime.d.ts.map +1 -0
- package/dist/agent/{agent-mcp-runtime.js → agent-live-mcp-runtime.js} +13 -42
- package/dist/agent/agent-live-mcp-runtime.js.map +1 -0
- package/dist/agent/agent-live-read-runtime.d.ts +61 -0
- package/dist/agent/agent-live-read-runtime.d.ts.map +1 -0
- package/dist/agent/agent-live-read-runtime.js +121 -0
- package/dist/agent/agent-live-read-runtime.js.map +1 -0
- package/dist/agent/agent-model-selection.d.ts +21 -34
- package/dist/agent/agent-model-selection.d.ts.map +1 -1
- package/dist/agent/agent-model-selection.js +61 -78
- package/dist/agent/agent-model-selection.js.map +1 -1
- package/dist/bus/command-bus.d.ts +14 -18
- package/dist/bus/command-bus.d.ts.map +1 -1
- package/dist/bus/command-bus.js +31 -48
- package/dist/bus/command-bus.js.map +1 -1
- package/dist/bus/event-bus.d.ts +17 -4
- package/dist/bus/event-bus.d.ts.map +1 -1
- package/dist/bus/event-bus.js +42 -12
- package/dist/bus/event-bus.js.map +1 -1
- package/dist/context/bounded-context.d.ts +140 -87
- package/dist/context/bounded-context.d.ts.map +1 -1
- package/dist/context/bounded-context.js +702 -329
- package/dist/context/bounded-context.js.map +1 -1
- package/dist/context/entity-inbox.d.ts +7 -2
- package/dist/context/entity-inbox.d.ts.map +1 -1
- package/dist/context/entity-inbox.js +22 -13
- package/dist/context/entity-inbox.js.map +1 -1
- package/dist/context/local-inbox-handoff.d.ts +34 -34
- package/dist/context/local-inbox-handoff.d.ts.map +1 -1
- package/dist/context/local-inbox-handoff.js +108 -150
- package/dist/context/local-inbox-handoff.js.map +1 -1
- package/dist/context/projection-handoff.d.ts +2 -2
- package/dist/context/projection-handoff.d.ts.map +1 -1
- package/dist/context/projection-handoff.js +10 -8
- package/dist/context/projection-handoff.js.map +1 -1
- package/dist/context/tenant-index.d.ts +36 -31
- package/dist/context/tenant-index.d.ts.map +1 -1
- package/dist/context/tenant-index.js +123 -125
- package/dist/context/tenant-index.js.map +1 -1
- package/dist/context/tenant-unknown-error.d.ts +33 -0
- package/dist/context/tenant-unknown-error.d.ts.map +1 -0
- package/dist/context/tenant-unknown-error.js +75 -0
- package/dist/context/tenant-unknown-error.js.map +1 -0
- package/dist/delivery/agent-delivery-scope.d.ts +66 -0
- package/dist/delivery/agent-delivery-scope.d.ts.map +1 -0
- package/dist/delivery/agent-delivery-scope.js +44 -0
- package/dist/delivery/agent-delivery-scope.js.map +1 -0
- package/dist/delivery/delivery-builder.d.ts +25 -1
- package/dist/delivery/delivery-builder.d.ts.map +1 -1
- package/dist/delivery/delivery-builder.js +89 -0
- package/dist/delivery/delivery-builder.js.map +1 -1
- package/dist/delivery/delivery-monitor.d.ts +1 -1
- package/dist/delivery/delivery-monitor.js +1 -1
- package/dist/delivery/delivery-run-control.d.ts +6 -0
- package/dist/delivery/delivery-run-control.d.ts.map +1 -1
- package/dist/delivery/delivery-run-control.js +10 -0
- package/dist/delivery/delivery-run-control.js.map +1 -1
- package/dist/delivery/delivery-supervisor.d.ts.map +1 -1
- package/dist/delivery/delivery-supervisor.js +28 -4
- package/dist/delivery/delivery-supervisor.js.map +1 -1
- package/dist/delivery/delivery-tenant.d.ts +17 -0
- package/dist/delivery/delivery-tenant.d.ts.map +1 -0
- package/dist/delivery/delivery-tenant.js +50 -0
- package/dist/delivery/delivery-tenant.js.map +1 -0
- package/dist/delivery/delivery.d.ts +96 -2
- package/dist/delivery/delivery.d.ts.map +1 -1
- package/dist/delivery/delivery.js +693 -53
- package/dist/delivery/delivery.js.map +1 -1
- package/dist/delivery/inbox-records.d.ts.map +1 -1
- package/dist/delivery/inbox-records.js +9 -16
- package/dist/delivery/inbox-records.js.map +1 -1
- package/dist/delivery/inbox-storage.d.ts +6 -0
- package/dist/delivery/inbox-storage.d.ts.map +1 -1
- package/dist/delivery/inbox-storage.js +43 -6
- package/dist/delivery/inbox-storage.js.map +1 -1
- package/dist/delivery/inbox.d.ts.map +1 -1
- package/dist/delivery/inbox.js +3 -2
- package/dist/delivery/inbox.js.map +1 -1
- package/dist/delivery/reception-observation.d.ts +12 -4
- package/dist/delivery/reception-observation.d.ts.map +1 -1
- package/dist/delivery/reception-observation.js +14 -3
- package/dist/delivery/reception-observation.js.map +1 -1
- package/dist/delivery/sharded-work-registry.d.ts +6 -0
- package/dist/delivery/sharded-work-registry.d.ts.map +1 -1
- package/dist/delivery/sharded-work-registry.js +41 -4
- package/dist/delivery/sharded-work-registry.js.map +1 -1
- package/dist/entity/entity-storage-descriptor.d.ts.map +1 -1
- package/dist/entity/entity-storage-descriptor.js +7 -4
- package/dist/entity/entity-storage-descriptor.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/integration/external-messages.d.ts.map +1 -1
- package/dist/integration/external-messages.js +9 -15
- package/dist/integration/external-messages.js.map +1 -1
- package/dist/integration/integration-broker.d.ts.map +1 -1
- package/dist/integration/integration-broker.js +112 -6
- package/dist/integration/integration-broker.js.map +1 -1
- package/dist/integration/third-party-context.d.ts.map +1 -1
- package/dist/integration/third-party-context.js +7 -10
- package/dist/integration/third-party-context.js.map +1 -1
- package/dist/repository/primitive-id.js +26 -11
- package/dist/repository/primitive-id.js.map +1 -1
- package/dist/repository/repository.d.ts +32 -60
- package/dist/repository/repository.d.ts.map +1 -1
- package/dist/repository/repository.js +1446 -1787
- package/dist/repository/repository.js.map +1 -1
- package/dist/runtime/runtime.d.ts +13 -0
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +18 -0
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/signal-metadata.d.ts.map +1 -1
- package/dist/runtime/signal-metadata.js +6 -6
- package/dist/runtime/signal-metadata.js.map +1 -1
- package/dist/runtime/signal-publisher.d.ts +0 -6
- package/dist/runtime/signal-publisher.d.ts.map +1 -1
- package/dist/runtime/signal-publisher.js +1 -9
- package/dist/runtime/signal-publisher.js.map +1 -1
- package/dist/runtime/standalone-handler-runtime.d.ts +0 -7
- package/dist/runtime/standalone-handler-runtime.d.ts.map +1 -1
- package/dist/runtime/standalone-handler-runtime.js +13 -99
- package/dist/runtime/standalone-handler-runtime.js.map +1 -1
- package/dist/server/managed-delivery-gate.d.ts +34 -0
- package/dist/server/managed-delivery-gate.d.ts.map +1 -0
- package/dist/server/managed-delivery-gate.js +70 -0
- package/dist/server/managed-delivery-gate.js.map +1 -0
- package/dist/server/managed-server-application.d.ts.map +1 -1
- package/dist/server/managed-server-application.js +7 -4
- package/dist/server/managed-server-application.js.map +1 -1
- package/dist/server/server-environment.d.ts +203 -25
- package/dist/server/server-environment.d.ts.map +1 -1
- package/dist/server/server-environment.js +661 -133
- package/dist/server/server-environment.js.map +1 -1
- package/dist/server/server-log.d.ts +7 -0
- package/dist/server/server-log.d.ts.map +1 -1
- package/dist/server/server-log.js +14 -1
- package/dist/server/server-log.js.map +1 -1
- package/dist/server/server.d.ts +18 -32
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/server.js +50 -204
- package/dist/server/server.js.map +1 -1
- package/dist/services/spine-services.d.ts +1 -1
- package/dist/services/spine-services.d.ts.map +1 -1
- package/dist/services/spine-services.js +236 -335
- package/dist/services/spine-services.js.map +1 -1
- package/dist/stand/event-origin-filter.js +3 -3
- package/dist/stand/event-origin-filter.js.map +1 -1
- package/dist/stand/stand.d.ts +14 -0
- package/dist/stand/stand.d.ts.map +1 -1
- package/dist/stand/stand.js +53 -9
- package/dist/stand/stand.js.map +1 -1
- package/dist/stand/subscription-observer.d.ts.map +1 -1
- package/dist/stand/subscription-observer.js +54 -40
- package/dist/stand/subscription-observer.js.map +1 -1
- package/dist/stand/subscription-registry.d.ts +6 -2
- package/dist/stand/subscription-registry.d.ts.map +1 -1
- package/dist/stand/subscription-registry.js +15 -11
- package/dist/stand/subscription-registry.js.map +1 -1
- package/dist/stand/subscription-runtime.d.ts +5 -3
- package/dist/stand/subscription-runtime.d.ts.map +1 -1
- package/dist/stand/subscription-runtime.js +52 -9
- package/dist/stand/subscription-runtime.js.map +1 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +4 -3
- package/dist/testing/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
- package/dist/agent/agent-admission.d.ts +0 -80
- package/dist/agent/agent-admission.d.ts.map +0 -1
- package/dist/agent/agent-admission.js +0 -127
- package/dist/agent/agent-admission.js.map +0 -1
- package/dist/agent/agent-ai-runtime.d.ts +0 -76
- package/dist/agent/agent-ai-runtime.d.ts.map +0 -1
- package/dist/agent/agent-ai-runtime.js +0 -1269
- package/dist/agent/agent-ai-runtime.js.map +0 -1
- package/dist/agent/agent-execution-fault.d.ts +0 -18
- package/dist/agent/agent-execution-fault.d.ts.map +0 -1
- package/dist/agent/agent-execution-fault.js.map +0 -1
- package/dist/agent/agent-execution-session.d.ts +0 -103
- package/dist/agent/agent-execution-session.d.ts.map +0 -1
- package/dist/agent/agent-execution-session.js +0 -238
- package/dist/agent/agent-execution-session.js.map +0 -1
- package/dist/agent/agent-interaction-audit.d.ts +0 -58
- package/dist/agent/agent-interaction-audit.d.ts.map +0 -1
- package/dist/agent/agent-interaction-audit.js +0 -114
- package/dist/agent/agent-interaction-audit.js.map +0 -1
- package/dist/agent/agent-interaction-events.d.ts +0 -40
- package/dist/agent/agent-interaction-events.d.ts.map +0 -1
- package/dist/agent/agent-interaction-events.js +0 -129
- package/dist/agent/agent-interaction-events.js.map +0 -1
- package/dist/agent/agent-mcp-budget.d.ts +0 -125
- package/dist/agent/agent-mcp-budget.d.ts.map +0 -1
- package/dist/agent/agent-mcp-budget.js +0 -566
- package/dist/agent/agent-mcp-budget.js.map +0 -1
- package/dist/agent/agent-mcp-host.d.ts +0 -125
- package/dist/agent/agent-mcp-host.d.ts.map +0 -1
- package/dist/agent/agent-mcp-host.js.map +0 -1
- package/dist/agent/agent-mcp-runtime.d.ts.map +0 -1
- package/dist/agent/agent-mcp-runtime.js.map +0 -1
- package/dist/agent/agent-read-runtime.d.ts +0 -70
- package/dist/agent/agent-read-runtime.d.ts.map +0 -1
- package/dist/agent/agent-read-runtime.js +0 -320
- package/dist/agent/agent-read-runtime.js.map +0 -1
- package/dist/agent/agent-revisions.d.ts +0 -35
- package/dist/agent/agent-revisions.d.ts.map +0 -1
- package/dist/agent/agent-revisions.js +0 -133
- package/dist/agent/agent-revisions.js.map +0 -1
- package/dist/agent/agent-scheduler.d.ts +0 -99
- package/dist/agent/agent-scheduler.d.ts.map +0 -1
- package/dist/agent/agent-scheduler.js +0 -398
- package/dist/agent/agent-scheduler.js.map +0 -1
- package/dist/bus/saved-dispatcher-binding.d.ts +0 -53
- package/dist/bus/saved-dispatcher-binding.d.ts.map +0 -1
- package/dist/bus/saved-dispatcher-binding.js.map +0 -1
- package/dist/delivery/delivery-run-coordinator.d.ts +0 -218
- package/dist/delivery/delivery-run-coordinator.d.ts.map +0 -1
- package/dist/delivery/delivery-run-coordinator.js +0 -609
- package/dist/delivery/delivery-run-coordinator.js.map +0 -1
- package/dist/delivery/parked-delivery-obligations.d.ts +0 -182
- package/dist/delivery/parked-delivery-obligations.d.ts.map +0 -1
- package/dist/delivery/parked-delivery-obligations.js +0 -390
- package/dist/delivery/parked-delivery-obligations.js.map +0 -1
- package/dist/server/environment-attachment.d.ts +0 -356
- package/dist/server/environment-attachment.d.ts.map +0 -1
- package/dist/server/environment-attachment.js +0 -2062
- package/dist/server/environment-attachment.js.map +0 -1
- package/dist/server/environment-delivery-records.d.ts +0 -77
- package/dist/server/environment-delivery-records.d.ts.map +0 -1
- package/dist/server/environment-delivery-records.js +0 -282
- package/dist/server/environment-delivery-records.js.map +0 -1
- package/dist/server/environment-delivery-worker.d.ts +0 -161
- package/dist/server/environment-delivery-worker.d.ts.map +0 -1
- package/dist/server/environment-delivery-worker.js +0 -973
- package/dist/server/environment-delivery-worker.js.map +0 -1
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { type MessageShape } from "@bufbuild/protobuf";
|
|
2
|
+
import { type MessageSchema } from "@spine-event-engine/core";
|
|
3
|
+
import type { AgentAi, AiModel, AiRegistry, AiResult, AiScope, ModelRef } from "@spine-event-engine/ai";
|
|
4
|
+
import { AiModelKind, ConversationIdSchema } from "@spine-event-engine/proto/agent";
|
|
5
|
+
import type { RepositoryAiOptions } from "../repository/repository.js";
|
|
6
|
+
import type { AgentLiveAudit } from "./agent-live-audit.js";
|
|
7
|
+
import { AgentLiveBudget } from "./agent-live-budget.js";
|
|
8
|
+
import type { AgentLiveModel } from "./agent-live-inputs.js";
|
|
9
|
+
/**
|
|
10
|
+
* Executes named AI calls for one live handler without a recovery journal.
|
|
11
|
+
*/
|
|
12
|
+
export declare class AgentLiveAiRuntime implements AgentAi {
|
|
13
|
+
#private;
|
|
14
|
+
private readonly registry;
|
|
15
|
+
private readonly repository;
|
|
16
|
+
private readonly scope;
|
|
17
|
+
private readonly selected;
|
|
18
|
+
private readonly budget;
|
|
19
|
+
private readonly deadlineEpochMs;
|
|
20
|
+
private readonly onSelect;
|
|
21
|
+
private readonly audit;
|
|
22
|
+
private readonly checkSession;
|
|
23
|
+
/**
|
|
24
|
+
* Binds selected models and one invocation-wide local budget.
|
|
25
|
+
*
|
|
26
|
+
* @param audit Retained history audit for this invocation.
|
|
27
|
+
* @param budget Invocation-wide resource budget.
|
|
28
|
+
* @param checkSession Callback that validates the current execution session.
|
|
29
|
+
* @param deadlineEpochMs Absolute invocation deadline, when configured.
|
|
30
|
+
* @param onSelect Callback that stages a model selection.
|
|
31
|
+
* @param registry Registered AI models or MCP servers.
|
|
32
|
+
* @param repository Repository configured for this Entity.
|
|
33
|
+
* @param scope Captured invocation or tenant scope.
|
|
34
|
+
* @param selected Models or selection retained for this invocation.
|
|
35
|
+
* @param signal Signal or cancellation signal for this operation.
|
|
36
|
+
*/
|
|
37
|
+
constructor(registry: AiRegistry, repository: RepositoryAiOptions, scope: AiScope, selected: ReadonlyMap<AiModelKind, AgentLiveModel>, budget: AgentLiveBudget, signal: AbortSignal, deadlineEpochMs: number | undefined, onSelect: (kind: AiModelKind, model: ModelRef | undefined) => void, audit: AgentLiveAudit<unknown>, checkSession?: () => Promise<void>);
|
|
38
|
+
/**
|
|
39
|
+
* Executes one validated registered capability and returns its fresh result.
|
|
40
|
+
*
|
|
41
|
+
* @typeParam I Generated input schema of the invoked capability.
|
|
42
|
+
* @typeParam O Generated output schema of the invoked capability.
|
|
43
|
+
* @param model Selected AI model for this invocation.
|
|
44
|
+
* @param request Typed request for the current operation.
|
|
45
|
+
* @returns The typed model result with its operation identifier.
|
|
46
|
+
*/
|
|
47
|
+
invoke<I extends MessageSchema, O extends MessageSchema>(model: AiModel<I, O>, request: {
|
|
48
|
+
readonly call: string;
|
|
49
|
+
readonly conversation: MessageShape<typeof ConversationIdSchema>;
|
|
50
|
+
readonly input: MessageShape<I>;
|
|
51
|
+
}): Promise<AiResult<MessageShape<O>>>;
|
|
52
|
+
/**
|
|
53
|
+
* Prepares a checked model preference for a later accepted signal.
|
|
54
|
+
*
|
|
55
|
+
* @param kind Declared model or operation kind.
|
|
56
|
+
* @param model Selected AI model for this invocation.
|
|
57
|
+
*/
|
|
58
|
+
select(kind: AiModelKind, model: ModelRef | undefined): void;
|
|
59
|
+
/**
|
|
60
|
+
* Rejects a handler that returned with a pending model operation.
|
|
61
|
+
*/
|
|
62
|
+
finish(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Cancels callbacks retained after the handler returns.
|
|
65
|
+
*/
|
|
66
|
+
close(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Rejects stale or cancelled handler capabilities.
|
|
69
|
+
*/
|
|
70
|
+
private requireOpen;
|
|
71
|
+
/**
|
|
72
|
+
* Validates typed input and per-handler call identity before any external work.
|
|
73
|
+
*
|
|
74
|
+
* @typeParam I Generated schema for the supplied input.
|
|
75
|
+
* @typeParam O Generated schema for the declared output.
|
|
76
|
+
* @param model Selected AI model for this invocation.
|
|
77
|
+
* @param request Typed request for the current operation.
|
|
78
|
+
*/
|
|
79
|
+
private validateRequest;
|
|
80
|
+
/**
|
|
81
|
+
* Connects the authenticated selected deployment and runs one backend operation.
|
|
82
|
+
*
|
|
83
|
+
* @typeParam I Generated input schema for the selected capability.
|
|
84
|
+
* @typeParam O Generated output schema for the selected capability.
|
|
85
|
+
* @param model Selected AI model for this invocation.
|
|
86
|
+
* @param operationId Typed AI operation identifier.
|
|
87
|
+
* @param request Typed request for the current operation.
|
|
88
|
+
* @returns The authenticated backend outcome for this operation.
|
|
89
|
+
*/
|
|
90
|
+
private execute;
|
|
91
|
+
/**
|
|
92
|
+
* Executes the authorized model and closes its selected MCP sessions.
|
|
93
|
+
*
|
|
94
|
+
* @typeParam I Generated input schema of the authorized model.
|
|
95
|
+
* @typeParam O Generated output schema of the authorized model.
|
|
96
|
+
* @param audit Retained history audit for this invocation.
|
|
97
|
+
* @param backend Selected AI backend registration.
|
|
98
|
+
* @param deadline Operation deadline, when configured.
|
|
99
|
+
* @param identity Authorized provider connection identity.
|
|
100
|
+
* @param model Selected AI model for this invocation.
|
|
101
|
+
* @param operation Current AI operation identity.
|
|
102
|
+
* @param operationId Typed AI operation identifier.
|
|
103
|
+
* @param request Typed request for the current operation.
|
|
104
|
+
* @returns The authorized backend outcome after MCP cleanup.
|
|
105
|
+
*/
|
|
106
|
+
private runAuthorized;
|
|
107
|
+
/**
|
|
108
|
+
* Records a safe setup failure without disguising unrelated errors.
|
|
109
|
+
*
|
|
110
|
+
* @param audit Retained history audit for this invocation.
|
|
111
|
+
* @param error Original operation or cleanup error.
|
|
112
|
+
* @returns The recorded safe failure for an MCP setup error.
|
|
113
|
+
*/
|
|
114
|
+
private setupFailure;
|
|
115
|
+
/**
|
|
116
|
+
* Invokes the prepared backend and validates its result before audit.
|
|
117
|
+
*
|
|
118
|
+
* @typeParam I Generated input schema used for validation.
|
|
119
|
+
* @typeParam O Generated output schema validated before audit.
|
|
120
|
+
* @param advertised Tools advertised by the selected MCP session.
|
|
121
|
+
* @param attempts Physical attempt state for this invocation.
|
|
122
|
+
* @param audit Retained history audit for this invocation.
|
|
123
|
+
* @param backend Selected AI backend registration.
|
|
124
|
+
* @param deadline Operation deadline, when configured.
|
|
125
|
+
* @param identity Authorized provider connection identity.
|
|
126
|
+
* @param mcp Selected MCP session, when present.
|
|
127
|
+
* @param model Selected AI model for this invocation.
|
|
128
|
+
* @param operationId Typed AI operation identifier.
|
|
129
|
+
* @param request Typed request for the current operation.
|
|
130
|
+
* @returns The validated backend outcome after its audit is saved.
|
|
131
|
+
*/
|
|
132
|
+
private runAndAudit;
|
|
133
|
+
/**
|
|
134
|
+
* Handles operation and cleanup failures while closing the selected protocol.
|
|
135
|
+
*
|
|
136
|
+
* @typeParam T Operation result retained through MCP cleanup.
|
|
137
|
+
* @param mcp Selected MCP session, when present.
|
|
138
|
+
* @param run Callback executed inside the guarded session.
|
|
139
|
+
* @returns The operation result after MCP cleanup succeeds.
|
|
140
|
+
*/
|
|
141
|
+
private withMcp;
|
|
142
|
+
/**
|
|
143
|
+
* Binds the exact configured MCP catalog to this live operation.
|
|
144
|
+
*
|
|
145
|
+
* @param attempts Physical attempt state for this invocation.
|
|
146
|
+
* @param audit Retained history audit for this invocation.
|
|
147
|
+
* @param backend Selected AI backend registration.
|
|
148
|
+
* @param deadline Operation deadline, when configured.
|
|
149
|
+
* @param model Selected AI model for this invocation.
|
|
150
|
+
* @param operation Current AI operation identity.
|
|
151
|
+
* @returns The configured MCP runtime, or undefined when no server is selected.
|
|
152
|
+
*/
|
|
153
|
+
private mcp;
|
|
154
|
+
/**
|
|
155
|
+
* Rejects a proposal absent from its completed physical model response.
|
|
156
|
+
*
|
|
157
|
+
* @param attempts Physical attempt state for this invocation.
|
|
158
|
+
* @param invocation Captured live Agent invocation.
|
|
159
|
+
*/
|
|
160
|
+
private checkProposal;
|
|
161
|
+
/**
|
|
162
|
+
* Handles an operation failure together with MCP cleanup failure.
|
|
163
|
+
*
|
|
164
|
+
* @param failed Original failure retained through cleanup.
|
|
165
|
+
* @param mcp Selected MCP session, when present.
|
|
166
|
+
* @returns Completion after preserving any operation and MCP cleanup failures.
|
|
167
|
+
*/
|
|
168
|
+
private closeMcp;
|
|
169
|
+
/**
|
|
170
|
+
* Executes a checked backend using the selected authenticated connection.
|
|
171
|
+
*
|
|
172
|
+
* @typeParam I Generated input schema sent to the backend.
|
|
173
|
+
* @typeParam O Generated output schema returned by the backend.
|
|
174
|
+
* @param advertised Tools advertised by the selected MCP session.
|
|
175
|
+
* @param backend Selected AI backend registration.
|
|
176
|
+
* @param control MCP execution controls for this invocation.
|
|
177
|
+
* @param deadline Operation deadline, when configured.
|
|
178
|
+
* @param identity Authorized provider connection identity.
|
|
179
|
+
* @param model Selected AI model for this invocation.
|
|
180
|
+
* @param operationId Typed AI operation identifier.
|
|
181
|
+
* @param request Typed request for the current operation.
|
|
182
|
+
* @returns The checked backend outcome from the authenticated connection.
|
|
183
|
+
*/
|
|
184
|
+
private runConnected;
|
|
185
|
+
/**
|
|
186
|
+
* Calculates capability time at the invocation's sampled deadline.
|
|
187
|
+
*
|
|
188
|
+
* @param model Selected AI model for this invocation.
|
|
189
|
+
* @returns The effective epoch deadline, or undefined when no limit applies.
|
|
190
|
+
*/
|
|
191
|
+
private operationDeadline;
|
|
192
|
+
/**
|
|
193
|
+
* Resolves the selected backend through current repository policy.
|
|
194
|
+
*
|
|
195
|
+
* @param model Selected AI model for this invocation.
|
|
196
|
+
* @returns The selected model and its registered backend.
|
|
197
|
+
*/
|
|
198
|
+
private selectedBackend;
|
|
199
|
+
/**
|
|
200
|
+
* Checks authenticated nonsecret identity immediately before connection.
|
|
201
|
+
*
|
|
202
|
+
* @param backend Selected AI backend registration.
|
|
203
|
+
* @param deadline Operation deadline, when configured.
|
|
204
|
+
* @param selected Models or selection retained for this invocation.
|
|
205
|
+
* @returns The revalidated authenticated connection identity.
|
|
206
|
+
*/
|
|
207
|
+
private authorize;
|
|
208
|
+
/**
|
|
209
|
+
* Returns credential-free fields from the validated selected connection.
|
|
210
|
+
*
|
|
211
|
+
* @param selected Models or selection retained for this invocation.
|
|
212
|
+
* @returns Credential-free fields from the selected connection.
|
|
213
|
+
*/
|
|
214
|
+
private savedIdentity;
|
|
215
|
+
/**
|
|
216
|
+
* Compares all credential-free identity fields.
|
|
217
|
+
*
|
|
218
|
+
* @param left Earlier value in the comparison.
|
|
219
|
+
* @param right Later value in the comparison.
|
|
220
|
+
* @returns Whether all credential-free connection fields match.
|
|
221
|
+
*/
|
|
222
|
+
private sameIdentity;
|
|
223
|
+
/**
|
|
224
|
+
* Creates physical tickets, validation, and local accounting to one backend.
|
|
225
|
+
*
|
|
226
|
+
* @param attempts Physical attempt state for this invocation.
|
|
227
|
+
* @param audit Retained history audit for this invocation.
|
|
228
|
+
* @param deadline Operation deadline, when configured.
|
|
229
|
+
* @param mcp Selected MCP session, when present.
|
|
230
|
+
* @param model Selected AI model for this invocation.
|
|
231
|
+
* @returns The controls for physical admission, validation, and accounting.
|
|
232
|
+
*/
|
|
233
|
+
private control;
|
|
234
|
+
/**
|
|
235
|
+
* Checks cancellation and the selected operation deadline.
|
|
236
|
+
*
|
|
237
|
+
* @param deadline Operation deadline, when configured.
|
|
238
|
+
* @returns Whether the session remains active and before its deadline.
|
|
239
|
+
*/
|
|
240
|
+
private hasAuthority;
|
|
241
|
+
/**
|
|
242
|
+
* Creates one fresh physical request with per-capability request count.
|
|
243
|
+
*
|
|
244
|
+
* @param _request Original request retained for callback compatibility.
|
|
245
|
+
* @param attempts Physical attempt state for this invocation.
|
|
246
|
+
* @param audit Retained history audit for this invocation.
|
|
247
|
+
* @param deadline Operation deadline, when configured.
|
|
248
|
+
* @param model Selected AI model for this invocation.
|
|
249
|
+
* @param number Physical attempt sequence number.
|
|
250
|
+
* @returns The admitted physical attempt or a safe failure.
|
|
251
|
+
*/
|
|
252
|
+
private beginAttempt;
|
|
253
|
+
/**
|
|
254
|
+
* Sets a fresh transport ticket only after its start audit settles.
|
|
255
|
+
*
|
|
256
|
+
* @param attempts Physical attempt state for this invocation.
|
|
257
|
+
* @param deadline Operation deadline, when configured.
|
|
258
|
+
* @param id Typed identifier of the requested item.
|
|
259
|
+
* @param model Selected AI model for this invocation.
|
|
260
|
+
* @returns The reserved transport ticket after its start audit.
|
|
261
|
+
*/
|
|
262
|
+
private newTicket;
|
|
263
|
+
/**
|
|
264
|
+
* Acquires full output credit before transport starts.
|
|
265
|
+
*
|
|
266
|
+
* @param attempts Physical attempt state for this invocation.
|
|
267
|
+
* @param bytes Measured serialized byte count.
|
|
268
|
+
* @param credit Reserved input and output byte credit.
|
|
269
|
+
* @param id Typed identifier of the requested item.
|
|
270
|
+
* @param model Selected AI model for this invocation.
|
|
271
|
+
* @returns The transport ticket with full response credit reserved.
|
|
272
|
+
*/
|
|
273
|
+
private reserveTransport;
|
|
274
|
+
/**
|
|
275
|
+
* Gets one existing reservation for a physical receipt.
|
|
276
|
+
*
|
|
277
|
+
* @param attempts Physical attempt state for this invocation.
|
|
278
|
+
* @param id Typed identifier of the requested item.
|
|
279
|
+
* @returns The active physical reservation for the supplied ticket ID.
|
|
280
|
+
*/
|
|
281
|
+
private ticket;
|
|
282
|
+
/**
|
|
283
|
+
* Completes measured response bytes without replay state.
|
|
284
|
+
*
|
|
285
|
+
* @param attempts Physical attempt state for this invocation.
|
|
286
|
+
* @param audit Retained history audit for this invocation.
|
|
287
|
+
* @param completion Completed provider attempt or operation.
|
|
288
|
+
* @returns Completion after response accounting and audit settle.
|
|
289
|
+
*/
|
|
290
|
+
private finishAttempt;
|
|
291
|
+
/**
|
|
292
|
+
* Returns one safe local diagnostic without a durable execution record.
|
|
293
|
+
*
|
|
294
|
+
* @param code Recorded failure code.
|
|
295
|
+
* @param retryableByNewSignal Whether a fresh signal may retry this failure.
|
|
296
|
+
* @returns A safe local AI failure without persisted execution status.
|
|
297
|
+
*/
|
|
298
|
+
private failure;
|
|
299
|
+
}
|
|
300
|
+
//# sourceMappingURL=agent-live-ai-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-live-ai-runtime.d.ts","sourceRoot":"","sources":["../../src/agent/agent-live-ai-runtime.ts"],"names":[],"mappings":"AAcA,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EACV,OAAO,EAEP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,OAAO,EACP,QAAQ,EACT,MAAM,wBAAwB,CAAC;AAgBhC,OAAO,EACL,WAAW,EAGX,oBAAoB,EAIrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAA4B,MAAM,wBAAwB,CAA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