Function
updateSessionAgentConfig
(
db: Db,
params: {
sessionKey: string;
agentCommand: string;
agentArgs: string[];
},
)
Source from the content-addressed store, hash-verified
| 149 | } |
| 150 | |
| 151 | export function updateSessionAgentConfig( |
| 152 | db: Db, |
| 153 | params: { |
| 154 | sessionKey: string; |
| 155 | agentCommand: string; |
| 156 | agentArgs: string[]; |
| 157 | }, |
| 158 | ): void { |
| 159 | const now = Date.now(); |
| 160 | db.prepare( |
| 161 | ` |
| 162 | UPDATE sessions |
| 163 | SET agent_command = ?, |
| 164 | agent_args_json = ?, |
| 165 | acp_session_id = NULL, |
| 166 | updated_at = ? |
| 167 | WHERE session_key = ? |
| 168 | `, |
| 169 | ).run( |
| 170 | params.agentCommand, |
| 171 | JSON.stringify(params.agentArgs), |
| 172 | now, |
| 173 | params.sessionKey, |
| 174 | ); |
| 175 | } |
| 176 | |
| 177 | export function getSession( |
| 178 | db: Db, |
Tested by
no test coverage detected