@agentv/core 4.34.1-next.1 → 4.35.0-next.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.
@@ -1569,7 +1569,29 @@ function validateProjects(errors, filePath, projects) {
1569
1569
  validateRequiredString(errors, filePath, projectRecord.id, `${location}.id`);
1570
1570
  validateRequiredString(errors, filePath, projectRecord.name, `${location}.name`);
1571
1571
  validateRequiredString(errors, filePath, projectRecord.path, `${location}.path`);
1572
- validateResultsConfig(errors, filePath, projectRecord.results, `${location}.results`);
1572
+ if (projectRecord.source !== void 0) {
1573
+ errors.push({
1574
+ severity: "error",
1575
+ filePath,
1576
+ location: `${location}.source`,
1577
+ message: `Field '${location}.source' was removed. Move 'source.url' to '${location}.repo_url' and move 'source.ref' to '${location}.ref'. Use a Git remote URL such as https://github.com/example/repo.git or git@github.com:example/repo.git.`
1578
+ });
1579
+ }
1580
+ if (projectRecord.repository !== void 0) {
1581
+ errors.push({
1582
+ severity: "error",
1583
+ filePath,
1584
+ location: `${location}.repository`,
1585
+ message: `Field '${location}.repository' was removed. Use '${location}.repo_url' with a Git remote URL instead.`
1586
+ });
1587
+ }
1588
+ if (projectRecord.repo_url !== void 0) {
1589
+ validateGitRemoteUrl(errors, filePath, projectRecord.repo_url, `${location}.repo_url`);
1590
+ }
1591
+ if (projectRecord.ref !== void 0) {
1592
+ validateRequiredString(errors, filePath, projectRecord.ref, `${location}.ref`);
1593
+ }
1594
+ validateProjectResultsConfig(errors, filePath, projectRecord.results, `${location}.results`);
1573
1595
  });
1574
1596
  }
1575
1597
  function validateRequiredString(errors, filePath, value, location) {
@@ -1582,6 +1604,104 @@ function validateRequiredString(errors, filePath, value, location) {
1582
1604
  });
1583
1605
  }
1584
1606
  }
1607
+ function validateGitRemoteUrl(errors, filePath, value, location) {
1608
+ if (typeof value !== "string" || value.trim().length === 0) {
1609
+ errors.push({
1610
+ severity: "error",
1611
+ filePath,
1612
+ location,
1613
+ message: `Field '${location}' must be a non-empty Git remote URL (e.g., https://github.com/EntityProcess/agentv.git or git@github.com:EntityProcess/agentv.git)`
1614
+ });
1615
+ return;
1616
+ }
1617
+ const repoUrl = value.trim();
1618
+ if (!/^(https?:\/\/|ssh:\/\/|git@|file:\/\/).+/.test(repoUrl)) {
1619
+ errors.push({
1620
+ severity: "error",
1621
+ filePath,
1622
+ location,
1623
+ message: `Field '${location}' must be a Git remote URL, not an owner/name shorthand. Use https://github.com/owner/repo.git or git@github.com:owner/repo.git.`
1624
+ });
1625
+ }
1626
+ }
1627
+ function validateProjectResultsConfig(errors, filePath, rawResults, location) {
1628
+ if (rawResults === void 0) {
1629
+ return;
1630
+ }
1631
+ if (typeof rawResults !== "object" || rawResults === null || Array.isArray(rawResults)) {
1632
+ errors.push({
1633
+ severity: "error",
1634
+ filePath,
1635
+ location,
1636
+ message: `Field '${location}' must be an object`
1637
+ });
1638
+ return;
1639
+ }
1640
+ const resultsRecord = rawResults;
1641
+ const removedFields = {
1642
+ mode: `Remove '${location}.mode'; project results use '${location}.repo_url' as the Git remote URL.`,
1643
+ repo: `Field '${location}.repo' was removed. Use '${location}.repo_url' with a Git remote URL instead.`,
1644
+ repository: `Field '${location}.repository' was removed. Use '${location}.repo_url' with a Git remote URL instead.`,
1645
+ local_path: `Field '${location}.local_path' was removed. Use '${location}.path' for the local clone path instead.`,
1646
+ auto_push: `Field '${location}.auto_push' was removed. Use '${location}.sync.auto_push' instead.`
1647
+ };
1648
+ for (const [field, message] of Object.entries(removedFields)) {
1649
+ if (resultsRecord[field] !== void 0) {
1650
+ errors.push({
1651
+ severity: "error",
1652
+ filePath,
1653
+ location: `${location}.${field}`,
1654
+ message
1655
+ });
1656
+ }
1657
+ }
1658
+ validateGitRemoteUrl(errors, filePath, resultsRecord.repo_url, `${location}.repo_url`);
1659
+ if (resultsRecord.path !== void 0) {
1660
+ if (typeof resultsRecord.path !== "string" || resultsRecord.path.trim().length === 0) {
1661
+ errors.push({
1662
+ severity: "error",
1663
+ filePath,
1664
+ location: `${location}.path`,
1665
+ message: `Field '${location}.path' must be a non-empty string`
1666
+ });
1667
+ } else if (!isFilesystemPath(resultsRecord.path.trim())) {
1668
+ errors.push({
1669
+ severity: "error",
1670
+ filePath,
1671
+ location: `${location}.path`,
1672
+ message: `'${location}.path' must be an absolute or home-relative filesystem path (e.g., ~/data/agentv-results).`
1673
+ });
1674
+ }
1675
+ }
1676
+ if (resultsRecord.sync !== void 0) {
1677
+ if (typeof resultsRecord.sync !== "object" || resultsRecord.sync === null || Array.isArray(resultsRecord.sync)) {
1678
+ errors.push({
1679
+ severity: "error",
1680
+ filePath,
1681
+ location: `${location}.sync`,
1682
+ message: `Field '${location}.sync' must be an object`
1683
+ });
1684
+ } else {
1685
+ const syncRecord = resultsRecord.sync;
1686
+ if (syncRecord.auto_push !== void 0 && typeof syncRecord.auto_push !== "boolean") {
1687
+ errors.push({
1688
+ severity: "error",
1689
+ filePath,
1690
+ location: `${location}.sync.auto_push`,
1691
+ message: `Field '${location}.sync.auto_push' must be a boolean`
1692
+ });
1693
+ }
1694
+ }
1695
+ }
1696
+ if (resultsRecord.branch_prefix !== void 0 && (typeof resultsRecord.branch_prefix !== "string" || resultsRecord.branch_prefix.trim().length === 0)) {
1697
+ errors.push({
1698
+ severity: "error",
1699
+ filePath,
1700
+ location: `${location}.branch_prefix`,
1701
+ message: `Field '${location}.branch_prefix' must be a non-empty string`
1702
+ });
1703
+ }
1704
+ }
1585
1705
  function validateResultsConfig(errors, filePath, rawResults, location) {
1586
1706
  if (rawResults === void 0) {
1587
1707
  return;