@torquefi/types 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 +21 -0
- package/README.md +43 -0
- package/dist/assistant.d.ts +63 -0
- package/dist/assistant.d.ts.map +1 -0
- package/dist/assistant.js +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/intelligence.d.ts +115 -0
- package/dist/intelligence.d.ts.map +1 -0
- package/dist/intelligence.js +4 -0
- package/dist/platform.d.ts +40 -0
- package/dist/platform.d.ts.map +1 -0
- package/dist/platform.js +2 -0
- package/package.json +68 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Torque
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
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
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @torquefi/types
|
|
2
|
+
|
|
3
|
+
Shared **TypeScript-only** types for Torque Platform API v1 — Intelligence feeds, Assistant chat, and v1 error JSON.
|
|
4
|
+
|
|
5
|
+
Published as **`@torquefi/types`** because the unscoped name `torque-types` was unpublished on npm in 2024 and cannot be reclaimed without npm support.
|
|
6
|
+
|
|
7
|
+
Zero runtime. Pair with `fetch`, axios, or the `torque-*` SDK clients.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
yarn add @torquefi/types
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import type {
|
|
19
|
+
IntelligenceItemV1,
|
|
20
|
+
IntelligenceFeedResponseV1,
|
|
21
|
+
AssistantChatPostBody,
|
|
22
|
+
AssistantChatFunctionResult,
|
|
23
|
+
TorqueV1ErrorBody,
|
|
24
|
+
} from '@torquefi/types'
|
|
25
|
+
|
|
26
|
+
// Subpath imports
|
|
27
|
+
import type { GetIntelligenceFeedParams } from '@torquefi/types/intelligence'
|
|
28
|
+
import type { AssistantChatStreamEvent } from '@torquefi/types/assistant'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Sync with app
|
|
32
|
+
|
|
33
|
+
Canonical shapes live in `torque_webapp`:
|
|
34
|
+
|
|
35
|
+
- `lib/api/torque-v1/intelligence/types.ts`
|
|
36
|
+
- `lib/integrations/ai/chat/service-helpers.ts`
|
|
37
|
+
- `lib/integrations/ai/surfaces/stream-assistant-chat.ts`
|
|
38
|
+
|
|
39
|
+
See [`public/docs/developer/SDK_ROADMAP.md`](../../public/docs/developer/SDK_ROADMAP.md) for the full SDK publish plan.
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
MIT
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** Free-tier wallet credit exhaustion (402). */
|
|
2
|
+
export declare const ASSISTANT_CREDITS_ERROR_CODE = "assistant_credits_exhausted";
|
|
3
|
+
export type AssistantChatMessage = {
|
|
4
|
+
role: string;
|
|
5
|
+
content?: unknown;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Integrator-facing chat context — subset of in-app AssistantContext.
|
|
10
|
+
* Pass wallet + chain so tools match the user's portfolio and deep links.
|
|
11
|
+
*/
|
|
12
|
+
export type AssistantChatContext = {
|
|
13
|
+
walletAddress?: string;
|
|
14
|
+
solanaWalletAddress?: string;
|
|
15
|
+
chainId?: number;
|
|
16
|
+
localCurrency?: string;
|
|
17
|
+
currencyRate?: number;
|
|
18
|
+
userName?: string;
|
|
19
|
+
displayName?: string;
|
|
20
|
+
conversationId?: string;
|
|
21
|
+
/** Smart-wallet JWT when combining chat with session-scoped tools (optional). */
|
|
22
|
+
authJWT?: string;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
};
|
|
25
|
+
export type AssistantChatPostBody = {
|
|
26
|
+
messages: AssistantChatMessage[];
|
|
27
|
+
context?: AssistantChatContext;
|
|
28
|
+
conversationId?: string;
|
|
29
|
+
};
|
|
30
|
+
export type AssistantChatFunctionResult = {
|
|
31
|
+
toolName?: string;
|
|
32
|
+
result?: Record<string, unknown>;
|
|
33
|
+
};
|
|
34
|
+
/** Non-streaming JSON response from POST /api/v1/assistant/chat */
|
|
35
|
+
export type AssistantChatResponse = {
|
|
36
|
+
content?: unknown;
|
|
37
|
+
functionResults?: AssistantChatFunctionResult[];
|
|
38
|
+
suggestions?: string[];
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
};
|
|
41
|
+
/** SSE events when POST /api/v1/assistant/chat?stream=true */
|
|
42
|
+
export type AssistantChatStreamEvent = {
|
|
43
|
+
type: 'delta';
|
|
44
|
+
text: string;
|
|
45
|
+
} | {
|
|
46
|
+
type: 'correction';
|
|
47
|
+
text: string;
|
|
48
|
+
} | {
|
|
49
|
+
type: 'done';
|
|
50
|
+
functionResults?: AssistantChatFunctionResult[];
|
|
51
|
+
} | {
|
|
52
|
+
type: 'error';
|
|
53
|
+
message?: string;
|
|
54
|
+
};
|
|
55
|
+
export type AssistantChatCreditsError = {
|
|
56
|
+
error: typeof ASSISTANT_CREDITS_ERROR_CODE;
|
|
57
|
+
message: string;
|
|
58
|
+
upgrade?: boolean;
|
|
59
|
+
remaining?: number;
|
|
60
|
+
limit?: number;
|
|
61
|
+
resetAt?: number | null;
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=assistant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant.d.ts","sourceRoot":"","sources":["../src/assistant.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,eAAO,MAAM,4BAA4B,gCAAgC,CAAA;AAEzE,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB,CAAA;AAED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d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/** Torque Intelligence integrator manifest version (capabilities + feed meta). */
|
|
2
|
+
export declare const INTELLIGENCE_MANIFEST_VERSION = 7;
|
|
3
|
+
export declare const INTELLIGENCE_FEED_DEFAULT_LIMIT = 12;
|
|
4
|
+
export declare const INTELLIGENCE_FEED_MAX_LIMIT = 24;
|
|
5
|
+
/** Extensible item kinds — integrators should ignore unknown kinds. */
|
|
6
|
+
export type IntelligenceItemKind = 'signal' | 'angle' | 'brief' | 'outlook';
|
|
7
|
+
export type IntelligenceHorizon = '24h' | 'swing' | 'structural';
|
|
8
|
+
export type IntelligenceBias = 'Long' | 'Short' | 'Watch';
|
|
9
|
+
export type IntelligenceResolutionTier = 'pool' | 'live' | 'emergency';
|
|
10
|
+
export interface IntelligenceSourceV1 {
|
|
11
|
+
type: 'tape' | 'social' | 'desk' | 'insight' | 'finnhub' | 'other';
|
|
12
|
+
label?: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface IntelligenceActionV1 {
|
|
16
|
+
label: string;
|
|
17
|
+
href: string;
|
|
18
|
+
chainId?: number;
|
|
19
|
+
iconSymbol?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IntelligenceLevelsV1 {
|
|
22
|
+
last?: number;
|
|
23
|
+
invalidation?: number;
|
|
24
|
+
target?: number;
|
|
25
|
+
}
|
|
26
|
+
/** Canonical integrator item. All v7 surfaces return this shape. */
|
|
27
|
+
export interface IntelligenceItemV1 {
|
|
28
|
+
id: string;
|
|
29
|
+
kind: IntelligenceItemKind;
|
|
30
|
+
title: string;
|
|
31
|
+
/** Normalized body: deskRead | description | synthesis paragraph */
|
|
32
|
+
summary: string;
|
|
33
|
+
horizon?: IntelligenceHorizon;
|
|
34
|
+
symbols: string[];
|
|
35
|
+
bias?: IntelligenceBias | null;
|
|
36
|
+
relevanceScore?: number;
|
|
37
|
+
levels?: IntelligenceLevelsV1;
|
|
38
|
+
source?: IntelligenceSourceV1;
|
|
39
|
+
actions?: IntelligenceActionV1[];
|
|
40
|
+
/** Server-computed catalyst key for dedupe across kinds */
|
|
41
|
+
dedupeKey?: string;
|
|
42
|
+
ingestedAtMs?: number;
|
|
43
|
+
resolution?: {
|
|
44
|
+
tier: IntelligenceResolutionTier;
|
|
45
|
+
ageMs?: number;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export interface IntelligenceLaneV1 {
|
|
49
|
+
id: 'timely' | 'desk' | 'outlook';
|
|
50
|
+
label: string;
|
|
51
|
+
items: IntelligenceItemV1[];
|
|
52
|
+
}
|
|
53
|
+
export interface IntelligenceFeedMetaV1 {
|
|
54
|
+
manifestVersion: number;
|
|
55
|
+
generatedAtMs: number;
|
|
56
|
+
bundleIngestedAtMs?: number;
|
|
57
|
+
personalized: boolean;
|
|
58
|
+
walletAddress?: string;
|
|
59
|
+
chainId?: number;
|
|
60
|
+
resolution?: {
|
|
61
|
+
angles?: {
|
|
62
|
+
tier: IntelligenceResolutionTier;
|
|
63
|
+
ageMs?: number;
|
|
64
|
+
};
|
|
65
|
+
signals?: {
|
|
66
|
+
tier: IntelligenceResolutionTier;
|
|
67
|
+
bundleAgeMs?: number;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
dedupedCount?: number;
|
|
71
|
+
}
|
|
72
|
+
export interface IntelligenceFeedResponseV1 {
|
|
73
|
+
meta: IntelligenceFeedMetaV1;
|
|
74
|
+
brief?: IntelligenceItemV1;
|
|
75
|
+
lanes?: {
|
|
76
|
+
timely?: IntelligenceLaneV1;
|
|
77
|
+
desk?: IntelligenceLaneV1;
|
|
78
|
+
outlook?: IntelligenceLaneV1;
|
|
79
|
+
};
|
|
80
|
+
items: IntelligenceItemV1[];
|
|
81
|
+
}
|
|
82
|
+
/** v6+ compatibility — normalized ideas with legacy meta fields. */
|
|
83
|
+
export interface TradeAnglesResponseV1 {
|
|
84
|
+
ideas: IntelligenceItemV1[];
|
|
85
|
+
meta: IntelligenceFeedMetaV1 & {
|
|
86
|
+
source?: IntelligenceResolutionTier;
|
|
87
|
+
shippableCount?: number | null;
|
|
88
|
+
matchedPreferredCount?: number | null;
|
|
89
|
+
emergencyFromPool?: number | null;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export interface HappeningNowResponseV1 {
|
|
93
|
+
items: IntelligenceItemV1[];
|
|
94
|
+
ingestedAtMs: number | null;
|
|
95
|
+
meta?: Pick<IntelligenceFeedMetaV1, 'manifestVersion' | 'bundleIngestedAtMs'>;
|
|
96
|
+
}
|
|
97
|
+
export type IntelligenceLaneId = 'timely' | 'desk' | 'outlook';
|
|
98
|
+
export interface GetIntelligenceFeedParams {
|
|
99
|
+
walletAddress?: string;
|
|
100
|
+
chainId?: number;
|
|
101
|
+
lanes?: IntelligenceLaneId[];
|
|
102
|
+
kinds?: IntelligenceItemKind[];
|
|
103
|
+
limit?: number;
|
|
104
|
+
includeBrief?: boolean;
|
|
105
|
+
/** Server-side live reroll; subject to COOLDOWN (429). */
|
|
106
|
+
force?: boolean;
|
|
107
|
+
}
|
|
108
|
+
export interface GetTradeAnglesParams {
|
|
109
|
+
walletAddress?: string;
|
|
110
|
+
force?: boolean;
|
|
111
|
+
}
|
|
112
|
+
export interface GetHappeningNowParams {
|
|
113
|
+
chainId?: number;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=intelligence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intelligence.d.ts","sourceRoot":"","sources":["../src/intelligence.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,eAAO,MAAM,6BAA6B,IAAI,CAAA;AAE9C,eAAO,MAAM,+BAA+B,KAAK,CAAA;AACjD,eAAO,MAAM,2BAA2B,KAAK,CAAA;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IACpC,KAAK,EAAE,kBAAkB,EAAE,CAAA;IAC3B,IAAI,EAAE,sBAAsB,GAAG;QAC7B,MAAM,CAAC,EAAE,0BAA0B,CAAA;QACnC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QAC9B,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QACrC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAClC,CAAA;CACF;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,kBAAkB,EAAE,CAAA;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,IAAI,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,iBAAiB,GAAG,oBAAoB,CAAC,CAAA;CAC9E;AAED,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAA;AAE9D,MAAM,WAAW,yBAAyB;IACxC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAA;IAC5B,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Bump when Torque API v1 capability map changes materially. */
|
|
2
|
+
export declare const TORQUE_V1_MANIFEST_VERSION = 7;
|
|
3
|
+
export interface TorqueV1ErrorBody {
|
|
4
|
+
error: {
|
|
5
|
+
code: string;
|
|
6
|
+
message: string;
|
|
7
|
+
details?: Record<string, unknown>;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/** Intelligence feed cooldown (429). */
|
|
11
|
+
export type TorqueV1CooldownErrorBody = TorqueV1ErrorBody & {
|
|
12
|
+
error: TorqueV1ErrorBody['error'] & {
|
|
13
|
+
code: 'COOLDOWN';
|
|
14
|
+
details: {
|
|
15
|
+
retryAfterMs: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export interface TorquePlatformClientConfig {
|
|
20
|
+
apiKey: string;
|
|
21
|
+
baseUrl?: string;
|
|
22
|
+
timeout?: number;
|
|
23
|
+
}
|
|
24
|
+
/** Subset of GET /api/v1/capabilities — enough for client version probes. */
|
|
25
|
+
export interface TorqueCapabilitiesProbe {
|
|
26
|
+
api: string;
|
|
27
|
+
manifestVersion: number;
|
|
28
|
+
intelligence?: {
|
|
29
|
+
status: string;
|
|
30
|
+
schema?: string;
|
|
31
|
+
primary?: string;
|
|
32
|
+
};
|
|
33
|
+
assistant?: {
|
|
34
|
+
status: string;
|
|
35
|
+
endpoints?: {
|
|
36
|
+
chat?: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,eAAO,MAAM,0BAA0B,IAAI,CAAA;AAE3C,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAClC,CAAA;CACF;AAED,wCAAwC;AACxC,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,GAAG;IAC1D,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAAG;QAClC,IAAI,EAAE,UAAU,CAAA;QAChB,OAAO,EAAE;YAAE,YAAY,EAAE,MAAM,CAAA;SAAE,CAAA;KAClC,CAAA;CACF,CAAA;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,6EAA6E;AAC7E,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAA;IACX,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE;QACb,MAAM,EAAE,MAAM,CAAA;QACd,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,SAAS,CAAC,EAAE;QACV,MAAM,EAAE,MAAM,CAAA;QACd,SAAS,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAC9B,CAAA;CACF"}
|
package/dist/platform.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@torquefi/types",
|
|
3
|
+
"publishConfig": {
|
|
4
|
+
"access": "public"
|
|
5
|
+
},
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"description": "Shared TypeScript types for Torque Platform API v1 (Intelligence, Assistant, errors)",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"require": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./intelligence": {
|
|
18
|
+
"types": "./dist/intelligence.d.ts",
|
|
19
|
+
"import": "./dist/intelligence.js",
|
|
20
|
+
"require": "./dist/intelligence.js"
|
|
21
|
+
},
|
|
22
|
+
"./assistant": {
|
|
23
|
+
"types": "./dist/assistant.d.ts",
|
|
24
|
+
"import": "./dist/assistant.js",
|
|
25
|
+
"require": "./dist/assistant.js"
|
|
26
|
+
},
|
|
27
|
+
"./platform": {
|
|
28
|
+
"types": "./dist/platform.d.ts",
|
|
29
|
+
"import": "./dist/platform.js",
|
|
30
|
+
"require": "./dist/platform.js"
|
|
31
|
+
},
|
|
32
|
+
"./package.json": "./package.json"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"README.md",
|
|
37
|
+
"LICENSE"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsc",
|
|
41
|
+
"clean": "rimraf dist",
|
|
42
|
+
"prepublishOnly": "yarn clean && yarn build"
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"torque",
|
|
46
|
+
"typescript",
|
|
47
|
+
"types",
|
|
48
|
+
"intelligence",
|
|
49
|
+
"assistant",
|
|
50
|
+
"api",
|
|
51
|
+
"sdk"
|
|
52
|
+
],
|
|
53
|
+
"author": "Torque <hello@torque.fi>",
|
|
54
|
+
"license": "MIT",
|
|
55
|
+
"homepage": "https://torque.fi",
|
|
56
|
+
"repository": {
|
|
57
|
+
"type": "git",
|
|
58
|
+
"url": "git+https://github.com/torque-fi/torque_webapp.git",
|
|
59
|
+
"directory": "packages/torque-types"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"rimraf": "^5.0.0",
|
|
63
|
+
"typescript": "^5.0.0"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=16.0.0"
|
|
67
|
+
}
|
|
68
|
+
}
|