@agimon-ai/po-git 0.0.0-alpha.197 → 0.0.0-alpha.199

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.
@@ -1,4 +1,4 @@
1
- import { A as NETWORK_TIMEOUT_MS, C as PoGitExpectedError, F as revision, I as runGit, L as GIT_ENGINE_CONTRACT, M as REBASE_TIMEOUT_MS, N as createWorktreeGit, P as remoteBranchHead, S as HubUnavailableError, _ as createWorktreeMessageInbox, a as credentialsFile, b as receiveWorktreeSetup, c as registryFile, f as StartWorktreeWorkflowSchema, g as GIT_WORKTREE_LIFECYCLE_EVENT, h as GIT_SESSION_CHANGED_EVENT, i as validRefName, j as READ_TIMEOUT_MS, l as createWorktreeRegistry, m as writeJsonAtomic, n as createGitOperationDependencies, p as readJson, r as createWorktreeOperations, s as poGitRoot, u as GIT_WORKFLOWS_CONTRACT, v as isSessionChangedEvent, w as invalidRequest, x as validSparseProfile, y as isWorktreeLifecycleEvent } from "../gitDependencies-DYe8D0VS.mjs";
1
+ import { A as NETWORK_TIMEOUT_MS, C as PoGitExpectedError, F as revision, I as runGit, L as GIT_ENGINE_CONTRACT, M as REBASE_TIMEOUT_MS, N as createWorktreeGit, P as remoteBranchHead, S as HubUnavailableError, _ as createWorktreeMessageInbox, a as credentialsFile, b as receiveWorktreeSetup, c as registryFile, f as StartWorktreeWorkflowSchema, g as GIT_WORKTREE_LIFECYCLE_EVENT, h as GIT_SESSION_CHANGED_EVENT, i as validRefName, j as READ_TIMEOUT_MS, l as createWorktreeRegistry, m as writeJsonAtomic, n as createGitOperationDependencies, p as readJson, r as createWorktreeOperations, s as poGitRoot, u as GIT_WORKFLOWS_CONTRACT, v as isSessionChangedEvent, w as invalidRequest, x as validSparseProfile, y as isWorktreeLifecycleEvent } from "../gitDependencies-Delu4xip.mjs";
2
2
  import { BACKGROUND_CONTEXT, PO_FS_SERVICE, PO_SHELL_SERVICE, requirePoFs, requirePoShell, withAbortSignal } from "@agimon-ai/po-core/platform";
3
3
  import { createGitEngineService, createPoFsAdapter } from "@agimon-ai/po-sparo";
4
4
  import { PO_SERVER_SCOPE_SERVICE, composeServerProviderOverrides, defineServerPlugin, packageResourcePath, readPackageResource, requirePoServerScope } from "@agimon-ai/po-core/serverPlugin";
@@ -890,12 +890,14 @@ function createWorktreeWorkflows(options) {
890
890
  }, signal);
891
891
  throw new WorktreeWorkflowError("not_started", "Workflow validation failed before checkout creation.", { cause: error });
892
892
  }
893
- if (report.errors.length || report.allocation && JSON.stringify(canonical(report.allocation)) !== JSON.stringify(canonical(input.overrides?.allocation))) {
893
+ const frozen = input.overrides?.allocation;
894
+ const refusal = report.errors.length ? `The workflow is not valid: ${report.errors.map((issue) => issue.message).join("; ")}` : report.allocation === void 0 ? void 0 : frozen === void 0 ? "This role-bound workflow needs an allocation prepared before the checkout, and none was supplied." : JSON.stringify(canonical(report.allocation)) !== JSON.stringify(canonical(frozen)) ? "The workflow allocation changed since it was prepared." : void 0;
895
+ if (refusal) {
894
896
  await update({
895
897
  ...attempt,
896
898
  state: "rejected"
897
899
  }, signal);
898
- throw new WorktreeWorkflowError("not_started", "Workflow validation failed or its prepared allocation changed.");
900
+ throw new WorktreeWorkflowError("not_started", refusal);
899
901
  }
900
902
  operation(signal).signal.throwIfAborted();
901
903
  try {