@illalabs/interfaces 0.8.0 → 0.8.1-canary-beta-9cda8b33
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/interfaces/chat/response.d.ts +5 -5
- package/dist/interfaces/chat/response.d.ts.map +1 -1
- package/dist/schemas/chatContext.d.ts +3 -3
- package/dist/schemas/chatRequestBody.d.ts +12 -12
- package/dist/schemas/executionCheckerQueryParams.d.ts +2 -2
- package/dist/schemas/illaTools.d.ts +6 -6
- package/dist/schemas/illaTools.d.ts.map +1 -1
- package/dist/schemas/illaTools.js +3 -2
- package/dist/schemas/illaTools.js.map +1 -1
- package/dist/schemas/messages.d.ts +12 -12
- package/dist/schemas/messages.d.ts.map +1 -1
- package/dist/schemas/messages.js +2 -1
- package/dist/schemas/messages.js.map +1 -1
- package/dist/schemas/planningRuntime.d.ts +6 -6
- package/dist/schemas/telemetryEvents.d.ts +81 -81
- package/dist/schemas/telemetryEvents.d.ts.map +1 -1
- package/dist/schemas/telemetryEvents.js +2 -1
- package/dist/schemas/telemetryEvents.js.map +1 -1
- package/dist/tools/IllaToolError.d.ts +6 -5
- package/dist/tools/IllaToolError.d.ts.map +1 -1
- package/dist/tools/IllaToolError.js.map +1 -1
- package/dist/tools/IllaToolOutcome.d.ts +4 -3
- package/dist/tools/IllaToolOutcome.d.ts.map +1 -1
- package/dist/tools/IllaToolOutcome.js.map +1 -1
- package/dist/types/actions/index.d.ts +1 -0
- package/dist/types/actions/index.d.ts.map +1 -1
- package/dist/types/actions/index.js +1 -0
- package/dist/types/actions/index.js.map +1 -1
- package/dist/types/actions/outputs/defi.output.d.ts +11 -0
- package/dist/types/actions/outputs/defi.output.d.ts.map +1 -0
- package/dist/types/actions/outputs/defi.output.js +2 -0
- package/dist/types/actions/outputs/defi.output.js.map +1 -0
- package/dist/types/actions/outputs/exchangeRate.output.d.ts +15 -0
- package/dist/types/actions/outputs/exchangeRate.output.d.ts.map +1 -0
- package/dist/types/actions/outputs/exchangeRate.output.js +2 -0
- package/dist/types/actions/outputs/exchangeRate.output.js.map +1 -0
- package/dist/types/actions/outputs/index.d.ts +7 -0
- package/dist/types/actions/outputs/index.d.ts.map +1 -0
- package/dist/types/actions/outputs/index.js +6 -0
- package/dist/types/actions/outputs/index.js.map +1 -0
- package/dist/types/actions/outputs/polymarket.output.d.ts +37 -0
- package/dist/types/actions/outputs/polymarket.output.d.ts.map +1 -0
- package/dist/types/actions/outputs/polymarket.output.js +2 -0
- package/dist/types/actions/outputs/polymarket.output.js.map +1 -0
- package/dist/types/actions/outputs/predictionMarket.output.d.ts +68 -0
- package/dist/types/actions/outputs/predictionMarket.output.d.ts.map +1 -0
- package/dist/types/actions/outputs/predictionMarket.output.js +2 -0
- package/dist/types/actions/outputs/predictionMarket.output.js.map +1 -0
- package/dist/types/actions/outputs/walletBalance.output.d.ts +18 -0
- package/dist/types/actions/outputs/walletBalance.output.d.ts.map +1 -0
- package/dist/types/actions/outputs/walletBalance.output.js +2 -0
- package/dist/types/actions/outputs/walletBalance.output.js.map +1 -0
- package/dist/types/actions/outputs.d.ts +39 -0
- package/dist/types/actions/outputs.d.ts.map +1 -1
- package/dist/types/illaMessage.d.ts +57 -0
- package/dist/types/illaMessage.d.ts.map +1 -0
- package/dist/types/illaMessage.js +2 -0
- package/dist/types/illaMessage.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/telemetry.d.ts +28 -5
- package/dist/types/telemetry.d.ts.map +1 -1
- package/dist/types/telemetry.js +1 -1
- package/dist/types/telemetry.js.map +1 -1
- package/dist/types/typedToolTypes.d.ts +65 -0
- package/dist/types/typedToolTypes.d.ts.map +1 -0
- package/dist/types/typedToolTypes.js +2 -0
- package/dist/types/typedToolTypes.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { FilePart, ProviderOptions, ReasoningPart, SystemModelMessage, TextPart, ToolApprovalRequest, ToolApprovalResponse, UserModelMessage } from "@ai-sdk/provider-utils";
|
|
2
|
+
import type { SupportedAction } from "../utils/constants.js";
|
|
3
|
+
import type { ActionOutputMapping } from "./actions/outputs.js";
|
|
4
|
+
export type IllaToolCallPart<A extends SupportedAction = SupportedAction> = {
|
|
5
|
+
type: "tool-call";
|
|
6
|
+
toolCallId: string;
|
|
7
|
+
toolName: A;
|
|
8
|
+
input: unknown;
|
|
9
|
+
providerOptions?: ProviderOptions;
|
|
10
|
+
providerExecuted?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type IllaToolResultOutput<A extends SupportedAction = SupportedAction> = {
|
|
13
|
+
type: "json";
|
|
14
|
+
value: ActionOutputMapping[A];
|
|
15
|
+
providerOptions?: ProviderOptions;
|
|
16
|
+
} | {
|
|
17
|
+
type: "text";
|
|
18
|
+
value: string;
|
|
19
|
+
providerOptions?: ProviderOptions;
|
|
20
|
+
} | {
|
|
21
|
+
type: "error-text";
|
|
22
|
+
value: string;
|
|
23
|
+
providerOptions?: ProviderOptions;
|
|
24
|
+
} | {
|
|
25
|
+
type: "error-json";
|
|
26
|
+
value: unknown;
|
|
27
|
+
providerOptions?: ProviderOptions;
|
|
28
|
+
} | {
|
|
29
|
+
type: "execution-denied";
|
|
30
|
+
reason?: string;
|
|
31
|
+
providerOptions?: ProviderOptions;
|
|
32
|
+
};
|
|
33
|
+
export type IllaToolResultPart<A extends SupportedAction = SupportedAction> = {
|
|
34
|
+
type: "tool-result";
|
|
35
|
+
toolCallId: string;
|
|
36
|
+
toolName: A;
|
|
37
|
+
output: IllaToolResultOutput<A>;
|
|
38
|
+
providerOptions?: ProviderOptions;
|
|
39
|
+
};
|
|
40
|
+
export type TypedToolCallPart = {
|
|
41
|
+
[A in SupportedAction]: IllaToolCallPart<A>;
|
|
42
|
+
}[SupportedAction];
|
|
43
|
+
export type TypedToolResultPart = {
|
|
44
|
+
[A in SupportedAction]: IllaToolResultPart<A>;
|
|
45
|
+
}[SupportedAction];
|
|
46
|
+
export type IllaAssistantMessage = {
|
|
47
|
+
role: "assistant";
|
|
48
|
+
content: string | Array<TextPart | FilePart | ReasoningPart | TypedToolCallPart | TypedToolResultPart | ToolApprovalRequest>;
|
|
49
|
+
providerOptions?: ProviderOptions;
|
|
50
|
+
};
|
|
51
|
+
export type IllaToolMessage = {
|
|
52
|
+
role: "tool";
|
|
53
|
+
content: Array<TypedToolResultPart | ToolApprovalResponse>;
|
|
54
|
+
providerOptions?: ProviderOptions;
|
|
55
|
+
};
|
|
56
|
+
export type IllaMessage = SystemModelMessage | UserModelMessage | IllaAssistantMessage | IllaToolMessage;
|
|
57
|
+
//# sourceMappingURL=illaMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"illaMessage.d.ts","sourceRoot":"","sources":["../../src/types/illaMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,QAAQ,EACR,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAIhE,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,IAAI;IACxE,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,CAAC,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,IACtE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,m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E,eAAe,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,CAAC,mBAAmB,GAAG,oBAAoB,CAAC,CAAC;IAC3D,eAAe,CAAC,EAAE,eAAe,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,WAAW,GACjB,kBAAkB,GAClB,gBAAgB,GAChB,oBAAoB,GACpB,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"illaMessage.js","sourceRoot":"","sources":["../../src/types/illaMessage.ts"],"names":[],"mappings":""}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
|
package/dist/types/index.js
CHANGED
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
* Event types are inferred from Zod schemas for type-safe runtime validation.
|
|
4
4
|
*/
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
import {
|
|
6
|
+
import type { SupportedAction } from "../utils/constants.js";
|
|
7
|
+
import type { IllaMessage } from "./illaMessage.js";
|
|
8
|
+
import type { TypedIllaToolErrorUnion, TypedPendingToolCallUnion } from "./typedToolTypes.js";
|
|
9
|
+
import { baseTelemetryEventSchema, connectedEventSchema, errorEventDataSchema, errorTelemetryEventSchema, finishEventSchema, iterationEndEventSchema, iterationStartEventSchema, llmEndEventSchema, llmStartEventSchema, planExecutionCompleteEventSchema, planExecutionFailedEventSchema, planExpiredEventSchema, planGeneratedEventSchema, planGeneratingEventSchema, planInvalidatedEventSchema, planStepCompletedEventSchema, planStepRetryingEventSchema, planStepSimulatedEventSchema, planStepStartedEventSchema, planStepVerificationFailedEventSchema, planStepVerificationPassedEventSchema, replanCompleteEventSchema, replanStartedEventSchema, RetryPhaseSchema, scratchpadResetEventSchema, streamEndEventDataSchema, streamEndTelemetryEventSchema, streamEventDataSchema, telemetryEventSchema, telemetryEventTypes, textDeltaEventSchema, toolCallBatchEventSchema, toolResultEventSchema } from "../schemas/telemetryEvents.js";
|
|
7
10
|
/**
|
|
8
11
|
* Types of telemetry events that can be emitted during orchestration.
|
|
9
12
|
* Inferred from telemetryEventTypes schema constant.
|
|
@@ -95,10 +98,30 @@ export type ErrorEvent = z.infer<typeof errorTelemetryEventSchema>;
|
|
|
95
98
|
*/
|
|
96
99
|
export type TelemetryEvent = z.infer<typeof telemetryEventSchema>;
|
|
97
100
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
* Result event data with strongly-typed fields for switch narrowing.
|
|
102
|
+
*
|
|
103
|
+
* Decoupled from `z.infer<typeof resultEventDataSchema>` because Zod infers
|
|
104
|
+
* `pendingTools` as `PendingToolCallType[]` (with `input: unknown`) and
|
|
105
|
+
* `toolErrors` as `IllaToolErrorJSON[]`, neither of which supports
|
|
106
|
+
* discriminated-union narrowing on `toolName`/`name`.
|
|
107
|
+
*
|
|
108
|
+
* The Zod schema is still used for **runtime** validation; this type is
|
|
109
|
+
* the **compile-time** contract that consumers see.
|
|
110
|
+
*/
|
|
111
|
+
export type ValidatedResultEventData = {
|
|
112
|
+
readonly type: "result";
|
|
113
|
+
readonly status: 200;
|
|
114
|
+
readonly messages: IllaMessage[];
|
|
115
|
+
readonly text: string;
|
|
116
|
+
readonly pendingTools?: ReadonlyArray<TypedPendingToolCallUnion>;
|
|
117
|
+
readonly incompleteTools?: ReadonlyArray<{
|
|
118
|
+
readonly toolCallId: string;
|
|
119
|
+
readonly toolName: SupportedAction;
|
|
120
|
+
readonly toolInput?: unknown;
|
|
121
|
+
}>;
|
|
122
|
+
readonly toolErrors?: ReadonlyArray<TypedIllaToolErrorUnion>;
|
|
123
|
+
readonly requestId: string;
|
|
124
|
+
};
|
|
102
125
|
/**
|
|
103
126
|
* Inferred type for error event data from Zod schema.
|
|
104
127
|
* Used by ErrorStreamEvent for type-safe runtime validation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/types/telemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACH,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,gCAAgC,EAChC,8BAA8B,EAC9B,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,qCAAqC,EACrC,qCAAqC,EACrC,yBAAyB,EACzB,wBAAwB,EACxB,
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/types/telemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EACH,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,gCAAgC,EAChC,8BAA8B,EAC9B,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,qCAAqC,EACrC,qCAAqC,EACrC,yBAAyB,EACzB,wBAAwB,EACxB,gBAAgB,EAChB,0BAA0B,EAC1B,wBAAwB,EACxB,6BAA6B,EAC7B,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACxB,MAAM,+BAA+B,CAAC;AAEvC;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,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,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,+EAA+E;AAC/E,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG,2DAA2D;AAC3D,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG,sDAAsD;AACtD,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACnC,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACvB,MAAM,GACN,UAAU,GACV,WAAW,GACX,eAAe,GACf,iBAAiB,GACjB,oBAAoB,GACpB,UAAU,GACV,OAAO,CAAC;AAEd;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACjC,kCAAkC;IAClC,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IACrC,0CAA0C;IAC1C,UAAU,IAAI,IAAI,CAAC;IACnB,kCAAkC;IAClC,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAC/B"}
|
package/dist/types/telemetry.js
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Event types are inferred from Zod schemas for type-safe runtime validation.
|
|
4
4
|
*/
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
import { baseTelemetryEventSchema, connectedEventSchema, errorEventDataSchema, errorTelemetryEventSchema, finishEventSchema, iterationEndEventSchema, iterationStartEventSchema, llmEndEventSchema, llmStartEventSchema, planExecutionCompleteEventSchema, planExecutionFailedEventSchema, planExpiredEventSchema, planGeneratedEventSchema, planGeneratingEventSchema, planInvalidatedEventSchema, planStepCompletedEventSchema, planStepRetryingEventSchema, planStepSimulatedEventSchema, planStepStartedEventSchema, planStepVerificationFailedEventSchema, planStepVerificationPassedEventSchema, replanCompleteEventSchema, replanStartedEventSchema,
|
|
6
|
+
import { baseTelemetryEventSchema, connectedEventSchema, errorEventDataSchema, errorTelemetryEventSchema, finishEventSchema, iterationEndEventSchema, iterationStartEventSchema, llmEndEventSchema, llmStartEventSchema, planExecutionCompleteEventSchema, planExecutionFailedEventSchema, planExpiredEventSchema, planGeneratedEventSchema, planGeneratingEventSchema, planInvalidatedEventSchema, planStepCompletedEventSchema, planStepRetryingEventSchema, planStepSimulatedEventSchema, planStepStartedEventSchema, planStepVerificationFailedEventSchema, planStepVerificationPassedEventSchema, replanCompleteEventSchema, replanStartedEventSchema, RetryPhaseSchema, scratchpadResetEventSchema, streamEndEventDataSchema, streamEndTelemetryEventSchema, streamEventDataSchema, telemetryEventSchema, telemetryEventTypes, textDeltaEventSchema, toolCallBatchEventSchema, toolResultEventSchema, } from "../schemas/telemetryEvents.js";
|
|
7
7
|
//# sourceMappingURL=telemetry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/types/telemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/types/telemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EACH,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,gCAAgC,EAChC,8BAA8B,EAC9B,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,qCAAqC,EACrC,qCAAqC,EACrC,yBAAyB,EACzB,wBAAwB,EACxB,gBAAgB,EAChB,0BAA0B,EAC1B,wBAAwB,EACxB,6BAA6B,EAC7B,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,GACxB,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { IllaToolErrorData } from "../schemas/illaTools.js";
|
|
2
|
+
import type { SimulationResult } from "../schemas/messages.js";
|
|
3
|
+
import type { SupportedAction } from "../utils/constants.js";
|
|
4
|
+
import type { ActionBatchTransactionsOutput, ActionOutputMapping, ActionSequenceOutput, ActionSignatureRequestsOutput, ActionSingleTransactionOutput, EvmTransaction } from "./actions/outputs.js";
|
|
5
|
+
/**
|
|
6
|
+
* Output shapes that produce on-chain operations and appear in pendingTools.
|
|
7
|
+
* The API's OrchestrateOutputBuilder only includes these in pendingTools.
|
|
8
|
+
*/
|
|
9
|
+
type TransactionLikeOutput = ActionBatchTransactionsOutput<EvmTransaction> | ActionSingleTransactionOutput<EvmTransaction> | ActionSignatureRequestsOutput | ActionSequenceOutput<EvmTransaction>;
|
|
10
|
+
/**
|
|
11
|
+
* Computes the subset of SupportedAction whose output is transaction-like.
|
|
12
|
+
* Actions with data-only outputs (ActionDataOutput) are excluded — they
|
|
13
|
+
* never appear in pendingTools at runtime.
|
|
14
|
+
*/
|
|
15
|
+
type PendingToolAction = {
|
|
16
|
+
[A in SupportedAction]: Extract<ActionOutputMapping[A], TransactionLikeOutput> extends never ? never : A;
|
|
17
|
+
}[SupportedAction];
|
|
18
|
+
/**
|
|
19
|
+
* Pending tool call typed by action name.
|
|
20
|
+
* When switching on toolName, `input` auto-narrows to that action's output shape.
|
|
21
|
+
*
|
|
22
|
+
* Note: `input` is named for legacy reasons — it actually holds the action's OUTPUT
|
|
23
|
+
* (the transaction/sequence the client must execute).
|
|
24
|
+
*/
|
|
25
|
+
export type TypedPendingToolCall<A extends PendingToolAction = PendingToolAction> = {
|
|
26
|
+
readonly type: "tool-call";
|
|
27
|
+
readonly toolCallId: string;
|
|
28
|
+
readonly toolName: A;
|
|
29
|
+
readonly input: Extract<ActionOutputMapping[A], TransactionLikeOutput>;
|
|
30
|
+
readonly simulated?: boolean;
|
|
31
|
+
readonly simulation?: SimulationResult;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Union of all typed pending tool calls, enabling switch narrowing:
|
|
35
|
+
*
|
|
36
|
+
* ```typescript
|
|
37
|
+
* for (const tool of response.pendingTools) {
|
|
38
|
+
* switch (tool.toolName) {
|
|
39
|
+
* case "swap":
|
|
40
|
+
* tool.input // ActionBatchTransactionsOutput<EvmTransaction>
|
|
41
|
+
* break;
|
|
42
|
+
* case "predictionMarketsBet":
|
|
43
|
+
* tool.input // ActionSequenceOutput<EvmTransaction>
|
|
44
|
+
* break;
|
|
45
|
+
* }
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export type TypedPendingToolCallUnion = {
|
|
50
|
+
[A in PendingToolAction]: TypedPendingToolCall<A>;
|
|
51
|
+
}[PendingToolAction];
|
|
52
|
+
/**
|
|
53
|
+
* Tool error typed by action name.
|
|
54
|
+
*/
|
|
55
|
+
export type TypedIllaToolError<A extends SupportedAction = SupportedAction> = {
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly name: A;
|
|
58
|
+
readonly data: IllaToolErrorData;
|
|
59
|
+
};
|
|
60
|
+
/** Union enabling switch narrowing on name */
|
|
61
|
+
export type TypedIllaToolErrorUnion = {
|
|
62
|
+
[A in SupportedAction]: TypedIllaToolError<A>;
|
|
63
|
+
}[SupportedAction];
|
|
64
|
+
export {};
|
|
65
|
+
//# sourceMappingURL=typedToolTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typedToolTypes.d.ts","sourceRoot":"","sources":["../../src/types/typedToolTypes.ts"],"names":[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