@rwendell/dossier 0.0.0-stage → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +323 -2
- package/agents/dossier-answerer.md +168 -0
- package/agents/dossier-proposer.md +215 -0
- package/agents/dossier-tailor.md +232 -0
- package/dist/answer/prompt.d.ts +17 -0
- package/dist/answer/prompt.js +44 -0
- package/dist/answer/prompt.js.map +1 -0
- package/dist/answer/run.d.ts +21 -0
- package/dist/answer/run.js +272 -0
- package/dist/answer/run.js.map +1 -0
- package/dist/career/import-resume.d.ts +17 -0
- package/dist/career/import-resume.js +194 -0
- package/dist/career/import-resume.js.map +1 -0
- package/dist/career/load.d.ts +10 -0
- package/dist/career/load.js +96 -0
- package/dist/career/load.js.map +1 -0
- package/dist/career/schema.d.ts +147 -0
- package/dist/career/schema.js +95 -0
- package/dist/career/schema.js.map +1 -0
- package/dist/clean/run.d.ts +1 -0
- package/dist/clean/run.js +8 -0
- package/dist/clean/run.js.map +1 -0
- package/dist/cli/commands/answer.d.ts +23 -0
- package/dist/cli/commands/answer.js +110 -0
- package/dist/cli/commands/answer.js.map +1 -0
- package/dist/cli/commands/clean.d.ts +2 -0
- package/dist/cli/commands/clean.js +11 -0
- package/dist/cli/commands/clean.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +2 -0
- package/dist/cli/commands/doctor.js +77 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/init.d.ts +7 -0
- package/dist/cli/commands/init.js +80 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/paths.d.ts +7 -0
- package/dist/cli/commands/paths.js +42 -0
- package/dist/cli/commands/paths.js.map +1 -0
- package/dist/cli/commands/proposal.d.ts +30 -0
- package/dist/cli/commands/proposal.js +148 -0
- package/dist/cli/commands/proposal.js.map +1 -0
- package/dist/cli/commands/pull-private.d.ts +8 -0
- package/dist/cli/commands/pull-private.js +30 -0
- package/dist/cli/commands/pull-private.js.map +1 -0
- package/dist/cli/commands/score.d.ts +11 -0
- package/dist/cli/commands/score.js +58 -0
- package/dist/cli/commands/score.js.map +1 -0
- package/dist/cli/commands/sync.d.ts +13 -0
- package/dist/cli/commands/sync.js +65 -0
- package/dist/cli/commands/sync.js.map +1 -0
- package/dist/cli/commands/tailor.d.ts +24 -0
- package/dist/cli/commands/tailor.js +113 -0
- package/dist/cli/commands/tailor.js.map +1 -0
- package/dist/cli/commands/verify.d.ts +6 -0
- package/dist/cli/commands/verify.js +15 -0
- package/dist/cli/commands/verify.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +87 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/config/config.d.ts +36 -0
- package/dist/config/config.js +71 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/paths.d.ts +32 -0
- package/dist/config/paths.js +121 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/evidence/numbers.d.ts +2 -0
- package/dist/evidence/numbers.js +26 -0
- package/dist/evidence/numbers.js.map +1 -0
- package/dist/evidence/verify.d.ts +109 -0
- package/dist/evidence/verify.js +445 -0
- package/dist/evidence/verify.js.map +1 -0
- package/dist/job/input.d.ts +9 -0
- package/dist/job/input.js +141 -0
- package/dist/job/input.js.map +1 -0
- package/dist/job/page.d.ts +14 -0
- package/dist/job/page.js +426 -0
- package/dist/job/page.js.map +1 -0
- package/dist/job/types.d.ts +30 -0
- package/dist/job/types.js +2 -0
- package/dist/job/types.js.map +1 -0
- package/dist/llm/agents.d.ts +7 -0
- package/dist/llm/agents.js +44 -0
- package/dist/llm/agents.js.map +1 -0
- package/dist/llm/opencode.d.ts +19 -0
- package/dist/llm/opencode.js +117 -0
- package/dist/llm/opencode.js.map +1 -0
- package/dist/llm/providers.d.ts +63 -0
- package/dist/llm/providers.js +207 -0
- package/dist/llm/providers.js.map +1 -0
- package/dist/private/pull.d.ts +7 -0
- package/dist/private/pull.js +168 -0
- package/dist/private/pull.js.map +1 -0
- package/dist/projects/rank.d.ts +17 -0
- package/dist/projects/rank.js +100 -0
- package/dist/projects/rank.js.map +1 -0
- package/dist/projects/store.d.ts +7 -0
- package/dist/projects/store.js +31 -0
- package/dist/projects/store.js.map +1 -0
- package/dist/projects/sync-github.d.ts +11 -0
- package/dist/projects/sync-github.js +269 -0
- package/dist/projects/sync-github.js.map +1 -0
- package/dist/projects/sync-local.d.ts +8 -0
- package/dist/projects/sync-local.js +318 -0
- package/dist/projects/sync-local.js.map +1 -0
- package/dist/projects/types.d.ts +71 -0
- package/dist/projects/types.js +2 -0
- package/dist/projects/types.js.map +1 -0
- package/dist/proposal/prompt.d.ts +20 -0
- package/dist/proposal/prompt.js +64 -0
- package/dist/proposal/prompt.js.map +1 -0
- package/dist/proposal/run.d.ts +28 -0
- package/dist/proposal/run.js +386 -0
- package/dist/proposal/run.js.map +1 -0
- package/dist/resume/basics.d.ts +4 -0
- package/dist/resume/basics.js +33 -0
- package/dist/resume/basics.js.map +1 -0
- package/dist/resume/find.d.ts +12 -0
- package/dist/resume/find.js +27 -0
- package/dist/resume/find.js.map +1 -0
- package/dist/resume/format.d.ts +3 -0
- package/dist/resume/format.js +53 -0
- package/dist/resume/format.js.map +1 -0
- package/dist/resume/one-page.d.ts +149 -0
- package/dist/resume/one-page.js +164 -0
- package/dist/resume/one-page.js.map +1 -0
- package/dist/resume/prompt.d.ts +10 -0
- package/dist/resume/prompt.js +23 -0
- package/dist/resume/prompt.js.map +1 -0
- package/dist/resume/render.d.ts +8 -0
- package/dist/resume/render.js +84 -0
- package/dist/resume/render.js.map +1 -0
- package/dist/resume/run.d.ts +21 -0
- package/dist/resume/run.js +350 -0
- package/dist/resume/run.js.map +1 -0
- package/dist/resume/skills.d.ts +6 -0
- package/dist/resume/skills.js +47 -0
- package/dist/resume/skills.js.map +1 -0
- package/dist/resume/trace.d.ts +13 -0
- package/dist/resume/trace.js +82 -0
- package/dist/resume/trace.js.map +1 -0
- package/dist/resume/types.d.ts +94 -0
- package/dist/resume/types.js +2 -0
- package/dist/resume/types.js.map +1 -0
- package/dist/resume/verify.d.ts +19 -0
- package/dist/resume/verify.js +193 -0
- package/dist/resume/verify.js.map +1 -0
- package/dist/upwork/profile.d.ts +50 -0
- package/dist/upwork/profile.js +302 -0
- package/dist/upwork/profile.js.map +1 -0
- package/dist/upwork/settings.d.ts +96 -0
- package/dist/upwork/settings.js +166 -0
- package/dist/upwork/settings.js.map +1 -0
- package/dist/util/open-file.d.ts +1 -0
- package/dist/util/open-file.js +24 -0
- package/dist/util/open-file.js.map +1 -0
- package/dist/util/slug.d.ts +2 -0
- package/dist/util/slug.js +13 -0
- package/dist/util/slug.js.map +1 -0
- package/dist/verify/run.d.ts +4 -0
- package/dist/verify/run.js +91 -0
- package/dist/verify/run.js.map +1 -0
- package/package.json +67 -4
- package/templates/career.example.yml +63 -0
- package/templates/career.private.example.yml +10 -0
- package/templates/config.example.yml +16 -0
- package/templates/freelance.example.yml +48 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import yargs from 'yargs';
|
|
4
|
+
import { hideBin } from 'yargs/helpers';
|
|
5
|
+
import { setCliCacheSelection } from '../config/paths.js';
|
|
6
|
+
import { doctorCommand } from './commands/doctor.js';
|
|
7
|
+
import { initCommand } from './commands/init.js';
|
|
8
|
+
import { pathsCommand } from './commands/paths.js';
|
|
9
|
+
import { proposalCommand } from './commands/proposal.js';
|
|
10
|
+
import { answerCommand } from './commands/answer.js';
|
|
11
|
+
import { tailorCommand } from './commands/tailor.js';
|
|
12
|
+
import { verifyCommand } from './commands/verify.js';
|
|
13
|
+
import { cleanCommand } from './commands/clean.js';
|
|
14
|
+
import { syncCommand } from './commands/sync.js';
|
|
15
|
+
import { scoreCommand } from './commands/score.js';
|
|
16
|
+
import { pullPrivateCommand } from './commands/pull-private.js';
|
|
17
|
+
const packageJson = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8'));
|
|
18
|
+
const cli = yargs(hideBin(process.argv))
|
|
19
|
+
.scriptName('dossier')
|
|
20
|
+
.usage('$0 <command> [options]')
|
|
21
|
+
.parserConfiguration({
|
|
22
|
+
'boolean-negation': false,
|
|
23
|
+
})
|
|
24
|
+
.option('cache-mode', {
|
|
25
|
+
type: 'string',
|
|
26
|
+
choices: ['auto', 'dev', 'release'],
|
|
27
|
+
describe: 'Cache location mode',
|
|
28
|
+
})
|
|
29
|
+
.option('cache-dir', {
|
|
30
|
+
type: 'string',
|
|
31
|
+
describe: 'Explicit cache directory (overrides cache mode)',
|
|
32
|
+
})
|
|
33
|
+
.option('dev', {
|
|
34
|
+
type: 'boolean',
|
|
35
|
+
describe: 'Use the project-local .cache (same as --cache-mode dev)',
|
|
36
|
+
default: false,
|
|
37
|
+
})
|
|
38
|
+
.option('release', {
|
|
39
|
+
type: 'boolean',
|
|
40
|
+
describe: 'Use the XDG cache (same as --cache-mode release)',
|
|
41
|
+
default: false,
|
|
42
|
+
})
|
|
43
|
+
.middleware((argv) => {
|
|
44
|
+
const values = argv;
|
|
45
|
+
if (values.dev && values.release) {
|
|
46
|
+
throw new Error('Use only one of --dev or --release.');
|
|
47
|
+
}
|
|
48
|
+
const mode = values.dev
|
|
49
|
+
? 'dev'
|
|
50
|
+
: values.release
|
|
51
|
+
? 'release'
|
|
52
|
+
: values.cacheMode;
|
|
53
|
+
setCliCacheSelection({
|
|
54
|
+
mode,
|
|
55
|
+
dir: values.cacheDir,
|
|
56
|
+
});
|
|
57
|
+
})
|
|
58
|
+
.command(initCommand)
|
|
59
|
+
.command(doctorCommand)
|
|
60
|
+
.command(pathsCommand)
|
|
61
|
+
.command(proposalCommand)
|
|
62
|
+
.command(answerCommand)
|
|
63
|
+
.command(tailorCommand)
|
|
64
|
+
.command(verifyCommand)
|
|
65
|
+
.command(cleanCommand)
|
|
66
|
+
.command(syncCommand)
|
|
67
|
+
.command(scoreCommand)
|
|
68
|
+
.command(pullPrivateCommand)
|
|
69
|
+
.demandCommand(1, 'Choose a command.')
|
|
70
|
+
.strict()
|
|
71
|
+
.help()
|
|
72
|
+
.alias('h', 'help')
|
|
73
|
+
.version(packageJson.version ?? '0.0.0')
|
|
74
|
+
.fail((message, error) => {
|
|
75
|
+
if (error)
|
|
76
|
+
throw error;
|
|
77
|
+
console.error(`dossier: ${message}`);
|
|
78
|
+
process.exit(1);
|
|
79
|
+
});
|
|
80
|
+
try {
|
|
81
|
+
await cli.parseAsync();
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
console.error(`dossier: ${error.message}`);
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAkB,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBA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|
+
go: "go";
|
|
5
|
+
opencode: "opencode";
|
|
6
|
+
openrouter: "openrouter";
|
|
7
|
+
}>;
|
|
8
|
+
export declare const ConfigSchema: z.ZodObject<{
|
|
9
|
+
output: z.ZodDefault<z.ZodObject<{
|
|
10
|
+
dir: z.ZodDefault<z.ZodString>;
|
|
11
|
+
open: z.ZodDefault<z.ZodBoolean>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
14
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
15
|
+
auto: "auto";
|
|
16
|
+
dev: "dev";
|
|
17
|
+
release: "release";
|
|
18
|
+
}>>;
|
|
19
|
+
dir: z.ZodDefault<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
theme: z.ZodDefault<z.ZodString>;
|
|
22
|
+
provider: z.ZodDefault<z.ZodEnum<{
|
|
23
|
+
auto: "auto";
|
|
24
|
+
go: "go";
|
|
25
|
+
opencode: "opencode";
|
|
26
|
+
openrouter: "openrouter";
|
|
27
|
+
}>>;
|
|
28
|
+
editor: z.ZodDefault<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export type Config = z.infer<typeof ConfigSchema>;
|
|
31
|
+
export interface LoadedConfig {
|
|
32
|
+
config: Config;
|
|
33
|
+
path: string | null;
|
|
34
|
+
}
|
|
35
|
+
export declare function loadConfig(): LoadedConfig;
|
|
36
|
+
export declare function formatConfig(config: Config): string;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { parse as parseYaml } from 'yaml';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { configFile, setConfigCacheSelection } from './paths.js';
|
|
5
|
+
export const ProviderSchema = z.enum([
|
|
6
|
+
'auto',
|
|
7
|
+
'opencode',
|
|
8
|
+
'go',
|
|
9
|
+
'openrouter',
|
|
10
|
+
]);
|
|
11
|
+
export const ConfigSchema = z
|
|
12
|
+
.object({
|
|
13
|
+
output: z
|
|
14
|
+
.object({
|
|
15
|
+
dir: z.string().default(''),
|
|
16
|
+
open: z.boolean().default(true),
|
|
17
|
+
})
|
|
18
|
+
.default({ dir: '', open: true }),
|
|
19
|
+
cache: z
|
|
20
|
+
.object({
|
|
21
|
+
mode: z.enum(['auto', 'dev', 'release']).default('auto'),
|
|
22
|
+
dir: z.string().default(''),
|
|
23
|
+
})
|
|
24
|
+
.default({ mode: 'auto', dir: '' }),
|
|
25
|
+
theme: z.string().default('jsonresume-theme-straightforward'),
|
|
26
|
+
provider: ProviderSchema.default('auto'),
|
|
27
|
+
editor: z.string().default(''),
|
|
28
|
+
});
|
|
29
|
+
export function loadConfig() {
|
|
30
|
+
if (!existsSync(configFile)) {
|
|
31
|
+
const config = withEnv(ConfigSchema.parse({}));
|
|
32
|
+
setConfigCacheSelection(config.cache);
|
|
33
|
+
return { config, path: null };
|
|
34
|
+
}
|
|
35
|
+
const raw = parseYaml(readFileSync(configFile, 'utf8')) ?? {};
|
|
36
|
+
const config = withEnv(ConfigSchema.parse(raw));
|
|
37
|
+
setConfigCacheSelection(config.cache);
|
|
38
|
+
return { config, path: configFile };
|
|
39
|
+
}
|
|
40
|
+
function withEnv(config) {
|
|
41
|
+
return {
|
|
42
|
+
...config,
|
|
43
|
+
provider: process.env.DOSSIER_PROVIDER
|
|
44
|
+
? ProviderSchema.parse(process.env.DOSSIER_PROVIDER)
|
|
45
|
+
: config.provider,
|
|
46
|
+
output: {
|
|
47
|
+
...config.output,
|
|
48
|
+
dir: process.env.DOSSIER_OUTPUT_DIR ?? config.output.dir,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export function formatConfig(config) {
|
|
53
|
+
return `# dossier machine configuration
|
|
54
|
+
output:
|
|
55
|
+
# Empty means the current working directory.
|
|
56
|
+
dir: ""
|
|
57
|
+
# Open the generated PDF when tailoring finishes.
|
|
58
|
+
open: ${config.output.open}
|
|
59
|
+
|
|
60
|
+
cache:
|
|
61
|
+
# auto | dev | release
|
|
62
|
+
mode: "${config.cache.mode}"
|
|
63
|
+
# Optional explicit cache directory; overrides mode.
|
|
64
|
+
dir: "${config.cache.dir}"
|
|
65
|
+
|
|
66
|
+
theme: "${config.theme}"
|
|
67
|
+
provider: "${config.provider}"
|
|
68
|
+
editor: ""
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC;IACnC,MAAM;IACN,UAAU;IACV,IAAI;IACJ,YAAY;CACb,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC;KAC1B,MAAM,CAAC;IACN,MAAM,EAAE,CAAC;SACN,MAAM,CAAC;QACN,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;KAChC,CAAC;SACD,OAAO,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACnC,KAAK,EAAE,CAAC;SACL,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,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AAG,MAAM,CAAC,MAAM;YAChB,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG;SACzD;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,OAAO;;;;;UAKC,MAAM,CAAC,MAAM,CAAC,IAAI;;;;WAIjB,MAAM,CAAC,KAAK,CAAC,IAAI;;UAElB,MAAM,CAAC,KAAK,CAAC,GAAG;;UAEhB,MAAM,CAAC,KAAK;aACT,MAAM,CAAC,QAAQ;;CAE3B,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const packageRoot: string;
|
|
2
|
+
export type CacheMode = 'auto' | 'dev' | 'release';
|
|
3
|
+
interface CacheSelection {
|
|
4
|
+
mode?: CacheMode;
|
|
5
|
+
dir?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function setCliCacheSelection(selection: CacheSelection): void;
|
|
8
|
+
export declare function setConfigCacheSelection(selection: CacheSelection): void;
|
|
9
|
+
export declare function getCacheMode(): 'dev' | 'release';
|
|
10
|
+
export declare function getCacheSource(): 'cli' | 'config' | 'env' | 'auto';
|
|
11
|
+
export declare function getCacheDir(): string;
|
|
12
|
+
export declare const dataDir: string;
|
|
13
|
+
export declare const configDir: string;
|
|
14
|
+
export declare const stateDir: string;
|
|
15
|
+
export declare const careerFile: string;
|
|
16
|
+
export declare const privateCareerFile: string;
|
|
17
|
+
export declare const freelanceFile: string;
|
|
18
|
+
export declare const legacyProposalFile: string;
|
|
19
|
+
export declare const legacyUpworkFile: string;
|
|
20
|
+
export declare const configFile: string;
|
|
21
|
+
export declare function getRuntimeDir(): string;
|
|
22
|
+
export declare function getAgentsDir(): string;
|
|
23
|
+
export declare function getProfileCacheDir(): string;
|
|
24
|
+
export declare function getGithubCacheFile(): string;
|
|
25
|
+
export declare function getLocalProjectsCacheFile(): string;
|
|
26
|
+
export declare function ensureBaseDirs(): void;
|
|
27
|
+
export declare function ensureRuntimeDir(): void;
|
|
28
|
+
export declare function cacheFile(...parts: string[]): string;
|
|
29
|
+
export declare function expandHome(value: string): string;
|
|
30
|
+
export declare function resolveOutputDir(configured: string | undefined, flag: string | undefined, cwd?: string): string;
|
|
31
|
+
export declare function displayPath(path: string, cwd?: string): string;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { existsSync, mkdirSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { isAbsolute, join, resolve } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import envPaths from 'env-paths';
|
|
6
|
+
const defaults = envPaths('dossier', { suffix: '' });
|
|
7
|
+
export const packageRoot = fileURLToPath(new URL('../../', import.meta.url));
|
|
8
|
+
const isSourceCheckout = existsSync(join(packageRoot, '.git')) ||
|
|
9
|
+
existsSync(join(packageRoot, 'src', 'cli', 'index.ts'));
|
|
10
|
+
let cliSelection = {};
|
|
11
|
+
let configSelection = {};
|
|
12
|
+
export function setCliCacheSelection(selection) {
|
|
13
|
+
cliSelection = { ...selection };
|
|
14
|
+
}
|
|
15
|
+
export function setConfigCacheSelection(selection) {
|
|
16
|
+
configSelection = { ...selection };
|
|
17
|
+
}
|
|
18
|
+
export function getCacheMode() {
|
|
19
|
+
const configured = cliSelection.mode ?? configSelection.mode;
|
|
20
|
+
if (configured === 'dev' || configured === 'release')
|
|
21
|
+
return configured;
|
|
22
|
+
const envMode = String(process.env.DOSSIER_CACHE_MODE ?? '')
|
|
23
|
+
.trim()
|
|
24
|
+
.toLowerCase();
|
|
25
|
+
if (envMode === 'dev' || envMode === 'release')
|
|
26
|
+
return envMode;
|
|
27
|
+
if (process.env.DOSSIER_DEV === '1')
|
|
28
|
+
return 'dev';
|
|
29
|
+
if (process.env.DOSSIER_DEV === '0')
|
|
30
|
+
return 'release';
|
|
31
|
+
return isSourceCheckout ? 'dev' : 'release';
|
|
32
|
+
}
|
|
33
|
+
export function getCacheSource() {
|
|
34
|
+
if (cliSelection.dir || (cliSelection.mode && cliSelection.mode !== 'auto')) {
|
|
35
|
+
return 'cli';
|
|
36
|
+
}
|
|
37
|
+
if (configSelection.dir ||
|
|
38
|
+
(configSelection.mode && configSelection.mode !== 'auto')) {
|
|
39
|
+
return 'config';
|
|
40
|
+
}
|
|
41
|
+
if (process.env.DOSSIER_CACHE_HOME ||
|
|
42
|
+
process.env.DOSSIER_CACHE_MODE ||
|
|
43
|
+
process.env.DOSSIER_DEV) {
|
|
44
|
+
return 'env';
|
|
45
|
+
}
|
|
46
|
+
return 'auto';
|
|
47
|
+
}
|
|
48
|
+
export function getCacheDir() {
|
|
49
|
+
const explicit = cliSelection.dir ||
|
|
50
|
+
configSelection.dir ||
|
|
51
|
+
process.env.DOSSIER_CACHE_HOME;
|
|
52
|
+
if (explicit)
|
|
53
|
+
return resolve(expandHome(explicit));
|
|
54
|
+
return getCacheMode() === 'dev'
|
|
55
|
+
? join(packageRoot, '.cache')
|
|
56
|
+
: defaults.cache;
|
|
57
|
+
}
|
|
58
|
+
export const dataDir = process.env.DOSSIER_DATA_HOME
|
|
59
|
+
? resolve(process.env.DOSSIER_DATA_HOME)
|
|
60
|
+
: defaults.data;
|
|
61
|
+
export const configDir = process.env.DOSSIER_CONFIG_HOME
|
|
62
|
+
? resolve(process.env.DOSSIER_CONFIG_HOME)
|
|
63
|
+
: defaults.config;
|
|
64
|
+
export const stateDir = process.env.DOSSIER_STATE_HOME
|
|
65
|
+
? resolve(process.env.DOSSIER_STATE_HOME)
|
|
66
|
+
: defaults.log;
|
|
67
|
+
export const careerFile = join(dataDir, 'career.yml');
|
|
68
|
+
export const privateCareerFile = join(dataDir, 'career.private.yml');
|
|
69
|
+
export const freelanceFile = join(dataDir, 'freelance.yml');
|
|
70
|
+
export const legacyProposalFile = join(dataDir, 'proposal.yml');
|
|
71
|
+
export const legacyUpworkFile = join(dataDir, 'upwork.yml');
|
|
72
|
+
export const configFile = join(configDir, 'config.yml');
|
|
73
|
+
export function getRuntimeDir() {
|
|
74
|
+
return join(getCacheDir(), 'opencode');
|
|
75
|
+
}
|
|
76
|
+
export function getAgentsDir() {
|
|
77
|
+
return join(getRuntimeDir(), '.opencode', 'agents');
|
|
78
|
+
}
|
|
79
|
+
export function getProfileCacheDir() {
|
|
80
|
+
return join(getCacheDir(), 'freelance');
|
|
81
|
+
}
|
|
82
|
+
export function getGithubCacheFile() {
|
|
83
|
+
return join(getCacheDir(), 'github.json');
|
|
84
|
+
}
|
|
85
|
+
export function getLocalProjectsCacheFile() {
|
|
86
|
+
return join(getCacheDir(), 'local-projects.json');
|
|
87
|
+
}
|
|
88
|
+
export function ensureBaseDirs() {
|
|
89
|
+
for (const dir of [dataDir, configDir, getCacheDir(), stateDir]) {
|
|
90
|
+
mkdirSync(dir, { recursive: true });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export function ensureRuntimeDir() {
|
|
94
|
+
mkdirSync(getAgentsDir(), { recursive: true });
|
|
95
|
+
}
|
|
96
|
+
export function cacheFile(...parts) {
|
|
97
|
+
return join(getCacheDir(), ...parts);
|
|
98
|
+
}
|
|
99
|
+
export function expandHome(value) {
|
|
100
|
+
const text = String(value ?? '').trim();
|
|
101
|
+
if (text === '~')
|
|
102
|
+
return homedir();
|
|
103
|
+
if (text.startsWith('~/'))
|
|
104
|
+
return join(homedir(), text.slice(2));
|
|
105
|
+
return text;
|
|
106
|
+
}
|
|
107
|
+
export function resolveOutputDir(configured, flag, cwd = process.cwd()) {
|
|
108
|
+
const value = flag ?? configured ?? '';
|
|
109
|
+
if (!value.trim())
|
|
110
|
+
return cwd;
|
|
111
|
+
const expanded = expandHome(value);
|
|
112
|
+
return isAbsolute(expanded) ? expanded : resolve(cwd, expanded);
|
|
113
|
+
}
|
|
114
|
+
export function displayPath(path, cwd = process.cwd()) {
|
|
115
|
+
if (path === cwd)
|
|
116
|
+
return '.';
|
|
117
|
+
if (path.startsWith(`${cwd}/`))
|
|
118
|
+
return `.${path.slice(cwd.length)}`;
|
|
119
|
+
return path;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/config/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,MAAM,QAAQ,GAAG,QAAQ,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;AAErD,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,QAAQ,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE7E,MAAM,gBAAgB,GACpB,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACrC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;AAS1D,IAAI,YAAY,GAAmB,EAAE,CAAC;AACtC,IAAI,eAAe,GAAmB,EAAE,CAAC;AAEzC,MAAM,UAAU,oBAAoB,CAAC,SAAyB;IAC5D,YAAY,GAAG,EAAE,GAAG,SAAS,EAAE,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,SAAyB;IAC/D,eAAe,GAAG,EAAE,GAAG,SAAS,EAAE,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,MAAM,UAAU,GAAG,YAAY,CAAC,IAAI,IAAI,eAAe,CAAC,IAAI,CAAC;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AAC,CAAC,CAAC,CAAC,CAAC;IACjE,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,UAA8B,EAC9B,IAAwB,EACxB,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;IAEnB,MAAM,KAAK,GAAG,IAAI,IAAI,UAAU,IAAI,EAAE,CAAC;IACvC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;QAAE,OAAO,GAAG,CAAC;IAC9B,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACnC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;IAC3D,IAAI,IAAI,KAAK,GAAG;QAAE,OAAO,GAAG,CAAC;IAC7B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC;QAAE,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;IACpE,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const MULTIPLIERS = {
|
|
2
|
+
m: 'm',
|
|
3
|
+
million: 'm',
|
|
4
|
+
k: 'k',
|
|
5
|
+
thousand: 'k',
|
|
6
|
+
b: 'b',
|
|
7
|
+
billion: 'b',
|
|
8
|
+
'%': '%',
|
|
9
|
+
x: 'x',
|
|
10
|
+
};
|
|
11
|
+
export function extractNumbers(text) {
|
|
12
|
+
const matches = String(text ?? '').match(/(?<![A-Za-z0-9.])\d+(?:,\d{3})*(?:\.\d+)?(?:\s*(?:M|k|K|million|billion|thousand|%|[xX]))?(?![A-Za-z0-9])/g) ?? [];
|
|
13
|
+
return matches.map((raw) => {
|
|
14
|
+
const value = raw.replace(/,/g, '').replace(/\s+/g, '').toLowerCase();
|
|
15
|
+
const match = value.match(/^(.*?)(million|billion|thousand|m|k|b|%|x)$/);
|
|
16
|
+
if (!match)
|
|
17
|
+
return value;
|
|
18
|
+
return `${match[1]}${MULTIPLIERS[match[2]]}`;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export function stripTimes(value) {
|
|
22
|
+
return String(value ?? '')
|
|
23
|
+
.replace(/\b\d{1,2}:\d{2}(?:\s*(?:am|pm))?\b/gi, ' ')
|
|
24
|
+
.replace(/\b\d{1,2}\s*(?:am|pm)\b/gi, ' ');
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=numbers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numbers.js","sourceRoot":"","sources":["../../src/evidence/numbers.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAA2B;IAC1C,CAAC,EAAE,GAAG;IACN,OAAO,EAAE,GAAG;IACZ,CAAC,EAAE,GAAG;IACN,QAAQ,EAAE,GAAG;IACb,CAAC,EAAE,GAAG;IACN,OAAO,EAAE,GAAG;IACZ,GAAG,EAAE,GAAG;IACR,CAAC,EAAE,GAAG;CACP,CAAC;AAEF,MAAM,UAAU,cAAc,CAAC,IAAa;IAC1C,MAAM,OAAO,GACX,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,KAAK,CACtB,4GAA4G,CAC7G,IAAI,EAAE,CAAC;IAEV,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACzB,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QACtE,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CACvB,6CAA6C,CAC9C,CAAC;QACF,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QACzB,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;SACvB,OAAO,CAAC,sCAAsC,EAAE,GAAG,CAAC;SACpD,OAAO,CAAC,2BAA2B,EAAE,GAAG,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { Career } from '../career/schema.js';
|
|
2
|
+
import type { Job } from '../job/types.js';
|
|
3
|
+
import { type UpworkProfile } from '../upwork/profile.js';
|
|
4
|
+
export interface Claim {
|
|
5
|
+
claim: string;
|
|
6
|
+
evidence?: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface Sample {
|
|
9
|
+
evidence: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
why?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ScreeningAnswer {
|
|
14
|
+
question?: string;
|
|
15
|
+
answer: string;
|
|
16
|
+
}
|
|
17
|
+
export interface RateValue {
|
|
18
|
+
type: 'hourly' | 'fixed';
|
|
19
|
+
amount: number;
|
|
20
|
+
currency?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface Fit {
|
|
23
|
+
verdict: 'strong' | 'stretch' | 'weak';
|
|
24
|
+
reasons?: string[];
|
|
25
|
+
concerns?: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface ProposalOutput {
|
|
28
|
+
hook?: string;
|
|
29
|
+
proposal: string;
|
|
30
|
+
screening_answers?: ScreeningAnswer[];
|
|
31
|
+
rate?: RateValue | null;
|
|
32
|
+
timeline?: string | null;
|
|
33
|
+
availability?: string | null;
|
|
34
|
+
samples?: Sample[];
|
|
35
|
+
claims?: Claim[];
|
|
36
|
+
evidence?: string[];
|
|
37
|
+
gaps?: string[];
|
|
38
|
+
fit?: Fit | null;
|
|
39
|
+
}
|
|
40
|
+
export interface Candidate {
|
|
41
|
+
name?: string;
|
|
42
|
+
displayName?: string;
|
|
43
|
+
source?: string;
|
|
44
|
+
evidence?: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
readme?: string;
|
|
47
|
+
localCommits?: string[];
|
|
48
|
+
fullName?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface VerifySettings {
|
|
51
|
+
rate?: RateValue | null;
|
|
52
|
+
availability?: string;
|
|
53
|
+
bannedPhrases?: string[];
|
|
54
|
+
minWords?: number;
|
|
55
|
+
maxWords?: number;
|
|
56
|
+
maxChars?: number;
|
|
57
|
+
}
|
|
58
|
+
export interface VerifyResult {
|
|
59
|
+
errors: string[];
|
|
60
|
+
warnings: string[];
|
|
61
|
+
claimCount: number;
|
|
62
|
+
evidenceCount: number;
|
|
63
|
+
gapCount: number;
|
|
64
|
+
wordCount: number;
|
|
65
|
+
charCount: number;
|
|
66
|
+
}
|
|
67
|
+
export interface VerifyProposalInput {
|
|
68
|
+
output: ProposalOutput;
|
|
69
|
+
career: Career;
|
|
70
|
+
candidates?: Candidate[];
|
|
71
|
+
hint?: string;
|
|
72
|
+
client?: string;
|
|
73
|
+
settings: VerifySettings;
|
|
74
|
+
job: Job;
|
|
75
|
+
questions?: string[];
|
|
76
|
+
requiredOpening?: string;
|
|
77
|
+
timeline?: string;
|
|
78
|
+
profile?: UpworkProfile | null;
|
|
79
|
+
}
|
|
80
|
+
export type QuestionType = 'application' | 'behavioral' | 'motivation' | 'interview-prep' | 'other';
|
|
81
|
+
export interface AnswerOutput {
|
|
82
|
+
question?: string;
|
|
83
|
+
question_type?: string;
|
|
84
|
+
answer: string;
|
|
85
|
+
claims?: Claim[];
|
|
86
|
+
evidence?: string[];
|
|
87
|
+
gaps?: string[];
|
|
88
|
+
follow_up?: string[];
|
|
89
|
+
}
|
|
90
|
+
export interface VerifyAnswerInput {
|
|
91
|
+
output: AnswerOutput;
|
|
92
|
+
career: Career;
|
|
93
|
+
candidates?: Candidate[];
|
|
94
|
+
hint?: string;
|
|
95
|
+
client?: string;
|
|
96
|
+
profile?: UpworkProfile | null;
|
|
97
|
+
}
|
|
98
|
+
export interface VerifyAnswerResult {
|
|
99
|
+
errors: string[];
|
|
100
|
+
warnings: string[];
|
|
101
|
+
claimCount: number;
|
|
102
|
+
evidenceCount: number;
|
|
103
|
+
gapCount: number;
|
|
104
|
+
}
|
|
105
|
+
export declare function verifyAnswer({ output, career, candidates, hint, client, profile, }: VerifyAnswerInput): VerifyAnswerResult;
|
|
106
|
+
export declare function verifyProposal({ output, career, candidates, hint, client, settings, job, questions, requiredOpening, timeline, profile, }: VerifyProposalInput): VerifyResult;
|
|
107
|
+
export declare function buildEvidenceMap(career: Career, candidates?: Candidate[], hint?: string, extraEvidence?: Record<string, string>): Map<string, string>;
|
|
108
|
+
export declare function buildAllowedYears(career: Career): Set<string>;
|
|
109
|
+
export declare function checkNumbers(output: string, sourceText: string, path: string, errors: string[], allowedYears: Set<string>): void;
|