opencontext 1.0.3 → 1.0.4

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 (2) hide show
  1. package/dist/cli/index.js +12 -41
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -49,7 +49,7 @@ const boxen_1 = __importDefault(require("boxen"));
49
49
  const fs = __importStar(require("fs"));
50
50
  const path = __importStar(require("path"));
51
51
  const os = __importStar(require("os"));
52
- const VERSION = '1.0.3';
52
+ const VERSION = '1.0.4';
53
53
  const CONFIG_DIR = path.join(os.homedir(), '.opencontext');
54
54
  const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
55
55
  // ASCII Logo
@@ -241,54 +241,25 @@ function generateFilename(companyName, ext = 'json') {
241
241
  .replace(/[^a-z0-9]+/g, '-')
242
242
  .replace(/^-|-$/g, '') + `-context.${ext}`;
243
243
  }
244
- // Convert result to CSV format
244
+ // Convert result to CSV format (columns = fields, one row of data)
245
245
  function resultToCSV(result) {
246
- const rows = [];
247
- // Header
248
- rows.push('Field,Value');
249
246
  // Helper to escape CSV values
250
247
  const escape = (val) => `"${val.replace(/"/g, '""')}"`;
248
+ // Define headers and values
249
+ const headers = [];
250
+ const values = [];
251
251
  // Basic fields
252
- rows.push(`Company Name,${escape(result.company_name)}`);
253
- rows.push(`Website,${escape(result.company_url)}`);
254
- rows.push(`Industry,${escape(result.industry)}`);
255
- rows.push(`Description,${escape(result.description)}`);
256
- rows.push(`Target Audience,${escape(result.target_audience)}`);
257
- rows.push(`Brand Tone,${escape(result.tone)}`);
252
+ headers.push('Company Name', 'Website', 'Industry', 'Description', 'Target Audience', 'Brand Tone');
253
+ values.push(escape(result.company_name), escape(result.company_url), escape(result.industry), escape(result.description), escape(result.target_audience), escape(result.tone));
258
254
  // Arrays as semicolon-separated
259
- if (result.products?.length) {
260
- rows.push(`Products,${escape(result.products.join('; '))}`);
261
- }
262
- if (result.competitors?.length) {
263
- rows.push(`Competitors,${escape(result.competitors.join('; '))}`);
264
- }
265
- if (result.pain_points?.length) {
266
- rows.push(`Pain Points,${escape(result.pain_points.join('; '))}`);
267
- }
268
- if (result.value_propositions?.length) {
269
- rows.push(`Value Propositions,${escape(result.value_propositions.join('; '))}`);
270
- }
271
- if (result.use_cases?.length) {
272
- rows.push(`Use Cases,${escape(result.use_cases.join('; '))}`);
273
- }
274
- if (result.content_themes?.length) {
275
- rows.push(`Content Themes,${escape(result.content_themes.join('; '))}`);
276
- }
255
+ headers.push('Products', 'Competitors', 'Pain Points', 'Value Propositions', 'Use Cases', 'Content Themes');
256
+ values.push(escape(result.products?.join('; ') || ''), escape(result.competitors?.join('; ') || ''), escape(result.pain_points?.join('; ') || ''), escape(result.value_propositions?.join('; ') || ''), escape(result.use_cases?.join('; ') || ''), escape(result.content_themes?.join('; ') || ''));
277
257
  // Voice persona
278
258
  if (result.voice_persona) {
279
- rows.push(`ICP Profile,${escape(result.voice_persona.icp_profile)}`);
280
- rows.push(`Voice Style,${escape(result.voice_persona.voice_style)}`);
281
- if (result.voice_persona.do_list?.length) {
282
- rows.push(`Do List,${escape(result.voice_persona.do_list.join('; '))}`);
283
- }
284
- if (result.voice_persona.dont_list?.length) {
285
- rows.push(`Dont List,${escape(result.voice_persona.dont_list.join('; '))}`);
286
- }
287
- if (result.voice_persona.example_phrases?.length) {
288
- rows.push(`Example Phrases,${escape(result.voice_persona.example_phrases.join('; '))}`);
289
- }
259
+ headers.push('ICP Profile', 'Voice Style', 'Do List', 'Dont List', 'Example Phrases');
260
+ values.push(escape(result.voice_persona.icp_profile || ''), escape(result.voice_persona.voice_style || ''), escape(result.voice_persona.do_list?.join('; ') || ''), escape(result.voice_persona.dont_list?.join('; ') || ''), escape(result.voice_persona.example_phrases?.join('; ') || ''));
290
261
  }
291
- return rows.join('\n');
262
+ return headers.join(',') + '\n' + values.join(',');
292
263
  }
293
264
  // Commands
294
265
  async function analyzeCommand(url, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencontext",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "AI-powered company context analysis from your terminal. Extract comprehensive company profiles with a single command.",
5
5
  "main": "dist/cli/index.js",
6
6
  "bin": {