forge-solana-sdk 2.0.3

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 ADDED
@@ -0,0 +1,120 @@
1
+ # FORGE SDK
2
+
3
+ ![npm](https://img.shields.io/npm/v/forge-solana-sdk)
4
+ ![npm](https://img.shields.io/npm/dm/forge-solana-sdk)
5
+ ![License](https://img.shields.io/npm/l/forge-solana-sdk)
6
+
7
+ Intent-driven app assembly on Solana. Infrastructure that survives.
8
+
9
+ ## ⚡ Install
10
+
11
+ ```bash
12
+ npm install -g forge-solana-sdk
13
+ ```
14
+
15
+ ## 🚀 Usage
16
+
17
+ ### Initialize a project
18
+ ```bash
19
+ forge init my-project
20
+ cd my-project
21
+ ```
22
+
23
+ ### Check status
24
+ ```bash
25
+ forge status
26
+ ```
27
+
28
+ ### Deploy to Solana
29
+ ```bash
30
+ forge deploy
31
+ ```
32
+
33
+ ## 📋 Prerequisites
34
+
35
+ - **Node.js** 18+
36
+ - **Rust** 1.70+
37
+ - **Solana CLI** (latest)
38
+ - **Anchor CLI** 0.29.0
39
+
40
+ ## 🎯 What FORGE Does
41
+
42
+ FORGE generates production-ready Anchor programs from intent. It creates the boilerplate so you focus on business logic.
43
+
44
+ - ✅ Generates complete Anchor workspace
45
+ - ✅ Creates Cargo.toml with proper dependencies
46
+ - ✅ Sets up lib.rs with Anchor framework
47
+ - ✅ Configures Anchor.toml for deployment
48
+ - ✅ Works with real Solana networks
49
+
50
+ ## 🚫 What FORGE Does NOT Do
51
+
52
+ FORGE does not:
53
+ - Host your code
54
+ - Manage your keys
55
+ - Abstract blockchain risks
56
+ - Hold your hand
57
+
58
+ If you want magic, look elsewhere.
59
+
60
+ ## 📚 Requirements
61
+
62
+ You must have:
63
+ - Basic Rust knowledge
64
+ - Understanding of Solana concepts
65
+ - Your own wallet and keys
66
+ - Test SOL for deployment
67
+
68
+ ## 🔧 Commands
69
+
70
+ | Command | Description |
71
+ |---------|-------------|
72
+ | `forge init <name>` | Create new Anchor project |
73
+ | `forge status` | Check environment and tools |
74
+ | `forge deploy` | Deploy program to Solana |
75
+
76
+ ## 📖 Examples
77
+
78
+ ```bash
79
+ # Create a token program
80
+ forge init my-token
81
+
82
+ # Check everything is ready
83
+ forge status
84
+
85
+ # Deploy to devnet
86
+ forge deploy
87
+ ```
88
+
89
+ ## 🏗️ Architecture
90
+
91
+ ```
92
+ FORGE CLI (npm)
93
+ ├── forge-sdk-solana - Node.js CLI tool
94
+ └── forge-runtime - Rust runtime (crates.io)
95
+
96
+ Both work together for complete Solana development
97
+ ```
98
+
99
+ ## 🐛 Support
100
+
101
+ This is infrastructure. If it breaks:
102
+ 1. File an issue on GitHub
103
+ 2. Include your `forge status` output
104
+ 3. Describe what you expected vs what happened
105
+
106
+ If you don't understand Solana, learn Solana first.
107
+
108
+ ## 📄 License
109
+
110
+ MIT - [https://github.com/forge-protocol/forge/blob/main/LICENSE](https://github.com/forge-protocol/forge/blob/main/LICENSE)
111
+
112
+ ## 🔗 Links
113
+
114
+ - **Homepage**: [https://github.com/forge-protocol/forge](https://github.com/forge-protocol/forge)
115
+ - **NPM Package**: [https://www.npmjs.com/package/forge-solana-sdk](https://www.npmjs.com/package/forge-solana-sdk)
116
+ - **Issues**: [https://github.com/forge-protocol/forge/issues](https://github.com/forge-protocol/forge/issues)
117
+
118
+ ---
119
+
120
+ **FORGE: Infrastructure, not cosplay.** ⚡
package/bin/forge.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+
3
+ // FORGE CLI Binary Entry Point
4
+ require('../dist/cli.js');
@@ -0,0 +1,2 @@
1
+ export declare const logo = "\n\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\n\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\n\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557\n\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D\n\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\n\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\n";
2
+ //# sourceMappingURL=ascii.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ascii.d.ts","sourceRoot":"","sources":["../src/ascii.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,gyCAOhB,CAAC"}
package/dist/ascii.js ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logo = void 0;
4
+ exports.logo = `
5
+ ███████╗ ██████╗ ██████╗ ██████╗ ███████╗
6
+ ██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝
7
+ █████╗ ██║ ██║██████╔╝██║ ███╗█████╗
8
+ ██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝
9
+ ██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗
10
+ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
11
+ `;
12
+ //# sourceMappingURL=ascii.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ascii.js","sourceRoot":"","sources":["../src/ascii.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG;;;;;;;CAOnB,CAAC"}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const commander_1 = require("commander");
5
+ const ascii_js_1 = require("./ascii.js");
6
+ const init_js_1 = require("./commands/init.js");
7
+ const deploy_js_1 = require("./commands/deploy.js");
8
+ const status_js_1 = require("./commands/status.js");
9
+ const program = new commander_1.Command();
10
+ program
11
+ .name('forge')
12
+ .description('FORGE - Intent-driven app assembly on Solana')
13
+ .version('2.0.0');
14
+ program
15
+ .command('init [projectName]')
16
+ .description('Initialize a new FORGE project')
17
+ .action(async (projectName) => {
18
+ await (0, init_js_1.initCommand)(projectName);
19
+ });
20
+ program
21
+ .command('deploy')
22
+ .description('Deploy program to Solana')
23
+ .action(async () => {
24
+ await (0, deploy_js_1.deployCommand)();
25
+ });
26
+ program
27
+ .command('status')
28
+ .description('Check FORGE status and environment')
29
+ .action(async () => {
30
+ await (0, status_js_1.statusCommand)();
31
+ });
32
+ // Show logo on help
33
+ program.on('--help', () => {
34
+ console.log(ascii_js_1.logo);
35
+ console.log('\nFORGE does not:');
36
+ console.log('- host your code');
37
+ console.log('- manage your keys');
38
+ console.log('- abstract blockchain risks\n');
39
+ });
40
+ // Parse arguments
41
+ program.parse();
42
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,yCAAkC;AAClC,gDAAiD;AACjD,oDAAqD;AACrD,oDAAqD;AAErD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,8CAA8C,CAAC;KAC3D,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,oBAAoB,CAAC;KAC7B,WAAW,CAAC,gCAAgC,CAAC;KAC7C,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;IAC5B,MAAM,IAAA,qBAAW,EAAC,WAAW,CAAC,CAAC;AACjC,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,0BAA0B,CAAC;KACvC,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,IAAA,yBAAa,GAAE,CAAC;AACxB,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,oCAAoC,CAAC;KACjD,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,IAAA,yBAAa,GAAE,CAAC;AACxB,CAAC,CAAC,CAAC;AAEL,oBAAoB;AACpB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;IACxB,OAAO,CAAC,GAAG,CAAC,eAAI,CAAC,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACjC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAClC,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC;AAEH,kBAAkB;AAClB,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function deployCommand(): Promise<void>;
2
+ //# sourceMappingURL=deploy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAEA,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAwBnD"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deployCommand = deployCommand;
4
+ const child_process_1 = require("child_process");
5
+ async function deployCommand() {
6
+ console.log('Deploying to Solana...\n');
7
+ try {
8
+ // Check if we're in an Anchor project
9
+ (0, child_process_1.execSync)('ls Anchor.toml', { stdio: 'pipe' });
10
+ }
11
+ catch (error) {
12
+ console.error('❌ Not in an Anchor project directory');
13
+ console.error('Run "forge init" first or cd into your project');
14
+ process.exit(1);
15
+ }
16
+ try {
17
+ console.log('Building program...');
18
+ (0, child_process_1.execSync)('anchor build', { stdio: 'inherit' });
19
+ console.log('\nDeploying...');
20
+ (0, child_process_1.execSync)('anchor deploy', { stdio: 'inherit' });
21
+ console.log('\n✅ Deployment successful!');
22
+ }
23
+ catch (error) {
24
+ console.error('❌ Deployment failed');
25
+ process.exit(1);
26
+ }
27
+ }
28
+ //# sourceMappingURL=deploy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":";;AAEA,sCAwBC;AA1BD,iDAAyC;AAElC,KAAK,UAAU,aAAa;IACjC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IAExC,IAAI,CAAC;QACH,sCAAsC;QACtC,IAAA,wBAAQ,EAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;QACtD,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;QACnC,IAAA,wBAAQ,EAAC,cAAc,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAE/C,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC9B,IAAA,wBAAQ,EAAC,eAAe,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAEhD,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function initCommand(projectName?: string): Promise<void>;
2
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAKA,wBAAsB,WAAW,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuGrE"}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initCommand = initCommand;
4
+ const child_process_1 = require("child_process");
5
+ const fs_1 = require("fs");
6
+ const path_1 = require("path");
7
+ const ascii_js_1 = require("../ascii.js");
8
+ async function initCommand(projectName) {
9
+ console.log(ascii_js_1.logo);
10
+ console.log('FORGE - Solana Development Platform\n');
11
+ const name = projectName || 'forge-project';
12
+ // Check if Anchor is installed
13
+ try {
14
+ (0, child_process_1.execSync)('anchor --version', { stdio: 'pipe' });
15
+ }
16
+ catch (error) {
17
+ console.error('❌ Anchor CLI not found. Install with:');
18
+ console.error('cargo install --git https://github.com/coral-xyz/anchor anchor-cli --tag v0.29.0');
19
+ process.exit(1);
20
+ }
21
+ console.log(`Initializing ${name}...\n`);
22
+ // Create project directory
23
+ const projectPath = (0, path_1.join)(process.cwd(), name);
24
+ if ((0, fs_1.existsSync)(projectPath)) {
25
+ console.error(`❌ Directory ${name} already exists`);
26
+ process.exit(1);
27
+ }
28
+ (0, fs_1.mkdirSync)(projectPath, { recursive: true });
29
+ (0, fs_1.mkdirSync)((0, path_1.join)(projectPath, 'programs', name, 'src'), { recursive: true });
30
+ // Generate program ID (simplified for demo)
31
+ const programId = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS";
32
+ // Create Anchor.toml
33
+ const anchorToml = `[toolchain]
34
+ anchor_version = "0.29.0"
35
+
36
+ [features]
37
+ seeds = false
38
+ skip-lint = false
39
+
40
+ [programs.localnet]
41
+ ${name} = "${programId}"
42
+
43
+ [registry]
44
+ url = "https://api.apr.dev"
45
+
46
+ [provider]
47
+ cluster = "Localnet"
48
+ wallet = "~/.config/solana/id.json"
49
+
50
+ [scripts]
51
+ test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
52
+ `;
53
+ // Create Cargo.toml
54
+ const cargoToml = `[package]
55
+ name = "${name}"
56
+ version = "0.1.0"
57
+ edition = "2021"
58
+
59
+ [lib]
60
+ crate-type = ["cdylib", "lib"]
61
+ name = "${name.replace(/-/g, '_')}"
62
+
63
+ [features]
64
+ no-entrypoint = []
65
+ no-idl = []
66
+ no-log-ix-name = []
67
+ cpi = ["no-entrypoint"]
68
+ default = []
69
+
70
+ [dependencies]
71
+ anchor-lang = "0.29.0"
72
+ anchor-spl = "0.29.0"
73
+ `;
74
+ // Create lib.rs
75
+ const libRs = `use anchor_lang::prelude::*;
76
+
77
+ declare_id!("${programId}");
78
+
79
+ #[program]
80
+ pub mod ${name.replace(/-/g, '_')} {
81
+ use super::*;
82
+
83
+ pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
84
+ msg!("Program initialized!");
85
+ Ok(())
86
+ }
87
+ }
88
+
89
+ #[derive(Accounts)]
90
+ pub struct Initialize {}
91
+ `;
92
+ // Write files
93
+ (0, fs_1.writeFileSync)((0, path_1.join)(projectPath, 'Anchor.toml'), anchorToml);
94
+ (0, fs_1.writeFileSync)((0, path_1.join)(projectPath, 'programs', name, 'Cargo.toml'), cargoToml);
95
+ (0, fs_1.writeFileSync)((0, path_1.join)(projectPath, 'programs', name, 'src', 'lib.rs'), libRs);
96
+ console.log('✅ Project created successfully!');
97
+ console.log(`\nNext steps:`);
98
+ console.log(` cd ${name}`);
99
+ console.log(` anchor build`);
100
+ console.log(` anchor test`);
101
+ }
102
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";;AAKA,kCAuGC;AA5GD,iDAAyC;AACzC,2BAA0D;AAC1D,+BAA4B;AAC5B,0CAAmC;AAE5B,KAAK,UAAU,WAAW,CAAC,WAAoB;IACpD,OAAO,CAAC,GAAG,CAAC,eAAI,CAAC,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;IAErD,MAAM,IAAI,GAAG,WAAW,IAAI,eAAe,CAAC;IAE5C,+BAA+B;IAC/B,IAAI,CAAC;QACH,IAAA,wBAAQ,EAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACvD,OAAO,CAAC,KAAK,CAAC,kFAAkF,CAAC,CA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E,YAAY,CAAC,EAAE,SAAS,CAAC,CAAC;IAC5E,IAAA,kBAAa,EAAC,IAAA,WAAI,EAAC,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC;IAE3E,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC9B,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function statusCommand(): Promise<void>;
2
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAIA,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CA2CnD"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.statusCommand = statusCommand;
4
+ const child_process_1 = require("child_process");
5
+ const fs_1 = require("fs");
6
+ const path_1 = require("path");
7
+ async function statusCommand() {
8
+ console.log('FORGE Status\n');
9
+ // Check Anchor
10
+ try {
11
+ const anchorVersion = (0, child_process_1.execSync)('anchor --version', { encoding: 'utf8' }).trim();
12
+ console.log(`✅ Anchor CLI: ${anchorVersion}`);
13
+ }
14
+ catch (error) {
15
+ console.log('❌ Anchor CLI: Not found');
16
+ }
17
+ // Check Solana CLI
18
+ try {
19
+ const solanaVersion = (0, child_process_1.execSync)('solana --version', { encoding: 'utf8' }).trim().split('\n')[0];
20
+ console.log(`✅ Solana CLI: ${solanaVersion}`);
21
+ }
22
+ catch (error) {
23
+ console.log('❌ Solana CLI: Not found');
24
+ }
25
+ // Check Rust
26
+ try {
27
+ const rustVersion = (0, child_process_1.execSync)('rustc --version', { encoding: 'utf8' }).trim().split(' ')[1];
28
+ console.log(`✅ Rust: ${rustVersion}`);
29
+ }
30
+ catch (error) {
31
+ console.log('❌ Rust: Not found');
32
+ }
33
+ // Check if in project
34
+ const anchorToml = (0, path_1.join)(process.cwd(), 'Anchor.toml');
35
+ if ((0, fs_1.existsSync)(anchorToml)) {
36
+ console.log('✅ In Anchor project');
37
+ try {
38
+ const config = (0, fs_1.readFileSync)(anchorToml, 'utf8');
39
+ const network = config.includes('devnet') ? 'devnet' : 'localnet';
40
+ console.log(`📡 Network: ${network}`);
41
+ }
42
+ catch (error) {
43
+ console.log('📡 Network: Unknown');
44
+ }
45
+ }
46
+ else {
47
+ console.log('❌ Not in Anchor project');
48
+ }
49
+ console.log('\nReady to build on Solana.');
50
+ }
51
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":";;AAIA,sCA2CC;AA/CD,iDAAyC;AACzC,2BAA8C;AAC9C,+BAA4B;AAErB,KAAK,UAAU,aAAa;IACjC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAE9B,eAAe;IACf,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,IAAA,wBAAQ,EAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAChF,OAAO,CAAC,GAAG,CAAC,iBAAiB,aAAa,EAAE,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACzC,CAAC;IAED,mBAAmB;IACnB,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,IAAA,wBAAQ,EAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAA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AAC;IACzC,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,10 @@
1
+ export interface ForgeConfig {
2
+ name: string;
3
+ version: string;
4
+ network: 'devnet' | 'mainnet-beta' | 'localnet';
5
+ programId?: string;
6
+ treasuryPubkey?: string;
7
+ }
8
+ export declare function loadConfig(): ForgeConfig;
9
+ export declare function saveConfig(config: Partial<ForgeConfig>): void;
10
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,QAAQ,GAAG,cAAc,GAAG,UAAU,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAID,wBAAgB,UAAU,IAAI,WAAW,CAUxC;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAW7D"}
package/dist/config.js ADDED
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadConfig = loadConfig;
4
+ exports.saveConfig = saveConfig;
5
+ const fs_1 = require("fs");
6
+ const path_1 = require("path");
7
+ const os_1 = require("os");
8
+ const CONFIG_FILE = (0, path_1.join)((0, os_1.homedir)(), '.forge', 'config.json');
9
+ function loadConfig() {
10
+ try {
11
+ if ((0, fs_1.existsSync)(CONFIG_FILE)) {
12
+ const data = (0, fs_1.readFileSync)(CONFIG_FILE, 'utf8');
13
+ return { ...getDefaultConfig(), ...JSON.parse(data) };
14
+ }
15
+ }
16
+ catch (error) {
17
+ // Ignore errors and use defaults
18
+ }
19
+ return getDefaultConfig();
20
+ }
21
+ function saveConfig(config) {
22
+ const current = loadConfig();
23
+ const updated = { ...current, ...config };
24
+ // Ensure .forge directory exists
25
+ const configDir = (0, path_1.join)((0, os_1.homedir)(), '.forge');
26
+ if (!(0, fs_1.existsSync)(configDir)) {
27
+ require('fs').mkdirSync(configDir, { recursive: true });
28
+ }
29
+ (0, fs_1.writeFileSync)(CONFIG_FILE, JSON.stringify(updated, null, 2));
30
+ }
31
+ function getDefaultConfig() {
32
+ return {
33
+ name: 'forge-project',
34
+ version: '0.1.0',
35
+ network: 'devnet'
36
+ };
37
+ }
38
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;AAcA,gCAUC;AAED,gCAWC;AArCD,2BAA6D;AAC7D,+BAA4B;AAC5B,2BAA6B;AAU7B,MAAM,WAAW,GAAG,IAAA,WAAI,EAAC,IAAA,YAAO,GAAE,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;AAE7D,SAAgB,UAAU;IACxB,IAAI,CAAC;QACH,IAAI,IAAA,eAAU,EAAC,WAAW,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,GAAG,IAAA,iBAAY,EAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAC/C,OAAO,EAAE,GAAG,gBAAgB,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACxD,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,iCAAiC;IACnC,CAAC;IACD,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC;AAED,SAAgB,UAAU,CAAC,MAA4B;IACrD,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,EAAE,CAAC;IAE1C,iCAAiC;IACjC,MAAM,SAAS,GAAG,IAAA,WAAI,EAAC,IAAA,YAAO,GAAE,EAAE,QAAQ,CAAC,CAAC;IAC5C,IAAI,CAAC,IAAA,eAAU,EAAC,SAAS,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,IAAA,kBAAa,EAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,gBAAgB;IACvB,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,QAAQ;KAClB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { logo } from './ascii.js';
2
+ export { loadConfig, saveConfig } from './config.js';
3
+ export { initCommand } from './commands/init.js';
4
+ export { deployCommand } from './commands/deploy.js';
5
+ export { statusCommand } from './commands/status.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ // FORGE SDK
3
+ // Main entry point for programmatic usage
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.statusCommand = exports.deployCommand = exports.initCommand = exports.saveConfig = exports.loadConfig = exports.logo = void 0;
6
+ var ascii_js_1 = require("./ascii.js");
7
+ Object.defineProperty(exports, "logo", { enumerable: true, get: function () { return ascii_js_1.logo; } });
8
+ var config_js_1 = require("./config.js");
9
+ Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function () { return config_js_1.loadConfig; } });
10
+ Object.defineProperty(exports, "saveConfig", { enumerable: true, get: function () { return config_js_1.saveConfig; } });
11
+ // Re-export key utilities for SDK usage
12
+ var init_js_1 = require("./commands/init.js");
13
+ Object.defineProperty(exports, "initCommand", { enumerable: true, get: function () { return init_js_1.initCommand; } });
14
+ var deploy_js_1 = require("./commands/deploy.js");
15
+ Object.defineProperty(exports, "deployCommand", { enumerable: true, get: function () { return deploy_js_1.deployCommand; } });
16
+ var status_js_1 = require("./commands/status.js");
17
+ Object.defineProperty(exports, "statusCommand", { enumerable: true, get: function () { return status_js_1.statusCommand; } });
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,YAAY;AACZ,0CAA0C;;;AAE1C,uCAAkC;AAAzB,gGAAA,IAAI,OAAA;AACb,yCAAqD;AAA5C,uGAAA,UAAU,OAAA;AAAE,uGAAA,UAAU,OAAA;AAE/B,wCAAwC;AACxC,8CAAiD;AAAxC,sGAAA,WAAW,OAAA;AACpB,kDAAqD;AAA5C,0GAAA,aAAa,OAAA;AACtB,kDAAqD;AAA5C,0GAAA,aAAa,OAAA"}
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "forge-solana-sdk",
3
+ "version": "2.0.3",
4
+ "description": "FORGE - Intent-driven app assembly on Solana",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "forge": "bin/forge.js"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "dist"
12
+ ],
13
+ "scripts": {
14
+ "build": "tsc",
15
+ "prepublishOnly": "npm run build",
16
+ "clean": "rm -rf dist"
17
+ },
18
+ "keywords": [
19
+ "solana",
20
+ "cli",
21
+ "blockchain",
22
+ "anchor",
23
+ "forge",
24
+ "sdk"
25
+ ],
26
+ "author": "FORGE Team <hello@forge-protocol.com>",
27
+ "license": "MIT",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/forge-protocol/forge.git"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/forge-protocol/forge/issues"
34
+ },
35
+ "homepage": "https://github.com/forge-protocol/forge#readme",
36
+ "dependencies": {
37
+ "commander": "^12.0.0"
38
+ },
39
+ "devDependencies": {
40
+ "@types/node": "^20",
41
+ "typescript": "^5"
42
+ }
43
+ }