{
  "$schema": "https://gismap.online/schemas/agent-recipe-v1.schema.json",
  "schemaVersion": 1,
  "id": "si-publishing",
  "title": "Publish a Brief from GISMap SI with AI Map (GISMap SI alpha)",
  "status": "experimental",
  "question": "Can an AI agent help turn data stored in GISMap SI into a published, verified Brief?",
  "answer": "Partly, by design. An agent can hand the person a GISMap SI draft: the /m/<id>?app=ai-map link that GISMap SI returns when it creates one. The person signs in to GISMap SI, builds the Brief with AI Map and presses Publish; GISMap SI then verifies the share link. The agent never handles the person's GISMap SI connection, and nothing publishes without the person. Needs GISMap SI alpha access while its connection tokens and public links are off for everyone else.",
  "triggers": [
    "Make a Brief from our inspections dataset in GISMap SI and publish it",
    "Open this GISMap SI dataset in AI Map",
    "Publish this GISMap SI map for the meeting, with the figures frozen",
    "Check that the published Brief still works"
  ],
  "inputTypes": [
    "A dataset stored in GISMap SI with a public FeatureServer link",
    "A GISMap SI draft (/m/<id>)",
    "A publication share link (/m/<id>?p=<publication>)"
  ],
  "inputs": {
    "required": [
      {
        "name": "draft",
        "description": "The draft's editUrl from GISMap SI (gismap.online/m/<id>?app=ai-map), created by the person in Stored Intel or by an SI tool that already holds their session. It carries only the map's id: no token and no private dataset id."
      }
    ],
    "optional": [
      {
        "name": "request",
        "description": "What the Brief should cover, in the person's words; AI Map reads it from the draft's context."
      },
      {
        "name": "dataMode",
        "description": "live (figures recompute when the Brief plays) or pinned (figures frozen and shown as of the publishing date). The person chooses in the Publish panel."
      }
    ]
  },
  "capabilities": [
    "mapSpec",
    "briefing"
  ],
  "engines": [
    "maplibre",
    "arcgis"
  ],
  "steps": [
    {
      "stage": "discover",
      "action": "Read llms.txt, this recipe and api/capabilities.json; note the engine and execution environment you actually have.",
      "interfaces": [
        "declarative-url"
      ],
      "references": [
        "https://gismap.online/llms.txt",
        "https://gismap.online/api/capabilities.json",
        "https://gismap.online/api/manifest.json"
      ]
    },
    {
      "stage": "plan",
      "action": "Confirm every dataset has a public FeatureServer link. GISMap SI refuses a draft otherwise (409 needs_public_link, with canPublish per dataset): tell the person that an owner or admin publishes the dataset in GISMap SI first. Never work around it.",
      "interfaces": [
        "external-adapter"
      ],
      "references": [
        "https://gismap.online/discover/ai/publish-with-gismap-si/"
      ]
    },
    {
      "stage": "execute",
      "action": "Give the person the draft's /m/<id>?app=ai-map link. They sign in to GISMap SI in the popup it offers; the connection stays in their browser tab. Never ask for, copy or put a GISMap SI token in a link, file or message.",
      "interfaces": [
        "declarative-url"
      ],
      "references": [
        "gismap.online/m/<id>?app=ai-map"
      ]
    },
    {
      "stage": "execute",
      "action": "Inside AI Map the assistant has the draft's GISMap SI context as reference data and the si_dataset_context, si_add_dataset and si_find_datasets tools; it builds the Brief with describe_layer, summarize_field and create_briefing and finishes with si_publish_preview, which only opens the Publish panel.",
      "interfaces": [
        "in-browser-api"
      ],
      "references": [
        "create_briefing",
        "si_publish_preview"
      ]
    },
    {
      "stage": "share",
      "action": "The person reviews the audience (anyone with the link), live or pinned, the layers and the figures, and presses Publish. The share link is /m/<id>?p=<publication>, opened in the viewer without signing in.",
      "interfaces": [
        "declarative-url"
      ],
      "references": [
        "gismap.online/m/<id>?p=<publication>"
      ]
    },
    {
      "stage": "verify",
      "action": "Read the verification report shown in the Publish panel (or si_verify in AI Map): status passed, warning or failed, and each check's message as written. External layers are reported as not_checked. Report what was checked and what was not.",
      "interfaces": [
        "in-browser-api"
      ],
      "references": [
        "si_verify"
      ]
    }
  ],
  "artifact": {
    "type": "briefing",
    "schema": "https://gismap.online/schemas/map-v1.schema.json",
    "structure": "A GISMap SI saved map of kind brief: map state plus briefing slides, with optional pinned figures on stat blocks; viewers read one published version."
  },
  "outputs": [
    {
      "format": "Editable draft for the workspace (/m/<id>)",
      "interface": "declarative-url",
      "interactive": true,
      "notes": "Members of the GISMap SI workspace only; needs sign-in."
    },
    {
      "format": "Verified share link (/m/<id>?p=<publication>)",
      "interface": "declarative-url",
      "interactive": true,
      "notes": "Anyone with the link, once GISMap SI's public links are on."
    }
  ],
  "verification": [
    "The draft opens in AI Map with the datasets on the map",
    "Every slide field exists in the layer (describe_layer)",
    "No invented figures: stat blocks or summarize_field only",
    "The person pressed Publish; the report's status and each check message are passed on as written",
    "The share link opens in the viewer without signing in"
  ],
  "limitations": [
    "GISMap SI alpha only: connection tokens and public share links are switched on for allowlisted people; everyone else gets the sign-in prompt or a not-found page.",
    "The only audience is anyone with the link; team-only and named-viewer links come later.",
    "Layers keep the data their FeatureServer links serve; a live publication recomputes figures but does not follow newer data yet.",
    "No tool publishes: an agent can prepare and open the Publish panel, but the person presses Publish.",
    "Maps and Briefs only; Tours and Cinematic animations are not published yet."
  ],
  "recovery": [
    "\"Sign in to GISMap SI\": the connection expired (after eight hours) or was revoked; the person signs in again.",
    "\"A newer version of this map exists\" (409): someone else saved; reload the map before publishing.",
    "Plan limit (402): the workspace has reached its maximum; the owner upgrades or deletes old maps in GISMap SI.",
    "A dataset with no public link: an owner or admin publishes it in GISMap SI; others ask one.",
    "Verification failed: read each failed check, fix that layer or field, save and publish again."
  ],
  "examples": [
    {
      "checkedOn": "2026-11-17",
      "checkedVersion": "0.54.0",
      "title": "From an inspections dataset to a pinned Brief",
      "prompt": "Make a three-slide Brief about open inspections from our GISMap SI dataset, pin the figures for Thursday's meeting, and publish it.",
      "dataset": [
        {
          "label": "A dataset in your GISMap SI workspace",
          "url": "https://gismap.si/"
        }
      ],
      "page": "https://gismap.online/discover/ai/publish-with-gismap-si/",
      "status": "prepared",
      "checks": [
        "Checked against a local stand-in for GISMap SI: the draft loaded, saved with If-Match, published as pinned and opened in the viewer without a token.",
        "Not yet checked against live GISMap SI, whose connection tokens and public links are off during the alpha.",
        "The sign-in popup and the full AI Map tool loop have not been run end to end."
      ]
    }
  ],
  "lastTestedVersion": "0.53.0",
  "resultStatuses": [
    "prepared",
    "validated",
    "loaded",
    "rendered",
    "verified",
    "partial",
    "failed"
  ]
}
