(ctx context.Context, exec agentExecutor, agentEmail, domain, name, userID string)
| 935 | } |
| 936 | |
| 937 | func createAgent(ctx context.Context, exec agentExecutor, agentEmail, domain, name, userID string) (*AgentIdentity, error) { |
| 938 | a := &AgentIdentity{ |
| 939 | ID: agentEmail, |
| 940 | Domain: normalizeDomain(domain), |
| 941 | Name: name, |
| 942 | Public: true, |
| 943 | CreatedAt: time.Now(), |
| 944 | UserID: userID, |
| 945 | HITLTTLSeconds: HITLDefaultTTLSeconds, |
| 946 | HITLExpirationAction: HITLDefaultExpirationAct, |
| 947 | } |
| 948 | _, err := exec.Exec(ctx, |
| 949 | `INSERT INTO agent_identities (id, domain, user_id, name, public, created_at) |
| 950 | VALUES ($1, $2, $3, $4, $5, $6)`, |
| 951 | a.ID, a.Domain, a.UserID, a.Name, a.Public, a.CreatedAt, |
| 952 | ) |
| 953 | if err != nil { |
| 954 | return nil, err |
| 955 | } |
| 956 | a.populateEmail() |
| 957 | return a, nil |
| 958 | } |
| 959 | |
| 960 | // UpdateAgentHITL updates all three HITL settings on an agent owned by userID. |
| 961 | // The TTL and expiration action are validated against the same rules as the |
no test coverage detected