careervivid 1.12.45 → 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.
- package/dist/agent/instructions.d.ts.map +1 -1
- package/dist/agent/instructions.js +24 -3
- package/dist/agent/tools/coding.d.ts.map +1 -1
- package/dist/agent/tools/coding.js +49 -4
- package/dist/agent/tools/jobOpenings.js +6 -6
- package/dist/agent/tools/local-tracker.js +3 -3
- package/dist/eval/runner.js +3 -3
- package/dist/eval/storage/CsvDataLogger.d.ts +2 -2
- package/dist/eval/storage/CsvDataLogger.js +6 -6
- package/package.json +1 -1
|
@@ -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,
|
|
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
|
|
58
|
-
4. Verify with run_command (
|
|
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-
|
|
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":["../../../src/agent/tools/coding.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"coding.d.ts","sourceRoot":"","sources":["../../../src/agent/tools/coding.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAyGlC,iBAAS,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAG3C;AAMD,eAAO,MAAM,YAAY,EAAE,IAqC1B,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,IA0B3B,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,IA+C3B,CAAC;AAMF,eAAO,MAAM,iBAAiB,EAAE,IA8C/B,CAAC;AAMF,eAAO,MAAM,eAAe,EAAE,IA8C7B,CAAC;AAMF,eAAO,MAAM,cAAc,EAAE,IAmD5B,CAAC;AAEF,iEAAiE;AACjE,wBAAgB,yBAAyB,IAAI,IAAI,CAQhD;AAMD,eAAO,MAAM,eAAe,EAAE,IAkD7B,CAAC;AAMF,wDAAwD;AACxD,eAAO,MAAM,gBAAgB,EAAE,IAAI,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 =
|
|
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 =
|
|
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 =
|
|
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-
|
|
49
|
-
resolve(__dirpath, "../../../../../career-
|
|
50
|
-
resolve(process.cwd(), "career-
|
|
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-
|
|
65
|
-
resolve(__dirpath, "../../../../../career-
|
|
66
|
-
resolve(process.cwd(), "career-
|
|
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-
|
|
106
|
-
resolve(__dirname, "../../../../../career-
|
|
107
|
-
resolve(process.cwd(), "career-
|
|
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/eval/runner.js
CHANGED
|
@@ -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-
|
|
67
|
-
resolve(__dirname, "../../../../../career-
|
|
68
|
-
resolve(process.cwd(), "career-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
65
|
-
resolve(__dirname, "../../../../../career-
|
|
66
|
-
resolve(process.cwd(), "career-
|
|
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-
|
|
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-
|
|
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() {
|