dotshare-cli 1.0.0 → 3.0.1

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 (57) hide show
  1. package/LICENSE +201 -21
  2. package/README.md +258 -189
  3. package/SECURITY.md +145 -0
  4. package/bin/dotshare-agent.js +7 -0
  5. package/bin/dotshare-cli.js +11 -7
  6. package/bin/dotshare-mcp.js +6 -0
  7. package/docs/AGENT_INTEGRATION.md +556 -0
  8. package/out/agent/commands.js +120 -0
  9. package/out/agent/server.js +98 -0
  10. package/out/cli/commands.js +129 -376
  11. package/package.json +34 -94
  12. package/bin/dotshare-scheduler.js +0 -208
  13. package/out/analytics.js +0 -67
  14. package/out/analytics.js.map +0 -1
  15. package/out/bluesky.js +0 -100
  16. package/out/bluesky.js.map +0 -1
  17. package/out/cli/commands.js.map +0 -1
  18. package/out/cli/config.js +0 -144
  19. package/out/cli/config.js.map +0 -1
  20. package/out/credential-provider.js +0 -92
  21. package/out/credential-provider.js.map +0 -1
  22. package/out/discord.js +0 -85
  23. package/out/discord.js.map +0 -1
  24. package/out/extension.js +0 -1383
  25. package/out/extension.js.map +0 -1
  26. package/out/facebook.js +0 -66
  27. package/out/facebook.js.map +0 -1
  28. package/out/gemini.js +0 -219
  29. package/out/gemini.js.map +0 -1
  30. package/out/linkedin.js +0 -110
  31. package/out/linkedin.js.map +0 -1
  32. package/out/message-handlers.js +0 -391
  33. package/out/message-handlers.js.map +0 -1
  34. package/out/openai.js +0 -217
  35. package/out/openai.js.map +0 -1
  36. package/out/post-executor.js +0 -168
  37. package/out/post-executor.js.map +0 -1
  38. package/out/reddit.js +0 -538
  39. package/out/reddit.js.map +0 -1
  40. package/out/scheduled-posts.js +0 -100
  41. package/out/scheduled-posts.js.map +0 -1
  42. package/out/scheduler.js +0 -98
  43. package/out/scheduler.js.map +0 -1
  44. package/out/storage-manager.js +0 -403
  45. package/out/storage-manager.js.map +0 -1
  46. package/out/telegram.js +0 -104
  47. package/out/telegram.js.map +0 -1
  48. package/out/types.js +0 -3
  49. package/out/types.js.map +0 -1
  50. package/out/webview-provider.js +0 -168
  51. package/out/webview-provider.js.map +0 -1
  52. package/out/x.js +0 -55
  53. package/out/x.js.map +0 -1
  54. package/out/xai.js +0 -235
  55. package/out/xai.js.map +0 -1
  56. package/src/cli/commands.ts +0 -380
  57. package/src/cli/config.ts +0 -148
@@ -1,168 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.DotShareProvider = void 0;
27
- const vscode = __importStar(require("vscode"));
28
- const fs = __importStar(require("fs"));
29
- const path = __importStar(require("path"));
30
- const message_handlers_1 = require("./message-handlers");
31
- const storage_manager_1 = require("./storage-manager");
32
- const analytics_1 = require("./analytics");
33
- const scheduler_1 = require("./scheduler");
34
- class DotShareProvider {
35
- constructor(_extensionUri, _context) {
36
- this._extensionUri = _extensionUri;
37
- this._context = _context;
38
- this._storageManager = new storage_manager_1.StorageManager(_context);
39
- this._analytics = new analytics_1.Analytics();
40
- this._messageHandlers = new message_handlers_1.MessageHandlers({
41
- webviewView: this._view,
42
- storageManager: this._storageManager,
43
- analytics: this._analytics,
44
- scheduler: this._scheduler
45
- });
46
- }
47
- resolveWebviewView(webviewView, _context, _token) {
48
- void _context; // Suppress unused parameter warning
49
- void _token; // Suppress unused parameter warning
50
- this._view = webviewView;
51
- webviewView.webview.options = {
52
- enableScripts: true,
53
- localResourceRoots: [this._extensionUri]
54
- };
55
- webviewView.webview.html = this._getHtmlForWebview(webviewView.webview);
56
- // Load initial data when webview is ready
57
- setImmediate(async () => {
58
- try {
59
- // Load saved configuration
60
- await this._loadConfiguration(webviewView);
61
- // Load scheduled posts
62
- await this._loadScheduledPosts(webviewView);
63
- // Load post history and analytics
64
- await this._loadPostHistory(webviewView);
65
- }
66
- catch (error) {
67
- console.error('Error loading initial data:', error);
68
- }
69
- });
70
- // Set up message handler with proper context
71
- this._messageHandlers = new message_handlers_1.MessageHandlers({
72
- webviewView: webviewView,
73
- storageManager: this._storageManager,
74
- analytics: this._analytics,
75
- scheduler: this._scheduler
76
- });
77
- webviewView.webview.onDidReceiveMessage(async (message) => {
78
- await this._messageHandlers.handleMessage(message);
79
- }, undefined, this._context.subscriptions);
80
- }
81
- async _loadConfiguration(webviewView) {
82
- try {
83
- const config = await this._storageManager.loadConfiguration();
84
- webviewView.webview.postMessage({
85
- command: 'updateConfiguration',
86
- selectedModel: config.selectedModel ? { ...config.selectedModel, apiKey: config.apiKey } : config.selectedModel,
87
- linkedinToken: config.linkedinToken,
88
- telegramBot: config.telegramBot,
89
- telegramChat: config.telegramChat,
90
- facebookToken: config.facebookToken,
91
- facebookPageToken: config.facebookPageToken,
92
- facebookPageId: config.facebookPageId,
93
- discordWebhookUrl: config.discordWebhookUrl,
94
- redditAccessToken: config.redditAccessToken,
95
- redditRefreshToken: config.redditRefreshToken,
96
- blueskyIdentifier: config.blueskyIdentifier,
97
- blueskyPassword: config.blueskyPassword
98
- });
99
- }
100
- catch (error) {
101
- console.error('Error loading configuration:', error);
102
- }
103
- }
104
- async _loadScheduledPosts(webviewView) {
105
- try {
106
- const scheduledPosts = this._storageManager.scheduledPostsStorage.loadScheduledPosts();
107
- // Start the scheduler if there are scheduled posts and it's not already running
108
- if (scheduledPosts.length > 0 && !this._scheduler) {
109
- const storagePath = this._context.globalStorageUri?.fsPath || this._context.extensionPath;
110
- const credentialsGetter = async () => ({
111
- linkedinToken: await this._context.secrets.get('linkedinToken') || '',
112
- telegramBot: await this._context.secrets.get('telegramBot') || '',
113
- telegramChat: await this._context.secrets.get('telegramChat') || '',
114
- xAccessToken: await this._context.secrets.get('xAccessToken') || '',
115
- xAccessSecret: await this._context.secrets.get('xAccessSecret') || '',
116
- facebookToken: await this._context.secrets.get('facebookToken') || '',
117
- facebookPageToken: await this._context.secrets.get('facebookPageToken') || '',
118
- facebookPageId: await this._context.secrets.get('facebookPageId') || '',
119
- discordWebhookUrl: await this._context.secrets.get('discordWebhookUrl') || '',
120
- redditAccessToken: await this._context.secrets.get('redditAccessToken') || '',
121
- redditRefreshToken: await this._context.secrets.get('redditRefreshToken') || '',
122
- blueskyIdentifier: await this._context.secrets.get('blueskyIdentifier') || '',
123
- blueskyPassword: await this._context.secrets.get('blueskyPassword') || ''
124
- });
125
- this._scheduler = new scheduler_1.Scheduler(storagePath, undefined, credentialsGetter);
126
- this._scheduler.start();
127
- console.log('Scheduler started for existing scheduled posts');
128
- }
129
- webviewView.webview.postMessage({
130
- command: 'updateScheduledPosts',
131
- scheduledPosts: scheduledPosts
132
- });
133
- }
134
- catch (error) {
135
- console.error('Error loading scheduled posts:', error);
136
- }
137
- }
138
- async _loadPostHistory(webviewView) {
139
- try {
140
- const postHistory = this._storageManager.getPostHistory();
141
- const analytics = this._storageManager.calculateAnalytics();
142
- webviewView.webview.postMessage({
143
- command: 'updatePostHistory',
144
- postHistory: postHistory
145
- });
146
- webviewView.webview.postMessage({
147
- command: 'updateAnalytics',
148
- analytics: analytics
149
- });
150
- }
151
- catch (error) {
152
- console.error('Error loading post history:', error);
153
- }
154
- }
155
- _getHtmlForWebview(webview) {
156
- const indexPath = path.join(this._extensionUri.fsPath, 'media', 'index.html');
157
- let html = fs.readFileSync(indexPath, 'utf-8');
158
- // Replace resource paths with webview URIs
159
- const cssUri = webview.asWebviewUri(vscode.Uri.joinPath(this._extensionUri, 'media', 'style.css'));
160
- const jsUri = webview.asWebviewUri(vscode.Uri.joinPath(this._extensionUri, 'media', 'app.js'));
161
- html = html.replace('./style.css', cssUri.toString());
162
- html = html.replace('./app.js', jsUri.toString());
163
- return html;
164
- }
165
- }
166
- exports.DotShareProvider = DotShareProvider;
167
- DotShareProvider.viewType = 'dotshareView';
168
- //# sourceMappingURL=webview-provider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webview-provider.js","sourceRoot":"","sources":["../src/webview-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,uCAAyB;AACzB,2CAA6B;AAC7B,yDAAqD;AACrD,uDAAmD;AACnD,2CAAwC;AACxC,2CAAwC;AAExC,MAAa,gBAAgB;IASzB,YACqB,aAAyB,EACzB,QAAiC;QADjC,kBAAa,GAAb,aAAa,CAAY;QACzB,aAAQ,GAAR,QAAQ,CAAyB;QAElD,IAAI,CAAC,eAAe,GAAG,IAAI,gCAAc,CAAC,QAAQ,CAAC,CAAC;QACpD,IAAI,CAAC,UAAU,GAAG,IAAI,qBAAS,EAAE,CAAC;QAClC,IAAI,CAAC,gBAAgB,GAAG,IAAI,kCAAe,CAAC;YACxC,WAAW,EAAE,IAAI,CAAC,KAAM;YACxB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,SAAS,EAAE,IAAI,CAAC,UAAU;YAC1B,SAAS,EAAE,IAAI,CAAC,UAAU;SAC7B,CAAC,CAAC;IACP,CAAC;IAEM,kBAAkB,CACrB,WAA+B,EAC/B,QAA0C,EAC1C,MAAgC;QAEhC,KAAK,QAAQ,CAAC,CAAC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AE,YAAY,CAAC,CAAC;QAC9E,IAAI,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAE/C,2CAA2C;QAC3C,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;QACnG,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;QAE/F,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QACtD,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QAElD,OAAO,IAAI,CAAC;IAChB,CAAC;;AAlKL,4CAmKC;AAlK0B,yBAAQ,GAAG,cAAc,CAAC"}
package/out/x.js DELETED
@@ -1,55 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.validateXCredentials = exports.shareToX = void 0;
7
- const axios_1 = __importDefault(require("axios"));
8
- async function shareToX(_accessToken, _accessSecret, tweetData) {
9
- try {
10
- // Twitter API v2 uses OAuth 2.0, but for simplicity we'll assume bearer token for now
11
- // In production, you'd want proper OAuth implementation
12
- const apiKey = process.env.TWITTER_API_KEY || '';
13
- const apiSecret = process.env.TWITTER_API_SECRET || '';
14
- const bearerToken = Buffer.from(`${apiKey}:${apiSecret}`).toString('base64');
15
- const headers = {
16
- 'Authorization': `Bearer ${bearerToken}`,
17
- 'Content-Type': 'application/json'
18
- };
19
- const tweetPayload = {
20
- text: tweetData.text
21
- };
22
- // Add media if provided
23
- if (tweetData.media && tweetData.media.length > 0) {
24
- // Note: This is simplified - actual media upload requires multiple API calls
25
- // Upload media first, then attach to tweet
26
- console.log('Media upload for Twitter not fully implemented yet');
27
- }
28
- const response = await axios_1.default.post('https://api.twitter.com/2/tweets', tweetPayload, { headers });
29
- return response.data.data.id;
30
- }
31
- catch (error) {
32
- const errorMessage = error instanceof Error ? error.message : String(error);
33
- console.error('Error posting to Twitter/X:', errorMessage);
34
- throw new Error('Failed to post to Twitter/X');
35
- }
36
- }
37
- exports.shareToX = shareToX;
38
- async function validateXCredentials() {
39
- try {
40
- // Basic validation by attempting to get user info
41
- const apiKey = process.env.TWITTER_API_KEY || '';
42
- const bearerToken = Buffer.from(`${apiKey}:${process.env.TWITTER_API_SECRET || ''}`).toString('base64');
43
- const headers = {
44
- 'Authorization': `Bearer ${bearerToken}`,
45
- 'Content-Type': 'application/json'
46
- };
47
- await axios_1.default.get(`https://api.twitter.com/2/users/me?user.fields=id,name,username`, { headers });
48
- return true;
49
- }
50
- catch (error) {
51
- return false;
52
- }
53
- }
54
- exports.validateXCredentials = validateXCredentials;
55
- //# sourceMappingURL=x.js.map
package/out/x.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"x.js","sourceRoot":"","sources":["../src/x.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAOnB,KAAK,UAAU,QAAQ,CAAC,YAAoB,EAAE,aAAqB,EAAE,SAAoB;IAC5F,IAAI;QACA,sFAAsF;QACtF,wDAAwD;QACxD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC;QACjD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,EAAE,CAAC;QACvD,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAE7E,MAAM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AC,GAAG,CAAC,iEAAiE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QAChG,OAAO,IAAI,CAAC;KACf;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,KAAK,CAAC;KAChB;AACL,CAAC;AAhBD,oDAgBC"}
package/out/xai.js DELETED
@@ -1,235 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.getAvailableModels = exports.generatePost = void 0;
27
- const vscode = __importStar(require("vscode"));
28
- const fs = __importStar(require("fs"));
29
- const path = __importStar(require("path"));
30
- const child_process_1 = require("child_process");
31
- const util_1 = require("util");
32
- const execAsync = (0, util_1.promisify)(child_process_1.exec);
33
- async function detectProjectType(workspacePath) {
34
- const projectFiles = {
35
- node: ['package.json', 'node_modules', 'tsconfig.json', 'webpack.config.js'],
36
- rust: ['Cargo.toml', 'Cargo.lock', 'src/main.rs'],
37
- python: ['requirements.txt', 'setup.py', 'pyproject.toml', 'Pipfile', '__init__.py'],
38
- go: ['go.mod', 'go.sum', 'main.go'],
39
- java: ['pom.xml', 'build.gradle', 'src/main/java'],
40
- dotnet: ['.csproj', 'Program.cs', 'Startup.cs'],
41
- web: ['index.html', 'app.js', 'style.css', 'webpack.config.js'],
42
- docker: ['Dockerfile', 'docker-compose.yml']
43
- };
44
- let maxMatches = 0;
45
- let detectedType = 'generic';
46
- for (const [type, files] of Object.entries(projectFiles)) {
47
- let matches = 0;
48
- for (const file of files) {
49
- if (fs.existsSync(path.join(workspacePath, file))) {
50
- matches++;
51
- }
52
- }
53
- if (matches > maxMatches) {
54
- maxMatches = matches;
55
- detectedType = type;
56
- }
57
- }
58
- return detectedType;
59
- }
60
- async function scanProjectFiles(workspacePath, projectType) {
61
- const relevantFiles = {
62
- node: ['README.md', 'readme.md', 'package.json', 'CHANGELOG.md', 'CONTRIBUTING.md'],
63
- rust: ['README.md', 'readme.md', 'Cargo.toml', 'CHANGELOG.md'],
64
- python: ['README.md', 'readme.md', 'setup.py', 'pyproject.toml', 'CHANGELOG.md'],
65
- go: ['README.md', 'readme.md', 'go.mod', 'CHANGELOG.md'],
66
- java: ['README.md', 'readme.md', 'pom.xml', 'build.gradle', 'CHANGELOG.md'],
67
- dotnet: ['README.md', 'readme.md', '.csproj', 'CHANGELOG.md'],
68
- web: ['README.md', 'readme.md', 'index.html', 'CHANGELOG.md'],
69
- docker: ['README.md', 'readme.md', 'Dockerfile', 'docker-compose.yml'],
70
- generic: ['README.md', 'readme.md', 'CHANGELOG.md', 'HISTORY.md']
71
- };
72
- let projectName = 'My Project';
73
- let description = 'A software project';
74
- const keywords = [];
75
- let content = '';
76
- const filesToCheck = relevantFiles[projectType] || relevantFiles.generic;
77
- for (const file of filesToCheck) {
78
- const filePath = path.join(workspacePath, file);
79
- if (fs.existsSync(filePath)) {
80
- try {
81
- const fileContent = fs.readFileSync(filePath, 'utf8');
82
- if (file.toLowerCase().includes('package.json')) {
83
- const packageJson = JSON.parse(fileContent);
84
- projectName = packageJson.name || projectName;
85
- description = packageJson.description || description;
86
- keywords.push(...(packageJson.keywords || []));
87
- }
88
- else if (file.toLowerCase().includes('cargo.toml')) {
89
- const lines = fileContent.split('\n');
90
- for (const line of lines) {
91
- if (line.startsWith('name = ')) {
92
- projectName = line.split('=')[1].trim().replace(/"/g, '');
93
- }
94
- else if (line.startsWith('description = ')) {
95
- description = line.split('=')[1].trim().replace(/"/g, '');
96
- }
97
- }
98
- }
99
- content += `${file}:\n${fileContent.substring(0, 1000)}${fileContent.length > 1000 ? '...[truncated]' : ''}\n\n`;
100
- }
101
- catch {
102
- // Skip if can't read
103
- }
104
- }
105
- }
106
- return { projectName, description, content, keywords };
107
- }
108
- async function getGitInfo(workspacePath) {
109
- try {
110
- await execAsync('git rev-parse --git-dir', { cwd: workspacePath });
111
- const { stdout: latestCommit } = await execAsync('git show --no-patch --format="Hash: %H%nAuthor: %an <%ae>%nDate: %ad (%ar)%nMessage: %s%n"', { cwd: workspacePath });
112
- const { stdout: recentChanges } = await execAsync('git log --max-count=5 --oneline --pretty=format:"• %s (%ar)"', { cwd: workspacePath });
113
- const { stdout: diffStat } = await execAsync('git show --stat --format="" | tail -10', { cwd: workspacePath });
114
- return {
115
- latestCommit: latestCommit.trim(),
116
- recentChanges: recentChanges.trim() || 'No recent changes',
117
- changedFiles: diffStat.trim() || 'No file changes'
118
- };
119
- }
120
- catch (e) {
121
- return {
122
- latestCommit: 'Project is not a git repository',
123
- recentChanges: 'Cannot access git history - initialize repository with "git init"',
124
- changedFiles: 'Git information unavailable'
125
- };
126
- }
127
- }
128
- async function generatePost(apiKey, model = 'grok-beta') {
129
- const workspaceFolder = vscode.workspace.workspaceFolders?.[0];
130
- if (!workspaceFolder) {
131
- vscode.window.showErrorMessage('No workspace folder found.');
132
- return null;
133
- }
134
- const workspacePath = workspaceFolder.uri.fsPath;
135
- const projectType = await detectProjectType(workspacePath);
136
- const projectData = await scanProjectFiles(workspacePath, projectType);
137
- const gitInfo = await getGitInfo(workspacePath);
138
- const contextPrompt = `
139
- IMPORTANT: You MUST ONLY use the information provided below. Do NOT make up or hallucinate any features, technologies, or details that are not explicitly mentioned in the project files.
140
-
141
- Project Information:
142
- - Project Name: ${projectData.projectName || 'Unknown Project'}
143
- - Description: ${projectData.description || 'No description available'}
144
- - Type: ${projectType.charAt(0).toUpperCase() + projectType.slice(1)} project
145
- - Keywords: ${projectData.keywords.join(', ') || 'No keywords specified'}
146
-
147
- Actual Project Files and Content:
148
- ${projectData.content || 'No project content found'}
149
-
150
- Git Status:
151
- ${gitInfo.latestCommit}
152
- ${gitInfo.recentChanges}
153
- ${gitInfo.changedFiles}
154
-
155
- TASK: Based on the EXACT information above about this specific project, create a social media post announcing recent developments. Focus on:
156
- 1. What was actually implemented or changed (from git info)
157
- 2. The technologies actually used (from package.json and file analysis)
158
- 3. The actual features mentioned in the code/files
159
- 4. Keep the language technical and project-specific
160
-
161
- Do NOT mention any technologies or features not found in the files above. If there's limited information, keep the post brief and accurate.
162
-
163
- Post should be engaging, under 280 characters, and include 1-2 relevant hashtags from the project context.
164
- `.trim();
165
- // xAI API implementation (using fetch since official SDK not available)
166
- try {
167
- const response = await fetch('https://api.x.ai/v1/chat/completions', {
168
- method: 'POST',
169
- headers: {
170
- 'Authorization': `Bearer ${apiKey}`,
171
- 'Content-Type': 'application/json'
172
- },
173
- body: JSON.stringify({
174
- model: model,
175
- messages: [
176
- { role: 'system', content: 'You are Grok, a helpful AI created by xAI. Create engaging social media posts based on project context and git history.' },
177
- { role: 'user', content: contextPrompt }
178
- ],
179
- max_tokens: 300
180
- })
181
- });
182
- if (!response.ok) {
183
- throw new Error(`HTTP ${response.status}: ${response.statusText}`);
184
- }
185
- const data = await response.json();
186
- const generatedText = data.choices?.[0]?.message?.content || '';
187
- return {
188
- text: generatedText.trim(),
189
- media: undefined
190
- };
191
- }
192
- catch (error) {
193
- const errorMessage = error instanceof Error ? error.message : String(error);
194
- let detailedMessage = `xAI API Error: ${errorMessage}`;
195
- if (errorMessage.includes('401')) {
196
- detailedMessage = 'Invalid xAI API key. Please check your credentials.';
197
- }
198
- else if (errorMessage.includes('429')) {
199
- detailedMessage = 'xAI API rate limit exceeded. Please try again later.';
200
- }
201
- else if (errorMessage.includes('fetch')) {
202
- detailedMessage = 'Network error connecting to xAI API. Check internet connection.';
203
- }
204
- vscode.window.showErrorMessage(detailedMessage);
205
- // Fallback response for development
206
- if (errorMessage.includes('fetch') || errorMessage.includes('Failed to fetch')) {
207
- const fallbackText = `🚀 Exciting updates in ${projectData.projectName}! Just pushed new features including major improvements to our ${projectType} codebase. Check out the latest changes with enhanced performance and better developer experience. #opensource #${projectType}`;
208
- return {
209
- text: fallbackText,
210
- media: undefined
211
- };
212
- }
213
- throw error;
214
- }
215
- }
216
- exports.generatePost = generatePost;
217
- async function getAvailableModels() {
218
- try {
219
- // Placeholder for xAI API call to list models
220
- // const response = await fetch('https://api.x.ai/v1/models', {
221
- // headers: { 'Authorization': `Bearer ${apiKey}` }
222
- // });
223
- // const data = await response.json();
224
- // return data.models.map((model) => model.id);
225
- // For now, return hardcoded models
226
- return ['grok-beta', 'grok-1'];
227
- }
228
- catch (error) {
229
- const errorMessage = error instanceof Error ? error.message : String(error);
230
- vscode.window.showErrorMessage(`xAI API Error fetching models: ${errorMessage}`);
231
- throw error; // Re-throw to be caught by extension.ts
232
- }
233
- }
234
- exports.getAvailableModels = getAvailableModels;
235
- //# sourceMappingURL=xai.js.map
package/out/xai.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"xai.js","sourceRoot":"","sources":["../src/xai.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,uCAAyB;AACzB,2CAA6B;AAC7B,iDAAqC;AACrC,+BAAiC;AAGjC,MAAM,SAAS,GAAG,IAAA,gBAAS,EAAC,oBAAI,CAAC,CAAC;AAElC,KAAK,UAAU,iBAAiB,CAAC,aAAqB;IAClD,MAAM,YAAY,GAAG;QACjB,IAAI,EAAE,CAAC,cAAc,EAAE,c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