]> git.giacomolli.uk - onechat/blobdiff - command.go
Require consent and review for autosquash
[onechat] / command.go
index fefb662da21039a37d44f0ccaca750abe2d6c0f7..8b5f29e106bbe511acba63bd6d7183840be2670f 100644 (file)
@@ -19,6 +19,8 @@ Commands:
                            import WhatsApp history (stop the daemon first)
     -n                     print the plan without model calls
     --agent NAME           import into an existing direct child (default: root)
                            import WhatsApp history (stop the daemon first)
     -n                     print the plan without model calls
     --agent NAME           import into an existing direct child (default: root)
+  notify [--agent-id ID] --source SOURCE --id ID --text TEXT
+                           send an external event (default: root)
   login                    log in to ChatGPT with a device code
   probe LOG COUNT [BUILDS] measure the compactor on a log, with real calls
   version                  show the build version
   login                    log in to ChatGPT with a device code
   probe LOG COUNT [BUILDS] measure the compactor on a log, with real calls
   version                  show the build version
@@ -80,6 +82,13 @@ func parseCommand(ctx context.Context, args []string) error {
                        return fmt.Errorf("run restore: %w", err)
                }
 
                        return fmt.Errorf("run restore: %w", err)
                }
 
+               return nil
+       case len(args) > 0 && args[0] == "notify":
+               err := notify(ctx, args[1:], os.Stdout)
+               if err != nil {
+                       return fmt.Errorf("submit external event: %w", err)
+               }
+
                return nil
        case len(args) > 0 && args[0] == "import":
                err := whatsappImport(ctx, args[1:], os.Stdout)
                return nil
        case len(args) > 0 && args[0] == "import":
                err := whatsappImport(ctx, args[1:], os.Stdout)