job-pro 1.0.86 → 1.0.88

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/apply.js CHANGED
@@ -1164,13 +1164,17 @@ export async function executeCdpRealBrowser(staged, session, target) {
1164
1164
  if (target.kind === "dry-run") {
1165
1165
  return { ok: false, posted_to: "dry-run (no network)", message: "dry-run requested — no HTTP call fired", steps: [] };
1166
1166
  }
1167
- if (target.kind === "upstream" && !session) {
1167
+ // Non-anon adapters need session.json (the SPA's login cookies); anon
1168
+ // multipart adapters (Greenhouse/Lever boards) can fire the apply form
1169
+ // without a session — the DOM walker handles those too.
1170
+ const needsSession = staged.submit_kind !== "multipart-anon";
1171
+ if (target.kind === "upstream" && needsSession && !session) {
1168
1172
  return {
1169
1173
  ok: false,
1170
1174
  posted_to: staged.apply_url,
1171
- message: "executeCdpRealBrowser requires session.json (the SPA's login cookies need to be in " +
1172
- "the puppeteer browser before navigation). Capture via extension/, drop under " +
1173
- "~/.jobpro/<adapter>.session.json.",
1175
+ message: "executeCdpRealBrowser requires session.json for non-anon adapters " +
1176
+ "(the SPA's login cookies need to be in the puppeteer browser before " +
1177
+ "navigation). Run `job-pro extension` to capture one.",
1174
1178
  steps: [],
1175
1179
  };
1176
1180
  }
package/dist/index.js CHANGED
@@ -235,6 +235,9 @@ VERBS (same surface for every company)
235
235
  --debug-submit-to <url> verify wire format
236
236
  --debug-submit ↑ shorthand → httpbin.org/post
237
237
  --really-submit actually fire (env-gated)
238
+ --via-cdp drive a puppeteer browser through
239
+ the SPA's apply form (DOM-based,
240
+ bypasses API body-shape uncertainty)
238
241
  --allow-stale-session bypass 30-day session-age gate
239
242
  memory list | get <k> | set k=v | event <kind> [payload] | clear
240
243
 
@@ -484,6 +487,7 @@ async function runCompany(adapter, company, rawArgs) {
484
487
  }
485
488
  if (verb === "apply") {
486
489
  const reallySubmit = args.includes("--really-submit");
490
+ const viaCdp = args.includes("--via-cdp");
487
491
  const printForm = args.includes("--print-form");
488
492
  const schemaOnly = args.includes("--schema");
489
493
  const interactive = args.includes("--interactive");
@@ -793,14 +797,24 @@ async function runCompany(adapter, company, rawArgs) {
793
797
  }
794
798
  // Family executors: each takes (staged, session, target) and returns
795
799
  // a MultiStepResult. All gate on session.json existing.
796
- const familyExecutor = kind === "feishu-3-step" ? executeFeishu3Step :
797
- kind === "moka-aes" ? executeMokaApply :
798
- kind === "beisen-wecruit" ? executeBeisenWecruit :
799
- kind === "beisen-italent" ? executeBeisenITalent :
800
- kind === "cdp-real-browser" ? executeCdpRealBrowser :
801
- null;
800
+ // --via-cdp forces the puppeteer DOM-driven path for any adapter,
801
+ // bypassing the API endpoint and any body-shape uncertainty. The
802
+ // CDP executor walks the SPA's apply form like a human: click
803
+ // "投递", fill name/email/phone, upload resume, click submit.
804
+ // Slower + needs Chrome, but reliable when API is uncertain.
805
+ const familyExecutor = viaCdp ? executeCdpRealBrowser :
806
+ kind === "feishu-3-step" ? executeFeishu3Step :
807
+ kind === "moka-aes" ? executeMokaApply :
808
+ kind === "beisen-wecruit" ? executeBeisenWecruit :
809
+ kind === "beisen-italent" ? executeBeisenITalent :
810
+ kind === "cdp-real-browser" ? executeCdpRealBrowser :
811
+ null;
802
812
  if (familyExecutor) {
803
- if (!session) {
813
+ // --via-cdp on multipart-anon (xpeng/weride/hoyoverse) doesn't
814
+ // need a session — Greenhouse/Lever forms accept anon submits.
815
+ // The CDP executor's own check is relaxed for multipart-anon.
816
+ const sessionRequired = !(viaCdp && kind === "multipart-anon");
817
+ if (sessionRequired && !session) {
804
818
  return emit({
805
819
  ok: false,
806
820
  source: company,
@@ -865,9 +879,10 @@ async function runCompany(adapter, company, rawArgs) {
865
879
  post_id: postId,
866
880
  mode: "really-submit-blocked",
867
881
  staged,
868
- message: `no captured session at ~/.jobpro/${company}.session.json. Install the ` +
869
- `extension/ directory in Chrome, log into the careers site, click Export, ` +
870
- `then mv ~/Downloads/jobpro/${company}.session.json ~/.jobpro/`,
882
+ message: `no captured session at ~/.jobpro/${company}.session.json. Run ` +
883
+ `\`job-pro extension\` for the bundled MV3 path + Chrome install ` +
884
+ `walkthrough; log into the careers site, click Export, then ` +
885
+ `mv ~/Downloads/jobpro/${company}.session.json ~/.jobpro/`,
871
886
  }, compact);
872
887
  }
873
888
  if (!isAnonMultipart) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "job-pro",
3
- "version": "1.0.86",
3
+ "version": "1.0.88",
4
4
  "description": "Query Chinese big-tech campus recruiting + auto-apply from your terminal. 50 companies, all 50 live (46 via official APIs, 4 via Liepin third-party fallback). 45/50 with end-to-end verified apply endpoints; 5 structurally-external (Liepin IM × 4 + Unitree WeChat). No signup, no token, no server.",
5
5
  "homepage": "https://job.ha7ch.com",
6
6
  "repository": "https://github.com/HA7CH/job-pro",