type: team
name: update
alias:
  - up
description: Update specific documents and their translations. Use --diagram to filter and select documents with diagrams, or --diagram-all to auto-update all diagrams.
skills:
  - url: ../init/index.mjs
    default_input:
      skipIfExists: true
      checkOnly: true
  - url: ../init/check.mjs
  - ../utils/load-sources.mjs
  - type: transform
    task_render_mode: hide
    jsonata: |
      $merge([
        $,
        {
          'documentStructure': originalDocumentStructure
        }
      ])
  # Check if --diagram or --diagram-all flag is set
  - url: ../update/check-diagram-flag.mjs
  - url: ../utils/choose-docs.mjs
    default_input:
      requiredFeedback: false
  - ../utils/format-document-structure.mjs
  - ../utils/ensure-document-icons.mjs
  - ../media/load-media-description.mjs
  - ../update/check-update-is-single.mjs
  - ../update/save-and-translate-document.mjs
  - url: ../utils/action-success.mjs
    default_input:
      action: "✅ Documents updated successfully!\n💡 Looks good? Run `aigne doc publish` to go live."
input_schema:
  type: object
  properties:
    glossary:
      type: string
      description: Glossary file for consistent terminology (use @filename.md)
    docs:
      type: array
      items:
        type: string
      description: Documents to update
    feedback:
      type: string
      description: Tell us what to change in this content
    reset:
      type: boolean
      description: Start fresh - ignore previous versions
    diagram:
      type: ["boolean", "string"]
      description: "Flag to update diagrams: true for user selection (can also use --diagram CLI arg)"
    "diagram-all":
      type: ["boolean", "string"]
      description: "Flag to auto-select all documents with diagrams (can also use --diagram-all CLI arg)"
output_schema:
  type: object
  properties:
    title:
      type: string
    description:
      type: string
    path:
      type: string
    content:
      type: string
mode: sequential
