@autohq/cli 0.1.546 → 0.1.548

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.
@@ -30870,7 +30870,7 @@ Object.assign(lookup, {
30870
30870
  // package.json
30871
30871
  var package_default = {
30872
30872
  name: "@autohq/cli",
30873
- version: "0.1.546",
30873
+ version: "0.1.548",
30874
30874
  license: "SEE LICENSE IN README.md",
30875
30875
  publishConfig: {
30876
30876
  access: "public"
@@ -35837,6 +35837,23 @@ var AgentIdentitySchema = external_exports.object({
35837
35837
  }).strict().refine((identity) => Object.keys(identity).length > 0, {
35838
35838
  message: "Identity requires at least one field"
35839
35839
  });
35840
+ var PersistedAgentIdentitySchema = external_exports.preprocess(
35841
+ normalizePersistedAgentIdentity,
35842
+ AgentIdentitySchema.optional()
35843
+ );
35844
+ function normalizePersistedAgentIdentity(value2) {
35845
+ if (typeof value2 !== "object" || value2 === null) return value2;
35846
+ const identity = value2;
35847
+ if (typeof identity.description !== "string") return value2;
35848
+ if (agentIdentityDescriptionLength(identity.description) <= AGENT_IDENTITY_DESCRIPTION_MAX_LENGTH) {
35849
+ return value2;
35850
+ }
35851
+ const clamped = clampAgentIdentityDescription(identity.description);
35852
+ const normalizedIdentity = { ...identity };
35853
+ if (clamped.length > 0) normalizedIdentity.description = clamped;
35854
+ else delete normalizedIdentity.description;
35855
+ return Object.keys(normalizedIdentity).length > 0 ? normalizedIdentity : void 0;
35856
+ }
35840
35857
  var BINDING_LIFECYCLE_VALUES = ["manual", "held"];
35841
35858
  var BindingLifecycleSpecSchema = external_exports.object({
35842
35859
  lifecycle: external_exports.enum(BINDING_LIFECYCLE_VALUES).default("manual"),
@@ -36069,20 +36086,16 @@ var PersistedAgentResourceSchema = external_exports.preprocess(
36069
36086
  function normalizePersistedAgentResource(value2) {
36070
36087
  if (typeof value2 !== "object" || value2 === null) return value2;
36071
36088
  const resource = value2;
36072
- const identity = resource.spec?.identity;
36073
- if (typeof identity?.description !== "string") return value2;
36074
- if (agentIdentityDescriptionLength(identity.description) <= AGENT_IDENTITY_DESCRIPTION_MAX_LENGTH) {
36075
- return value2;
36076
- }
36077
- const clamped = clampAgentIdentityDescription(identity.description);
36078
- const normalizedIdentity = { ...identity };
36079
- if (clamped.length > 0) normalizedIdentity.description = clamped;
36080
- else delete normalizedIdentity.description;
36089
+ if (resource.spec?.identity === void 0) return value2;
36090
+ const normalizedIdentity = normalizePersistedAgentIdentity(
36091
+ resource.spec.identity
36092
+ );
36093
+ if (normalizedIdentity === resource.spec.identity) return value2;
36081
36094
  return {
36082
36095
  ...resource,
36083
36096
  spec: {
36084
36097
  ...resource.spec,
36085
- ...Object.keys(normalizedIdentity).length > 0 ? { identity: normalizedIdentity } : { identity: void 0 }
36098
+ identity: normalizedIdentity
36086
36099
  }
36087
36100
  };
36088
36101
  }