agentf 0.5.0 → 0.6.0

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.
@@ -176,6 +176,7 @@ module Agentf
176
176
  end
177
177
 
178
178
  KNOWN_TOOLS = %w[
179
+ agentf-mcp-list-tools
179
180
  agentf-code-glob
180
181
  agentf-code-grep
181
182
  agentf-code-tree
@@ -183,29 +184,24 @@ module Agentf
183
184
  agentf-architecture-analyze-layers
184
185
  agentf-memory-recent
185
186
  agentf-memory-search
186
- agentf-memory-by-tag
187
187
  agentf-memory-by-agent
188
188
  agentf-memory-by-type
189
- agentf-memory-tags
190
- agentf-memory-pitfalls
189
+ agentf-memory-episodes
191
190
  agentf-memory-lessons
192
- agentf-memory-successes
193
191
  agentf-memory-intents
194
192
  agentf-memory-business-intents
195
193
  agentf-memory-feature-intents
196
194
  agentf-memory-neighbors
197
195
  agentf-memory-subgraph
196
+ agentf-memory-add-playbook
198
197
  agentf-memory-add-lesson
199
- agentf-memory-add-success
200
- agentf-memory-add-pitfall
201
198
  agentf-memory-add-business-intent
202
199
  agentf-memory-add-feature-intent
203
200
  ].freeze
204
201
 
205
202
  WRITE_TOOLS = Set.new(%w[
203
+ agentf-memory-add-playbook
206
204
  agentf-memory-add-lesson
207
- agentf-memory-add-success
208
- agentf-memory-add-pitfall
209
205
  agentf-memory-add-business-intent
210
206
  agentf-memory-add-feature-intent
211
207
  ]).freeze
@@ -392,7 +388,7 @@ module Agentf
392
388
  end
393
389
 
394
390
  s.tool("agentf-memory-search") do
395
- description "Search memories by keyword."
391
+ description "Search memories semantically."
396
392
  argument :query, String, required: true, description: "Search query"
397
393
  argument :limit, Integer, required: false, description: "How many results to return (1-100)"
398
394
  call do |args|
@@ -402,13 +398,13 @@ module Agentf
402
398
  end
403
399
  end
404
400
 
405
- s.tool("agentf-memory-by-tag") do
406
- description "Get memories by tag."
407
- argument :tag, String, required: true, description: "Tag to filter"
401
+ s.tool("agentf-memory-episodes") do
402
+ description "List episode memories with optional outcome filter."
403
+ argument :outcome, String, required: false, description: "Optional outcome filter: positive|negative|neutral"
408
404
  argument :limit, Integer, required: false, description: "How many results to return (1-100)"
409
405
  call do |args|
410
- mcp_server.send(:guard!, "agentf-memory-by-tag", **args)
411
- result = reviewer.get_by_tag(args[:tag], limit: args[:limit] || 10)
406
+ mcp_server.send(:guard!, "agentf-memory-episodes", **args)
407
+ result = reviewer.get_episodes(limit: args[:limit] || 10, outcome: args[:outcome])
412
408
  JSON.generate(result)
413
409
  end
414
410
  end
@@ -435,25 +431,6 @@ module Agentf
435
431
  end
436
432
  end
437
433
 
438
- s.tool("agentf-memory-tags") do
439
- description "List all unique memory tags."
440
- call do |args|
441
- mcp_server.send(:guard!, "agentf-memory-tags", **args)
442
- result = reviewer.get_all_tags
443
- JSON.generate(result)
444
- end
445
- end
446
-
447
- s.tool("agentf-memory-pitfalls") do
448
- description "List pitfall memories."
449
- argument :limit, Integer, required: false, description: "How many results to return (1-100)"
450
- call do |args|
451
- mcp_server.send(:guard!, "agentf-memory-pitfalls", **args)
452
- result = reviewer.get_pitfalls(limit: args[:limit] || 10)
453
- JSON.generate(result)
454
- end
455
- end
456
-
457
434
  s.tool("agentf-memory-lessons") do
458
435
  description "List lesson memories."
459
436
  argument :limit, Integer, required: false, description: "How many results to return (1-100)"
@@ -464,16 +441,6 @@ module Agentf
464
441
  end
465
442
  end
466
443
 
467
- s.tool("agentf-memory-successes") do
468
- description "List success memories."
469
- argument :limit, Integer, required: false, description: "How many results to return (1-100)"
470
- call do |args|
471
- mcp_server.send(:guard!, "agentf-memory-successes", **args)
472
- result = reviewer.get_successes(limit: args[:limit] || 10)
473
- JSON.generate(result)
474
- end
475
- end
476
-
477
444
  s.tool("agentf-memory-intents") do
478
445
  description "List intents (business|feature)."
479
446
  argument :kind, String, required: false, description: "Optional: business|feature"
@@ -518,7 +485,6 @@ module Agentf
518
485
  description "Store a business intent in Redis."
519
486
  argument :title, String, required: true, description: "Intent title"
520
487
  argument :description, String, required: true, description: "Intent description"
521
- argument :tags, Array, required: false, items: String, description: "Tags"
522
488
  argument :constraints, Array, required: false, items: String, description: "Constraints"
523
489
  argument :priority, Integer, required: false, description: "Priority"
524
490
  call do |args|
@@ -529,7 +495,6 @@ module Agentf
529
495
  id = memory.store_business_intent(
530
496
  title: args[:title],
531
497
  description: args[:description],
532
- tags: args[:tags] || [],
533
498
  constraints: args[:constraints] || [],
534
499
  priority: args[:priority] || 1
535
500
  )
@@ -548,7 +513,6 @@ module Agentf
548
513
  description "Store a feature intent in Redis."
549
514
  argument :title, String, required: true, description: "Intent title"
550
515
  argument :description, String, required: true, description: "Intent description"
551
- argument :tags, Array, required: false, items: String, description: "Tags"
552
516
  argument :acceptance, Array, required: false, items: String, description: "Acceptance criteria"
553
517
  argument :non_goals, Array, required: false, items: String, description: "Non-goals"
554
518
  argument :related_task_id, String, required: false, description: "Related task id"
@@ -560,7 +524,6 @@ module Agentf
560
524
  id = memory.store_feature_intent(
561
525
  title: args[:title],
562
526
  description: args[:description],
563
- tags: args[:tags] || [],
564
527
  acceptance_criteria: args[:acceptance] || [],
565
528
  non_goals: args[:non_goals] || [],
566
529
  related_task_id: args[:related_task_id]
@@ -612,12 +575,28 @@ module Agentf
612
575
  end
613
576
  end
614
577
 
578
+ s.tool("agentf-mcp-list-tools") do
579
+ description "List MCP tools and current guardrail status."
580
+ call do |_args|
581
+ # Use guard to ensure the caller is allowed to invoke tools
582
+ mcp_server.send(:guard!, "agentf-mcp-list-tools", **{})
583
+
584
+ tools = s.list_tools
585
+ guard = {
586
+ allowed_tools: mcp_server.guardrails[:allowed_tools].to_a,
587
+ allow_writes: mcp_server.guardrails[:allow_writes],
588
+ max_arg_length: mcp_server.guardrails[:max_arg_length]
589
+ }
590
+
591
+ JSON.generate({ tools: tools, guardrails: guard })
592
+ end
593
+ end
594
+
615
595
  s.tool("agentf-memory-add-lesson") do
616
596
  description "Store a lesson memory in Redis."
617
597
  argument :title, String, required: true, description: "Lesson title"
618
598
  argument :description, String, required: true, description: "Lesson description"
619
599
  argument :agent, String, required: false, description: "Agent name"
620
- argument :tags, Array, required: false, items: String, description: "Tags"
621
600
  argument :context, String, required: false, description: "Context"
622
601
  call do |args|
623
602
  mcp_server.send(:guard!, "agentf-memory-add-lesson", **args)
@@ -629,7 +608,6 @@ module Agentf
629
608
  title: args[:title],
630
609
  description: args[:description],
631
610
  agent: args[:agent] || Agentf::AgentRoles::ENGINEER,
632
- tags: args[:tags] || [],
633
611
  context: args[:context].to_s,
634
612
  code_snippet: ""
635
613
  )
@@ -650,64 +628,24 @@ module Agentf
650
628
  end
651
629
  end
652
630
 
653
- s.tool("agentf-memory-add-success") do
654
- description "Store a success memory in Redis."
655
- argument :title, String, required: true, description: "Success title"
656
- argument :description, String, required: true, description: "Success description"
657
- argument :agent, String, required: false, description: "Agent name"
658
- argument :tags, Array, required: false, items: String, description: "Tags"
659
- argument :context, String, required: false, description: "Context"
660
- call do |args|
661
- mcp_server.send(:guard!, "agentf-memory-add-success", **args)
662
- begin
663
- id = nil
664
- res = mcp_server.send(:safe_mcp_memory_write, memory, attempted: { tool: "agentf-memory-add-success", args: args }) do
665
- id = memory.store_episode(
666
- type: "success",
667
- title: args[:title],
668
- description: args[:description],
669
- agent: args[:agent] || Agentf::AgentRoles::ENGINEER,
670
- tags: args[:tags] || [],
671
- context: args[:context].to_s,
672
- code_snippet: ""
673
- )
674
- end
675
-
676
- if res.is_a?(Hash) && res["confirmation_required"]
677
- JSON.generate(
678
- confirmation_required: true,
679
- confirmation_details: res["confirmation_details"],
680
- attempted: res["attempted"],
681
- confirmed_write_token: res["confirmed_write_token"],
682
- confirmation_prompt: res["confirmation_prompt"]
683
- )
684
- else
685
- JSON.generate(id: id, type: "success", status: "stored")
686
- end
687
- end
688
- end
689
- end
690
-
691
- s.tool("agentf-memory-add-pitfall") do
692
- description "Store a pitfall memory in Redis."
693
- argument :title, String, required: true, description: "Pitfall title"
694
- argument :description, String, required: true, description: "Pitfall description"
631
+ s.tool("agentf-memory-add-playbook") do
632
+ description "Store a playbook memory in Redis."
633
+ argument :title, String, required: true, description: "Playbook title"
634
+ argument :description, String, required: true, description: "Playbook description"
695
635
  argument :agent, String, required: false, description: "Agent name"
696
- argument :tags, Array, required: false, items: String, description: "Tags"
697
- argument :context, String, required: false, description: "Context"
636
+ argument :steps, Array, required: false, items: String, description: "Ordered playbook steps"
637
+ argument :feature_area, String, required: false, description: "Feature area"
698
638
  call do |args|
699
- mcp_server.send(:guard!, "agentf-memory-add-pitfall", **args)
639
+ mcp_server.send(:guard!, "agentf-memory-add-playbook", **args)
700
640
  begin
701
641
  id = nil
702
- res = mcp_server.send(:safe_mcp_memory_write, memory, attempted: { tool: "agentf-memory-add-pitfall", args: args }) do
703
- id = memory.store_episode(
704
- type: "pitfall",
642
+ res = mcp_server.send(:safe_mcp_memory_write, memory, attempted: { tool: "agentf-memory-add-playbook", args: args }) do
643
+ id = memory.store_playbook(
705
644
  title: args[:title],
706
645
  description: args[:description],
707
- agent: args[:agent] || Agentf::AgentRoles::ENGINEER,
708
- tags: args[:tags] || [],
709
- context: args[:context].to_s,
710
- code_snippet: ""
646
+ agent: args[:agent] || Agentf::AgentRoles::PLANNER,
647
+ steps: args[:steps] || [],
648
+ feature_area: args[:feature_area]
711
649
  )
712
650
  end
713
651
 
@@ -720,7 +658,7 @@ module Agentf
720
658
  confirmation_prompt: res["confirmation_prompt"]
721
659
  )
722
660
  else
723
- JSON.generate(id: id, type: "pitfall", status: "stored")
661
+ JSON.generate(id: id, type: "playbook", status: "stored")
724
662
  end
725
663
  end
726
664
  end