Explorer

definy.mcp-project-text

description
The text of the definy_get_project tool
type
Fn(
  commit: @definy.event-snapshot,
  parts: List<@definy.snapshot-check-part>,
  names: List<Record{id: String, name: String}>
) -> String
expression
fn(commit$0, parts$1, names$2) =>
  @std.string-join(
    items: @core.list-concat(
      left: [
        @std.string-join(
          items: [
            "project ",
            $0.commit.project_name,
            ", branch ",
            $0.commit.branch,
            ", snapshot ",
            $0.event_hash,
            ", modules: ",
            @std.string-join(
              items: @core.list-map(
                T: @definy.stored-snapshot-module,
                U: String,
                f: fn(item$3) =>
                  $3.name,
                xs: $0.commit.modules
              ),
              separator: ", "
            ),
            "\nEach line is a part and its type. Use definy_get_part for the expression."
          ],
          separator: ""
        )
      ],
      right: @core.list-map(
        T: @definy.snapshot-check-part,
        U: String,
        f: fn(item$4) =>
          @std.string-join(
            items: [
              $4.name,
              ": ",
              match $4.content {
                #none(_) =>
                  "(content not resolved)",
                #some(content$5) =>
                  @std.string-join(
                    items: [
                      match $5.part_type {
                        #none(_) =>
                          "(no type)",
                        #some(type$6) =>
                          @definy.expression-text(expression: $6, indent: "  ", names: $2)
                      },
                      match @core.equal(left: @core.list-length(value: $5.description), right: 0) {
                        true =>
                          "",
                        false =>
                          @core.string-concat(left: "  // ", right: @definy.localized-texts-text(texts: $5.description))
                      }
                    ],
                    separator: ""
                  )
              }
            ],
            separator: ""
          ),
        xs: $1
      )
    ),
    separator: "\n"
  )
visibility
public
definy.mcp-project-text (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: g808PFKZHMzrSLmpojDLQ64enSHvqG_1HumRWDOlvyk
content hash: HeM2LqXhFWQjb5cncgpd8QTzWP9jejewlDAAYoqNiwQ