@illalabs/interfaces 0.0.0 → 0.1.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/LICENSE +17 -2
- package/README.md +98 -1
- package/dist/errors/endpoints/chat/ChatBaseError.d.ts +8 -0
- package/dist/errors/endpoints/chat/ChatBaseError.d.ts.map +1 -0
- package/dist/errors/endpoints/chat/ChatBaseError.js +2 -0
- package/dist/errors/endpoints/chat/ChatBaseError.js.map +1 -0
- package/dist/errors/endpoints/chat/index.d.ts +6 -0
- package/dist/errors/endpoints/chat/index.d.ts.map +1 -0
- package/dist/errors/endpoints/chat/index.js +2 -0
- package/dist/errors/endpoints/chat/index.js.map +1 -0
- package/dist/errors/endpoints/executionChecker/ExecutionCheckerBaseError.d.ts +10 -0
- package/dist/errors/endpoints/executionChecker/ExecutionCheckerBaseError.d.ts.map +1 -0
- package/dist/errors/endpoints/executionChecker/ExecutionCheckerBaseError.js +2 -0
- package/dist/errors/endpoints/executionChecker/ExecutionCheckerBaseError.js.map +1 -0
- package/dist/errors/endpoints/executionChecker/index.d.ts +3 -0
- package/dist/errors/endpoints/executionChecker/index.d.ts.map +1 -0
- package/dist/errors/endpoints/executionChecker/index.js +2 -0
- package/dist/errors/endpoints/executionChecker/index.js.map +1 -0
- package/dist/errors/index.d.ts +5 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +3 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/external.d.ts +4 -0
- package/dist/external.d.ts.map +1 -0
- package/dist/external.js +4 -0
- package/dist/external.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/autoRouter.d.ts +34 -0
- package/dist/interfaces/autoRouter.d.ts.map +1 -0
- package/dist/interfaces/autoRouter.js +2 -0
- package/dist/interfaces/autoRouter.js.map +1 -0
- package/dist/interfaces/base.d.ts +15 -0
- package/dist/interfaces/base.d.ts.map +1 -0
- package/dist/interfaces/base.js +2 -0
- package/dist/interfaces/base.js.map +1 -0
- package/dist/interfaces/chat/index.d.ts +3 -0
- package/dist/interfaces/chat/index.d.ts.map +1 -0
- package/dist/interfaces/chat/index.js +3 -0
- package/dist/interfaces/chat/index.js.map +1 -0
- package/dist/interfaces/chat/request.d.ts +11 -0
- package/dist/interfaces/chat/request.d.ts.map +1 -0
- package/dist/interfaces/chat/request.js +2 -0
- package/dist/interfaces/chat/request.js.map +1 -0
- package/dist/interfaces/chat/response.d.ts +22 -0
- package/dist/interfaces/chat/response.d.ts.map +1 -0
- package/dist/interfaces/chat/response.js +2 -0
- package/dist/interfaces/chat/response.js.map +1 -0
- package/dist/interfaces/executionChecker/index.d.ts +3 -0
- package/dist/interfaces/executionChecker/index.d.ts.map +1 -0
- package/dist/interfaces/executionChecker/index.js +3 -0
- package/dist/interfaces/executionChecker/index.js.map +1 -0
- package/dist/interfaces/executionChecker/request.d.ts +16 -0
- package/dist/interfaces/executionChecker/request.d.ts.map +1 -0
- package/dist/interfaces/executionChecker/request.js +3 -0
- package/dist/interfaces/executionChecker/request.js.map +1 -0
- package/dist/interfaces/executionChecker/response.d.ts +32 -0
- package/dist/interfaces/executionChecker/response.d.ts.map +1 -0
- package/dist/interfaces/executionChecker/response.js +2 -0
- package/dist/interfaces/executionChecker/response.js.map +1 -0
- package/dist/interfaces/index.d.ts +4 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/index.js +4 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/internal.d.ts +5 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +5 -0
- package/dist/internal.js.map +1 -0
- package/dist/schemas/chatContext.d.ts +336 -0
- package/dist/schemas/chatContext.d.ts.map +1 -0
- package/dist/schemas/chatContext.js +7 -0
- package/dist/schemas/chatContext.js.map +1 -0
- package/dist/schemas/chatRequestBody.d.ts +321 -0
- package/dist/schemas/chatRequestBody.d.ts.map +1 -0
- package/dist/schemas/chatRequestBody.js +13 -0
- package/dist/schemas/chatRequestBody.js.map +1 -0
- package/dist/schemas/executionCheckerQueryParams.d.ts +40 -0
- package/dist/schemas/executionCheckerQueryParams.d.ts.map +1 -0
- package/dist/schemas/executionCheckerQueryParams.js +18 -0
- package/dist/schemas/executionCheckerQueryParams.js.map +1 -0
- package/dist/schemas/index.d.ts +8 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +8 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/messages.d.ts +252 -0
- package/dist/schemas/messages.d.ts.map +1 -0
- package/dist/schemas/messages.js +67 -0
- package/dist/schemas/messages.js.map +1 -0
- package/dist/schemas/toolAutorouter.d.ts +156 -0
- package/dist/schemas/toolAutorouter.d.ts.map +1 -0
- package/dist/schemas/toolAutorouter.js +37 -0
- package/dist/schemas/toolAutorouter.js.map +1 -0
- package/dist/schemas/userContext.d.ts +11 -0
- package/dist/schemas/userContext.d.ts.map +1 -0
- package/dist/schemas/userContext.js +8 -0
- package/dist/schemas/userContext.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/messages.d.ts +9 -0
- package/dist/types/messages.d.ts.map +1 -0
- package/dist/types/messages.js +2 -0
- package/dist/types/messages.js.map +1 -0
- package/dist/types/toolAutorouter.d.ts +7 -0
- package/dist/types/toolAutorouter.d.ts.map +1 -0
- package/dist/types/toolAutorouter.js +2 -0
- package/dist/types/toolAutorouter.js.map +1 -0
- package/dist/utils/constants.d.ts +78 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/constants.js +57 -0
- package/dist/utils/constants.js.map +1 -0
- package/package.json +40 -5
- package/index.d.ts +0 -1
- package/index.js +0 -1
package/LICENSE
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2025
|
|
3
|
+
Copyright (c) 2025 Wonderland
|
|
4
|
+
|
|
4
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
-
in the Software without restriction
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,100 @@
|
|
|
1
1
|
# @illalabs/interfaces
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A published TypeScript package that provides shared type definitions and interfaces for ILLA applications.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The Shared Interfaces package is a **published npm package** that serves as a centralized library of TypeScript interfaces and types used across the ILLA platform, providing:
|
|
8
|
+
|
|
9
|
+
- Auto router configuration types for DeFi and Bridge operations
|
|
10
|
+
- Standardized types for cross-application consistency
|
|
11
|
+
- Endpoints interfaces definitions
|
|
12
|
+
|
|
13
|
+
## Requirements
|
|
14
|
+
|
|
15
|
+
- Node.js >= 22
|
|
16
|
+
- PNPM >= 9.5.0
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @illalabs/interfaces
|
|
22
|
+
# or
|
|
23
|
+
yarn add @illalabs/interfaces
|
|
24
|
+
# or
|
|
25
|
+
pnpm add @illalabs/interfaces
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import type { AutoRouterConfig, DeFiConfig, LendingProvider } from "@illalabs/interfaces";
|
|
32
|
+
|
|
33
|
+
// Define a DeFi configuration
|
|
34
|
+
const actionsConfig: DeFiConfig = {
|
|
35
|
+
supply: "aave",
|
|
36
|
+
withdraw: "default-config",
|
|
37
|
+
borrow: "aave",
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// Complete auto router configuration
|
|
41
|
+
const autoRouterConfig: AutoRouterConfig = {
|
|
42
|
+
defi: actionsConfig,
|
|
43
|
+
swapBridge: "lifi",
|
|
44
|
+
};
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Available Scripts
|
|
48
|
+
|
|
49
|
+
| Script | Description |
|
|
50
|
+
| ------------- | --------------------------- |
|
|
51
|
+
| `build` | Build the package using TSC |
|
|
52
|
+
| `dev` | Build with watch mode |
|
|
53
|
+
| `test` | Run tests |
|
|
54
|
+
| `test:cov` | Run tests with coverage |
|
|
55
|
+
| `lint` | Run ESLint |
|
|
56
|
+
| `lint:fix` | Run linter and fix issues |
|
|
57
|
+
| `format` | Check code formatting |
|
|
58
|
+
| `format:fix` | Fix code formatting |
|
|
59
|
+
| `check-types` | Check TypeScript types |
|
|
60
|
+
| `clean` | Remove dist folder |
|
|
61
|
+
|
|
62
|
+
## Project Structure
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
src/
|
|
66
|
+
├── errors/ # Custom error classes for endpoints and domain
|
|
67
|
+
├── interfaces/ # Shared interfaces used across services
|
|
68
|
+
├── schemas/ # Runtime validation (e.g., zod) schemas
|
|
69
|
+
├── types/ # Reusable type aliases and enums
|
|
70
|
+
├── external.ts # Public surface area (re-exported by package entry)
|
|
71
|
+
├── internal.ts # Internal exports only for internal consumers
|
|
72
|
+
└── index.ts # Source entry point
|
|
73
|
+
|
|
74
|
+
test/ # Unit tests
|
|
75
|
+
dist/ # Compiled build output
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Versioning
|
|
79
|
+
|
|
80
|
+
This package follows [Semantic Versioning](https://semver.org/):
|
|
81
|
+
|
|
82
|
+
- **MAJOR**: Breaking changes to interfaces
|
|
83
|
+
- **MINOR**: New interfaces or optional properties
|
|
84
|
+
- **PATCH**: Bug fixes and documentation updates
|
|
85
|
+
|
|
86
|
+
## Contributing
|
|
87
|
+
|
|
88
|
+
1. Create a feature branch
|
|
89
|
+
2. Make your changes
|
|
90
|
+
3. Add or update tests
|
|
91
|
+
4. Run linting and type checks
|
|
92
|
+
5. Submit a pull request
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
MIT - See [LICENSE](../../LICENSE) file for details.
|
|
97
|
+
|
|
98
|
+
## Repository
|
|
99
|
+
|
|
100
|
+
This published package is part of the [ILLA API monorepo](https://github.com/IllaLabs/api).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatBaseError.d.ts","sourceRoot":"","sources":["../../../../src/errors/endpoints/chat/ChatBaseError.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatBaseError.js","sourceRoot":"","sources":["../../../../src/errors/endpoints/chat/ChatBaseError.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/errors/endpoints/chat/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/errors/endpoints/chat/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecutionCheckerBaseError.d.ts","sourceRoot":"","sources":["../../../../src/errors/endpoints/executionChecker/ExecutionCheckerBaseError.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oCAAoC,GAAG;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecutionCheckerBaseError.js","sourceRoot":"","sources":["../../../../src/errors/endpoints/executionChecker/ExecutionCheckerBaseError.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/errors/endpoints/executionChecker/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,gCAAgC,CAAC;AAE3F,MAAM,MAAM,qBAAqB,GAAG,oCAAoC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/errors/endpoints/executionChecker/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "./endpoints/chat/index.js";
|
|
2
|
+
export * from "./endpoints/executionChecker/index.js";
|
|
3
|
+
export type { ChatError } from "./endpoints/chat/index.js";
|
|
4
|
+
export type { ExecutionCheckerError } from "./endpoints/executionChecker/index.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uCAAuC,CAAC;AACtD,YAAY,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,YAAY,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uCAAuC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external.d.ts","sourceRoot":"","sources":["../src/external.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC"}
|
package/dist/external.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external.js","sourceRoot":"","sources":["../src/external.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { SupportedLendingProvider, SupportedSwapBridgeProvider } from "../utils/constants.js";
|
|
2
|
+
/**
|
|
3
|
+
* Lending provider type
|
|
4
|
+
*/
|
|
5
|
+
export type LendingProvider = SupportedLendingProvider;
|
|
6
|
+
/**
|
|
7
|
+
* Configuration for lending only operations
|
|
8
|
+
*/
|
|
9
|
+
export type LendingOnly = {
|
|
10
|
+
lending: LendingProvider;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Configuration for specific DeFi actions
|
|
14
|
+
*/
|
|
15
|
+
export type ActionsOnly = {
|
|
16
|
+
supply: LendingProvider;
|
|
17
|
+
withdraw: LendingProvider;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* DeFi configuration union type
|
|
21
|
+
*/
|
|
22
|
+
export type DeFiConfig = LendingOnly | ActionsOnly;
|
|
23
|
+
/**
|
|
24
|
+
* Swap and bridge provider type
|
|
25
|
+
*/
|
|
26
|
+
export type SwapBridgeProvider = SupportedSwapBridgeProvider;
|
|
27
|
+
/**
|
|
28
|
+
* Auto router configuration interface
|
|
29
|
+
*/
|
|
30
|
+
export interface AutoRouterConfig {
|
|
31
|
+
DeFi?: DeFiConfig;
|
|
32
|
+
SwapBridge?: SwapBridgeProvider;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=autoRouter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autoRouter.d.ts","sourceRoot":"","sources":["../../src/interfaces/autoRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEnG;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,wBAAwB,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACtB,OAAO,EAAE,eAAe,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACtB,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,eAAe,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,UAAU,CAAC,EAAE,kBAAkB,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autoRouter.js","sourceRoot":"","sources":["../../src/interfaces/autoRouter.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface BaseApiResponse {
|
|
2
|
+
readonly status: number;
|
|
3
|
+
}
|
|
4
|
+
export interface BaseApiErrorResponse extends BaseApiResponse {
|
|
5
|
+
readonly status: 400 | 401 | 403 | 429 | 500;
|
|
6
|
+
readonly error: string;
|
|
7
|
+
}
|
|
8
|
+
export interface BaseApiSuccessResponse extends BaseApiResponse {
|
|
9
|
+
readonly status: 200;
|
|
10
|
+
}
|
|
11
|
+
export interface CoreApiAuthHeaders {
|
|
12
|
+
readonly "x-auth-token": string;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/interfaces/base.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IACzD,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC7C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAuB,SAAQ,eAAe;IAC3D,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/interfaces/base.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/chat/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/chat/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TypeOf } from "zod";
|
|
2
|
+
import type { CoreApiAuthHeaders } from "../base.js";
|
|
3
|
+
import { CoreApiChatBodyRequestSchema } from "../../schemas/chatRequestBody.js";
|
|
4
|
+
export type CoreApiChatBodyRequest = TypeOf<typeof CoreApiChatBodyRequestSchema>;
|
|
5
|
+
export interface CoreApiChatRequest {
|
|
6
|
+
readonly path: "/api/v1/chat";
|
|
7
|
+
readonly method: "POST";
|
|
8
|
+
readonly headers: CoreApiAuthHeaders;
|
|
9
|
+
readonly body: CoreApiChatBodyRequest;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/interfaces/chat/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAElC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAEhF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAGjF,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/interfaces/chat/request.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ChatError } from "../../errors/endpoints/chat/index.js";
|
|
2
|
+
import type { MessageHistoryType, ToolCallType, ToolErrorPartType, ToolIncompletePartType } from "../../types/messages.js";
|
|
3
|
+
import type { BaseApiSuccessResponse } from "../base.js";
|
|
4
|
+
/**
|
|
5
|
+
* Success response for chat endpoint
|
|
6
|
+
*/
|
|
7
|
+
export interface CoreApiChatSuccessResponse extends BaseApiSuccessResponse {
|
|
8
|
+
readonly messages: MessageHistoryType;
|
|
9
|
+
readonly text: string;
|
|
10
|
+
readonly pendingTools?: ReadonlyArray<ToolCallType>;
|
|
11
|
+
readonly incompleteTools?: ReadonlyArray<ToolIncompletePartType>;
|
|
12
|
+
readonly toolErrors?: ReadonlyArray<ToolErrorPartType>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Union type of all possible chat error responses
|
|
16
|
+
*/
|
|
17
|
+
export type CoreApiChatErrorResponse = ChatError;
|
|
18
|
+
/**
|
|
19
|
+
* Union type of all possible chat responses
|
|
20
|
+
*/
|
|
21
|
+
export type CoreApiChatResponse = CoreApiChatSuccessResponse | CoreApiChatErrorResponse;
|
|
22
|
+
//# sourceMappingURL=response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/interfaces/chat/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,KAAK,EACR,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,0BAA2B,SAAQ,sBAAsB;IACtE,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACpD,QAAQ,CAAC,eAAe,CAAC,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;IACjE,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;CAC1D;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,0BAA0B,GAAG,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/interfaces/chat/response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/executionChecker/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/executionChecker/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { CoreApiAuthHeaders } from "../../internal.js";
|
|
3
|
+
import { BaseLongPollingArgsSchema } from "../../internal.js";
|
|
4
|
+
export type BaseLongPollingArgs = z.infer<typeof BaseLongPollingArgsSchema>;
|
|
5
|
+
export type LongPollingActionParams<T extends BaseLongPollingArgs = BaseLongPollingArgs> = {
|
|
6
|
+
readonly toolName: string;
|
|
7
|
+
readonly protocol: string;
|
|
8
|
+
readonly args: T;
|
|
9
|
+
};
|
|
10
|
+
export interface LongPollingActionRequest<T extends BaseLongPollingArgs = BaseLongPollingArgs> {
|
|
11
|
+
readonly path: "/api/v1/actions/check";
|
|
12
|
+
readonly method: "GET";
|
|
13
|
+
readonly headers: CoreApiAuthHeaders;
|
|
14
|
+
readonly params: LongPollingActionParams<T>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/interfaces/executionChecker/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,mBAAmB,GAAG,mBAAmB,IAAI;IACvF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,wBAAwB,CAAC,CAAC,SAAS,mBAAmB,GAAG,mBAAmB;IACzF,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC;CAC/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/interfaces/executionChecker/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ExecutionCheckerError } from "../../errors/endpoints/executionChecker/index.js";
|
|
2
|
+
import type { BaseApiSuccessResponse } from "../base.js";
|
|
3
|
+
export type ExecutionActionStatus = "pending" | "failed" | "success";
|
|
4
|
+
interface LongPollingActionBaseResponse extends BaseApiSuccessResponse {
|
|
5
|
+
readonly pollStatus: ExecutionActionStatus;
|
|
6
|
+
readonly toolName: string;
|
|
7
|
+
readonly protocol: string;
|
|
8
|
+
}
|
|
9
|
+
export interface LongPollingActionPending extends LongPollingActionBaseResponse {
|
|
10
|
+
readonly pollStatus: "pending";
|
|
11
|
+
readonly message?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface LongPollingActionErrored extends LongPollingActionBaseResponse {
|
|
14
|
+
readonly pollStatus: "failed";
|
|
15
|
+
readonly error: unknown;
|
|
16
|
+
readonly details?: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface LongPollingActionSucceeded<TPayload = unknown> extends LongPollingActionBaseResponse {
|
|
19
|
+
readonly pollStatus: "success";
|
|
20
|
+
readonly payload: TPayload;
|
|
21
|
+
}
|
|
22
|
+
export type LongPollingActionSuccessResponse<TPayload = unknown> = LongPollingActionPending | LongPollingActionErrored | LongPollingActionSucceeded<TPayload>;
|
|
23
|
+
export type LongPollingActionErrorResponse = ExecutionCheckerError;
|
|
24
|
+
export type LongPollingActionResponse<TPayload = unknown> = LongPollingActionSuccessResponse<TPayload> | LongPollingActionErrorResponse;
|
|
25
|
+
/**
|
|
26
|
+
* Normalized action status representation combining pending, failed, and succeeded states.
|
|
27
|
+
*/
|
|
28
|
+
export type ActionStatus<TPayload = unknown, TError = unknown> = LongPollingActionPending | (LongPollingActionErrored & {
|
|
29
|
+
readonly error: TError;
|
|
30
|
+
}) | LongPollingActionSucceeded<TPayload>;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/interfaces/executionChecker/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kDAAkD,CAAC;AAC9F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAErE,UAAU,6BAA8B,SAAQ,sBAAsB;IAClE,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAyB,SAAQ,6BAA6B;IAC3E,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAyB,SAAQ,6BAA6B;IAC3E,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,0BAA0B,CAAC,QAAQ,GAAG,OAAO,CAC1D,SAAQ,6BAA6B;IACrC,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;CAC9B;AAED,MAAM,MAAM,gCAAgC,CAAC,QAAQ,GAAG,OAAO,IACzD,wBAAwB,GACxB,wBAAwB,GACxB,0BAA0B,CAAC,QAAQ,CAAC,CAAC;AAE3C,MAAM,MAAM,8BAA8B,GAAG,qBAAqB,CAAC;AAEnE,MAAM,MAAM,yBAAyB,CAAC,QAAQ,GAAG,OAAO,IAClD,gCAAgC,CAAC,QAAQ,CAAC,GAC1C,8BAA8B,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,QAAQ,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,IACvD,wBAAwB,GACxB,CAAC,wBAAwB,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GACvD,0BAA0B,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/interfaces/executionChecker/response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC"}
|
package/dist/internal.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC"}
|