@continuumdao/continuum-node-sdk 1.3.7 → 1.3.8

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.
Files changed (62) hide show
  1. package/dist/core/chart/index.d.ts +6 -0
  2. package/dist/core/chart/index.d.ts.map +1 -0
  3. package/dist/core/chart/index.js +6 -0
  4. package/dist/core/chart/index.js.map +1 -0
  5. package/dist/core/chart/keygen-format.d.ts +21 -0
  6. package/dist/core/chart/keygen-format.d.ts.map +1 -0
  7. package/dist/core/chart/keygen-format.js +43 -0
  8. package/dist/core/chart/keygen-format.js.map +1 -0
  9. package/dist/core/chart/ohlcv.d.ts +21 -0
  10. package/dist/core/chart/ohlcv.d.ts.map +1 -0
  11. package/dist/core/chart/ohlcv.js +54 -0
  12. package/dist/core/chart/ohlcv.js.map +1 -0
  13. package/dist/core/chart/overlay-schemas.d.ts +385 -0
  14. package/dist/core/chart/overlay-schemas.d.ts.map +1 -0
  15. package/dist/core/chart/overlay-schemas.js +99 -0
  16. package/dist/core/chart/overlay-schemas.js.map +1 -0
  17. package/dist/core/chart/overlays.d.ts +7 -0
  18. package/dist/core/chart/overlays.d.ts.map +1 -0
  19. package/dist/core/chart/overlays.js +579 -0
  20. package/dist/core/chart/overlays.js.map +1 -0
  21. package/dist/core/chart/panes.d.ts +7 -0
  22. package/dist/core/chart/panes.d.ts.map +1 -0
  23. package/dist/core/chart/panes.js +30 -0
  24. package/dist/core/chart/panes.js.map +1 -0
  25. package/dist/core/chart/prepare.d.ts +5 -0
  26. package/dist/core/chart/prepare.d.ts.map +1 -0
  27. package/dist/core/chart/prepare.js +175 -0
  28. package/dist/core/chart/prepare.js.map +1 -0
  29. package/dist/core/chart/schemas.d.ts +321 -0
  30. package/dist/core/chart/schemas.d.ts.map +1 -0
  31. package/dist/core/chart/schemas.js +86 -0
  32. package/dist/core/chart/schemas.js.map +1 -0
  33. package/dist/core/chart/volume-direction.d.ts +15 -0
  34. package/dist/core/chart/volume-direction.d.ts.map +1 -0
  35. package/dist/core/chart/volume-direction.js +63 -0
  36. package/dist/core/chart/volume-direction.js.map +1 -0
  37. package/dist/core/keygen-messaging.d.ts +4 -1
  38. package/dist/core/keygen-messaging.d.ts.map +1 -1
  39. package/dist/core/keygen-messaging.js +70 -1
  40. package/dist/core/keygen-messaging.js.map +1 -1
  41. package/dist/core/ta/catalog.d.ts +1 -1
  42. package/dist/core/ta/schemas.d.ts +3 -3
  43. package/dist/mcp/chart.d.ts +3 -0
  44. package/dist/mcp/chart.d.ts.map +1 -0
  45. package/dist/mcp/chart.js +14 -0
  46. package/dist/mcp/chart.js.map +1 -0
  47. package/dist/mcp/keygen-messaging.d.ts.map +1 -1
  48. package/dist/mcp/keygen-messaging.js +13 -3
  49. package/dist/mcp/keygen-messaging.js.map +1 -1
  50. package/dist/mcp/register.d.ts.map +1 -1
  51. package/dist/mcp/register.js +3 -0
  52. package/dist/mcp/register.js.map +1 -1
  53. package/dist/mcp/resources/agent-mcp-servers.md +34 -0
  54. package/dist/mcp/resources/chart.md +186 -0
  55. package/dist/mcp/resources/keygen.md +8 -1
  56. package/dist/mcp/resources/overview.md +1 -0
  57. package/dist/mcp/resources/technical-indicators.md +3 -1
  58. package/dist/schemas/extended.d.ts +26 -0
  59. package/dist/schemas/extended.d.ts.map +1 -1
  60. package/dist/schemas/extended.js +35 -1
  61. package/dist/schemas/extended.js.map +1 -1
  62. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ export const MAIN_CHART_PANE_ID = 'main';
2
+ const MIN_MAIN_PANE_RATIO = 0.35;
3
+ const MIN_OSC_PANE_RATIO = 0.14;
4
+ const MAX_OSC_PANE_RATIO = 0.22;
5
+ export function buildPaneLayout(chart) {
6
+ const oscillatorPaneIds = [
7
+ ...new Set(chart.series
8
+ .map(s => s.paneId)
9
+ .filter((id) => !!id && id !== MAIN_CHART_PANE_ID)),
10
+ ].sort();
11
+ if (oscillatorPaneIds.length === 0) {
12
+ return {
13
+ ...chart,
14
+ panes: [{ id: MAIN_CHART_PANE_ID, heightRatio: 1 }],
15
+ };
16
+ }
17
+ const oscHeight = Math.min(MAX_OSC_PANE_RATIO, Math.max(MIN_OSC_PANE_RATIO, 0.55 / oscillatorPaneIds.length));
18
+ const mainHeight = Math.max(MIN_MAIN_PANE_RATIO, 1 - oscHeight * oscillatorPaneIds.length);
19
+ return {
20
+ ...chart,
21
+ panes: [
22
+ { id: MAIN_CHART_PANE_ID, heightRatio: mainHeight },
23
+ ...oscillatorPaneIds.map(id => ({ id, heightRatio: oscHeight })),
24
+ ],
25
+ };
26
+ }
27
+ export function seriesPaneId(series) {
28
+ return series.paneId ?? MAIN_CHART_PANE_ID;
29
+ }
30
+ //# sourceMappingURL=panes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panes.js","sourceRoot":"","sources":["../../../src/core/chart/panes.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACjC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAChC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,MAAM,UAAU,eAAe,CAAC,KAAqB;IACpD,MAAM,iBAAiB,GAAG;QACzB,GAAG,IAAI,GAAG,CACT,KAAK,CAAC,MAAM;aACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;aAClB,MAAM,CAAC,CAAC,EAAE,EAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,kBAAkB,CAAC,CACjE;KACD,CAAC,IAAI,EAAE,CAAC;IAET,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpC,OAAO;YACN,GAAG,KAAK;YACR,KAAK,EAAE,CAAC,EAAC,EAAE,EAAE,kBAAkB,EAAE,WAAW,EAAE,CAAC,EAAC,CAAC;SACjD,CAAC;IACH,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CACzB,kBAAkB,EAClB,IAAI,CAAC,GAAG,CAAC,kBAAkB,EAAE,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAC7D,CAAC;IACF,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAC1B,mBAAmB,EACnB,CAAC,GAAG,SAAS,GAAG,iBAAiB,CAAC,MAAM,CACxC,CAAC;IAEF,OAAO;QACN,GAAG,KAAK;QACR,KAAK,EAAE;YACN,EAAC,EAAE,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAC;YACjD,GAAG,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAC,CAAC,CAAC;SAC9D;KACD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAyB;IACrD,OAAO,MAAM,CAAC,MAAM,IAAI,kBAAkB,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { SdkResult } from '../result.js';
2
+ import { type PrepareChartInput, type PrepareChartOutput } from './schemas.js';
3
+ export declare function prepareChart(input: PrepareChartInput): SdkResult<PrepareChartOutput>;
4
+ export declare function isChartV1Payload(value: unknown): value is PrepareChartOutput;
5
+ //# sourceMappingURL=prepare.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../src/core/chart/prepare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAMN,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,MAAM,cAAc,CAAC;AA2JtB,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAAC,kBAAkB,CAAC,CA+CpF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAM5E"}
@@ -0,0 +1,175 @@
1
+ import { CHART_V1_KIND, DEFAULT_CHART_HEIGHT, DEFAULT_CHART_MAX_POINTS, } from './schemas.js';
2
+ import { applyVolumeDirectionFromCandles } from './volume-direction.js';
3
+ import { expandChartOverlays } from './overlays.js';
4
+ import { buildPaneLayout } from './panes.js';
5
+ function parseChartTime(raw) {
6
+ if (typeof raw === 'string') {
7
+ const trimmed = raw.trim();
8
+ if (/^\d{4}-\d{2}-\d{2}$/.test(trimmed)) {
9
+ const [year, month, day] = trimmed.split('-').map(Number);
10
+ if (!Number.isFinite(year) || !Number.isFinite(month) || !Number.isFinite(day)) {
11
+ return null;
12
+ }
13
+ return { year, month, day };
14
+ }
15
+ const ms = Date.parse(trimmed);
16
+ if (Number.isFinite(ms)) {
17
+ return Math.floor(ms / 1000);
18
+ }
19
+ return null;
20
+ }
21
+ if (typeof raw === 'number' && Number.isFinite(raw)) {
22
+ if (raw > 1e12) {
23
+ return Math.floor(raw / 1000);
24
+ }
25
+ if (raw >= 0) {
26
+ return Math.floor(raw);
27
+ }
28
+ }
29
+ return null;
30
+ }
31
+ function timeSortKey(time) {
32
+ if (typeof time === 'number') {
33
+ return time;
34
+ }
35
+ return time.year * 10_000 + time.month * 100 + time.day;
36
+ }
37
+ function timesEqual(a, b) {
38
+ if (typeof a === 'number' && typeof b === 'number') {
39
+ return a === b;
40
+ }
41
+ if (typeof a === 'object' && typeof b === 'object') {
42
+ return a.year === b.year && a.month === b.month && a.day === b.day;
43
+ }
44
+ return false;
45
+ }
46
+ function normalizeLinePoint(raw) {
47
+ const time = parseChartTime(raw.time);
48
+ const value = raw.value;
49
+ if (time == null || typeof value !== 'number' || !Number.isFinite(value)) {
50
+ return null;
51
+ }
52
+ return { time, value };
53
+ }
54
+ function normalizeCandlePoint(raw) {
55
+ const time = parseChartTime(raw.time);
56
+ const open = raw.open;
57
+ const high = raw.high;
58
+ const low = raw.low;
59
+ const close = raw.close;
60
+ if (time == null ||
61
+ typeof open !== 'number' ||
62
+ typeof high !== 'number' ||
63
+ typeof low !== 'number' ||
64
+ typeof close !== 'number' ||
65
+ ![open, high, low, close].every(Number.isFinite)) {
66
+ return null;
67
+ }
68
+ return { time, open, high, low, close };
69
+ }
70
+ function normalizeHistogramPoint(raw) {
71
+ const time = parseChartTime(raw.time);
72
+ const value = raw.value;
73
+ if (time == null || typeof value !== 'number' || !Number.isFinite(value)) {
74
+ return null;
75
+ }
76
+ const color = raw.color;
77
+ return {
78
+ time,
79
+ value,
80
+ ...(typeof color === 'string' && color.trim() ? { color: color.trim() } : {}),
81
+ };
82
+ }
83
+ function dedupeSortedByTime(rows) {
84
+ const out = [];
85
+ for (const row of rows) {
86
+ const last = out.at(-1);
87
+ if (last && timesEqual(last.time, row.time)) {
88
+ out[out.length - 1] = row;
89
+ continue;
90
+ }
91
+ out.push(row);
92
+ }
93
+ return out;
94
+ }
95
+ function normalizeSeriesData(type, rawRows, maxPoints) {
96
+ const normalized = [];
97
+ for (const raw of rawRows) {
98
+ if (type === 'candlestick') {
99
+ const candle = normalizeCandlePoint(raw);
100
+ if (candle) {
101
+ normalized.push(candle);
102
+ }
103
+ continue;
104
+ }
105
+ if (type === 'histogram') {
106
+ const bar = normalizeHistogramPoint(raw);
107
+ if (bar) {
108
+ normalized.push(bar);
109
+ }
110
+ continue;
111
+ }
112
+ const line = normalizeLinePoint(raw);
113
+ if (line) {
114
+ normalized.push(line);
115
+ }
116
+ }
117
+ if (normalized.length === 0) {
118
+ return {
119
+ ok: false,
120
+ reason: `Series type "${type}" has no valid data points (each point needs a valid time and numeric fields).`,
121
+ };
122
+ }
123
+ normalized.sort((a, b) => timeSortKey(a.time) - timeSortKey(b.time));
124
+ const deduped = dedupeSortedByTime(normalized);
125
+ const capped = deduped.length > maxPoints ? deduped.slice(deduped.length - maxPoints) : deduped;
126
+ return { ok: true, data: capped };
127
+ }
128
+ export function prepareChart(input) {
129
+ const maxPoints = input.options?.maxPoints ?? DEFAULT_CHART_MAX_POINTS;
130
+ const seriesOut = [];
131
+ for (const series of input.series) {
132
+ const dataResult = normalizeSeriesData(series.type, series.data, maxPoints);
133
+ if (!dataResult.ok) {
134
+ return {
135
+ ok: false,
136
+ reason: `Series "${series.id}": ${dataResult.reason}`,
137
+ };
138
+ }
139
+ seriesOut.push({
140
+ id: series.id,
141
+ type: series.type,
142
+ label: series.label,
143
+ data: dataResult.data,
144
+ ...(series.priceScaleId ? { priceScaleId: series.priceScaleId } : {}),
145
+ ...(series.overlay != null ? { overlay: series.overlay } : {}),
146
+ ...(series.style ? { style: series.style } : {}),
147
+ });
148
+ }
149
+ const colorVolumeFromCandles = input.options?.colorVolumeFromCandles ?? true;
150
+ const seriesWithVolumeDirection = applyVolumeDirectionFromCandles(seriesOut, colorVolumeFromCandles);
151
+ const expanded = expandChartOverlays(seriesWithVolumeDirection, input.overlays);
152
+ if (!expanded.ok) {
153
+ return expanded;
154
+ }
155
+ const chartPayload = buildPaneLayout({
156
+ ...(input.title?.trim() ? { title: input.title.trim() } : {}),
157
+ height: input.height ?? DEFAULT_CHART_HEIGHT,
158
+ series: expanded.data,
159
+ });
160
+ return {
161
+ ok: true,
162
+ data: {
163
+ kind: CHART_V1_KIND,
164
+ chart: chartPayload,
165
+ },
166
+ };
167
+ }
168
+ export function isChartV1Payload(value) {
169
+ if (!value || typeof value !== 'object') {
170
+ return false;
171
+ }
172
+ const o = value;
173
+ return o.kind === CHART_V1_KIND && typeof o.chart === 'object' && o.chart != null;
174
+ }
175
+ //# sourceMappingURL=prepare.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepare.js","sourceRoot":"","sources":["../../../src/core/chart/prepare.ts"],"names":[],"mappings":"AACA,OAAO,EACN,aAAa,EACb,oBAAoB,EACpB,wBAAwB,GAKxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,+BAA+B,EAAC,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAClD,OAAO,EAAC,eAAe,EAAC,M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C,CAAC;IAC3C,OAAO,CAAC,CAAC,IAAI,KAAK,aAAa,IAAI,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC;AACnF,CAAC"}
@@ -0,0 +1,321 @@
1
+ import { z } from 'zod';
2
+ export { ChartOverlayInputSchema, PrepareChartOverlaysSchema } from './overlay-schemas.js';
3
+ export type { ChartOverlayInput } from './overlay-schemas.js';
4
+ export declare const CHART_V1_KIND: "continuum/chart/v1";
5
+ export declare const DEFAULT_CHART_MAX_POINTS = 5000;
6
+ export declare const DEFAULT_CHART_HEIGHT = 280;
7
+ export declare const MAX_CHART_SERIES = 40;
8
+ export declare const ChartSeriesTypeSchema: z.ZodEnum<{
9
+ line: "line";
10
+ candlestick: "candlestick";
11
+ area: "area";
12
+ histogram: "histogram";
13
+ }>;
14
+ export declare const ChartLineStyleSchema: z.ZodEnum<{
15
+ solid: "solid";
16
+ dashed: "dashed";
17
+ dotted: "dotted";
18
+ }>;
19
+ export declare const ChartSeriesStyleSchema: z.ZodObject<{
20
+ color: z.ZodOptional<z.ZodString>;
21
+ lineWidth: z.ZodOptional<z.ZodNumber>;
22
+ lineStyle: z.ZodOptional<z.ZodEnum<{
23
+ solid: "solid";
24
+ dashed: "dashed";
25
+ dotted: "dotted";
26
+ }>>;
27
+ }, z.core.$strict>;
28
+ export declare const ChartSeriesInputSchema: z.ZodObject<{
29
+ id: z.ZodString;
30
+ type: z.ZodEnum<{
31
+ line: "line";
32
+ candlestick: "candlestick";
33
+ area: "area";
34
+ histogram: "histogram";
35
+ }>;
36
+ label: z.ZodString;
37
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
38
+ priceScaleId: z.ZodOptional<z.ZodEnum<{
39
+ left: "left";
40
+ right: "right";
41
+ }>>;
42
+ overlay: z.ZodOptional<z.ZodBoolean>;
43
+ style: z.ZodOptional<z.ZodObject<{
44
+ color: z.ZodOptional<z.ZodString>;
45
+ lineWidth: z.ZodOptional<z.ZodNumber>;
46
+ lineStyle: z.ZodOptional<z.ZodEnum<{
47
+ solid: "solid";
48
+ dashed: "dashed";
49
+ dotted: "dotted";
50
+ }>>;
51
+ }, z.core.$strict>>;
52
+ }, z.core.$strict>;
53
+ export declare const PrepareChartInputSchema: z.ZodObject<{
54
+ title: z.ZodOptional<z.ZodString>;
55
+ height: z.ZodOptional<z.ZodNumber>;
56
+ series: z.ZodArray<z.ZodObject<{
57
+ id: z.ZodString;
58
+ type: z.ZodEnum<{
59
+ line: "line";
60
+ candlestick: "candlestick";
61
+ area: "area";
62
+ histogram: "histogram";
63
+ }>;
64
+ label: z.ZodString;
65
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
66
+ priceScaleId: z.ZodOptional<z.ZodEnum<{
67
+ left: "left";
68
+ right: "right";
69
+ }>>;
70
+ overlay: z.ZodOptional<z.ZodBoolean>;
71
+ style: z.ZodOptional<z.ZodObject<{
72
+ color: z.ZodOptional<z.ZodString>;
73
+ lineWidth: z.ZodOptional<z.ZodNumber>;
74
+ lineStyle: z.ZodOptional<z.ZodEnum<{
75
+ solid: "solid";
76
+ dashed: "dashed";
77
+ dotted: "dotted";
78
+ }>>;
79
+ }, z.core.$strict>>;
80
+ }, z.core.$strict>>;
81
+ overlays: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
82
+ type: z.ZodEnum<{
83
+ sma: "sma";
84
+ ema: "ema";
85
+ }>;
86
+ sourceSeriesId: z.ZodString;
87
+ period: z.ZodOptional<z.ZodNumber>;
88
+ id: z.ZodOptional<z.ZodString>;
89
+ label: z.ZodOptional<z.ZodString>;
90
+ overlay: z.ZodOptional<z.ZodBoolean>;
91
+ priceScaleId: z.ZodOptional<z.ZodEnum<{
92
+ left: "left";
93
+ right: "right";
94
+ }>>;
95
+ style: z.ZodOptional<z.ZodObject<{
96
+ color: z.ZodOptional<z.ZodString>;
97
+ lineWidth: z.ZodOptional<z.ZodNumber>;
98
+ lineStyle: z.ZodOptional<z.ZodEnum<{
99
+ solid: "solid";
100
+ dashed: "dashed";
101
+ dotted: "dotted";
102
+ }>>;
103
+ }, z.core.$strict>>;
104
+ }, z.core.$strict>, z.ZodObject<{
105
+ type: z.ZodLiteral<"bollinger">;
106
+ sourceSeriesId: z.ZodString;
107
+ period: z.ZodOptional<z.ZodNumber>;
108
+ stdDev: z.ZodOptional<z.ZodNumber>;
109
+ id: z.ZodOptional<z.ZodString>;
110
+ overlay: z.ZodOptional<z.ZodBoolean>;
111
+ priceScaleId: z.ZodOptional<z.ZodEnum<{
112
+ left: "left";
113
+ right: "right";
114
+ }>>;
115
+ style: z.ZodOptional<z.ZodObject<{
116
+ color: z.ZodOptional<z.ZodString>;
117
+ lineWidth: z.ZodOptional<z.ZodNumber>;
118
+ lineStyle: z.ZodOptional<z.ZodEnum<{
119
+ solid: "solid";
120
+ dashed: "dashed";
121
+ dotted: "dotted";
122
+ }>>;
123
+ }, z.core.$strict>>;
124
+ }, z.core.$strict>, z.ZodObject<{
125
+ type: z.ZodLiteral<"fibonacci">;
126
+ sourceSeriesId: z.ZodOptional<z.ZodString>;
127
+ range: z.ZodOptional<z.ZodObject<{
128
+ high: z.ZodNumber;
129
+ low: z.ZodNumber;
130
+ trend: z.ZodEnum<{
131
+ up: "up";
132
+ down: "down";
133
+ }>;
134
+ }, z.core.$strict>>;
135
+ levels: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
136
+ trend: z.ZodOptional<z.ZodEnum<{
137
+ up: "up";
138
+ down: "down";
139
+ }>>;
140
+ id: z.ZodOptional<z.ZodString>;
141
+ overlay: z.ZodOptional<z.ZodBoolean>;
142
+ priceScaleId: z.ZodOptional<z.ZodEnum<{
143
+ left: "left";
144
+ right: "right";
145
+ }>>;
146
+ style: z.ZodOptional<z.ZodObject<{
147
+ color: z.ZodOptional<z.ZodString>;
148
+ lineWidth: z.ZodOptional<z.ZodNumber>;
149
+ lineStyle: z.ZodOptional<z.ZodEnum<{
150
+ solid: "solid";
151
+ dashed: "dashed";
152
+ dotted: "dotted";
153
+ }>>;
154
+ }, z.core.$strict>>;
155
+ }, z.core.$strict>, z.ZodObject<{
156
+ type: z.ZodLiteral<"rsi">;
157
+ sourceSeriesId: z.ZodString;
158
+ period: z.ZodOptional<z.ZodNumber>;
159
+ id: z.ZodOptional<z.ZodString>;
160
+ label: z.ZodOptional<z.ZodString>;
161
+ style: z.ZodOptional<z.ZodObject<{
162
+ color: z.ZodOptional<z.ZodString>;
163
+ lineWidth: z.ZodOptional<z.ZodNumber>;
164
+ lineStyle: z.ZodOptional<z.ZodEnum<{
165
+ solid: "solid";
166
+ dashed: "dashed";
167
+ dotted: "dotted";
168
+ }>>;
169
+ }, z.core.$strict>>;
170
+ }, z.core.$strict>, z.ZodObject<{
171
+ type: z.ZodLiteral<"macd">;
172
+ sourceSeriesId: z.ZodString;
173
+ fastPeriod: z.ZodOptional<z.ZodNumber>;
174
+ slowPeriod: z.ZodOptional<z.ZodNumber>;
175
+ signalPeriod: z.ZodOptional<z.ZodNumber>;
176
+ id: z.ZodOptional<z.ZodString>;
177
+ style: z.ZodOptional<z.ZodObject<{
178
+ color: z.ZodOptional<z.ZodString>;
179
+ lineWidth: z.ZodOptional<z.ZodNumber>;
180
+ lineStyle: z.ZodOptional<z.ZodEnum<{
181
+ solid: "solid";
182
+ dashed: "dashed";
183
+ dotted: "dotted";
184
+ }>>;
185
+ }, z.core.$strict>>;
186
+ }, z.core.$strict>, z.ZodObject<{
187
+ type: z.ZodLiteral<"stochasticrsi">;
188
+ sourceSeriesId: z.ZodString;
189
+ rsiPeriod: z.ZodOptional<z.ZodNumber>;
190
+ stochasticPeriod: z.ZodOptional<z.ZodNumber>;
191
+ kPeriod: z.ZodOptional<z.ZodNumber>;
192
+ dPeriod: z.ZodOptional<z.ZodNumber>;
193
+ id: z.ZodOptional<z.ZodString>;
194
+ style: z.ZodOptional<z.ZodObject<{
195
+ color: z.ZodOptional<z.ZodString>;
196
+ lineWidth: z.ZodOptional<z.ZodNumber>;
197
+ lineStyle: z.ZodOptional<z.ZodEnum<{
198
+ solid: "solid";
199
+ dashed: "dashed";
200
+ dotted: "dotted";
201
+ }>>;
202
+ }, z.core.$strict>>;
203
+ }, z.core.$strict>], "type">>>;
204
+ options: z.ZodOptional<z.ZodObject<{
205
+ maxPoints: z.ZodOptional<z.ZodNumber>;
206
+ colorVolumeFromCandles: z.ZodOptional<z.ZodBoolean>;
207
+ }, z.core.$strict>>;
208
+ }, z.core.$strict>;
209
+ export declare const ChartTimeSchema: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
210
+ year: z.ZodNumber;
211
+ month: z.ZodNumber;
212
+ day: z.ZodNumber;
213
+ }, z.core.$strict>]>;
214
+ export declare const ChartPaneSchema: z.ZodObject<{
215
+ id: z.ZodString;
216
+ heightRatio: z.ZodNumber;
217
+ }, z.core.$strict>;
218
+ export declare const ChartSeriesOutputSchema: z.ZodObject<{
219
+ id: z.ZodString;
220
+ type: z.ZodEnum<{
221
+ line: "line";
222
+ candlestick: "candlestick";
223
+ area: "area";
224
+ histogram: "histogram";
225
+ }>;
226
+ label: z.ZodString;
227
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
228
+ priceScaleId: z.ZodOptional<z.ZodEnum<{
229
+ left: "left";
230
+ right: "right";
231
+ }>>;
232
+ paneId: z.ZodOptional<z.ZodString>;
233
+ overlay: z.ZodOptional<z.ZodBoolean>;
234
+ style: z.ZodOptional<z.ZodObject<{
235
+ color: z.ZodOptional<z.ZodString>;
236
+ lineWidth: z.ZodOptional<z.ZodNumber>;
237
+ lineStyle: z.ZodOptional<z.ZodEnum<{
238
+ solid: "solid";
239
+ dashed: "dashed";
240
+ dotted: "dotted";
241
+ }>>;
242
+ }, z.core.$strict>>;
243
+ }, z.core.$strict>;
244
+ export declare const ChartV1PayloadSchema: z.ZodObject<{
245
+ title: z.ZodOptional<z.ZodString>;
246
+ height: z.ZodOptional<z.ZodNumber>;
247
+ panes: z.ZodOptional<z.ZodArray<z.ZodObject<{
248
+ id: z.ZodString;
249
+ heightRatio: z.ZodNumber;
250
+ }, z.core.$strict>>>;
251
+ series: z.ZodArray<z.ZodObject<{
252
+ id: z.ZodString;
253
+ type: z.ZodEnum<{
254
+ line: "line";
255
+ candlestick: "candlestick";
256
+ area: "area";
257
+ histogram: "histogram";
258
+ }>;
259
+ label: z.ZodString;
260
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
261
+ priceScaleId: z.ZodOptional<z.ZodEnum<{
262
+ left: "left";
263
+ right: "right";
264
+ }>>;
265
+ paneId: z.ZodOptional<z.ZodString>;
266
+ overlay: z.ZodOptional<z.ZodBoolean>;
267
+ style: z.ZodOptional<z.ZodObject<{
268
+ color: z.ZodOptional<z.ZodString>;
269
+ lineWidth: z.ZodOptional<z.ZodNumber>;
270
+ lineStyle: z.ZodOptional<z.ZodEnum<{
271
+ solid: "solid";
272
+ dashed: "dashed";
273
+ dotted: "dotted";
274
+ }>>;
275
+ }, z.core.$strict>>;
276
+ }, z.core.$strict>>;
277
+ }, z.core.$strict>;
278
+ export declare const PrepareChartOutputSchema: z.ZodObject<{
279
+ kind: z.ZodLiteral<"continuum/chart/v1">;
280
+ chart: z.ZodObject<{
281
+ title: z.ZodOptional<z.ZodString>;
282
+ height: z.ZodOptional<z.ZodNumber>;
283
+ panes: z.ZodOptional<z.ZodArray<z.ZodObject<{
284
+ id: z.ZodString;
285
+ heightRatio: z.ZodNumber;
286
+ }, z.core.$strict>>>;
287
+ series: z.ZodArray<z.ZodObject<{
288
+ id: z.ZodString;
289
+ type: z.ZodEnum<{
290
+ line: "line";
291
+ candlestick: "candlestick";
292
+ area: "area";
293
+ histogram: "histogram";
294
+ }>;
295
+ label: z.ZodString;
296
+ data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
297
+ priceScaleId: z.ZodOptional<z.ZodEnum<{
298
+ left: "left";
299
+ right: "right";
300
+ }>>;
301
+ paneId: z.ZodOptional<z.ZodString>;
302
+ overlay: z.ZodOptional<z.ZodBoolean>;
303
+ style: z.ZodOptional<z.ZodObject<{
304
+ color: z.ZodOptional<z.ZodString>;
305
+ lineWidth: z.ZodOptional<z.ZodNumber>;
306
+ lineStyle: z.ZodOptional<z.ZodEnum<{
307
+ solid: "solid";
308
+ dashed: "dashed";
309
+ dotted: "dotted";
310
+ }>>;
311
+ }, z.core.$strict>>;
312
+ }, z.core.$strict>>;
313
+ }, z.core.$strict>;
314
+ }, z.core.$strict>;
315
+ export type ChartSeriesType = z.infer<typeof ChartSeriesTypeSchema>;
316
+ export type ChartSeriesStyle = z.infer<typeof ChartSeriesStyleSchema>;
317
+ export type PrepareChartInput = z.infer<typeof PrepareChartInputSchema>;
318
+ export type PrepareChartOutput = z.infer<typeof PrepareChartOutputSchema>;
319
+ export type ChartV1Payload = z.infer<typeof ChartV1PayloadSchema>;
320
+ export type ChartTime = z.infer<typeof ChartTimeSchema>;
321
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/core/chart/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,EAAC,uBAAuB,EAAE,0BAA0B,EAAC,MAAM,sBAAsB,CAAC;AACzF,YAAY,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAE5D,eAAO,MAAM,aAAa,EAAG,oBAA6B,CAAC;AAE3D,eAAO,MAAM,wBAAwB,OAAQ,CAAC;AAC9C,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,eAAO,MAAM,qBAAqB;;;;;EAAuD,CAAC;AAE1F,eAAO,MAAM,oBAAoB;;;;EAAwC,CAAC;AAE1E,eAAO,MAAM,sBAAsB;;;;;;;;kBAMzB,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;kBAUzB,CAAC;AAEX,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAe1B,CAAC;AAEX,eAAO,MAAM,eAAe;;;;oBAS1B,CAAC;AAEH,eAAO,MAAM,eAAe;;;kBAKlB,CAAC;AAEX,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;kBAW1B,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAOvB,CAAC;AAEX,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAK3B,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -0,0 +1,86 @@
1
+ import { z } from 'zod';
2
+ import { PrepareChartOverlaysSchema } from './overlay-schemas.js';
3
+ export { ChartOverlayInputSchema, PrepareChartOverlaysSchema } from './overlay-schemas.js';
4
+ export const CHART_V1_KIND = 'continuum/chart/v1';
5
+ export const DEFAULT_CHART_MAX_POINTS = 5_000;
6
+ export const DEFAULT_CHART_HEIGHT = 280;
7
+ export const MAX_CHART_SERIES = 40;
8
+ export const ChartSeriesTypeSchema = z.enum(['line', 'candlestick', 'area', 'histogram']);
9
+ export const ChartLineStyleSchema = z.enum(['solid', 'dashed', 'dotted']);
10
+ export const ChartSeriesStyleSchema = z
11
+ .object({
12
+ color: z.string().min(1).optional(),
13
+ lineWidth: z.number().positive().optional(),
14
+ lineStyle: ChartLineStyleSchema.optional(),
15
+ })
16
+ .strict();
17
+ export const ChartSeriesInputSchema = z
18
+ .object({
19
+ id: z.string().min(1).max(64),
20
+ type: ChartSeriesTypeSchema,
21
+ label: z.string().min(1).max(128),
22
+ data: z.array(z.record(z.string(), z.unknown())).min(1),
23
+ priceScaleId: z.enum(['left', 'right']).optional(),
24
+ overlay: z.boolean().optional(),
25
+ style: ChartSeriesStyleSchema.optional(),
26
+ })
27
+ .strict();
28
+ export const PrepareChartInputSchema = z
29
+ .object({
30
+ title: z.string().max(256).optional(),
31
+ height: z.number().int().min(120).max(800).optional(),
32
+ series: z.array(ChartSeriesInputSchema).min(1).max(16),
33
+ overlays: PrepareChartOverlaysSchema.optional(),
34
+ options: z
35
+ .object({
36
+ maxPoints: z.number().int().min(2).max(DEFAULT_CHART_MAX_POINTS).optional(),
37
+ /** Match histogram bars to candlestick open/close at the same time (any bar period). Default true. */
38
+ colorVolumeFromCandles: z.boolean().optional(),
39
+ })
40
+ .strict()
41
+ .optional(),
42
+ })
43
+ .strict();
44
+ export const ChartTimeSchema = z.union([
45
+ z.number().int().nonnegative(),
46
+ z
47
+ .object({
48
+ year: z.number().int(),
49
+ month: z.number().int().min(1).max(12),
50
+ day: z.number().int().min(1).max(31),
51
+ })
52
+ .strict(),
53
+ ]);
54
+ export const ChartPaneSchema = z
55
+ .object({
56
+ id: z.string().min(1).max(64),
57
+ heightRatio: z.number().positive().max(1),
58
+ })
59
+ .strict();
60
+ export const ChartSeriesOutputSchema = z
61
+ .object({
62
+ id: z.string(),
63
+ type: ChartSeriesTypeSchema,
64
+ label: z.string(),
65
+ data: z.array(z.record(z.string(), z.unknown())),
66
+ priceScaleId: z.enum(['left', 'right']).optional(),
67
+ paneId: z.string().min(1).max(64).optional(),
68
+ overlay: z.boolean().optional(),
69
+ style: ChartSeriesStyleSchema.optional(),
70
+ })
71
+ .strict();
72
+ export const ChartV1PayloadSchema = z
73
+ .object({
74
+ title: z.string().optional(),
75
+ height: z.number().int().optional(),
76
+ panes: z.array(ChartPaneSchema).min(1).max(12).optional(),
77
+ series: z.array(ChartSeriesOutputSchema).min(1).max(MAX_CHART_SERIES),
78
+ })
79
+ .strict();
80
+ export const PrepareChartOutputSchema = z
81
+ .object({
82
+ kind: z.literal(CHART_V1_KIND),
83
+ chart: ChartV1PayloadSchema,
84
+ })
85
+ .strict();
86
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/core/chart/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EAAC,0BAA0B,EAAC,MAAM,sBAAsB,CAAC;AAEhE,OAAO,EAAC,uBAAuB,EAAE,0BAA0B,EAAC,MAAM,sBAAsB,CAAC;AAGzF,MAAM,CAAC,MAAM,aAAa,GAAG,oBAA6B,CAAC;AAE3D,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAC9C,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AACxC,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAEnC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAE1F,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IA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,CAAC,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC;CACrE,CAAC;KACD,MAAM,EAAE,CAAC;AAEX,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC;KACvC,MAAM,CAAC;IACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC9B,KAAK,EAAE,oBAAoB;CAC3B,CAAC;KACD,MAAM,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { ChartTime } from './schemas.js';
2
+ export type VolumeBarDirection = 'up' | 'down';
3
+ export declare function chartTimeKey(time: ChartTime): string;
4
+ export declare function candleDirection(open: number, close: number): VolumeBarDirection;
5
+ type CandlestickSeriesLike = {
6
+ type: string;
7
+ data: Record<string, unknown>[];
8
+ };
9
+ export declare function buildCandleDirectionMap(seriesList: CandlestickSeriesLike[]): Map<string, VolumeBarDirection>;
10
+ export declare function applyVolumeDirectionFromCandles<TSeries extends {
11
+ type: string;
12
+ data: Record<string, unknown>[];
13
+ }>(seriesList: TSeries[], enabled?: boolean): TSeries[];
14
+ export {};
15
+ //# sourceMappingURL=volume-direction.d.ts.map