create-stylus-ide 1.0.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/Readme.MD +1515 -0
- package/cli.js +28 -0
- package/frontend/.vscode/settings.json +9 -0
- package/frontend/app/api/chat/route.ts +101 -0
- package/frontend/app/api/check-setup/route.ts +93 -0
- package/frontend/app/api/cleanup/route.ts +14 -0
- package/frontend/app/api/compile/route.ts +95 -0
- package/frontend/app/api/compile-stream/route.ts +98 -0
- package/frontend/app/api/complete/route.ts +86 -0
- package/frontend/app/api/deploy/route.ts +118 -0
- package/frontend/app/api/export-abi/route.ts +58 -0
- package/frontend/app/favicon.ico +0 -0
- package/frontend/app/globals.css +177 -0
- package/frontend/app/layout.tsx +29 -0
- package/frontend/app/ml/page.tsx +694 -0
- package/frontend/app/page.tsx +1132 -0
- package/frontend/app/providers.tsx +18 -0
- package/frontend/app/qlearning/page.tsx +188 -0
- package/frontend/app/raytracing/page.tsx +268 -0
- package/frontend/components/abi/ABIDialog.tsx +132 -0
- package/frontend/components/ai/AICompletionPopup.tsx +76 -0
- package/frontend/components/ai/ChatPanel.tsx +292 -0
- package/frontend/components/ai/QuickActions.tsx +128 -0
- package/frontend/components/blockchain/BlockchainContractBanner.tsx +64 -0
- package/frontend/components/blockchain/BlockchainLoadingDialog.tsx +188 -0
- package/frontend/components/deploy/DeployDialog.tsx +334 -0
- package/frontend/components/editor/FileTabs.tsx +181 -0
- package/frontend/components/editor/MonacoEditor.tsx +306 -0
- package/frontend/components/file-tree/ContextMenu.tsx +110 -0
- package/frontend/components/file-tree/DeleteConfirmDialog.tsx +61 -0
- package/frontend/components/file-tree/FileInputDialog.tsx +97 -0
- package/frontend/components/file-tree/FileNode.tsx +60 -0
- package/frontend/components/file-tree/FileTree.tsx +259 -0
- package/frontend/components/file-tree/FileTreeSkeleton.tsx +26 -0
- package/frontend/components/file-tree/FolderNode.tsx +105 -0
- package/frontend/components/github/GitHubLoadingDialog.tsx +201 -0
- package/frontend/components/github/GitHubMetadataBanner.tsx +61 -0
- package/frontend/components/github/LoadFromGitHubDialog.tsx +125 -0
- package/frontend/components/github/URLCopyButton.tsx +60 -0
- package/frontend/components/interact/ContractInteraction.tsx +323 -0
- package/frontend/components/interact/ContractPlaceholder.tsx +41 -0
- package/frontend/components/orbit/BenchmarkDialog.tsx +342 -0
- package/frontend/components/orbit/OrbitExplorer.tsx +273 -0
- package/frontend/components/project/ProjectActions.tsx +176 -0
- package/frontend/components/q-learning/ContractConfig.tsx +172 -0
- package/frontend/components/q-learning/MazeGrid.tsx +346 -0
- package/frontend/components/q-learning/PathAnimation.tsx +384 -0
- package/frontend/components/q-learning/QTableHeatmap.tsx +300 -0
- package/frontend/components/q-learning/TrainingForm.tsx +349 -0
- package/frontend/components/ray-tracing/ContractConfig.tsx +245 -0
- package/frontend/components/ray-tracing/MintingForm.tsx +280 -0
- package/frontend/components/ray-tracing/RenderCanvas.tsx +228 -0
- package/frontend/components/ray-tracing/RenderingPanel.tsx +259 -0
- package/frontend/components/ray-tracing/StyleControls.tsx +217 -0
- package/frontend/components/setup/SetupGuide.tsx +290 -0
- package/frontend/components/ui/KeyboardShortcutHint.tsx +74 -0
- package/frontend/components/ui/alert-dialog.tsx +157 -0
- package/frontend/components/ui/alert.tsx +66 -0
- package/frontend/components/ui/badge.tsx +46 -0
- package/frontend/components/ui/button.tsx +62 -0
- package/frontend/components/ui/card.tsx +92 -0
- package/frontend/components/ui/context-menu.tsx +252 -0
- package/frontend/components/ui/dialog.tsx +143 -0
- package/frontend/components/ui/dropdown-menu.tsx +257 -0
- package/frontend/components/ui/input.tsx +21 -0
- package/frontend/components/ui/label.tsx +24 -0
- package/frontend/components/ui/progress.tsx +31 -0
- package/frontend/components/ui/scroll-area.tsx +58 -0
- package/frontend/components/ui/select.tsx +190 -0
- package/frontend/components/ui/separator.tsx +28 -0
- package/frontend/components/ui/sheet.tsx +139 -0
- package/frontend/components/ui/skeleton.tsx +13 -0
- package/frontend/components/ui/slider.tsx +63 -0
- package/frontend/components/ui/sonner.tsx +40 -0
- package/frontend/components/ui/tabs.tsx +66 -0
- package/frontend/components/ui/textarea.tsx +18 -0
- package/frontend/components/wallet/ConnectButton.tsx +167 -0
- package/frontend/components/wallet/FaucetButton.tsx +256 -0
- package/frontend/components.json +22 -0
- package/frontend/eslint.config.mjs +18 -0
- package/frontend/hooks/useAICompletion.ts +75 -0
- package/frontend/hooks/useBlockchainLoader.ts +58 -0
- package/frontend/hooks/useChats.ts +137 -0
- package/frontend/hooks/useCompilation.ts +173 -0
- package/frontend/hooks/useFileTabs.ts +178 -0
- package/frontend/hooks/useGitHubLoader.ts +50 -0
- package/frontend/hooks/useKeyboardShortcuts.ts +47 -0
- package/frontend/hooks/usePanelState.ts +115 -0
- package/frontend/hooks/useProjectState.ts +276 -0
- package/frontend/hooks/useResponsive.ts +29 -0
- package/frontend/lib/abi-parser.ts +58 -0
- package/frontend/lib/blockchain-api.ts +374 -0
- package/frontend/lib/blockchain-explorers.ts +75 -0
- package/frontend/lib/blockchain-loader.ts +112 -0
- package/frontend/lib/cargo-template.ts +64 -0
- package/frontend/lib/compilation.ts +529 -0
- package/frontend/lib/constants.ts +31 -0
- package/frontend/lib/deployment.ts +176 -0
- package/frontend/lib/file-utils.ts +83 -0
- package/frontend/lib/github-api.ts +246 -0
- package/frontend/lib/github-loader.ts +369 -0
- package/frontend/lib/ml-contract-template.txt +900 -0
- package/frontend/lib/orbit-chains.ts +181 -0
- package/frontend/lib/output-formatter.ts +68 -0
- package/frontend/lib/project-manager.ts +632 -0
- package/frontend/lib/ray-tracing-abi.ts +206 -0
- package/frontend/lib/storage.ts +189 -0
- package/frontend/lib/templates.ts +1662 -0
- package/frontend/lib/url-parser.ts +188 -0
- package/frontend/lib/utils.ts +6 -0
- package/frontend/lib/wagmi-config.ts +24 -0
- package/frontend/next.config.ts +7 -0
- package/frontend/package-lock.json +16259 -0
- package/frontend/package.json +60 -0
- package/frontend/postcss.config.mjs +7 -0
- package/frontend/public/file.svg +1 -0
- package/frontend/public/globe.svg +1 -0
- package/frontend/public/ml-weights/.gitkeep +0 -0
- package/frontend/public/ml-weights/model.pkl +0 -0
- package/frontend/public/ml-weights/model_weights.json +27102 -0
- package/frontend/public/ml-weights/test_samples.json +7888 -0
- package/frontend/public/next.svg +1 -0
- package/frontend/public/vercel.svg +1 -0
- package/frontend/public/window.svg +1 -0
- package/frontend/scripts/check-env.js +52 -0
- package/frontend/scripts/setup.js +285 -0
- package/frontend/tailwind.config.ts +64 -0
- package/frontend/tsconfig.json +34 -0
- package/frontend/types/blockchain.ts +63 -0
- package/frontend/types/github.ts +54 -0
- package/frontend/types/project.ts +106 -0
- package/ml-training/README.md +56 -0
- package/ml-training/train_tiny_model.py +325 -0
- package/ml-training/update_template.py +59 -0
- package/package.json +30 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { defineChain, type Chain } from "viem";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Verified sources:
|
|
5
|
+
* - Xai Testnet v2 (Sepolia)
|
|
6
|
+
* - ApeChain Curtis (Testnet)
|
|
7
|
+
* - Nitrogen (Orbit Celestia) Testnet
|
|
8
|
+
*
|
|
9
|
+
* Note: “PublicNode” provider does not currently list these Orbit testnets like it does for Arbitrum Sepolia,
|
|
10
|
+
* so we include other public/free RPC providers (Caldera/official + thirdweb/dRPC/Ankr/etc).
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Xai Testnet v2 (often referred to as "XAI Sepolia" in wallets/UIs)
|
|
14
|
+
export const xaiSepolia = defineChain({
|
|
15
|
+
id: 37714555429,
|
|
16
|
+
name: "Xai Testnet v2",
|
|
17
|
+
network: "xai-testnet-v2",
|
|
18
|
+
nativeCurrency: {
|
|
19
|
+
decimals: 18,
|
|
20
|
+
name: "sXAI",
|
|
21
|
+
symbol: "sXAI",
|
|
22
|
+
},
|
|
23
|
+
rpcUrls: {
|
|
24
|
+
default: {
|
|
25
|
+
http: [
|
|
26
|
+
"https://testnet-v2.xai-chain.net/rpc",
|
|
27
|
+
"https://rpc.ankr.com/xai_testnet",
|
|
28
|
+
"https://37714555429.rpc.thirdweb.com",
|
|
29
|
+
"https://xai-testnet.rpc.quicknode.com",
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
public: {
|
|
33
|
+
http: [
|
|
34
|
+
"https://testnet-v2.xai-chain.net/rpc",
|
|
35
|
+
"https://rpc.ankr.com/xai_testnet",
|
|
36
|
+
"https://37714555429.rpc.thirdweb.com",
|
|
37
|
+
"https://xai-testnet.rpc.quicknode.com",
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
blockExplorers: {
|
|
42
|
+
default: {
|
|
43
|
+
name: "XaiScan (Sepolia)",
|
|
44
|
+
url: "https://sepolia.xaiscan.io/",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
testnet: true,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// ApeChain Curtis (Testnet) — Arbitrum Orbit rollup
|
|
51
|
+
export const apechainCurtis = defineChain({
|
|
52
|
+
id: 33111,
|
|
53
|
+
name: "ApeChain Curtis (Testnet)",
|
|
54
|
+
network: "apechain-curtis",
|
|
55
|
+
nativeCurrency: {
|
|
56
|
+
decimals: 18,
|
|
57
|
+
name: "ApeCoin",
|
|
58
|
+
symbol: "APE",
|
|
59
|
+
},
|
|
60
|
+
rpcUrls: {
|
|
61
|
+
default: {
|
|
62
|
+
http: [
|
|
63
|
+
"https://curtis.rpc.caldera.xyz/http",
|
|
64
|
+
"https://rpc.curtis.apechain.com",
|
|
65
|
+
"https://apechain-curtis.drpc.org",
|
|
66
|
+
"https://33111.rpc.thirdweb.com",
|
|
67
|
+
"https://curtis.gateway.tenderly.co",
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
public: {
|
|
71
|
+
http: [
|
|
72
|
+
"https://curtis.rpc.caldera.xyz/http",
|
|
73
|
+
"https://rpc.curtis.apechain.com",
|
|
74
|
+
"https://apechain-curtis.drpc.org",
|
|
75
|
+
"https://33111.rpc.thirdweb.com",
|
|
76
|
+
"https://curtis.gateway.tenderly.co",
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
blockExplorers: {
|
|
81
|
+
default: {
|
|
82
|
+
name: "Curtis Explorer",
|
|
83
|
+
url: "https://curtis.explorer.caldera.xyz/",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
testnet: true,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// Nitrogen (Orbit Celestia) Testnet — settlement: Arbitrum Sepolia
|
|
90
|
+
export const nitrogenTestnet = defineChain({
|
|
91
|
+
id: 96384675468,
|
|
92
|
+
name: "Nitrogen (Orbit Celestia) Testnet",
|
|
93
|
+
network: "nitrogen",
|
|
94
|
+
nativeCurrency: {
|
|
95
|
+
decimals: 18,
|
|
96
|
+
name: "Ethereum",
|
|
97
|
+
symbol: "ETH",
|
|
98
|
+
},
|
|
99
|
+
rpcUrls: {
|
|
100
|
+
default: {
|
|
101
|
+
http: ["https://nitrogen-rpc.altlayer.io"],
|
|
102
|
+
},
|
|
103
|
+
public: {
|
|
104
|
+
http: ["https://nitrogen-rpc.altlayer.io"],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
blockExplorers: {
|
|
108
|
+
default: {
|
|
109
|
+
name: "Nitrogen Explorer",
|
|
110
|
+
url: "https://nitrogen-explorer.altlayer.io/",
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
testnet: true,
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
export interface OrbitChainInfo {
|
|
117
|
+
id: number;
|
|
118
|
+
name: string;
|
|
119
|
+
chain: Chain;
|
|
120
|
+
focus: string;
|
|
121
|
+
description: string;
|
|
122
|
+
gasToken: string;
|
|
123
|
+
benefits: string[];
|
|
124
|
+
mlContractAddress?: string;
|
|
125
|
+
recommended?: boolean;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export const orbitChains: OrbitChainInfo[] = [
|
|
129
|
+
{
|
|
130
|
+
id: xaiSepolia.id,
|
|
131
|
+
name: "Xai Testnet v2",
|
|
132
|
+
chain: xaiSepolia,
|
|
133
|
+
focus: "Gaming & AI",
|
|
134
|
+
description:
|
|
135
|
+
"Xai Orbit chain testnet v2 (sXAI gas) for gaming/AI workloads",
|
|
136
|
+
gasToken: "sXAI",
|
|
137
|
+
benefits: [
|
|
138
|
+
"Gaming-focused Orbit ecosystem",
|
|
139
|
+
"Good fit for frequent inference calls",
|
|
140
|
+
"Dedicated explorer + infra",
|
|
141
|
+
],
|
|
142
|
+
recommended: true,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: apechainCurtis.id,
|
|
146
|
+
name: "ApeChain Curtis (Testnet)",
|
|
147
|
+
chain: apechainCurtis,
|
|
148
|
+
focus: "Gaming / Consumer Apps",
|
|
149
|
+
description:
|
|
150
|
+
"ApeChain public testnet (APE gas) on Arbitrum Orbit (Caldera infra)",
|
|
151
|
+
gasToken: "APE",
|
|
152
|
+
benefits: [
|
|
153
|
+
"Non-ETH gas token (good for comparisons)",
|
|
154
|
+
"Public Caldera + ApeChain RPC options",
|
|
155
|
+
"Great for benchmarking app-style workloads",
|
|
156
|
+
],
|
|
157
|
+
recommended: true,
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: nitrogenTestnet.id,
|
|
161
|
+
name: "Nitrogen (Orbit Celestia) Testnet",
|
|
162
|
+
chain: nitrogenTestnet,
|
|
163
|
+
focus: "DA / Infra Experiments",
|
|
164
|
+
description:
|
|
165
|
+
"Arbitrum Orbit public testnet using Celestia DA (settles to Arbitrum Sepolia)",
|
|
166
|
+
gasToken: "ETH",
|
|
167
|
+
benefits: [
|
|
168
|
+
"Public RPC + explorer",
|
|
169
|
+
"Interesting Orbit + DA story for demos",
|
|
170
|
+
"Good baseline ETH-gas comparison vs other Orbit chains",
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
];
|
|
174
|
+
|
|
175
|
+
export function getOrbitChain(chainId: number): OrbitChainInfo | undefined {
|
|
176
|
+
return orbitChains.find((chain) => chain.id === chainId);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function isOrbitChain(chainId: number): boolean {
|
|
180
|
+
return orbitChains.some((chain) => chain.id === chainId);
|
|
181
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strip ANSI color codes from terminal output
|
|
3
|
+
*/
|
|
4
|
+
export function stripAnsiCodes(text: string | undefined): string {
|
|
5
|
+
if (!text) return "";
|
|
6
|
+
return text.replace(/\x1B\[[0-?]*[ -/]*[@-~]/g, "");
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Format compilation time in human-readable format
|
|
11
|
+
*/
|
|
12
|
+
export function formatCompilationTime(ms: number): string {
|
|
13
|
+
if (ms < 1000) {
|
|
14
|
+
return `${ms}ms`;
|
|
15
|
+
}
|
|
16
|
+
const seconds = (ms / 1000).toFixed(2);
|
|
17
|
+
return `${seconds}s`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Format file size in human-readable format
|
|
22
|
+
*/
|
|
23
|
+
export function formatFileSize(bytes: number): string {
|
|
24
|
+
const kb = bytes / 1024;
|
|
25
|
+
if (kb < 1024) {
|
|
26
|
+
return `${kb.toFixed(2)} KB`;
|
|
27
|
+
}
|
|
28
|
+
const mb = kb / 1024;
|
|
29
|
+
return `${mb.toFixed(2)} MB`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Detect output type and apply appropriate styling
|
|
34
|
+
*/
|
|
35
|
+
export function getOutputStyle(data: string | undefined): {
|
|
36
|
+
isError: boolean;
|
|
37
|
+
isWarning: boolean;
|
|
38
|
+
isSuccess: boolean;
|
|
39
|
+
} {
|
|
40
|
+
if (!data) return { isError: false, isWarning: false, isSuccess: false };
|
|
41
|
+
|
|
42
|
+
const cleanData = stripAnsiCodes(data).toLowerCase();
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
isError: cleanData.includes("error") || cleanData.includes("failed"),
|
|
46
|
+
isWarning: cleanData.includes("warning"),
|
|
47
|
+
isSuccess: cleanData.includes("finished") || cleanData.includes("✓"),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Extract meaningful lines from cargo output
|
|
53
|
+
*/
|
|
54
|
+
export function formatCargoOutput(output: string | undefined): string {
|
|
55
|
+
if (!output) return "";
|
|
56
|
+
|
|
57
|
+
const lines = output.split("\n");
|
|
58
|
+
const filtered = lines.filter((line) => {
|
|
59
|
+
const clean = stripAnsiCodes(line).trim();
|
|
60
|
+
// Skip empty lines and build status lines
|
|
61
|
+
if (!clean || (clean.startsWith("Compiling") && !clean.includes("("))) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
return filtered.join("\n");
|
|
68
|
+
}
|