@forgecharts/sdk 1.1.32 → 1.1.36

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 (162) hide show
  1. package/dist/api/IndicatorDAG.d.ts +2 -0
  2. package/dist/api/IndicatorDAG.d.ts.map +1 -1
  3. package/dist/api/TChart.d.ts +13 -0
  4. package/dist/api/TChart.d.ts.map +1 -1
  5. package/dist/api/drawingUtils.d.ts +6 -0
  6. package/dist/api/drawingUtils.d.ts.map +1 -1
  7. package/dist/core/Chart.d.ts +30 -1
  8. package/dist/core/Chart.d.ts.map +1 -1
  9. package/dist/core/Crosshair.d.ts.map +1 -1
  10. package/dist/core/InteractionManager.d.ts +16 -1
  11. package/dist/core/InteractionManager.d.ts.map +1 -1
  12. package/dist/core/TimeScale.d.ts.map +1 -1
  13. package/dist/datafeed/DatafeedConnector.d.ts.map +1 -1
  14. package/dist/forgecharts.css +4143 -0
  15. package/dist/{tscript/TScriptIndicator.d.ts → forgescript/ForgeScriptIndicator.d.ts} +19 -5
  16. package/dist/forgescript/ForgeScriptIndicator.d.ts.map +1 -0
  17. package/dist/forgescript/ForgeScriptTypes.d.ts +89 -0
  18. package/dist/forgescript/ForgeScriptTypes.d.ts.map +1 -0
  19. package/dist/forgescript/__tests__/ai-response-parser.test.d.ts +2 -0
  20. package/dist/forgescript/__tests__/ai-response-parser.test.d.ts.map +1 -0
  21. package/dist/forgescript/__tests__/language-detector.test.d.ts +2 -0
  22. package/dist/forgescript/__tests__/language-detector.test.d.ts.map +1 -0
  23. package/dist/forgescript/__tests__/lexer.test.d.ts +2 -0
  24. package/dist/forgescript/__tests__/lexer.test.d.ts.map +1 -0
  25. package/dist/forgescript/__tests__/orchestrator.test.d.ts +2 -0
  26. package/dist/forgescript/__tests__/orchestrator.test.d.ts.map +1 -0
  27. package/dist/forgescript/__tests__/parser.test.d.ts +2 -0
  28. package/dist/forgescript/__tests__/parser.test.d.ts.map +1 -0
  29. package/dist/forgescript/__tests__/pine-transpiler.test.d.ts +2 -0
  30. package/dist/forgescript/__tests__/pine-transpiler.test.d.ts.map +1 -0
  31. package/dist/forgescript/__tests__/runtime.test.d.ts +2 -0
  32. package/dist/forgescript/__tests__/runtime.test.d.ts.map +1 -0
  33. package/dist/forgescript/__tests__/sandbox.test.d.ts +2 -0
  34. package/dist/forgescript/__tests__/sandbox.test.d.ts.map +1 -0
  35. package/dist/forgescript/__tests__/save-gate.test.d.ts +2 -0
  36. package/dist/forgescript/__tests__/save-gate.test.d.ts.map +1 -0
  37. package/dist/forgescript/__tests__/series.test.d.ts +2 -0
  38. package/dist/forgescript/__tests__/series.test.d.ts.map +1 -0
  39. package/dist/forgescript/__tests__/telemetry.test.d.ts +2 -0
  40. package/dist/forgescript/__tests__/telemetry.test.d.ts.map +1 -0
  41. package/dist/forgescript/__tests__/validation.test.d.ts +2 -0
  42. package/dist/forgescript/__tests__/validation.test.d.ts.map +1 -0
  43. package/dist/forgescript/ast.d.ts +153 -0
  44. package/dist/forgescript/ast.d.ts.map +1 -0
  45. package/dist/forgescript/builtins/color.d.ts +29 -0
  46. package/dist/forgescript/builtins/color.d.ts.map +1 -0
  47. package/dist/forgescript/builtins/math.d.ts +22 -0
  48. package/dist/forgescript/builtins/math.d.ts.map +1 -0
  49. package/dist/forgescript/builtins/request.d.ts +22 -0
  50. package/dist/forgescript/builtins/request.d.ts.map +1 -0
  51. package/dist/forgescript/builtins/syminfo.d.ts +27 -0
  52. package/dist/forgescript/builtins/syminfo.d.ts.map +1 -0
  53. package/dist/forgescript/builtins/ta.d.ts +39 -0
  54. package/dist/forgescript/builtins/ta.d.ts.map +1 -0
  55. package/dist/forgescript/conversion/ai-conversion-agent.d.ts +41 -0
  56. package/dist/forgescript/conversion/ai-conversion-agent.d.ts.map +1 -0
  57. package/dist/forgescript/conversion/conversion-orchestrator.d.ts +44 -0
  58. package/dist/forgescript/conversion/conversion-orchestrator.d.ts.map +1 -0
  59. package/dist/forgescript/conversion/index.d.ts +19 -0
  60. package/dist/forgescript/conversion/index.d.ts.map +1 -0
  61. package/dist/forgescript/conversion/language-detector.d.ts +27 -0
  62. package/dist/forgescript/conversion/language-detector.d.ts.map +1 -0
  63. package/dist/forgescript/conversion/prompts/index.d.ts +17 -0
  64. package/dist/forgescript/conversion/prompts/index.d.ts.map +1 -0
  65. package/dist/forgescript/conversion/sandbox.d.ts +23 -0
  66. package/dist/forgescript/conversion/sandbox.d.ts.map +1 -0
  67. package/dist/forgescript/conversion/save-gate.d.ts +29 -0
  68. package/dist/forgescript/conversion/save-gate.d.ts.map +1 -0
  69. package/dist/forgescript/conversion/telemetry.d.ts +22 -0
  70. package/dist/forgescript/conversion/telemetry.d.ts.map +1 -0
  71. package/dist/forgescript/conversion/types.d.ts +120 -0
  72. package/dist/forgescript/conversion/types.d.ts.map +1 -0
  73. package/dist/forgescript/conversion/validation.d.ts +18 -0
  74. package/dist/forgescript/conversion/validation.d.ts.map +1 -0
  75. package/dist/{tscript → forgescript}/lexer.d.ts +7 -1
  76. package/dist/forgescript/lexer.d.ts.map +1 -0
  77. package/dist/{tscript → forgescript}/parser.d.ts +14 -0
  78. package/dist/forgescript/parser.d.ts.map +1 -0
  79. package/dist/{pine → forgescript/pine}/PineCompiler.d.ts +7 -4
  80. package/dist/forgescript/pine/PineCompiler.d.ts.map +1 -0
  81. package/dist/forgescript/pine/diagnostics.d.ts.map +1 -0
  82. package/dist/forgescript/pine/index.d.ts.map +1 -0
  83. package/dist/{pine → forgescript/pine}/pine-ast.d.ts +50 -2
  84. package/dist/forgescript/pine/pine-ast.d.ts.map +1 -0
  85. package/dist/forgescript/pine/pine-lexer.d.ts.map +1 -0
  86. package/dist/forgescript/pine/pine-parser.d.ts +108 -0
  87. package/dist/forgescript/pine/pine-parser.d.ts.map +1 -0
  88. package/dist/{pine → forgescript/pine}/pine-transpiler.d.ts +10 -3
  89. package/dist/forgescript/pine/pine-transpiler.d.ts.map +1 -0
  90. package/dist/forgescript/runtime.d.ts +307 -0
  91. package/dist/forgescript/runtime.d.ts.map +1 -0
  92. package/dist/forgescript/series.d.ts.map +1 -0
  93. package/dist/index.d.ts +9 -6
  94. package/dist/index.d.ts.map +1 -1
  95. package/dist/index.js +3365 -265
  96. package/dist/index.js.map +1 -1
  97. package/dist/internal.js +3409 -309
  98. package/dist/internal.js.map +1 -1
  99. package/dist/licensing/ChartRuntimeResolver.d.ts +4 -0
  100. package/dist/licensing/ChartRuntimeResolver.d.ts.map +1 -1
  101. package/dist/licensing/licenseTypes.d.ts +18 -0
  102. package/dist/licensing/licenseTypes.d.ts.map +1 -1
  103. package/dist/logo_dark-B2KCSRPJ.png +0 -0
  104. package/dist/logo_light-NAWNBY4G.png +0 -0
  105. package/dist/react/canvas/ChartCanvas.d.ts +18 -2
  106. package/dist/react/canvas/ChartCanvas.d.ts.map +1 -1
  107. package/dist/react/canvas/PointerOverlay.d.ts +3 -1
  108. package/dist/react/canvas/PointerOverlay.d.ts.map +1 -1
  109. package/dist/react/canvas/TableOverlay.d.ts +12 -0
  110. package/dist/react/canvas/TableOverlay.d.ts.map +1 -0
  111. package/dist/react/canvas/toolbars/LeftToolbar.d.ts +7 -1
  112. package/dist/react/canvas/toolbars/LeftToolbar.d.ts.map +1 -1
  113. package/dist/react/hooks/useBrokerEvents.d.ts +32 -0
  114. package/dist/react/hooks/useBrokerEvents.d.ts.map +1 -0
  115. package/dist/react/index.js +2506 -387
  116. package/dist/react/index.js.map +1 -1
  117. package/dist/react/internal.d.ts +1 -1
  118. package/dist/react/internal.d.ts.map +1 -1
  119. package/dist/react/internal.js +5103 -988
  120. package/dist/react/internal.js.map +1 -1
  121. package/dist/react/shell/ManagedAppShell.d.ts +20 -0
  122. package/dist/react/shell/ManagedAppShell.d.ts.map +1 -1
  123. package/dist/react/shell/OrderEntryPanel.d.ts +73 -1
  124. package/dist/react/shell/OrderEntryPanel.d.ts.map +1 -1
  125. package/dist/react/shell/ScriptDrawer.d.ts +5 -1
  126. package/dist/react/shell/ScriptDrawer.d.ts.map +1 -1
  127. package/dist/react/shell/TradeDrawer.d.ts +8 -1
  128. package/dist/react/shell/TradeDrawer.d.ts.map +1 -1
  129. package/dist/react/shell/WatchlistDrawer.d.ts.map +1 -1
  130. package/dist/react/shell/useWatchlistQuotes.d.ts +1 -0
  131. package/dist/react/shell/useWatchlistQuotes.d.ts.map +1 -1
  132. package/dist/react/workspace/ChartWorkspace.d.ts +5 -1
  133. package/dist/react/workspace/ChartWorkspace.d.ts.map +1 -1
  134. package/dist/react/workspace/SymbolSearchDialog.d.ts.map +1 -1
  135. package/dist/react/workspace/TabBar.d.ts.map +1 -1
  136. package/dist/react/workspace/toolbars/BottomToolbar.d.ts.map +1 -1
  137. package/dist/react/workspace/toolbars/TopToolbar.d.ts +2 -1
  138. package/dist/react/workspace/toolbars/TopToolbar.d.ts.map +1 -1
  139. package/dist/renderers/CandlestickRenderer.d.ts.map +1 -1
  140. package/dist/services/serverClock.d.ts +61 -0
  141. package/dist/services/serverClock.d.ts.map +1 -0
  142. package/package.json +3 -2
  143. package/dist/pine/PineCompiler.d.ts.map +0 -1
  144. package/dist/pine/diagnostics.d.ts.map +0 -1
  145. package/dist/pine/index.d.ts.map +0 -1
  146. package/dist/pine/pine-ast.d.ts.map +0 -1
  147. package/dist/pine/pine-lexer.d.ts.map +0 -1
  148. package/dist/pine/pine-parser.d.ts +0 -51
  149. package/dist/pine/pine-parser.d.ts.map +0 -1
  150. package/dist/pine/pine-transpiler.d.ts.map +0 -1
  151. package/dist/tscript/TScriptIndicator.d.ts.map +0 -1
  152. package/dist/tscript/ast.d.ts +0 -89
  153. package/dist/tscript/ast.d.ts.map +0 -1
  154. package/dist/tscript/lexer.d.ts.map +0 -1
  155. package/dist/tscript/parser.d.ts.map +0 -1
  156. package/dist/tscript/runtime.d.ts +0 -123
  157. package/dist/tscript/runtime.d.ts.map +0 -1
  158. package/dist/tscript/series.d.ts.map +0 -1
  159. /package/dist/{pine → forgescript/pine}/diagnostics.d.ts +0 -0
  160. /package/dist/{pine → forgescript/pine}/index.d.ts +0 -0
  161. /package/dist/{pine → forgescript/pine}/pine-lexer.d.ts +0 -0
  162. /package/dist/{tscript → forgescript}/series.d.ts +0 -0
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Conversion Orchestrator — central pipeline for AI-assisted script conversion.
3
+ *
4
+ * Pipeline flow:
5
+ * 1. Language Detection / User Override
6
+ * 2. Route: deterministic (Pine) or AI (Python, JS, unknown)
7
+ * 3. For Pine: deterministic first, optionally AI-refine
8
+ * 4. Validation Layer (syntax + runtime + hallucination)
9
+ * 5. Sandbox Execution
10
+ * 6. Build Save Gate check
11
+ * 7. Emit telemetry
12
+ *
13
+ * ForgeScript passthrough: if source is already ForgeScript, skip conversion.
14
+ *
15
+ * Core principle: NO AI output bypasses validation. NO silent approximations.
16
+ */
17
+ import type { SourceLanguage, ConversionResult } from './types';
18
+ import type { AILanguageClassifier } from './language-detector';
19
+ import type { LLMProvider } from './ai-conversion-agent';
20
+ export interface ConversionOptions {
21
+ /** Force a specific source language (skip detection). */
22
+ sourceLanguage?: SourceLanguage;
23
+ /** LLM provider for AI conversion. If omitted, AI path is unavailable. */
24
+ llmProvider?: LLMProvider;
25
+ /** AI language classifier fallback. */
26
+ aiClassifier?: AILanguageClassifier;
27
+ /** Skip sandbox execution. Default: false. */
28
+ skipSandbox?: boolean;
29
+ /** Pre-acknowledge all warnings (testing only — never in production). */
30
+ acknowledgeWarnings?: boolean;
31
+ /** Pre-confirm save (testing only — never in production). */
32
+ confirmSave?: boolean;
33
+ /** Force AI conversion even when deterministic is available. */
34
+ forceAI?: boolean;
35
+ }
36
+ /**
37
+ * Run the full conversion pipeline.
38
+ *
39
+ * @param source - Raw source code pasted by the user.
40
+ * @param options - Pipeline configuration.
41
+ * @returns Complete ConversionResult with code, validation, sandbox, and gate.
42
+ */
43
+ export declare function convertScript(source: string, options?: ConversionOptions): Promise<ConversionResult>;
44
+ //# sourceMappingURL=conversion-orchestrator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversion-orchestrator.d.ts","sourceRoot":"","sources":["../../../src/forgescript/conversion/conversion-orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAMjB,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAKhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMzD,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,0EAA0E;IAC1E,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,uCAAuC;IACvC,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,8CAA8C;IAC9C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yEAAyE;IACzE,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,6DAA6D;IAC7D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAID;;;;;;GAMG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,gBAAgB,CAAC,CA8K3B"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * AI-Assisted Script Conversion System — public API.
3
+ *
4
+ * Re-exports the conversion pipeline, language detection, validation,
5
+ * sandbox, save gate, AI agent, prompt templates, and telemetry.
6
+ */
7
+ export type { SourceLanguage, Confidence, LanguageDetectionResult, ConversionPath, ConversionWarning, ConversionAssumption, ReviewItem, AIConversionResponse, ValidationIssue, ValidationResult, SandboxResult, SaveGateCheck, ConversionResult, ConversionTelemetryEvent, } from './types';
8
+ export { detectLanguage, detectLanguageWithFallback } from './language-detector';
9
+ export type { AILanguageClassifier } from './language-detector';
10
+ export { convertScript } from './conversion-orchestrator';
11
+ export type { ConversionOptions } from './conversion-orchestrator';
12
+ export { validateForgeScript } from './validation';
13
+ export { runSandbox } from './sandbox';
14
+ export { evaluateSaveGate } from './save-gate';
15
+ export { runAIConversion, parseAIResponse } from './ai-conversion-agent';
16
+ export type { LLMProvider, ChatMessage } from './ai-conversion-agent';
17
+ export { getSystemPrompt, buildConversionPrompt, FORGESCRIPT_REFERENCE } from './prompts';
18
+ export { onConversionEvent, emitConversionEvent, buildTelemetryEvent, clearTelemetryListeners, } from './telemetry';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/forgescript/conversion/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EACV,cAAc,EACd,UAAU,EACV,uBAAuB,EACvB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjF,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAGhE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACzE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGtE,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAG1F,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Language Detection — heuristic-based source language identification.
3
+ *
4
+ * Uses keyword/pattern scoring to determine the most likely scripting
5
+ * language of a pasted code snippet. Designed to be fast, deterministic,
6
+ * and to run client-side without network calls.
7
+ *
8
+ * An optional AI-based classification callback can refine "unknown" results.
9
+ */
10
+ import type { LanguageDetectionResult } from './types';
11
+ /**
12
+ * Detect the source language of a script using pattern-based heuristics.
13
+ *
14
+ * Returns the best-matching language and a confidence level.
15
+ * If no patterns match above a threshold the result is `unknown / LOW`.
16
+ */
17
+ export declare function detectLanguage(source: string): LanguageDetectionResult;
18
+ /**
19
+ * Optional AI-based classification callback type.
20
+ * Implementations should call an LLM to classify the language.
21
+ */
22
+ export type AILanguageClassifier = (source: string) => Promise<LanguageDetectionResult>;
23
+ /**
24
+ * Enhanced detection: heuristics first, falls back to AI if result is `unknown`.
25
+ */
26
+ export declare function detectLanguageWithFallback(source: string, aiClassifier?: AILanguageClassifier): Promise<LanguageDetectionResult>;
27
+ //# sourceMappingURL=language-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language-detector.d.ts","sourceRoot":"","sources":["../../../src/forgescript/conversion/language-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAA8B,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAuEnF;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,uBAAuB,CA0CtE;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAExF;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,oBAAoB,GAClC,OAAO,CAAC,uBAAuB,CAAC,CAIlC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * AI Prompt Templates — language-specific prompt contracts for conversion.
3
+ *
4
+ * Each template produces a structured prompt that instructs an LLM to convert
5
+ * source code from a specific language into valid ForgeScript.
6
+ * The response format is enforced by JSON schema in openai-provider.ts,
7
+ * NOT by prompt instructions — do not add markdown format rules here.
8
+ *
9
+ * These prompts are deterministic text; they have no runtime side effects.
10
+ */
11
+ import type { SourceLanguage } from '../types';
12
+ export declare const FORGESCRIPT_REFERENCE: string;
13
+ /** Get the system prompt for a specific source language. */
14
+ export declare function getSystemPrompt(language: SourceLanguage): string;
15
+ /** Build the full user message for the AI conversion request. */
16
+ export declare function buildConversionPrompt(sourceLanguage: SourceLanguage, sourceCode: string): string;
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/forgescript/conversion/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI/C,eAAO,MAAM,qBAAqB,QAsG1B,CAAC;AA0GT,4DAA4D;AAC5D,wBAAgB,eAAe,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAQhE;AAED,iEAAiE;AACjE,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,MAAM,GACjB,MAAM,CAUR"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Sandbox Execution — compile and safely run ForgeScript in isolation.
3
+ *
4
+ * The sandbox:
5
+ * 1. Compiles the ForgeScript source (syntax check)
6
+ * 2. Runs it against synthetic bar data (runtime check)
7
+ * 3. Reports any compile/runtime errors
8
+ * 4. Surfaces a preview of the output
9
+ *
10
+ * No external I/O, no eval, no dynamic code — the tree-walking interpreter
11
+ * is inherently sandboxed. This module adds execution-time safety.
12
+ */
13
+ import type { SandboxResult } from './types';
14
+ import type { OHLCV } from '@forgecharts/types';
15
+ /**
16
+ * Run a ForgeScript source in a sandboxed environment.
17
+ *
18
+ * @param source - ForgeScript source code.
19
+ * @param bars - Optional bar data; defaults to 200 synthetic 1-min bars.
20
+ * @returns SandboxResult with success/failure, preview, and any errors.
21
+ */
22
+ export declare function runSandbox(source: string, bars?: readonly OHLCV[]): SandboxResult;
23
+ //# sourceMappingURL=sandbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../../src/forgescript/conversion/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAmChD;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,SAAS,KAAK,EAAE,GACtB,aAAa,CAyDf"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Save Gate — pre-save checklist enforcement.
3
+ *
4
+ * A script CANNOT be saved unless ALL of:
5
+ * 1. The ForgeScript compiles successfully
6
+ * 2. Validation passes (no error-severity issues)
7
+ * 3. All warnings have been acknowledged by the user
8
+ * 4. The user explicitly confirms
9
+ *
10
+ * No auto-save. No bypassing.
11
+ */
12
+ import type { SaveGateCheck, ValidationResult, SandboxResult, ConversionWarning } from './types';
13
+ /**
14
+ * Evaluate whether a converted script is eligible to be saved.
15
+ *
16
+ * @param validation - Result from the validation layer.
17
+ * @param sandbox - Result from sandbox execution (null = skipped).
18
+ * @param warnings - Conversion warnings to present.
19
+ * @param warningsAcknowledged - Whether the user has acknowledged all warnings.
20
+ * @param userConfirmed - Whether the user has explicitly pressed "Save".
21
+ */
22
+ export declare function evaluateSaveGate(params: {
23
+ validation: ValidationResult;
24
+ sandbox: SandboxResult | null;
25
+ warnings: ConversionWarning[];
26
+ warningsAcknowledged: boolean;
27
+ userConfirmed: boolean;
28
+ }): SaveGateCheck;
29
+ //# sourceMappingURL=save-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-gate.d.ts","sourceRoot":"","sources":["../../../src/forgescript/conversion/save-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,aAAa,EAAE,OAAO,CAAC;CACxB,GAAG,aAAa,CAuChB"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Conversion Telemetry — event tracking for observability.
3
+ *
4
+ * Tracks conversion pipeline usage, success rates, and failure patterns
5
+ * to drive improvements in prompts, converter coverage, and the
6
+ * ForgeScript runtime itself.
7
+ *
8
+ * Events are emitted to registered listeners. The consumer (app layer)
9
+ * is responsible for persisting events to a backend or analytics system.
10
+ */
11
+ import type { ConversionTelemetryEvent } from './types';
12
+ /** Telemetry event listener callback. */
13
+ export type TelemetryListener = (event: ConversionTelemetryEvent) => void;
14
+ /** Register a listener that receives all conversion telemetry events. */
15
+ export declare function onConversionEvent(listener: TelemetryListener): () => void;
16
+ /** Emit a telemetry event to all registered listeners. */
17
+ export declare function emitConversionEvent(event: ConversionTelemetryEvent): void;
18
+ /** Build a telemetry event from pipeline parameters. */
19
+ export declare function buildTelemetryEvent(params: Omit<ConversionTelemetryEvent, 'timestamp'>): ConversionTelemetryEvent;
20
+ /** Remove all registered listeners (useful for tests). */
21
+ export declare function clearTelemetryListeners(): void;
22
+ //# sourceMappingURL=telemetry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../../src/forgescript/conversion/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD,yCAAyC;AACzC,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,CAAC;AAM1E,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,IAAI,CAOzE;AAED,0DAA0D;AAC1D,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,IAAI,CAQzE;AAED,wDAAwD;AACxD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,wBAAwB,EAAE,WAAW,CAAC,GAAG,wBAAwB,CAEjH;AAED,0DAA0D;AAC1D,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Shared types for the AI-assisted script conversion system.
3
+ *
4
+ * ForgeScript is the canonical target language. All conversions produce
5
+ * ForgeScript source that must pass validation before saving.
6
+ */
7
+ /** Languages the conversion system can accept as input. */
8
+ export type SourceLanguage = 'pine' | 'python' | 'javascript' | 'forgescript' | 'unknown';
9
+ /** Confidence level for language detection or AI conversion. */
10
+ export type Confidence = 'HIGH' | 'MEDIUM' | 'LOW';
11
+ /** Result of language detection. */
12
+ export interface LanguageDetectionResult {
13
+ /** Best-guess language. */
14
+ readonly language: SourceLanguage;
15
+ /** Confidence of the detection. */
16
+ readonly confidence: Confidence;
17
+ /** Human-readable reason. */
18
+ readonly reason: string;
19
+ /** Heuristic scores used to pick the language. */
20
+ readonly scores: Readonly<Record<SourceLanguage, number>>;
21
+ }
22
+ /** Which conversion strategy was used. */
23
+ export type ConversionPath = 'deterministic' | 'ai' | 'hybrid' | 'passthrough';
24
+ /** A single warning surfaced during conversion. */
25
+ export interface ConversionWarning {
26
+ readonly severity: 'info' | 'warning' | 'error';
27
+ readonly category: 'approximation' | 'unsupported' | 'semantic_risk' | 'hallucination' | 'general';
28
+ readonly message: string;
29
+ }
30
+ /** An assumption the converter made on behalf of the user. */
31
+ export interface ConversionAssumption {
32
+ readonly description: string;
33
+ }
34
+ /** Item the user should manually verify. */
35
+ export interface ReviewItem {
36
+ readonly description: string;
37
+ }
38
+ /** Parsed structured response from the AI conversion agent. */
39
+ export interface AIConversionResponse {
40
+ readonly forgeScript: string;
41
+ readonly warnings: ConversionWarning[];
42
+ readonly assumptions: ConversionAssumption[];
43
+ readonly reviewChecklist: ReviewItem[];
44
+ readonly unsupportedFeatures: string[];
45
+ readonly confidence: Confidence;
46
+ readonly confidenceExplanation: string;
47
+ }
48
+ /** A single validation issue. */
49
+ export interface ValidationIssue {
50
+ readonly severity: 'error' | 'warning';
51
+ readonly code: string;
52
+ readonly message: string;
53
+ readonly line?: number;
54
+ readonly col?: number;
55
+ }
56
+ /** Full validation report. */
57
+ export interface ValidationResult {
58
+ readonly ok: boolean;
59
+ readonly issues: ValidationIssue[];
60
+ }
61
+ /** Result of a sandbox execution run. */
62
+ export interface SandboxResult {
63
+ readonly ok: boolean;
64
+ readonly plotCount: number;
65
+ readonly barCount: number;
66
+ readonly error?: string;
67
+ /** First few output values per plot (for preview). */
68
+ readonly preview: Array<{
69
+ title: string;
70
+ lastValue: number;
71
+ }>;
72
+ }
73
+ /** Check result for the save gate. */
74
+ export interface SaveGateCheck {
75
+ readonly canSave: boolean;
76
+ readonly blockers: string[];
77
+ readonly warningsToAcknowledge: string[];
78
+ }
79
+ /** Complete result of the conversion pipeline. */
80
+ export interface ConversionResult {
81
+ /** The detected or user-selected source language. */
82
+ readonly sourceLanguage: SourceLanguage;
83
+ /** Which conversion path was taken. */
84
+ readonly conversionPath: ConversionPath;
85
+ /** The converted ForgeScript source (empty string if conversion failed). */
86
+ readonly forgeScript: string;
87
+ /** Validation result against the ForgeScript grammar & runtime. */
88
+ readonly validation: ValidationResult;
89
+ /** Sandbox execution result (null if sandbox was skipped). */
90
+ readonly sandbox: SandboxResult | null;
91
+ /** Save-gate check. */
92
+ readonly saveGate: SaveGateCheck;
93
+ /** Human-readable warnings from the conversion itself. */
94
+ readonly warnings: ConversionWarning[];
95
+ /** Assumptions made during conversion. */
96
+ readonly assumptions: ConversionAssumption[];
97
+ /** Items the user should manually verify. */
98
+ readonly reviewChecklist: ReviewItem[];
99
+ /** Features that could not be converted. */
100
+ readonly unsupportedFeatures: string[];
101
+ /** Overall confidence in the conversion quality. */
102
+ readonly confidence: Confidence;
103
+ readonly confidenceExplanation: string;
104
+ /** Deterministic output (when applicable) for comparison. */
105
+ readonly deterministicOutput?: string;
106
+ }
107
+ /** Event emitted for observability. */
108
+ export interface ConversionTelemetryEvent {
109
+ readonly timestamp: number;
110
+ readonly sourceLanguage: SourceLanguage;
111
+ readonly detectionConfidence: Confidence;
112
+ readonly conversionPath: ConversionPath;
113
+ readonly validationOk: boolean;
114
+ readonly sandboxOk: boolean | null;
115
+ readonly savedByUser: boolean | null;
116
+ readonly errorCount: number;
117
+ readonly warningCount: number;
118
+ readonly unsupportedCount: number;
119
+ }
120
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/forgescript/conversion/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,2DAA2D;AAC3D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,YAAY,GAAG,aAAa,GAAG,SAAS,CAAC;AAE1F,gEAAgE;AAChE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEnD,oCAAoC;AACpC,MAAM,WAAW,uBAAuB;IACtC,2BAA2B;IAC3B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,mCAAmC;IACnC,QAAQ,CAAC,UAAU,EAA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CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,0DAA0D;IAC1D,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IACvC,0CAA0C;IAC1C,QAAQ,CAAC,WAAW,EAAE,oBAAoB,EAAE,CAAC;IAC7C,6CAA6C;IAC7C,QAAQ,CAAC,eAAe,EAAE,UAAU,EAAE,CAAC;IACvC,4CAA4C;IAC5C,QAAQ,CAAC,mBAAmB,EAAE,MAAM,EAAE,CAAC;IACvC,oDAAoD;IACpD,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,6DAA6D;IAC7D,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CACvC;AAID,uCAAuC;AACvC,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,mBAAmB,EAAE,UAAU,CAAC;IACzC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * ForgeScript Validation Layer — post-conversion validation.
3
+ *
4
+ * Validates converted ForgeScript source across four dimensions:
5
+ * 1. Syntax — can the source be parsed without errors?
6
+ * 2. Runtime — are all referenced functions & namespaces supported?
7
+ * 3. Capability — are lookback/permission limits respected?
8
+ * 4. Hallucination — reject unknown identifiers & APIs
9
+ *
10
+ * If any error-severity issue is found, the script MUST NOT be saved.
11
+ */
12
+ import type { ValidationResult } from './types';
13
+ /**
14
+ * Validate a ForgeScript source string.
15
+ * Returns a full validation report with zero or more issues.
16
+ */
17
+ export declare function validateForgeScript(source: string): ValidationResult;
18
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/forgescript/conversion/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,SAAS,CAAC;AAgEjE;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAwLpE"}
@@ -10,7 +10,7 @@
10
10
  * LPAREN, RPAREN, LBRACKET, RBRACKET, COMMA, EQ, NEWLINE
11
11
  * EOF
12
12
  */
13
- export type TokenKind = 'NUMBER' | 'STRING' | 'BOOL' | 'IDENT' | 'PLUS' | 'MINUS' | 'STAR' | 'SLASH' | 'PERCENT' | 'LT' | 'GT' | 'LTE' | 'GTE' | 'EQEQ' | 'NEQ' | 'QMARK' | 'COLON' | 'LPAREN' | 'RPAREN' | 'LBRACKET' | 'RBRACKET' | 'COMMA' | 'EQ' | 'NEWLINE' | 'EOF';
13
+ export type TokenKind = 'NUMBER' | 'STRING' | 'BOOL' | 'IDENT' | 'COLOR' | 'PLUS' | 'MINUS' | 'STAR' | 'SLASH' | 'PERCENT' | 'LT' | 'GT' | 'LTE' | 'GTE' | 'EQEQ' | 'NEQ' | 'QMARK' | 'COLON' | 'COLONEQ' | 'DOT' | 'LPAREN' | 'RPAREN' | 'LBRACKET' | 'RBRACKET' | 'COMMA' | 'EQ' | 'ARROW' | 'INDENT' | 'DEDENT' | 'NEWLINE' | 'EOF';
14
14
  export type Token = {
15
15
  kind: TokenKind;
16
16
  value: string;
@@ -24,6 +24,10 @@ export declare class Lexer {
24
24
  private _col;
25
25
  constructor(src: string);
26
26
  tokenize(): Token[];
27
+ /** After each NEWLINE, inject INDENT/DEDENT tokens based on the indentation
28
+ * of the following non-blank line. Enables indented if/else blocks. */
29
+ private _injectIndents;
30
+ private _rawTokenize;
27
31
  private _make;
28
32
  private _peek;
29
33
  private _isAlpha;
@@ -32,5 +36,7 @@ export declare class Lexer {
32
36
  private _readNumber;
33
37
  private _readString;
34
38
  private _readIdent;
39
+ private _readColor;
40
+ private _isHex;
35
41
  }
36
42
  //# sourceMappingURL=lexer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexer.d.ts","sourceRoot":"","sources":["../../src/forgescript/lexer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,SAAS,GACjB,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAChD,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAC/C,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAC5C,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,GACrC,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAC7C,OAAO,GAAG,IAAI,GAAG,OAAO,GACxB,QAAQ,GAAG,QAAQ,GACnB,SAAS,GAAG,KAAK,CAAC;AAEtB,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAI,SAAS,CAAC;IAClB,KAAK,EAAG,MAAM,CAAC;IACf,IAAI,EAAI,MAAM,CAAC;IACf,GAAG,EAAK,MAAM,CAAC;CAChB,CAAC;AAKF,qBAAa,KAAK;IAChB,OAAO,CAAC,IAAI,CAAU;IACtB,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,IAAI,CAAc;gBAEd,GAAG,EAAE,MAAM;IAIvB,QAAQ,IAAI,KAAK,EAAE;IAMnB;4EACwE;IACxE,OAAO,CAAC,cAAc;IAoDtB,OAAO,CAAC,YAAY;IA2EpB,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,0BAA0B;IAmBlC,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,WAAW;IAkBnB,OAAO,CAAC,UAAU;IAgBlB,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,MAAM;CAGf"}
@@ -20,8 +20,18 @@ export declare class Parser {
20
20
  parse(): Program;
21
21
  private _stmt;
22
22
  private _indicatorDecl;
23
+ private _varDeclStmt;
24
+ private _reassign;
25
+ private _forStmt;
23
26
  private _assign;
24
27
  private _exprStmt;
28
+ private _ifStmt;
29
+ private _whileStmt;
30
+ /** Lookahead: is this IDENT '(' ... ')' '=>'? Scans without consuming. */
31
+ private _isFnDecl;
32
+ /** Parse: name(p1, p2, ...) => expr OR name(p1, p2, ...) =>\n block */
33
+ private _fnDeclStmt;
34
+ private _indentedBlock;
25
35
  private _expr;
26
36
  private _ternary;
27
37
  private _or;
@@ -32,7 +42,11 @@ export declare class Parser {
32
42
  private _multiplication;
33
43
  private _unary;
34
44
  private _primary;
45
+ /** Parse IDENT.IDENT or IDENT.IDENT(args) */
46
+ private _nsCallOrMember;
35
47
  private _callExpr;
48
+ /** Parse a mixed positional + named argument list. */
49
+ private _argList;
36
50
  private _binop;
37
51
  private _current;
38
52
  private _advance;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/forgescript/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,OAAO,EAMR,MAAM,OAAO,CAAC;AAIf,qBAAa,MAAM;IACjB,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,IAAI,CAAa;gBAEb,GAAG,EAAE,MAAM;IAIvB,KAAK,IAAI,OAAO;IAYhB,OAAO,CAAC,KAAK;IA6Cb,OAAO,CAAC,cAAc;IAoBtB,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,QAAQ;IAiBhB,OAAO,CAAC,OAAO;IAQf,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,UAAU;IAQlB,0EAA0E;IAC1E,OAAO,CAAC,SAAS;IAejB,0EAA0E;IAC1E,OAAO,CAAC,WAAW;IAyBnB,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,QAAQ;IAYhB,OAAO,CAAC,GAAG;IAWX,OAAO,CAAC,IAAI;IAWZ,OAAO,CAAC,IAAI;IAUZ,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,SAAS;IAUjB,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,MAAM;IASd,OAAO,CAAC,QAAQ;IA4EhB,6CAA6C;IAC7C,OAAO,CAAC,eAAe;IA0BvB,OAAO,CAAC,SAAS;IAQjB,sDAAsD;IACtD,OAAO,CAAC,QAAQ;IA0BhB,OAAO,CAAC,MAAM;IAQd,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,iBAAiB;IAgBzB,OAAO,CAAC,oBAAoB;CAC7B"}
@@ -3,15 +3,18 @@
3
3
  *
4
4
  * Pipeline:
5
5
  * Pine source → PineLexer → PineToken[] → PineParser → PineProgram
6
- * → PineTranspiler → TScript source → TScriptIndicator runtime
6
+ * → PineTranspiler → ForgeScript source → ForgeScriptIndicator runtime
7
+ *
8
+ * Supported versions: Pine v5 and v6.
9
+ * Scripts tagged //@version=N where N > 6 will compile with a warning.
7
10
  */
8
11
  import type { Diagnostic } from './diagnostics';
9
12
  import type { OHLCV } from '@forgecharts/types';
10
- import type { IndicatorPoint } from '../core/IndicatorEngine';
13
+ import type { IndicatorPoint } from '../../core/IndicatorEngine';
11
14
  export type { Diagnostic };
12
15
  export type { DiagnosticSeverity } from './diagnostics';
13
16
  export interface PineCompileResult {
14
- /** The transpiled TScript source string. */
17
+ /** The transpiled ForgeScript source string. */
15
18
  readonly tscript: string;
16
19
  readonly diagnostics: readonly Diagnostic[];
17
20
  /** `true` when there are no error-severity diagnostics. */
@@ -19,7 +22,7 @@ export interface PineCompileResult {
19
22
  }
20
23
  export declare class PineCompiler {
21
24
  /**
22
- * Compile Pine Script source to TScript.
25
+ * Compile Pine Script source to ForgeScript.
23
26
  * Parse errors throw a `SyntaxError`; semantic problems populate diagnostics.
24
27
  */
25
28
  compile(pineSource: string): PineCompileResult;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PineCompiler.d.ts","sourceRoot":"","sources":["../../../src/forgescript/pine/PineCompiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAY,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,YAAY,EAAE,UAAU,EAAE,CAAC;AAC3B,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,QAAQ,CAAC,OAAO,EAAM,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,EAAW,OAAO,CAAC;CAC/B;AAED,qBAAa,YAAY;IACvB;;;OAGG;IACH,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB;IAkC9C;;;OAGG;IACH,MAAM,CAAC,GAAG,CACR,UAAU,EAAE,MAAM,EAClB,IAAI,EAAQ,SAAS,KAAK,EAAE,GAC3B;QAAE,KAAK,EAAE,cAAc,EAAE,EAAE,CAAC;QAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAA;KAAE;CAYrE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../../src/forgescript/pine/diagnostics.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9D,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAM,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAO,MAAM,CAAC;IAC1B,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAM,MAAM,CAAC;CAC3B;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAE3C,GAAG,CACD,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAG,MAAM,EAChB,GAAG,EAAO;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EACvC,IAAI,EAAM,MAAM,GACf,IAAI;IAIP,IAAI,WAAW,IAAI,SAAS,UAAU,EAAE,CAAwB;IAEhE,SAAS,IAAI,OAAO;CAGrB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/forgescript/pine/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAU,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAO,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAQ,gBAAgB,CAAC;AAChD,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACpE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Pine Script AST types — subset understood by the ForgeCharts Pine compat layer.
3
3
  *
4
- * Supported Pine v5 constructs:
4
+ * Supported Pine v5/v6 constructs:
5
5
  * indicator(title, overlay?, ...)
6
6
  * input(defval, title?, ...) / input.int() / input.float() / input.bool() / input.source()
7
7
  * ta.sma() ta.ema() ta.wma() ta.rma() ta.rsi() ta.macd()
@@ -9,9 +9,14 @@
9
9
  * ta.crossover() ta.crossunder() ta.barssince()
10
10
  * math.abs() math.max() math.min() math.round() math.floor() math.ceil()
11
11
  * math.sqrt() math.log() math.pow() math.sign()
12
+ * str.* (partial — unsupported functions emit a diagnostic)
12
13
  * plot() plotshape()
13
14
  * nz() na()
14
15
  * if / else blocks
16
+ * switch expression/statement (v6+)
17
+ * while loop (v6+)
18
+ * for...in loop (v6+ — emits unsupported diagnostic)
19
+ * type / method / import / export / enum (v6+ — silently skipped with diagnostics)
15
20
  * var declarations
16
21
  * ternary a ? b : c
17
22
  */
@@ -133,7 +138,50 @@ export type PineIf = {
133
138
  else_: PineStmt[];
134
139
  loc: Loc;
135
140
  };
136
- export type PineStmt = PineIndicatorDecl | PineVarDecl | PineAssign | PineExprStmt | PineIf;
141
+ export type PineSwitchCase = {
142
+ /** null = default / else case (no condition) */
143
+ condition: PineExpr | null;
144
+ body: PineStmt[];
145
+ };
146
+ /**
147
+ * Pine v6 switch statement/expression.
148
+ *
149
+ * switch subject → equality-compare each case against subject
150
+ * switch (no subject) → each case condition is evaluated as a boolean
151
+ */
152
+ export type PineSwitch = {
153
+ kind: 'PineSwitch';
154
+ subject: PineExpr | null;
155
+ cases: PineSwitchCase[];
156
+ loc: Loc;
157
+ };
158
+ export type PineWhile = {
159
+ kind: 'PineWhile';
160
+ condition: PineExpr;
161
+ body: PineStmt[];
162
+ loc: Loc;
163
+ };
164
+ export type PineForIn = {
165
+ kind: 'PineForIn';
166
+ varName: string;
167
+ iterable: PineExpr;
168
+ body: PineStmt[];
169
+ loc: Loc;
170
+ };
171
+ /** User-defined type declaration (v6). Transpiled to a no-op with a diagnostic. */
172
+ export type PineTypeDef = {
173
+ kind: 'PineTypeDef';
174
+ name: string;
175
+ loc: Loc;
176
+ };
177
+ /** Library import statement (v6). Transpiled to a no-op with a diagnostic. */
178
+ export type PineImport = {
179
+ kind: 'PineImport';
180
+ path: string;
181
+ alias: string;
182
+ loc: Loc;
183
+ };
184
+ export type PineStmt = PineIndicatorDecl | PineVarDecl | PineAssign | PineExprStmt | PineIf | PineSwitch | PineWhile | PineForIn | PineTypeDef | PineImport;
137
185
  export type PineProgram = {
138
186
  kind: 'PineProgram';
139
187
  version: number;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pine-ast.d.ts","sourceRoot":"","sources":["../../../src/forgescript/pine/pine-ast.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,MAAM,MAAM,GAAG,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAIhD,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAE,CAAC;AAC/E,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAE,CAAC;AAC/E,MAAM,MAAM,WAAW,GAAK;IAAE,IAAI,EAAE,aAAa,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