export const LAUNCH_CHILD_CONVERSATION_TOOL_NAME = "launch_child_conversation";

/**
 * Action discriminator generated by the SDK for the client-defined launch tool
 * (`ClientAction_<tool-name>`). Keep the SDK naming convention contained here
 * instead of repeating its generated class name throughout the frontend.
 */
export const LAUNCH_CHILD_CONVERSATION_ACTION_KIND =
  `ClientAction_${LAUNCH_CHILD_CONVERSATION_TOOL_NAME}` as const;

/**
 * Prefix of the machine-generated message the frontend posts back into the
 * parent conversation after a launch. Client tools are acknowledged by the
 * agent-server before the browser has done any work, so this message is the
 * only way to hand the agent the child's id, URL and status — or corrective
 * guidance when the call was malformed. The chat hides it (see
 * `should-render-event.ts`) because the agent relays the same information in
 * its own reply.
 */
export const CHILD_CONVERSATION_RESULT_PREFIX = "[child-conversation] ";

export const CHILD_CONVERSATION_TARGETS = ["local", "cloud"] as const;
export type ChildConversationTarget =
  (typeof CHILD_CONVERSATION_TARGETS)[number];

export const CHILD_CONVERSATION_ISOLATIONS = ["worktree", "shared"] as const;
export type ChildConversationIsolation =
  (typeof CHILD_CONVERSATION_ISOLATIONS)[number];

/**
 * `parent_conversation_id` on the local start-conversation request landed in
 * software-agent-sdk#4188. Older agent-servers accept the request and drop the
 * field (the pydantic model ignores extras), so the launch still succeeds — we
 * just tell the agent the relationship was not persisted instead of letting it
 * believe in a link that does not exist.
 */
export const MIN_AGENT_SERVER_VERSION_FOR_PARENT_LINK = "1.37.1";
