kin: KIN-083 Healthcheck claude CLI auth: перед запуском pipeline проверять что claude залогинен (быстрый claude -p 'ok' --output-format json, проверить is_error и 'Not logged in'). Если не залогинен — не запускать pipeline, а показать ошибку 'Claude CLI requires login' в GUI с инструкцией.
This commit is contained in:
parent
a80679ae72
commit
bfc8f1c0bb
18 changed files with 1390 additions and 57 deletions
|
|
@ -99,6 +99,15 @@ def get_project(conn: sqlite3.Connection, id: str) -> dict | None:
|
|||
return _row_to_dict(row)
|
||||
|
||||
|
||||
def delete_project(conn: sqlite3.Connection, id: str) -> None:
|
||||
"""Delete a project and all its related data (modules, decisions, tasks)."""
|
||||
# Delete tables that have FK references to tasks BEFORE deleting tasks
|
||||
for table in ("modules", "agent_logs", "decisions", "pipelines", "tasks"):
|
||||
conn.execute(f"DELETE FROM {table} WHERE project_id = ?", (id,))
|
||||
conn.execute("DELETE FROM projects WHERE id = ?", (id,))
|
||||
conn.commit()
|
||||
|
||||
|
||||
def get_effective_mode(conn: sqlite3.Connection, project_id: str, task_id: str) -> str:
|
||||
"""Return effective execution mode: 'auto' or 'review'.
|
||||
|
||||
|
|
@ -381,17 +390,26 @@ def add_module(
|
|||
) -> dict:
|
||||
"""Register a project module."""
|
||||
cur = conn.execute(
|
||||
"""INSERT INTO modules (project_id, name, type, path, description,
|
||||
"""INSERT OR IGNORE INTO modules (project_id, name, type, path, description,
|
||||
owner_role, dependencies)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?)""",
|
||||
(project_id, name, type, path, description, owner_role,
|
||||
_json_encode(dependencies)),
|
||||
)
|
||||
created = cur.rowcount > 0
|
||||
conn.commit()
|
||||
row = conn.execute(
|
||||
"SELECT * FROM modules WHERE id = ?", (cur.lastrowid,)
|
||||
).fetchone()
|
||||
return _row_to_dict(row)
|
||||
if cur.lastrowid:
|
||||
row = conn.execute(
|
||||
"SELECT * FROM modules WHERE id = ?", (cur.lastrowid,)
|
||||
).fetchone()
|
||||
else:
|
||||
row = conn.execute(
|
||||
"SELECT * FROM modules WHERE project_id = ? AND name = ?",
|
||||
(project_id, name),
|
||||
).fetchone()
|
||||
result = _row_to_dict(row)
|
||||
result["_created"] = created
|
||||
return result
|
||||
|
||||
|
||||
def get_modules(conn: sqlite3.Connection, project_id: str) -> list[dict]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue