@@ -12,12 +12,15 @@ import (
1212 "syscall"
1313
1414 "github.com/agentcodinglab/aicodingagentteam/internal/a2a"
15+ "github.com/agentcodinglab/aicodingagentteam/internal/acp"
16+ "github.com/agentcodinglab/aicodingagentteam/internal/agent"
1517 "github.com/agentcodinglab/aicodingagentteam/internal/audit"
1618 "github.com/agentcodinglab/aicodingagentteam/internal/config"
1719 "github.com/agentcodinglab/aicodingagentteam/internal/coordinator"
1820 "github.com/agentcodinglab/aicodingagentteam/internal/governance"
1921 "github.com/agentcodinglab/aicodingagentteam/internal/host"
2022 "github.com/agentcodinglab/aicodingagentteam/internal/knowledge"
23+ "github.com/agentcodinglab/aicodingagentteam/internal/mcp"
2124 "github.com/agentcodinglab/aicodingagentteam/internal/memory"
2225 "github.com/agentcodinglab/aicodingagentteam/internal/planner"
2326 "github.com/agentcodinglab/aicodingagentteam/internal/qualitygate"
@@ -61,6 +64,18 @@ func main() {
6164 cmdServe (ctx , cfg )
6265 case "knowledge" :
6366 cmdKnowledge (ctx , os .Args [2 :])
67+ case "continue" :
68+ cmdContinue (ctx , cfg , os .Args [2 :])
69+ case "mcp" :
70+ cmdMCPServe (ctx , cfg )
71+ case "a2a" :
72+ cmdA2AServe (ctx , cfg )
73+ case "acp" :
74+ cmdACPServe (ctx , cfg )
75+ case "memory" :
76+ cmdMemory (ctx , os .Args [2 :])
77+ case "ci" :
78+ cmdGovern (ctx , append ([]string {"--ci" }, os .Args [2 :]... ))
6479 case "version" :
6580 fmt .Printf ("aicodingagentteam %s (commit=%s, built=%s)\n " , version , commit , date )
6681 default :
@@ -332,6 +347,108 @@ var tempDir = func() string {
332347 return d
333348}
334349
350+ func cmdContinue (ctx context.Context , cfg * config.Config , args []string ) {
351+ fs := flag .NewFlagSet ("continue" , flag .ExitOnError )
352+ _ = fs .Parse (args )
353+ d := newDirector (cfg )
354+ resumed , msg , err := d .ContinuePlan (ctx , fs .Arg (0 ))
355+ if err != nil {
356+ fmt .Fprintf (os .Stderr , "error: %v\n " , err )
357+ os .Exit (1 )
358+ }
359+ if resumed {
360+ fmt .Printf ("workflow resumed: %s\n " , msg )
361+ } else {
362+ fmt .Printf ("cannot continue: %s\n " , msg )
363+ }
364+ }
365+
366+ func cmdMCPServe (ctx context.Context , cfg * config.Config ) {
367+ govEngine := governance .NewWithConfig (".aicodingagentteam/rules.json" , audit .New (".aicodingagentteam/audit" ))
368+ srv := mcp .New (govEngine )
369+ fmt .Println ("MCP server: stdio JSON-RPC (govern_file, govern_directory)" )
370+ if err := srv .Serve (ctx ); err != nil && err != context .Canceled {
371+ fmt .Fprintf (os .Stderr , "mcp server error: %v\n " , err )
372+ os .Exit (1 )
373+ }
374+ }
375+
376+ func cmdA2AServe (ctx context.Context , cfg * config.Config ) {
377+ bus := a2a .NewBusFromEnv (audit .New (".aicodingagentteam/audit" ))
378+ agent .RegisterAllReviewers (bus )
379+ d := newDirector (cfg )
380+ srv := api .NewServer (cfg .Coordinator .GRPC , cfg .Coordinator .MCP , cfg .Coordinator .ACP , cfg .Coordinator .A2A , d )
381+ fmt .Printf ("A2A server: listening on :%d\n " , cfg .Coordinator .A2A )
382+ if err := srv .Start (ctx ); err != nil && err != context .Canceled {
383+ fmt .Fprintf (os .Stderr , "a2a server error: %v\n " , err )
384+ os .Exit (1 )
385+ }
386+ }
387+
388+ func cmdACPServe (ctx context.Context , cfg * config.Config ) {
389+ srv := acp .New ()
390+ fmt .Println ("ACP server: stdio JSON-RPC (session lifecycle)" )
391+ if err := srv .Serve (ctx ); err != nil && err != context .Canceled {
392+ fmt .Fprintf (os .Stderr , "acp server error: %v\n " , err )
393+ os .Exit (1 )
394+ }
395+ }
396+
397+ func cmdMemory (ctx context.Context , args []string ) {
398+ if len (args ) < 1 {
399+ fmt .Println ("Usage:" )
400+ fmt .Println (" aicodingagentteam memory show Show all memories (facts/pitfalls/lessons)" )
401+ fmt .Println (" aicodingagentteam memory capture on|off Enable/disable fact capture" )
402+ fmt .Println (" aicodingagentteam memory recall on|off Enable/disable recipe recall" )
403+ return
404+ }
405+ mem := memory .New (".aicodingagentteam/memory" )
406+ sub := args [0 ]
407+ switch sub {
408+ case "show" :
409+ facts , _ := mem .RecallFacts (ctx )
410+ fmt .Println ("=== Facts ===" )
411+ for _ , f := range facts {
412+ fmt .Printf (" [%s] %s: %s\n " , f .Source , f .Key , f .Value )
413+ }
414+ if len (facts ) == 0 {
415+ fmt .Println (" (none)" )
416+ }
417+ pitfalls , _ := mem .RecallPitfalls (ctx )
418+ fmt .Println ("=== Pitfalls ===" )
419+ for _ , p := range pitfalls {
420+ fmt .Printf (" [%s] count=%d verified=%v: %s\n " , p .ID , p .Count , p .Verified , p .Detail )
421+ }
422+ if len (pitfalls ) == 0 {
423+ fmt .Println (" (none)" )
424+ }
425+ lessons , _ := mem .RecallLessons (ctx )
426+ fmt .Println ("=== Lessons ===" )
427+ for _ , l := range lessons {
428+ fmt .Printf (" [%s] verified=%v: %s\n " , l .ID , l .Verified , l .Rule )
429+ }
430+ if len (lessons ) == 0 {
431+ fmt .Println (" (none)" )
432+ }
433+ case "capture" :
434+ if len (args ) < 2 {
435+ fmt .Fprintln (os .Stderr , "usage: memory capture on|off" )
436+ os .Exit (1 )
437+ }
438+ mem .SetCaptureOn (args [1 ] == "on" )
439+ fmt .Printf ("memory capture: %s\n " , args [1 ])
440+ case "recall" :
441+ if len (args ) < 2 {
442+ fmt .Fprintln (os .Stderr , "usage: memory recall on|off" )
443+ os .Exit (1 )
444+ }
445+ mem .SetRecallOn (args [1 ] == "on" )
446+ fmt .Printf ("memory recall: %s\n " , args [1 ])
447+ default :
448+ fmt .Fprintf (os .Stderr , "unknown memory subcommand: %s\n " , sub )
449+ os .Exit (1 )
450+ }
451+ }
335452func printCheckDetails (details []types.CheckSummary ) {
336453 for _ , d := range details {
337454 if d .Status == "pass" {
0 commit comments