agentf 0.4.5 → 0.4.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 375fdc4ce17f8fe753e2f99a1ac35ee5a4ce2ac8b592812b924a4b755faf7827
4
- data.tar.gz: 7d45fb33f315c8cd15fb4297556d063603d763fe3a0f9e79906a259f1dac6808
3
+ metadata.gz: 1a6b455ea4e8d08419665c731414589a39173932f0bdf70788b76cfbcc7c0380
4
+ data.tar.gz: 4552007bea3fbb27e4940f09542f76e557bdac18f06391dfcb7db6914adc9017
5
5
  SHA512:
6
- metadata.gz: 4eb3d691ed13cae8b2780955eb4e059c878f1ad3f219ffe577d439b1695a7d5d3408d6770f2a7d1a3d45e78df678993a882eb130003e4bcc5c5e5759b7508051
7
- data.tar.gz: 635accb75b7532c51cee21c02a5d54b9df35010e2db3c46efe3e788452cdaca5f9b35bfdc538969227dd0808cf4b3b37d1e0821f73f8c9431f2ec54dca12ea2e
6
+ metadata.gz: 37efe8cb9847156d5d0e93ee981c108fddab0940eab62fe60bb609e6fc68f799c14fd84f08214263ec4e98d05b617b5be7cd8d035d8a9352d7c639b4737947bb
7
+ data.tar.gz: c26f29b7059e1997f62b1a9b25c628c6ff25832309e8766ba2d076ebdf8333ca7ac3206145ae4e05f623c84aa6771c316970b5377e0b48de2980dff3e5c077df
@@ -25,8 +25,8 @@ module Agentf
25
25
  "store_lesson" => { cli: "agentf memory add-lesson \"<title>\" \"<description>\" --agent=<AGENT> --tags=learning", tool: "agentf-memory-add-lesson" },
26
26
  "store_success" => { cli: "agentf memory add-success \"<title>\" \"<description>\" --agent=<AGENT> --tags=success", tool: "agentf-memory-add-success" },
27
27
  "store_pitfall" => { cli: "agentf memory add-pitfall \"<title>\" \"<description>\" --agent=<AGENT> --tags=pitfall", tool: "agentf-memory-add-pitfall" },
28
- "store_business_intent" => { cli: "agentf memory add-business-intent \"<title>\" \"<description>\" --tags=strategy", tool: "agentf-memory-add-lesson" },
29
- "store_feature_intent" => { cli: "agentf memory add-feature-intent \"<title>\" \"<description>\" --acceptance=\"<criteria>\"", tool: "agentf-memory-add-lesson" }
28
+ "store_business_intent" => { cli: "agentf memory add-business-intent \"<title>\" \"<description>\" --tags=strategy", tool: "agentf-memory-add-business-intent" },
29
+ "store_feature_intent" => { cli: "agentf memory add-feature-intent \"<title>\" \"<description>\" --acceptance=\"<criteria>\"", tool: "agentf-memory-add-feature-intent" }
30
30
  }.freeze
31
31
 
32
32
  PROVIDER_LAYOUTS = {
@@ -631,6 +631,165 @@ module Agentf
631
631
  return runAgentfCli(context.directory, "memory", "search", [args.query, "-n", String(limit)]);
632
632
  },
633
633
  }),
634
+ "agentf-memory-by-tag": tool({
635
+ description: "Get Agentf memories by tag.",
636
+ args: {
637
+ tag: tool.schema.string().describe("Tag to filter by"),
638
+ limit: tool.schema.number().int().min(1).max(100).optional().describe("How many results to return"),
639
+ },
640
+ async execute(args, context) {
641
+ const limit = args.limit ?? 10;
642
+ return runAgentfCli(context.directory, "memory", "by-tag", [args.tag, "-n", String(limit)]);
643
+ },
644
+ }),
645
+ "agentf-memory-by-agent": tool({
646
+ description: "Get Agentf memories by agent.",
647
+ args: {
648
+ agent: tool.schema.string().describe("Agent name"),
649
+ limit: tool.schema.number().int().min(1).max(100).optional().describe("How many results to return"),
650
+ },
651
+ async execute(args, context) {
652
+ const limit = args.limit ?? 10;
653
+ return runAgentfCli(context.directory, "memory", "by-agent", [args.agent, "-n", String(limit)]);
654
+ },
655
+ }),
656
+ "agentf-memory-by-type": tool({
657
+ description: "Get Agentf memories by type.",
658
+ args: {
659
+ type: tool.schema.string().describe("Memory type (pitfall|lesson|success|business_intent|feature_intent)"),
660
+ limit: tool.schema.number().int().min(1).max(100).optional().describe("How many results to return"),
661
+ },
662
+ async execute(args, context) {
663
+ const limit = args.limit ?? 10;
664
+ return runAgentfCli(context.directory, "memory", "by-type", [args.type, "-n", String(limit)]);
665
+ },
666
+ }),
667
+ "agentf-memory-tags": tool({
668
+ description: "List all unique memory tags.",
669
+ args: {},
670
+ async execute(_args, context) {
671
+ return runAgentfCli(context.directory, "memory", "tags", []);
672
+ },
673
+ }),
674
+ "agentf-memory-pitfalls": tool({
675
+ description: "List pitfall memories.",
676
+ args: { limit: tool.schema.number().int().min(1).max(100).optional() },
677
+ async execute(args, context) {
678
+ const limit = args.limit ?? 10;
679
+ return runAgentfCli(context.directory, "memory", "pitfalls", ["-n", String(limit)]);
680
+ },
681
+ }),
682
+ "agentf-memory-lessons": tool({
683
+ description: "List lesson memories.",
684
+ args: { limit: tool.schema.number().int().min(1).max(100).optional() },
685
+ async execute(args, context) {
686
+ const limit = args.limit ?? 10;
687
+ return runAgentfCli(context.directory, "memory", "lessons", ["-n", String(limit)]);
688
+ },
689
+ }),
690
+ "agentf-memory-successes": tool({
691
+ description: "List success memories.",
692
+ args: { limit: tool.schema.number().int().min(1).max(100).optional() },
693
+ async execute(args, context) {
694
+ const limit = args.limit ?? 10;
695
+ return runAgentfCli(context.directory, "memory", "successes", ["-n", String(limit)]);
696
+ },
697
+ }),
698
+ "agentf-memory-intents": tool({
699
+ description: "List intents (business, feature or both).",
700
+ args: { kind: tool.schema.string().optional(), limit: tool.schema.number().int().min(1).max(100).optional() },
701
+ async execute(args, context) {
702
+ const limit = args.limit ?? 10;
703
+ const kind = args.kind ? String(args.kind) : "";
704
+ const cmdArgs = kind ? [kind, "-n", String(limit)] : ["-n", String(limit)];
705
+ return runAgentfCli(context.directory, "memory", "intents", cmdArgs);
706
+ },
707
+ }),
708
+ "agentf-memory-business-intents": tool({
709
+ description: "List business intents.",
710
+ args: { limit: tool.schema.number().int().min(1).max(100).optional() },
711
+ async execute(args, context) {
712
+ const limit = args.limit ?? 10;
713
+ return runAgentfCli(context.directory, "memory", "business-intents", ["-n", String(limit)]);
714
+ },
715
+ }),
716
+ "agentf-memory-feature-intents": tool({
717
+ description: "List feature intents.",
718
+ args: { limit: tool.schema.number().int().min(1).max(100).optional() },
719
+ async execute(args, context) {
720
+ const limit = args.limit ?? 10;
721
+ return runAgentfCli(context.directory, "memory", "feature-intents", ["-n", String(limit)]);
722
+ },
723
+ }),
724
+ "agentf-memory-add-business-intent": tool({
725
+ description: "Store a business intent in Redis.",
726
+ args: {
727
+ title: tool.schema.string(),
728
+ description: tool.schema.string(),
729
+ tags: tool.schema.array(tool.schema.string()).optional(),
730
+ constraints: tool.schema.array(tool.schema.string()).optional(),
731
+ priority: tool.schema.number().int().optional(),
732
+ },
733
+ async execute(args, context) {
734
+ const commandArgs = [args.title, args.description];
735
+ if (args.tags?.length) commandArgs.push(`--tags=${args.tags.join(",")}`);
736
+ if (args.constraints?.length) commandArgs.push(`--constraints=${args.constraints.join(";")}`);
737
+ if (Number.isInteger(args.priority)) commandArgs.push(`--priority=${String(args.priority)}`);
738
+ return runAgentfCli(context.directory, "memory", "add-business-intent", commandArgs);
739
+ },
740
+ }),
741
+ "agentf-memory-add-feature-intent": tool({
742
+ description: "Store a feature intent in Redis.",
743
+ args: {
744
+ title: tool.schema.string(),
745
+ description: tool.schema.string(),
746
+ tags: tool.schema.array(tool.schema.string()).optional(),
747
+ acceptance: tool.schema.array(tool.schema.string()).optional(),
748
+ non_goals: tool.schema.array(tool.schema.string()).optional(),
749
+ related_task_id: tool.schema.string().optional(),
750
+ },
751
+ async execute(args, context) {
752
+ const commandArgs = [args.title, args.description];
753
+ if (args.tags?.length) commandArgs.push(`--tags=${args.tags.join(",")}`);
754
+ if (args.acceptance?.length) commandArgs.push(`--acceptance=${args.acceptance.join(";")}`);
755
+ if (args.non_goals?.length) commandArgs.push(`--non-goals=${args.non_goals.join(";")}`);
756
+ if (args.related_task_id) commandArgs.push(`--task=${args.related_task_id}`);
757
+ return runAgentfCli(context.directory, "memory", "add-feature-intent", commandArgs);
758
+ },
759
+ }),
760
+ "agentf-memory-neighbors": tool({
761
+ description: "Get neighboring memory nodes by edge traversal.",
762
+ args: {
763
+ node_id: tool.schema.string(),
764
+ relation: tool.schema.string().optional(),
765
+ depth: tool.schema.number().int().optional(),
766
+ limit: tool.schema.number().int().optional(),
767
+ },
768
+ async execute(args, context) {
769
+ const commandArgs = [args.node_id];
770
+ if (args.relation) commandArgs.push(`--relation=${args.relation}`);
771
+ if (Number.isInteger(args.depth)) commandArgs.push(`--depth=${String(args.depth)}`);
772
+ if (Number.isInteger(args.limit)) commandArgs.push(`-n`, String(args.limit));
773
+ return runAgentfCli(context.directory, "memory", "neighbors", commandArgs);
774
+ },
775
+ }),
776
+ "agentf-memory-subgraph": tool({
777
+ description: "Build a subgraph from seed ids.",
778
+ args: {
779
+ seed_ids: tool.schema.array(tool.schema.string()),
780
+ relation_filters: tool.schema.array(tool.schema.string()).optional(),
781
+ depth: tool.schema.number().int().optional(),
782
+ limit: tool.schema.number().int().optional(),
783
+ },
784
+ async execute(args, context) {
785
+ const seeds = (args.seed_ids || []).join(",");
786
+ const commandArgs = [seeds];
787
+ if (args.relation_filters?.length) commandArgs.push(`--relation=${args.relation_filters.join(",")}`);
788
+ if (Number.isInteger(args.depth)) commandArgs.push(`--depth=${String(args.depth)}`);
789
+ if (Number.isInteger(args.limit)) commandArgs.push(`-n`, String(args.limit));
790
+ return runAgentfCli(context.directory, "memory", "subgraph", commandArgs);
791
+ },
792
+ }),
634
793
  "agentf-memory-add-lesson": tool({
635
794
  description: "Store a lesson memory in Redis.",
636
795
  args: {
@@ -28,17 +28,31 @@ module Agentf
28
28
  agentf-architecture-analyze-layers
29
29
  agentf-memory-recent
30
30
  agentf-memory-search
31
+ agentf-memory-by-tag
32
+ agentf-memory-by-agent
33
+ agentf-memory-by-type
34
+ agentf-memory-tags
35
+ agentf-memory-pitfalls
36
+ agentf-memory-lessons
37
+ agentf-memory-successes
38
+ agentf-memory-intents
39
+ agentf-memory-business-intents
40
+ agentf-memory-feature-intents
31
41
  agentf-memory-neighbors
32
42
  agentf-memory-subgraph
33
43
  agentf-memory-add-lesson
34
44
  agentf-memory-add-success
35
45
  agentf-memory-add-pitfall
46
+ agentf-memory-add-business-intent
47
+ agentf-memory-add-feature-intent
36
48
  ].freeze
37
49
 
38
50
  WRITE_TOOLS = Set.new(%w[
39
51
  agentf-memory-add-lesson
40
52
  agentf-memory-add-success
41
53
  agentf-memory-add-pitfall
54
+ agentf-memory-add-business-intent
55
+ agentf-memory-add-feature-intent
42
56
  ]).freeze
43
57
 
44
58
  attr_reader :server, :guardrails
@@ -214,6 +228,160 @@ module Agentf
214
228
  end
215
229
  end
216
230
 
231
+ s.tool("agentf-memory-by-tag") do
232
+ description "Get memories by tag."
233
+ argument :tag, String, required: true, description: "Tag to filter"
234
+ argument :limit, Integer, required: false, description: "How many results to return (1-100)"
235
+ call do |args|
236
+ mcp_server.send(:guard!, "agentf-memory-by-tag", **args)
237
+ result = reviewer.get_by_tag(args[:tag], limit: args[:limit] || 10)
238
+ JSON.generate(result)
239
+ end
240
+ end
241
+
242
+ s.tool("agentf-memory-by-agent") do
243
+ description "Get memories by agent."
244
+ argument :agent, String, required: true, description: "Agent name"
245
+ argument :limit, Integer, required: false, description: "How many results to return (1-100)"
246
+ call do |args|
247
+ mcp_server.send(:guard!, "agentf-memory-by-agent", **args)
248
+ result = reviewer.get_by_agent(args[:agent], limit: args[:limit] || 10)
249
+ JSON.generate(result)
250
+ end
251
+ end
252
+
253
+ s.tool("agentf-memory-by-type") do
254
+ description "Get memories by type."
255
+ argument :type, String, required: true, description: "Memory type"
256
+ argument :limit, Integer, required: false, description: "How many results to return (1-100)"
257
+ call do |args|
258
+ mcp_server.send(:guard!, "agentf-memory-by-type", **args)
259
+ result = reviewer.get_by_type(args[:type], limit: args[:limit] || 10)
260
+ JSON.generate(result)
261
+ end
262
+ end
263
+
264
+ s.tool("agentf-memory-tags") do
265
+ description "List all unique memory tags."
266
+ call do |args|
267
+ mcp_server.send(:guard!, "agentf-memory-tags", **args)
268
+ result = reviewer.get_all_tags
269
+ JSON.generate(result)
270
+ end
271
+ end
272
+
273
+ s.tool("agentf-memory-pitfalls") do
274
+ description "List pitfall memories."
275
+ argument :limit, Integer, required: false, description: "How many results to return (1-100)"
276
+ call do |args|
277
+ mcp_server.send(:guard!, "agentf-memory-pitfalls", **args)
278
+ result = reviewer.get_pitfalls(limit: args[:limit] || 10)
279
+ JSON.generate(result)
280
+ end
281
+ end
282
+
283
+ s.tool("agentf-memory-lessons") do
284
+ description "List lesson memories."
285
+ argument :limit, Integer, required: false, description: "How many results to return (1-100)"
286
+ call do |args|
287
+ mcp_server.send(:guard!, "agentf-memory-lessons", **args)
288
+ result = reviewer.get_lessons(limit: args[:limit] || 10)
289
+ JSON.generate(result)
290
+ end
291
+ end
292
+
293
+ s.tool("agentf-memory-successes") do
294
+ description "List success memories."
295
+ argument :limit, Integer, required: false, description: "How many results to return (1-100)"
296
+ call do |args|
297
+ mcp_server.send(:guard!, "agentf-memory-successes", **args)
298
+ result = reviewer.get_successes(limit: args[:limit] || 10)
299
+ JSON.generate(result)
300
+ end
301
+ end
302
+
303
+ s.tool("agentf-memory-intents") do
304
+ description "List intents (business|feature)."
305
+ argument :kind, String, required: false, description: "Optional: business|feature"
306
+ argument :limit, Integer, required: false, description: "How many results to return (1-100)"
307
+ call do |args|
308
+ mcp_server.send(:guard!, "agentf-memory-intents", **args)
309
+ kind = args[:kind]
310
+ limit = args[:limit] || 10
311
+ result = case kind
312
+ when "business"
313
+ reviewer.get_business_intents(limit: limit)
314
+ when "feature"
315
+ reviewer.get_feature_intents(limit: limit)
316
+ else
317
+ reviewer.get_intents(limit: limit)
318
+ end
319
+ JSON.generate(result)
320
+ end
321
+ end
322
+
323
+ s.tool("agentf-memory-business-intents") do
324
+ description "List business intents."
325
+ argument :limit, Integer, required: false, description: "How many results to return (1-100)"
326
+ call do |args|
327
+ mcp_server.send(:guard!, "agentf-memory-business-intents", **args)
328
+ result = reviewer.get_business_intents(limit: args[:limit] || 10)
329
+ JSON.generate(result)
330
+ end
331
+ end
332
+
333
+ s.tool("agentf-memory-feature-intents") do
334
+ description "List feature intents."
335
+ argument :limit, Integer, required: false, description: "How many results to return (1-100)"
336
+ call do |args|
337
+ mcp_server.send(:guard!, "agentf-memory-feature-intents", **args)
338
+ result = reviewer.get_feature_intents(limit: args[:limit] || 10)
339
+ JSON.generate(result)
340
+ end
341
+ end
342
+
343
+ s.tool("agentf-memory-add-business-intent") do
344
+ description "Store a business intent in Redis."
345
+ argument :title, String, required: true, description: "Intent title"
346
+ argument :description, String, required: true, description: "Intent description"
347
+ argument :tags, Array, required: false, items: String, description: "Tags"
348
+ argument :constraints, Array, required: false, items: String, description: "Constraints"
349
+ argument :priority, Integer, required: false, description: "Priority"
350
+ call do |args|
351
+ mcp_server.send(:guard!, "agentf-memory-add-business-intent", **args)
352
+ id = memory.store_business_intent(
353
+ title: args[:title],
354
+ description: args[:description],
355
+ tags: args[:tags] || [],
356
+ constraints: args[:constraints] || [],
357
+ priority: args[:priority] || 1
358
+ )
359
+ JSON.generate(id: id, type: "business_intent", status: "stored")
360
+ end
361
+ end
362
+
363
+ s.tool("agentf-memory-add-feature-intent") do
364
+ description "Store a feature intent in Redis."
365
+ argument :title, String, required: true, description: "Intent title"
366
+ argument :description, String, required: true, description: "Intent description"
367
+ argument :tags, Array, required: false, items: String, description: "Tags"
368
+ argument :acceptance, Array, required: false, items: String, description: "Acceptance criteria"
369
+ argument :non_goals, Array, required: false, items: String, description: "Non-goals"
370
+ argument :related_task_id, String, required: false, description: "Related task id"
371
+ call do |args|
372
+ mcp_server.send(:guard!, "agentf-memory-add-feature-intent", **args)
373
+ id = memory.store_feature_intent(
374
+ title: args[:title],
375
+ description: args[:description],
376
+ tags: args[:tags] || [],
377
+ acceptance_criteria: args[:acceptance] || [],
378
+ non_goals: args[:non_goals] || [],
379
+ related_task_id: args[:related_task_id]
380
+ )
381
+ JSON.generate(id: id, type: "feature_intent", status: "stored")
382
+ end
383
+ end
384
+
217
385
  s.tool("agentf-memory-neighbors") do
218
386
  description "Get neighboring memory nodes by edge traversal."
219
387
  argument :node_id, String, required: true, description: "Starting node id"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Agentf
4
- VERSION = "0.4.5"
4
+ VERSION = "0.4.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agentf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neal Deters