@proagentstore/cli 0.1.17 → 0.1.18

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.
@@ -40,6 +40,7 @@ export class LocalRunner {
40
40
  }
41
41
  createTask(request) {
42
42
  const normalized = normalizeCreateTaskRequest(request);
43
+ validateTaskInput(normalized.type, normalized.input);
43
44
  const now = new Date().toISOString();
44
45
  const requiresApproval = normalized.requiresApproval || APPROVAL_REQUIRED_TASKS.has(normalized.type);
45
46
  const task = {
@@ -354,11 +355,11 @@ export class LocalRunner {
354
355
  export function normalizeJobApplicationInput(input) {
355
356
  const url = stringValue(input.url);
356
357
  if (!url || !/^https?:\/\//.test(url)) {
357
- throw new RunnerInputError("job.apply_basic requires an http(s) url");
358
+ throw new RunnerInputError("job application requires an http(s) url");
358
359
  }
359
360
  const resumePath = resolve(stringValue(input.resumePath));
360
361
  if (!resumePath || !existsSync(resumePath)) {
361
- throw new RunnerInputError("job.apply_basic requires an existing resumePath");
362
+ throw new RunnerInputError("job application requires an existing local resumePath");
362
363
  }
363
364
  const candidate = isRecord(input.candidate) ? input.candidate : {};
364
365
  const fullName = stringValue(candidate.fullName);
@@ -522,6 +523,15 @@ function normalizeCreateTaskRequest(request) {
522
523
  : "",
523
524
  };
524
525
  }
526
+ function validateTaskInput(type, input) {
527
+ if (type === "job.apply_basic") {
528
+ normalizeJobApplicationInput(input);
529
+ return;
530
+ }
531
+ if (type === "job.apply_authenticated") {
532
+ normalizeAuthenticatedJobInput(input);
533
+ }
534
+ }
525
535
  export function fileUrl(path) {
526
536
  return pathToFileURL(path).toString();
527
537
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proagentstore/cli",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "CLI for creating, publishing, and running ProAgentStore agents",
5
5
  "license": "MIT",
6
6
  "type": "module",