careervivid 1.12.40 → 1.12.46

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.
@@ -1 +1 @@
1
- {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/agent/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,eAAO,MAAM,aAAa,QAalB,CAAC;AAMT,eAAO,MAAM,cAAc,QAcnB,CAAC;AAMT,eAAO,MAAM,cAAc,QAgBnB,CAAC;AAMT,eAAO,MAAM,kBAAkB,QAwCvB,CAAC;AAMT,eAAO,MAAM,YAAY,QA2CjB,CAAC;AAMT,eAAO,MAAM,iBAAiB,QAiBtB,CAAC;AAOT;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE;IACzC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,MAAM,CAkCT"}
1
+ {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/agent/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,eAAO,MAAM,aAAa,QAalB,CAAC;AAMT,eAAO,MAAM,cAAc,QAcnB,CAAC;AAMT,eAAO,MAAM,cAAc,QAqCnB,CAAC;AAMT,eAAO,MAAM,kBAAkB,QAwCvB,CAAC;AAMT,eAAO,MAAM,YAAY,QA2CjB,CAAC;AAMT,eAAO,MAAM,iBAAiB,QAiBtB,CAAC;AAOT;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE;IACzC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,MAAM,CAkCT"}
@@ -51,11 +51,32 @@ export const CODING_SECTION = `
51
51
 
52
52
  You have access to file I/O, shell execution, and codebase search tools.
53
53
 
54
+ ### ⚠️ File Access Scope (STRICT — do not bypass)
55
+
56
+ You operate with least-privilege file access. This is enforced at the tool level and cannot be overridden.
57
+
58
+ **READ access** is limited to:
59
+ - \`career-vivid/\` — your job tracker data, résumé drafts, and career pipeline files
60
+ - \`cli/\` — the CLI source code (your own code)
61
+ - \`tmp/\` or \`/tmp/\` — temporary scratch files
62
+
63
+ **WRITE access** is limited to:
64
+ - \`career-vivid/\` — ONLY the career data directory you own
65
+ - \`tmp/\` or \`/tmp/\` — temporary scratch files
66
+
67
+ **NEVER attempt to read or write:**
68
+ - \`src/\` — web app source code (React, components, pages)
69
+ - \`functions/\` — Firebase Cloud Functions source
70
+ - \`next-app/\` — Next.js application source
71
+ - Any file outside your allowed prefixes
72
+
73
+ If a task requires modifying web app code (\`src/\`, \`functions/\`, etc.), tell the user to make that change in their editor. Your role is career data management, not application development.
74
+
54
75
  ### Workflow
55
76
  1. Read relevant files first (read_file). Never overwrite blindly.
56
77
  2. Emit a short "Plan:" describing files you will touch and the approach.
57
- 3. Write code using write_file or patch_file.
58
- 4. Verify with run_command (tsc --noEmit, npm test, etc.).
78
+ 3. Write data using write_file or patch_file (career-vivid/ only).
79
+ 4. Verify with run_command (read-only commands like cat, ls, grep).
59
80
  5. Fix errors and loop until clean; summarise all changes made.
60
81
 
61
82
  ### Code Quality
@@ -82,7 +103,7 @@ export const JOBS_TOOLS_SECTION = `
82
103
  - **openings_apply** — Mark a specific opening as Applied (requires explicit date).
83
104
 
84
105
  ### CSV Pipeline Tracker (tracker_*)
85
- These tools read/write jobs.csv — the local career-ops pipeline spreadsheet.
106
+ These tools read/write jobs.csv — the local career-vivid pipeline spreadsheet.
86
107
  - **tracker_list_jobs** — Show the pipeline (supports tier/status filters and sort_by).
87
108
  - **tracker_add_job** — Add a new company to the tracker.
88
109
  - **tracker_update_job** — Update any field on a job entry (status, scores, notes, follow-up).
@@ -1 +1 @@
1
- {"version":3,"file":"coding.d.ts","sourceRoot":"","sources":["../../../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,EAQlC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,8 +1,53 @@
1
1
  import { execSync } from 'child_process';
2
2
  import { existsSync, readFileSync, writeFileSync, readdirSync, statSync, mkdirSync } from 'fs';
3
- import { resolve, dirname, relative, join } from 'path';
3
+ import { resolve, dirname, relative, join, normalize } from 'path';
4
4
  import { Type } from '@google/genai';
5
5
  // ============================================================================
6
+ // Path-based Access Control (Least Privilege)
7
+ // ============================================================================
8
+ /**
9
+ * Directories the agent is ALLOWED to READ.
10
+ * These are relative to the repo root (process.cwd()) or absolute paths the agent owns.
11
+ */
12
+ const READ_ALLOWED_PREFIXES = [
13
+ // Agent's own data & config
14
+ 'career-vivid/', // job tracker CSV, résumé drafts, career data
15
+ 'cli/', // CLI source — agent may read its own code
16
+ // Scratch / temporary outputs produced by the agent
17
+ 'tmp/',
18
+ '/tmp/',
19
+ // User's home config file is read by loadConfig() — not by read_file tool
20
+ ];
21
+ /**
22
+ * Directories the agent is ALLOWED to WRITE.
23
+ * This is intentionally much narrower than the read list.
24
+ * Source code (src/, functions/, next-app/) is completely off-limits.
25
+ */
26
+ const WRITE_ALLOWED_PREFIXES = [
27
+ 'career-vivid/', // job tracker CSV, résumé drafts — the only structured data the agent owns
28
+ 'tmp/',
29
+ '/tmp/',
30
+ ];
31
+ /**
32
+ * Resolve a raw path argument and check it against an allowlist.
33
+ * @throws if the resolved path falls outside every allowed prefix.
34
+ */
35
+ function guardPath(rawPath, allowedPrefixes, mode) {
36
+ const cwd = process.cwd();
37
+ const absPath = normalize(resolve(rawPath));
38
+ const allowed = allowedPrefixes.some(prefix => {
39
+ const fullPrefix = prefix.startsWith('/') ? normalize(prefix) : normalize(join(cwd, prefix));
40
+ return absPath.startsWith(fullPrefix);
41
+ });
42
+ if (!allowed) {
43
+ const rel = relative(cwd, absPath);
44
+ throw new Error(`⛔ Access denied: ${mode} access to "${rel}" is not permitted.\n` +
45
+ `The agent can only ${mode} files inside: ${allowedPrefixes.join(', ')}\n` +
46
+ `To access this file, use your editor or the CareerVivid web app.`);
47
+ }
48
+ return absPath;
49
+ }
50
+ // ============================================================================
6
51
  // Safe list for run_command (no confirmation required)
7
52
  // ============================================================================
8
53
  const SAFE_COMMAND_PREFIXES = [
@@ -77,7 +122,7 @@ export const readFileTool = {
77
122
  required: ['path'],
78
123
  },
79
124
  execute: async (args) => {
80
- const absPath = resolve(args.path);
125
+ const absPath = guardPath(args.path, READ_ALLOWED_PREFIXES, 'read');
81
126
  if (!existsSync(absPath)) {
82
127
  throw new Error(`File not found: ${absPath}`);
83
128
  }
@@ -114,7 +159,7 @@ export const writeFileTool = {
114
159
  required: ['path', 'content'],
115
160
  },
116
161
  execute: async (args) => {
117
- const absPath = resolve(args.path);
162
+ const absPath = guardPath(args.path, WRITE_ALLOWED_PREFIXES, 'write');
118
163
  mkdirSync(dirname(absPath), { recursive: true });
119
164
  writeFileSync(absPath, args.content, 'utf-8');
120
165
  const lines = args.content.split('\n').length;
@@ -151,7 +196,7 @@ export const patchFileTool = {
151
196
  required: ['path', 'start_line', 'end_line', 'new_content'],
152
197
  },
153
198
  execute: async (args) => {
154
- const absPath = resolve(args.path);
199
+ const absPath = guardPath(args.path, WRITE_ALLOWED_PREFIXES, 'write');
155
200
  if (!existsSync(absPath))
156
201
  throw new Error(`File not found: ${absPath}`);
157
202
  const lines = readFileSync(absPath, 'utf-8').split('\n');
@@ -45,9 +45,9 @@ function getJobsCsvPath() {
45
45
  const __dirpath = dirname(__filename);
46
46
  // 1. Check dev repo locations (for local development)
47
47
  const devCandidates = [
48
- resolve(__dirpath, "../../../../career-ops/data/jobs.csv"),
49
- resolve(__dirpath, "../../../../../career-ops/data/jobs.csv"),
50
- resolve(process.cwd(), "career-ops/data/jobs.csv"),
48
+ resolve(__dirpath, "../../../../career-vivid/data/jobs.csv"),
49
+ resolve(__dirpath, "../../../../../career-vivid/data/jobs.csv"),
50
+ resolve(process.cwd(), "career-vivid/data/jobs.csv"),
51
51
  ];
52
52
  for (const p of devCandidates) {
53
53
  if (existsSync(p))
@@ -61,9 +61,9 @@ function getOpeningsPath() {
61
61
  const __dirpath = dirname(__filename);
62
62
  // Mirror next to jobs.csv
63
63
  const devCandidates = [
64
- resolve(__dirpath, "../../../../career-ops/data/job_openings.csv"),
65
- resolve(__dirpath, "../../../../../career-ops/data/job_openings.csv"),
66
- resolve(process.cwd(), "career-ops/data/job_openings.csv"),
64
+ resolve(__dirpath, "../../../../career-vivid/data/job_openings.csv"),
65
+ resolve(__dirpath, "../../../../../career-vivid/data/job_openings.csv"),
66
+ resolve(process.cwd(), "career-vivid/data/job_openings.csv"),
67
67
  ];
68
68
  for (const p of devCandidates) {
69
69
  if (existsSync(p))
@@ -102,9 +102,9 @@ function getCsvPath() {
102
102
  const __dirname = dirname(__filename);
103
103
  // 1. Check dev repo locations first (for existing users/contributors)
104
104
  const devCandidates = [
105
- resolve(__dirname, "../../../../career-ops/data/jobs.csv"),
106
- resolve(__dirname, "../../../../../career-ops/data/jobs.csv"),
107
- resolve(process.cwd(), "career-ops/data/jobs.csv"),
105
+ resolve(__dirname, "../../../../career-vivid/data/jobs.csv"),
106
+ resolve(__dirname, "../../../../../career-vivid/data/jobs.csv"),
107
+ resolve(process.cwd(), "career-vivid/data/jobs.csv"),
108
108
  ];
109
109
  for (const p of devCandidates) {
110
110
  if (existsSync(p))
package/dist/api.d.ts CHANGED
@@ -237,4 +237,17 @@ export declare function listCoverLetters(jobId?: string): Promise<{
237
237
  coverLetters: CoverLetter[];
238
238
  total: number;
239
239
  } | ApiError>;
240
+ export interface ReferredUser {
241
+ uid: string;
242
+ email: string;
243
+ signupDate: string | null;
244
+ }
245
+ export interface ReferralStatsResult {
246
+ code: string;
247
+ totalReferred: number;
248
+ maxReferrals: number;
249
+ referredUsers: ReferredUser[];
250
+ }
251
+ /** Fetch user's referral code and stats */
252
+ export declare function getReferralStats(): Promise<ReferralStatsResult | ApiError>;
240
253
  //# sourceMappingURL=api.d.ts.map
package/dist/api.d.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 +248,7 @@ export async function listCoverLetters(jobId) {
248
248
  params.jobId = jobId;
249
249
  return cfRequest("GET", "cliCoverLettersList", undefined, Object.keys(params).length ? params : undefined);
250
250
  }
251
+ /** Fetch user's referral code and stats */
252
+ export async function getReferralStats() {
253
+ return cfRequest("GET", "cliReferralStats");
254
+ }
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare function registerReferralCommand(program: Command): void;
3
+ //# sourceMappingURL=referral.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"referral.d.ts","sourceRoot":"","sources":["../../src/commands/referral.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,QAiFvD"}
@@ -0,0 +1,82 @@
1
+ import chalk from "chalk";
2
+ import ora from "ora";
3
+ import { getReferralStats, isApiError } from "../api.js";
4
+ import { printError } from "../output.js";
5
+ function getProgressBar(current, total, width = 30) {
6
+ const percentage = Math.min(Math.max(current / total, 0), 1);
7
+ const filledLength = Math.round(width * percentage);
8
+ const emptyLength = width - filledLength;
9
+ const filledBar = '█'.repeat(filledLength);
10
+ const emptyBar = '░'.repeat(emptyLength);
11
+ return `[${chalk.green(filledBar)}${chalk.dim(emptyBar)}]`;
12
+ }
13
+ export function registerReferralCommand(program) {
14
+ const referralCmd = program
15
+ .command("referral")
16
+ .description("Manage your CareerVivid referral code, track progress, and view rewards")
17
+ .option("--code", "Print your referral code")
18
+ .option("--link", "Print your full referral link")
19
+ .option("--draft-message", "Print a pre-written shareable message")
20
+ .option("--status", "Show your referral progress and rewards")
21
+ .option("--list", "List your successfully referred users")
22
+ .option("--json", "Output raw JSON data")
23
+ .action(async (opts) => {
24
+ const isJson = opts.json ?? process.argv.includes("--json");
25
+ const spinner = ora("Fetching referral stats…").start();
26
+ const result = await getReferralStats();
27
+ if (isApiError(result)) {
28
+ spinner.fail("Failed to get referral stats.");
29
+ printError(result.message, undefined, isJson);
30
+ process.exit(1);
31
+ }
32
+ spinner.stop();
33
+ const baseUrl = "https://careervivid.app/register?ref=";
34
+ const fullLink = `${baseUrl}${result.code}`;
35
+ if (isJson) {
36
+ console.log(JSON.stringify({ ...result, fullLink }));
37
+ return;
38
+ }
39
+ // Fallback to show all if no specific flags provided
40
+ const showAll = !opts.code && !opts.link && !opts.draftMessage && !opts.status && !opts.list;
41
+ if (opts.code || showAll) {
42
+ console.log(`\n ${chalk.cyan.bold("Your Referral Code:")} ${chalk.white.bold(result.code)}`);
43
+ }
44
+ if (opts.link || showAll) {
45
+ console.log(`\n ${chalk.cyan.bold("Your Referral Link:")} ${chalk.underline.blue(fullLink)}`);
46
+ }
47
+ if (opts.draftMessage || showAll) {
48
+ console.log(`\n ${chalk.magenta.bold("Share Message:")}`);
49
+ console.log(chalk.dim(` --------------------------------------------------`));
50
+ console.log(` Accelerate Your Career Path with CareerVivid! 🚀`);
51
+ console.log();
52
+ console.log(` Use my exclusive code ${chalk.bold(result.code)} to get 2 Months of Premium for free.`);
53
+ console.log();
54
+ console.log(` Sign up here: ${fullLink}`);
55
+ console.log(chalk.dim(` --------------------------------------------------`));
56
+ }
57
+ if (opts.status || showAll) {
58
+ const remaining = result.maxReferrals - result.totalReferred;
59
+ console.log(`\n ${chalk.yellow.bold("Redemption Progress:")}`);
60
+ console.log(` ${getProgressBar(result.totalReferred, result.maxReferrals)} ${chalk.white.bold(`${result.totalReferred}/${result.maxReferrals}`)}`);
61
+ console.log(` ${chalk.dim(`${remaining} referrals remaining\n`)}`);
62
+ console.log(` ${chalk.cyan.bold("The Rewards:")}`);
63
+ console.log(` ${chalk.green.bold("They Get:")} 2 months free Premium, 1000 AI credits/month, All premium templates`);
64
+ console.log(` ${chalk.green.bold("You Get:")} 1 month free Premium per successful referral (Up to 5 months)`);
65
+ }
66
+ if (opts.list || showAll) {
67
+ console.log(`\n ${chalk.blue.bold("Referred Users:")}`);
68
+ if (result.referredUsers.length === 0) {
69
+ console.log(` ${chalk.dim("No referrals yet. Share your code to get started!")}`);
70
+ }
71
+ else {
72
+ result.referredUsers.forEach((u, i) => {
73
+ const date = u.signupDate
74
+ ? new Date(u.signupDate).toLocaleDateString()
75
+ : "Recently";
76
+ console.log(` ${chalk.dim(`${i + 1}.`)} ${chalk.white(u.email)} ${chalk.dim(`(Joined: ${date})`)} ${chalk.green('✓ active')}`);
77
+ });
78
+ }
79
+ }
80
+ console.log("\n");
81
+ });
82
+ }
@@ -63,9 +63,9 @@ const __filename = fileURLToPath(import.meta.url);
63
63
  const __dirname = dirname(__filename);
64
64
  function findJobsCsvPath() {
65
65
  const candidates = [
66
- resolve(__dirname, "../../../../career-ops/data/jobs.csv"),
67
- resolve(__dirname, "../../../../../career-ops/data/jobs.csv"),
68
- resolve(process.cwd(), "career-ops/data/jobs.csv"),
66
+ resolve(__dirname, "../../../../career-vivid/data/jobs.csv"),
67
+ resolve(__dirname, "../../../../../career-vivid/data/jobs.csv"),
68
+ resolve(process.cwd(), "career-vivid/data/jobs.csv"),
69
69
  ];
70
70
  return candidates.find(existsSync) ?? null;
71
71
  }
@@ -4,7 +4,7 @@
4
4
  * Writes one row per EvalResult to a dated CSV file at:
5
5
  * <outputDir>/results-YYYY-MM-DD.csv
6
6
  *
7
- * Default output directory: career-ops/eval/
7
+ * Default output directory: career-vivid/eval/
8
8
  *
9
9
  * Features:
10
10
  * - Append-safe: if the file already exists from an earlier run today, new
@@ -18,7 +18,7 @@ import type { EvalResult, RunSummary } from "../types.js";
18
18
  export interface CsvDataLoggerOptions {
19
19
  /**
20
20
  * Directory to write CSV files into.
21
- * Defaults to <repo_root>/career-ops/eval/
21
+ * Defaults to <repo_root>/career-vivid/eval/
22
22
  */
23
23
  outputDir?: string;
24
24
  }
@@ -4,7 +4,7 @@
4
4
  * Writes one row per EvalResult to a dated CSV file at:
5
5
  * <outputDir>/results-YYYY-MM-DD.csv
6
6
  *
7
- * Default output directory: career-ops/eval/
7
+ * Default output directory: career-vivid/eval/
8
8
  *
9
9
  * Features:
10
10
  * - Append-safe: if the file already exists from an earlier run today, new
@@ -61,17 +61,17 @@ function defaultOutputDir() {
61
61
  const __dirname = dirname(__filename);
62
62
  // From dist/eval/storage/ or src/eval/storage/, go up 4 levels to repo root
63
63
  const candidates = [
64
- resolve(__dirname, "../../../../career-ops/eval"),
65
- resolve(__dirname, "../../../../../career-ops/eval"),
66
- resolve(process.cwd(), "career-ops/eval"),
64
+ resolve(__dirname, "../../../../career-vivid/eval"),
65
+ resolve(__dirname, "../../../../../career-vivid/eval"),
66
+ resolve(process.cwd(), "career-vivid/eval"),
67
67
  ];
68
68
  // Return the first parent that exists, or the cwd-relative fallback
69
69
  for (const c of candidates) {
70
- // We only care if the career-ops dir exists — create eval/ inside it
70
+ // We only care if the career-vivid dir exists — create eval/ inside it
71
71
  if (existsSync(resolve(c, "..")))
72
72
  return c;
73
73
  }
74
- return resolve(process.cwd(), "career-ops/eval");
74
+ return resolve(process.cwd(), "career-vivid/eval");
75
75
  }
76
76
  /** Format date as YYYY-MM-DD in local time. */
77
77
  function todayStr() {
package/dist/index.js CHANGED
@@ -51,6 +51,7 @@ import { registerWorkspaceCommand } from "./commands/workspace.js";
51
51
  import { registerProfileCommand } from "./commands/profile.js";
52
52
  import { registerJobsCommand } from "./commands/jobs.js";
53
53
  import { registerResumesCommand } from "./commands/resumes.js";
54
+ import { registerReferralCommand } from "./commands/referral.js";
54
55
  import { registerEvalCommand } from "./commands/eval.js";
55
56
  const __dirname = dirname(fileURLToPath(import.meta.url));
56
57
  const pkg = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf-8"));
@@ -74,6 +75,7 @@ registerWorkspaceCommand(program);
74
75
  registerProfileCommand(program);
75
76
  registerJobsCommand(program);
76
77
  registerResumesCommand(program);
78
+ registerReferralCommand(program);
77
79
  registerEvalCommand(program);
78
80
  // Shortcuts for whiteboard creation
79
81
  registerNewCommand(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "careervivid",
3
- "version": "1.12.40",
3
+ "version": "1.12.46",
4
4
  "description": "Official CLI for CareerVivid — publish articles, diagrams, and portfolio updates from your terminal or AI agent",
5
5
  "type": "module",
6
6
  "bin": {