cueme 0.1.13 → 0.1.15
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.
- package/package.json +1 -1
- package/src/db.js +13 -0
- package/src/handler.js +15 -0
package/package.json
CHANGED
package/src/db.js
CHANGED
|
@@ -90,6 +90,19 @@ async function initSchema(db) {
|
|
|
90
90
|
|
|
91
91
|
await run(db, 'CREATE INDEX IF NOT EXISTS ix_cue_files_sha256 ON cue_files(sha256)');
|
|
92
92
|
|
|
93
|
+
await run(
|
|
94
|
+
db,
|
|
95
|
+
[
|
|
96
|
+
'CREATE TABLE IF NOT EXISTS agent_envs (',
|
|
97
|
+
' agent_id TEXT PRIMARY KEY,',
|
|
98
|
+
' agent_runtime TEXT,',
|
|
99
|
+
' project_dir TEXT,',
|
|
100
|
+
' agent_terminal TEXT,',
|
|
101
|
+
' updated_at TEXT',
|
|
102
|
+
')',
|
|
103
|
+
].join('\n')
|
|
104
|
+
);
|
|
105
|
+
|
|
93
106
|
await run(
|
|
94
107
|
db,
|
|
95
108
|
[
|
package/src/handler.js
CHANGED
|
@@ -139,6 +139,21 @@ async function handleJoin(db, agent_runtime) {
|
|
|
139
139
|
const project_dir = process.cwd();
|
|
140
140
|
const agent_terminal = detectAgentTerminal();
|
|
141
141
|
const normalized_runtime = normalizeAgentRuntime(agent_runtime);
|
|
142
|
+
const updated_at = nowIso();
|
|
143
|
+
|
|
144
|
+
await run(
|
|
145
|
+
db,
|
|
146
|
+
[
|
|
147
|
+
'INSERT INTO agent_envs (agent_id, agent_runtime, project_dir, agent_terminal, updated_at)',
|
|
148
|
+
'VALUES (?, ?, ?, ?, ?)',
|
|
149
|
+
'ON CONFLICT(agent_id) DO UPDATE SET',
|
|
150
|
+
' agent_runtime = excluded.agent_runtime,',
|
|
151
|
+
' project_dir = excluded.project_dir,',
|
|
152
|
+
' agent_terminal = excluded.agent_terminal,',
|
|
153
|
+
' updated_at = excluded.updated_at',
|
|
154
|
+
].join('\n'),
|
|
155
|
+
[agent_id, normalized_runtime, project_dir, agent_terminal, updated_at]
|
|
156
|
+
);
|
|
142
157
|
|
|
143
158
|
let message =
|
|
144
159
|
`agent_id=${agent_id}\n` +
|