@letta-ai/letta-code 0.34.3 → 0.34.4
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/dist/gateway-core.js +166 -621
- package/dist/gateway-core.js.map +8 -13
- package/dist/mcp-client.js +2 -2
- package/dist/mcp-client.js.map +1 -1
- package/dist/mcp-oauth.js +2 -2
- package/dist/mcp-oauth.js.map +1 -1
- package/dist/types/agent/subagents/manager.d.ts.map +1 -1
- package/dist/types/agent/subagents/sandbox.d.ts +6 -0
- package/dist/types/agent/subagents/sandbox.d.ts.map +1 -1
- package/dist/types/channels/gateway-core.d.ts +50 -8
- package/dist/types/channels/gateway-core.d.ts.map +1 -1
- package/dist/types/channels/gateway-sources.d.ts +0 -1
- package/dist/types/channels/gateway-sources.d.ts.map +1 -1
- package/dist/types/channels/message-channel-executor.d.ts +0 -1
- package/dist/types/channels/message-channel-executor.d.ts.map +1 -1
- package/dist/types/channels/message-channel-idempotency.d.ts +5 -14
- package/dist/types/channels/message-channel-idempotency.d.ts.map +1 -1
- package/dist/types/channels/message-channel-tool-definition.d.ts +1 -4
- package/dist/types/channels/message-channel-tool-definition.d.ts.map +1 -1
- package/dist/types/channels/plugin-types.d.ts +2 -3
- package/dist/types/channels/plugin-types.d.ts.map +1 -1
- package/dist/types/channels/types.d.ts +1 -3
- package/dist/types/channels/types.d.ts.map +1 -1
- package/dist/types/types/protocol_v2.d.ts +11 -5
- package/dist/types/types/protocol_v2.d.ts.map +1 -1
- package/dist/types/websocket/listener/queue.d.ts.map +1 -1
- package/letta.js +233 -804
- package/package.json +1 -1
- package/scripts/source-file-size-baseline.json +1 -1
- package/dist/types/channels/gateway-assistant-relay.d.ts +0 -37
- package/dist/types/channels/gateway-assistant-relay.d.ts.map +0 -1
- package/dist/types/channels/gateway-registration-policy.d.ts +0 -14
- package/dist/types/channels/gateway-registration-policy.d.ts.map +0 -1
- package/dist/types/channels/gateway-runtime-registration.d.ts +0 -12
- package/dist/types/channels/gateway-runtime-registration.d.ts.map +0 -1
- package/dist/types/channels/gateway-runtime-state.d.ts +0 -48
- package/dist/types/channels/gateway-runtime-state.d.ts.map +0 -1
- package/dist/types/channels/gateway-runtime-tool-scopes.d.ts +0 -26
- package/dist/types/channels/gateway-runtime-tool-scopes.d.ts.map +0 -1
- package/dist/types/channels/gateway-types.d.ts +0 -71
- package/dist/types/channels/gateway-types.d.ts.map +0 -1
- package/dist/types/types/channel-account-protocol.d.ts +0 -14
- package/dist/types/types/channel-account-protocol.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"src/settings-manager.ts": 2092,
|
|
36
36
|
"src/tools/manager.ts": 2610,
|
|
37
37
|
"src/tools/tool-execution-context.test.ts": 1092,
|
|
38
|
-
"src/types/protocol_v2.ts":
|
|
38
|
+
"src/types/protocol_v2.ts": 2548,
|
|
39
39
|
"src/websocket/listen-client-concurrency.test.ts": 2557,
|
|
40
40
|
"src/websocket/listen-client-protocol.test.ts": 5707,
|
|
41
41
|
"src/websocket/listener/commands/memory.ts": 1114,
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { StopReasonType, StreamDeltaMessage } from "../types/app-server-protocol";
|
|
2
|
-
import type { MessageChannelIdempotencyScope } from "./message-channel-idempotency";
|
|
3
|
-
import type { ChannelTurnSource } from "./types";
|
|
4
|
-
export interface GatewayAssistantTextAccumulatorState {
|
|
5
|
-
currentMessageId: string | null;
|
|
6
|
-
currentText: string;
|
|
7
|
-
deltaKeys: string[];
|
|
8
|
-
finalizedMessageIds: string[];
|
|
9
|
-
}
|
|
10
|
-
export interface FinalizedGatewayAssistantMessage {
|
|
11
|
-
messageId: string;
|
|
12
|
-
text: string;
|
|
13
|
-
}
|
|
14
|
-
export declare class GatewayAssistantTextAccumulator {
|
|
15
|
-
private currentMessageId;
|
|
16
|
-
private currentText;
|
|
17
|
-
private readonly deltaKeys;
|
|
18
|
-
private readonly finalizedMessageIds;
|
|
19
|
-
constructor(state?: GatewayAssistantTextAccumulatorState);
|
|
20
|
-
snapshot(): GatewayAssistantTextAccumulatorState;
|
|
21
|
-
handleDelta(message: StreamDeltaMessage): FinalizedGatewayAssistantMessage[];
|
|
22
|
-
finalizeCurrent(): FinalizedGatewayAssistantMessage | null;
|
|
23
|
-
}
|
|
24
|
-
export declare function relayFinalizedAssistantMessage(options: {
|
|
25
|
-
message: FinalizedGatewayAssistantMessage;
|
|
26
|
-
sources: ChannelTurnSource[];
|
|
27
|
-
idempotencyScope: MessageChannelIdempotencyScope;
|
|
28
|
-
relay?: (options: {
|
|
29
|
-
text: string;
|
|
30
|
-
sources: ChannelTurnSource[];
|
|
31
|
-
idempotencyScope: MessageChannelIdempotencyScope;
|
|
32
|
-
}) => void | Promise<void>;
|
|
33
|
-
}): void | Promise<void>;
|
|
34
|
-
export declare function stopReasonFromDelta(message: StreamDeltaMessage): StopReasonType | null;
|
|
35
|
-
export declare function runIdFromDelta(message: StreamDeltaMessage): string | undefined;
|
|
36
|
-
export declare function channelTurnOutcome(stopReason: StopReasonType): "completed" | "error" | "cancelled";
|
|
37
|
-
//# sourceMappingURL=gateway-assistant-relay.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-assistant-relay.d.ts","sourceRoot":"","sources":["../../../src/channels/gateway-assistant-relay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,MAAM,WAAW,oCAAoC;IACnD,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,gCAAgC;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,+BAA+B;IAC1C,OAAO,CAAC,gBAAgB,CAAgB;IACxC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;IACxC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAc;gBAEtC,KAAK,CAAC,EAAE,oCAAoC;IAOxD,QAAQ,IAAI,oCAAoC;IAShD,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,gCAAgC,EAAE;IA2C5E,eAAe,IAAI,gCAAgC,GAAG,IAAI;CAS3D;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE;IACtD,OAAO,EAAE,gCAAgC,CAAC;IAC1C,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,gBAAgB,EAAE,8BAA8B,CAAC;IACjD,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,iBAAiB,EAAE,CAAC;QAC7B,gBAAgB,EAAE,8BAA8B,CAAC;KAClD,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBvB;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,kBAAkB,GAC1B,cAAc,GAAG,IAAI,CAOvB;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,kBAAkB,GAC1B,MAAM,GAAG,SAAS,CAGpB;AAED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,cAAc,GACzB,WAAW,GAAG,OAAO,GAAG,WAAW,CAKrC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { RuntimeScope, RuntimeStartResponseMessage } from "../types/app-server-protocol";
|
|
2
|
-
import type { ChannelGatewayHooks, ChannelGatewayModelStatus } from "./gateway-types";
|
|
3
|
-
import type { ChannelTurnSource } from "./types";
|
|
4
|
-
export declare function prepareGatewayRegistrationPolicy(options: {
|
|
5
|
-
hooks: ChannelGatewayHooks;
|
|
6
|
-
runtime: RuntimeScope;
|
|
7
|
-
sources: ChannelTurnSource[];
|
|
8
|
-
override?: boolean;
|
|
9
|
-
}): Promise<{
|
|
10
|
-
automaticRelay: boolean;
|
|
11
|
-
tool: Awaited<ReturnType<ChannelGatewayHooks["buildExternalTool"]>>;
|
|
12
|
-
}>;
|
|
13
|
-
export declare function modelStatusFromRuntimeStart(response: RuntimeStartResponseMessage, runtime: RuntimeScope): ChannelGatewayModelStatus;
|
|
14
|
-
//# sourceMappingURL=gateway-registration-policy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-registration-policy.d.ts","sourceRoot":"","sources":["../../../src/channels/gateway-registration-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,2BAA2B,EAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,wBAAsB,gCAAgC,CAAC,OAAO,EAAE;IAC9D,KAAK,EAAE,mBAAmB,CAAC;IAC3B,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,OAAO,CAAC;IACV,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;CACrE,CAAC,CAeD;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,2BAA2B,EACrC,OAAO,EAAE,YAAY,GACpB,yBAAyB,CAiB3B"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { RuntimeStartExternalToolsGroup } from "../types/app-server-protocol";
|
|
2
|
-
import type { GatewayRuntimeState } from "./gateway-runtime-state";
|
|
3
|
-
import type { ChannelGatewayClient, ChannelGatewayDelivery, ChannelGatewayHooks } from "./gateway-types";
|
|
4
|
-
export declare function performGatewayRuntimeRegistration(options: {
|
|
5
|
-
client: ChannelGatewayClient;
|
|
6
|
-
hooks: ChannelGatewayHooks;
|
|
7
|
-
state: GatewayRuntimeState;
|
|
8
|
-
delivery: ChannelGatewayDelivery;
|
|
9
|
-
policyOverride?: boolean;
|
|
10
|
-
externalToolsOverride?: readonly RuntimeStartExternalToolsGroup[];
|
|
11
|
-
}): Promise<boolean>;
|
|
12
|
-
//# sourceMappingURL=gateway-runtime-registration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-runtime-registration.d.ts","sourceRoot":"","sources":["../../../src/channels/gateway-runtime-registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAKlF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AAEzB,wBAAsB,iCAAiC,CAAC,OAAO,EAAE;IAC/D,MAAM,EAAE,oBAAoB,CAAC;IAC7B,KAAK,EAAE,mBAAmB,CAAC;IAC3B,KAAK,EAAE,mBAAmB,CAAC;IAC3B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qBAAqB,CAAC,EAAE,SAAS,8BAA8B,EAAE,CAAC;CACnE,GAAG,OAAO,CAAC,OAAO,CAAC,CAsEnB"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { RuntimeScope } from "../types/app-server-protocol";
|
|
2
|
-
import type { GatewayAssistantTextAccumulator } from "./gateway-assistant-relay";
|
|
3
|
-
import type { GatewayToolScope } from "./gateway-runtime-tool-scopes";
|
|
4
|
-
import type { ChannelGatewayModelStatus, ChannelGatewayRichDraft } from "./gateway-types";
|
|
5
|
-
import type { MessageChannelIdempotencyScope } from "./message-channel-idempotency";
|
|
6
|
-
import type { createChannelTurnProgressBuilder } from "./progress-builder";
|
|
7
|
-
import type { ChannelTurnSource } from "./types";
|
|
8
|
-
export type ActiveGatewayTurn = {
|
|
9
|
-
batchId: string;
|
|
10
|
-
routingSources: ChannelTurnSource[];
|
|
11
|
-
lifecycleSources: ChannelTurnSource[];
|
|
12
|
-
progress: ReturnType<typeof createChannelTurnProgressBuilder>;
|
|
13
|
-
richDraft: ChannelGatewayRichDraft | null;
|
|
14
|
-
runId?: string;
|
|
15
|
-
assistantText: GatewayAssistantTextAccumulator;
|
|
16
|
-
idempotencyScope: MessageChannelIdempotencyScope;
|
|
17
|
-
relayEligible: boolean;
|
|
18
|
-
toolScopes: GatewayToolScope[];
|
|
19
|
-
};
|
|
20
|
-
export type GatewayRuntimeState = {
|
|
21
|
-
runtime: RuntimeScope;
|
|
22
|
-
pendingSourcesByClientMessageId: Map<string, {
|
|
23
|
-
sources: ChannelTurnSource[];
|
|
24
|
-
disposition: "submitting" | "queued";
|
|
25
|
-
automaticRelay: boolean;
|
|
26
|
-
toolScope?: GatewayToolScope;
|
|
27
|
-
removalDisposition?: "dequeued" | "cancelled";
|
|
28
|
-
}>;
|
|
29
|
-
active: ActiveGatewayTurn | null;
|
|
30
|
-
registrationSignature: string | null;
|
|
31
|
-
registration: Promise<void> | null;
|
|
32
|
-
routedSources: ChannelTurnSource[];
|
|
33
|
-
replayedControlRequestIds: Set<string>;
|
|
34
|
-
submissionQueue: Promise<void>;
|
|
35
|
-
hookQueue: Promise<void> | null;
|
|
36
|
-
acceptedClientMessageIds: Set<string>;
|
|
37
|
-
modelStatus: ChannelGatewayModelStatus | null;
|
|
38
|
-
};
|
|
39
|
-
export declare function gatewayRuntimeKey(runtime: RuntimeScope<string | null>): string;
|
|
40
|
-
export declare function hasAgentRuntime<T extends {
|
|
41
|
-
runtime?: RuntimeScope<string | null> | null;
|
|
42
|
-
}>(value: T): value is T & {
|
|
43
|
-
runtime: RuntimeScope;
|
|
44
|
-
};
|
|
45
|
-
export declare function hasGatewayRuntimeWork(state: GatewayRuntimeState | undefined): boolean;
|
|
46
|
-
export declare function rememberAcceptedClientMessageId(state: GatewayRuntimeState, clientMessageId: string): void;
|
|
47
|
-
export declare function remainingGatewaySources(state: GatewayRuntimeState): ChannelTurnSource[];
|
|
48
|
-
//# sourceMappingURL=gateway-runtime-state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-runtime-state.d.ts","sourceRoot":"","sources":["../../../src/channels/gateway-runtime-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,KAAK,EACV,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAIjD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,iBAAiB,EAAE,CAAC;IACpC,gBAAgB,EAAE,iBAAiB,EAAE,CAAC;IACtC,QAAQ,EAAE,UAAU,CAAC,OAAO,gCAAgC,CAAC,CAAC;IAC9D,SAAS,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC1C,KAAK,CAAC,EAAE,MAAM,C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AAA;CAAE,CAElD;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,mBAAmB,GAAG,SAAS,GACrC,OAAO,CAIT;AAED,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,mBAAmB,EAC1B,eAAe,EAAE,MAAM,GACtB,IAAI,CAON;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,mBAAmB,GACzB,iBAAiB,EAAE,CAOrB"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ExternalToolDefinitionPayload, RuntimeExternalToolsUpdateGroup, RuntimeScope, RuntimeStartExternalToolsGroup } from "../types/app-server-protocol";
|
|
2
|
-
import type { ChannelGatewayClient, ChannelGatewayToolScopeState } from "./gateway-types";
|
|
3
|
-
import type { ChannelTurnSource } from "./types";
|
|
4
|
-
export type GatewayToolScope = ChannelGatewayToolScopeState;
|
|
5
|
-
export declare class GatewayRuntimeToolScopes {
|
|
6
|
-
private readonly client;
|
|
7
|
-
private readonly states;
|
|
8
|
-
private readonly retryTimers;
|
|
9
|
-
private closed;
|
|
10
|
-
constructor(client: ChannelGatewayClient);
|
|
11
|
-
create(runtime: RuntimeScope, sources: ChannelTurnSource[], automaticRelay: boolean, tool: ExternalToolDefinitionPayload | null): GatewayToolScope;
|
|
12
|
-
retain(scope: GatewayToolScope): void;
|
|
13
|
-
detach(scope: GatewayToolScope): GatewayToolScope;
|
|
14
|
-
release(scope: GatewayToolScope): void;
|
|
15
|
-
resolve(runtime: RuntimeScope<string | null>, scopeId: string): GatewayToolScope | null;
|
|
16
|
-
selection(scope: GatewayToolScope): string[];
|
|
17
|
-
hasRetainedScopes(runtime: RuntimeScope<string | null>): boolean;
|
|
18
|
-
registrationGroups(runtime: RuntimeScope<string | null>, includeUnscoped: boolean): readonly RuntimeStartExternalToolsGroup[];
|
|
19
|
-
setDesiredUnscoped(runtime: RuntimeScope<string | null>, groups: readonly RuntimeStartExternalToolsGroup[]): void;
|
|
20
|
-
updateDesiredUnscoped(updates: readonly RuntimeExternalToolsUpdateGroup[], isBusy: (runtime: RuntimeScope<string | null>) => boolean): Promise<void>;
|
|
21
|
-
flushWhenIdle(runtime: RuntimeScope<string | null>, isBusy: () => boolean, schedule: (task: () => Promise<void>) => Promise<void>): void;
|
|
22
|
-
forgetRuntime(runtime: RuntimeScope<string | null>): void;
|
|
23
|
-
close(): void;
|
|
24
|
-
private getState;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=gateway-runtime-tool-scopes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-runtime-tool-scopes.d.ts","sourceRoot":"","sources":["../../../src/channels/gateway-runtime-tool-scopes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,+BAA+B,EAC/B,YAAY,EACZ,8BAA8B,EAC/B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAQjD,MAAM,MAAM,gBAAgB,GAAG,4BAA4B,CAAC;AAQ5D,qBAAa,wBAAwB;IAKvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;IAC9D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA6B;IACzD,OAAO,CAAC,MAAM,CAAS;gBAEM,MAAM,EAAE,oBAAoB;IAEzD,MAAM,CACJ,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,iBAAiB,EAAE,EAC5B,cAAc,EAAE,OAAO,EACvB,IAAI,EAAE,6BAA6B,GAAG,IAAI,GACzC,gBAAgB;IAenB,MAAM,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAIrC,MAAM,CAAC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB;IAKjD,OAAO,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAItC,OAAO,CACL,OAAO,EAAE,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,EACpC,OAAO,EAAE,MAAM,GACd,gBAAgB,GAAG,IAAI;IAI1B,SAAS,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,EAAE;IAI5C,iBAAiB,CAAC,OAAO,EAAE,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,OAAO;IAIhE,kBAAkB,CAChB,OAAO,EAAE,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,EACpC,eAAe,EAAE,OAAO,GACvB,SAAS,8BAA8B,EAAE;IAS5C,kBAAkB,CAChB,OAAO,EAAE,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,EACpC,MAAM,EAAE,SAAS,8BAA8B,EAAE,GAChD,IAAI;IAID,qBAAqB,CACzB,OAAO,EAAE,SAAS,+BAA+B,EAAE,EACnD,MAAM,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,OAAO,GACxD,OAAO,CAAC,IAAI,CAAC;IAoChB,aAAa,CACX,OAAO,EAAE,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,EACpC,MAAM,EAAE,MAAM,OAAO,EACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GACrD,IAAI;IA4BP,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI;IAIzD,KAAK,IAAI,IAAI;IAOb,OAAO,CAAC,QAAQ;CASjB"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { MessageCreate } from "@letta-ai/letta-client/resources/agents/agents";
|
|
2
|
-
import type { ExternalToolCallRequestMessage, ExternalToolCallResult, ExternalToolDefinitionPayload, InputAcceptedResponseMessage, InputCommand, RuntimeExternalToolsUpdateGroup, RuntimeExternalToolsUpdateResponseMessage, RuntimeScope, RuntimeStartCommand, RuntimeStartExternalToolsGroup, RuntimeStartResponseMessage, WsProtocolMessage } from "../types/app-server-protocol";
|
|
3
|
-
import type { GatewayAssistantTextAccumulatorState } from "./gateway-assistant-relay";
|
|
4
|
-
import type { MessageChannelIdempotencyScope, MessageChannelIdempotencyState } from "./message-channel-idempotency";
|
|
5
|
-
import type { ChannelControlRequestEvent, ChannelDefaultPermissionMode, ChannelTurnLifecycleEvent, ChannelTurnProgressEvent, ChannelTurnSource } from "./types";
|
|
6
|
-
export interface ChannelGatewayClient {
|
|
7
|
-
close(): void;
|
|
8
|
-
onMessage(listener: (message: WsProtocolMessage) => void): () => void;
|
|
9
|
-
onExternalToolCall(handler: (request: ExternalToolCallRequestMessage) => Promise<ExternalToolCallResult> | ExternalToolCallResult): () => void;
|
|
10
|
-
submitInput(command: Omit<InputCommand, "type">): Promise<InputAcceptedResponseMessage>;
|
|
11
|
-
runtimeStart(options: Omit<RuntimeStartCommand, "type" | "request_id"> & {
|
|
12
|
-
request_id?: string;
|
|
13
|
-
}): Promise<RuntimeStartResponseMessage>;
|
|
14
|
-
runtimeExternalToolsUpdate(options: {
|
|
15
|
-
updates: readonly RuntimeExternalToolsUpdateGroup[];
|
|
16
|
-
}): Promise<RuntimeExternalToolsUpdateResponseMessage>;
|
|
17
|
-
}
|
|
18
|
-
export interface ChannelGatewayHooks {
|
|
19
|
-
buildExternalTool(runtime: RuntimeScope, sources: ChannelTurnSource[], policy?: {
|
|
20
|
-
automaticRelay: boolean;
|
|
21
|
-
}): Promise<ExternalToolDefinitionPayload | null>;
|
|
22
|
-
resolveAssistantRelayPolicy?(runtime: RuntimeScope, sources: ChannelTurnSource[]): boolean | Promise<boolean>;
|
|
23
|
-
executeExternalTool(request: ExternalToolCallRequestMessage, sources: ChannelTurnSource[], idempotencyScope?: MessageChannelIdempotencyScope | null): Promise<ExternalToolCallResult> | ExternalToolCallResult;
|
|
24
|
-
relayAssistantText?(options: {
|
|
25
|
-
text: string;
|
|
26
|
-
sources: ChannelTurnSource[];
|
|
27
|
-
idempotencyScope: MessageChannelIdempotencyScope;
|
|
28
|
-
}): void | Promise<void>;
|
|
29
|
-
onLifecycle(event: ChannelTurnLifecycleEvent): void | Promise<void>;
|
|
30
|
-
onProgress(event: ChannelTurnProgressEvent): void | Promise<void>;
|
|
31
|
-
onControlRequest(event: ChannelControlRequestEvent): void | Promise<void>;
|
|
32
|
-
createRichDraft?(options: {
|
|
33
|
-
batchId: string;
|
|
34
|
-
sources: ChannelTurnSource[];
|
|
35
|
-
}): ChannelGatewayRichDraft | null;
|
|
36
|
-
}
|
|
37
|
-
export interface ChannelGatewayDelivery {
|
|
38
|
-
runtime: RuntimeScope;
|
|
39
|
-
content: MessageCreate["content"];
|
|
40
|
-
sources: ChannelTurnSource[];
|
|
41
|
-
clientMessageId: string;
|
|
42
|
-
defaultPermissionMode?: ChannelDefaultPermissionMode;
|
|
43
|
-
}
|
|
44
|
-
export interface ChannelGatewayActiveTurnState {
|
|
45
|
-
assistantText: GatewayAssistantTextAccumulatorState;
|
|
46
|
-
idempotency: MessageChannelIdempotencyState;
|
|
47
|
-
/** Effective policy captured when this turn was registered. */
|
|
48
|
-
automaticRelay?: boolean;
|
|
49
|
-
/** Immutable scoped tool registrations retained across ownership handoff. */
|
|
50
|
-
toolScopes?: ChannelGatewayToolScopeState[];
|
|
51
|
-
}
|
|
52
|
-
export interface ChannelGatewayToolScopeState {
|
|
53
|
-
id: string;
|
|
54
|
-
runtime: RuntimeScope;
|
|
55
|
-
sources: ChannelTurnSource[];
|
|
56
|
-
automaticRelay: boolean;
|
|
57
|
-
group?: RuntimeStartExternalToolsGroup;
|
|
58
|
-
}
|
|
59
|
-
export type ChannelGatewayHandoffDelivery = Omit<ChannelGatewayDelivery, "content"> & {
|
|
60
|
-
activeTurnState?: ChannelGatewayActiveTurnState;
|
|
61
|
-
};
|
|
62
|
-
export interface ChannelGatewayRichDraft {
|
|
63
|
-
handleDelta(delta: import("../types/app-server-protocol").StreamDeltaMessage["delta"]): void;
|
|
64
|
-
flushPending(): Promise<void>;
|
|
65
|
-
dispose(): void;
|
|
66
|
-
}
|
|
67
|
-
export interface ChannelGatewayModelStatus {
|
|
68
|
-
modelHandle: string | null;
|
|
69
|
-
scope: "agent" | "conversation";
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=gateway-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-types.d.ts","sourceRoot":"","sources":["../../../src/channels/gateway-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,KAAK,EACV,8BAA8B,EAC9B,sBAAsB,EACtB,6BAA6B,EAC7B,4BAA4B,EAC5B,YAAY,EACZ,+BAA+B,EAC/B,yCAAyC,EACzC,YAAY,EACZ,mBAAmB,EACnB,8BAA8B,EAC9B,2BAA2B,EAC3B,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,KAAK,EACV,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACV,0BAA0B,EAC1B,4BAA4B,EAC5B,yBAAyB,EACzB,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,oBAAoB;IACnC,KAAK,IAAI,IAAI,CAAC;IACd,SAAS,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACtE,kBAAkB,CAChB,OAAO,EAAE,CACP,OAAO,EAAE,8BAA8B,KACpC,OAAO,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,GAC5D,MAAM,IAAI,CAAC;IACd,WAAW,CACT,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,GAClC,OAAO,CAAC,4BAA4B,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KAAK,EAAE,OAAO,GAAG,cAAc,CAAC;CACjC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type DmPolicy = "pairing" | "allowlist" | "open";
|
|
2
|
-
export type ChannelReplyMode = "tool" | "relay";
|
|
3
|
-
export type ChannelPluginConfig = Record<string, unknown>;
|
|
4
|
-
export interface ChannelAccountCreatePayload {
|
|
5
|
-
account_id?: string;
|
|
6
|
-
display_name?: string;
|
|
7
|
-
enabled?: boolean;
|
|
8
|
-
dm_policy?: DmPolicy;
|
|
9
|
-
reply_mode?: ChannelReplyMode;
|
|
10
|
-
allowed_users?: string[];
|
|
11
|
-
/** Plugin-owned account config. New fields should be added here, not centrally. */
|
|
12
|
-
config?: ChannelPluginConfig;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=channel-account-protocol.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"channel-account-protocol.d.ts","sourceRoot":"","sources":["../../../src/types/channel-account-protocol.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;AACxD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,CAAC;AAChD,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1D,MAAM,WAAW,2BAA2B;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,mFAAmF;IACnF,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B"}
|