MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / MarkInstalled

Method MarkInstalled

internal/metadata/store.go:295–312  ·  view source on GitHub ↗

MarkInstalled sets the installed flag and records the target app.

(ctx context.Context, kind, installKey, targetApp string)

Source from the content-addressed store, hash-verified

293
294// MarkInstalled sets the installed flag and records the target app.
295func (s *Store) MarkInstalled(ctx context.Context, kind, installKey, targetApp string) error {
296 if err := s.Init(ctx); err != nil {
297 return err
298 }
299 db, err := s.open()
300 if err != nil {
301 return err
302 }
303 defer db.Close()
304 now := timeNow()
305 _, err = db.ExecContext(ctx, `
306 UPDATE metadata_items SET installed = 1, installed_targets = ?, updated_at = ?
307 WHERE kind = ? AND install_key = ?`, targetApp, now, kind, installKey)
308 if err != nil {
309 return fmt.Errorf("metadata: mark installed: %w", err)
310 }
311 return nil
312}
313
314// MarkUninstalled removes the specified app from the installed targets list.
315// If no targets remain, the installed flag is cleared. Uses a transaction to

Callers 4

TestMarkInstalledFunction · 0.95
InstallToTargetsMethod · 0.80

Calls 3

InitMethod · 0.95
openMethod · 0.95
timeNowFunction · 0.85

Tested by 2

TestMarkInstalledFunction · 0.76