Topolo Docs Topolo Platform
Open workspace

Get storage widget

Read the semantic v3 storage widget for the verified Bytes workspace. An empty accessible workspace still returns a valid widget.

Outcome

Read the semantic v3 storage widget for the verified Bytes workspace. An empty accessible workspace still returns a valid widget.

Before you start

  • Verify identity, pin environment and organization, and discover a granted Bytes workspace before choosing file keys.
  • The action requires files:read. Select a verified workspace resource separately from action input; a body field cannot supply a workspace grant.
  • Scope org uses the verified workspace shared root; private uses the caller’s private subtree. The accepted legacy all value resolves to org and does not grant cross-organization browsing. The bucket input cannot switch the configured R2 binding.

Discover the target

topolo whoami --json
topolo actions get app_topolo_bytes.widget.get --detail --json
topolo resources topolo-bytes --json
topolo workspaces list topolo-bytes --json
  • File keys are paths returned by files.list/search in the selected workspace and scope. Discover the granted workspace id; do not derive access from fixture ids.

Request

GET /api/widget

Save action input as payload.json. The reviewed plan separates path identifiers, query fields and the HTTP body. Set BYTES_WORKSPACE_ID from granted resource discovery.

Inspect and test this action in the signed action console. A test response still requires the verification below.

Input fields

Use an empty input object; verified context is separate.

Exact input schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {},
  "additionalProperties": false
}

Effects

  • Reads workspace storage counters.

Interpret the response

This response does not return a guaranteed canonical target identifier. Keep the discovered request context and interpret its documented values without inventing a resource id.

Validate the complete widget against the SDK v3 widget schema; counts reflect the widget builder, not a downloaded inventory.

The schema describes supported success fields; optional metadata and integration-dependent values may vary. Errors have the exact shapes shown in refused examples.

Success schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "const": true
    },
    "contractVersion": {
      "type": "string",
      "const": "3.0.0"
    },
    "appId": {
      "type": "string",
      "minLength": 1
    },
    "serviceName": {
      "type": "string",
      "minLength": 1
    },
    "generatedAt": {
      "type": "string",
      "minLength": 1
    },
    "widgets": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "string",
            "minLength": 1
          },
          "appId": {
            "type": "string",
            "minLength": 1
          },
          "serviceName": {
            "type": "string",
            "minLength": 1
          },
          "lastUpdated": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "enum": [
              "stats",
              "chart",
              "activity",
              "notifications",
              "actions"
            ]
          },
          "presentation": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string",
                "minLength": 1
              },
              "contexts": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "enum": [
                    "personal",
                    "organization",
                    "workspace",
                    "resource"
                  ]
                }
              },
              "supportedSizes": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "enum": [
                    "compact",
                    "medium",
                    "wide",
                    "full"
                  ]
                }
              },
              "defaultSize": {
                "enum": [
                  "compact",
                  "medium",
                  "wide",
                  "full"
                ]
              }
            },
            "required": [
              "title",
              "contexts",
              "supportedSizes",
              "defaultSize"
            ],
            "additionalProperties": false
          },
          "resource": {
            "type": "object",
            "properties": {
              "resourceType": {
                "type": "string",
                "minLength": 1
              },
              "resourceId": {
                "type": "string",
                "minLength": 1
              },
              "requiredPermissions": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "required": [
              "resourceType",
              "requiredPermissions"
            ],
            "additionalProperties": false
          },
          "state": {
            "type": "object",
            "properties": {
              "status": {
                "enum": [
                  "ready",
                  "empty",
                  "unavailable",
                  "stale",
                  "error"
                ]
              },
              "observedAt": {
                "type": "string",
                "minLength": 1
              },
              "lastSuccessfulAt": {
                "type": "string",
                "minLength": 1
              },
              "code": {
                "type": "string",
                "minLength": 1
              },
              "message": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "status",
              "observedAt"
            ],
            "additionalProperties": false
          },
          "refresh": {
            "type": "object",
            "properties": {
              "intervalSeconds": {
                "type": "number"
              },
              "timeoutSeconds": {
                "type": "number"
              },
              "maxAgeSeconds": {
                "type": "number"
              },
              "staleWhileRevalidateSeconds": {
                "type": "number"
              }
            },
            "required": [
              "intervalSeconds",
              "timeoutSeconds",
              "maxAgeSeconds",
              "staleWhileRevalidateSeconds"
            ],
            "additionalProperties": false
          },
          "configuration": {
            "type": "object",
            "properties": {
              "allowMultipleInstances": {
                "type": "boolean"
              },
              "fields": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "minLength": 1
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1
                    },
                    "type": {
                      "enum": [
                        "string",
                        "number",
                        "boolean",
                        "select",
                        "multi-select",
                        "date-range"
                      ]
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "options": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string",
                            "minLength": 1
                          },
                          "label": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "value",
                          "label"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "key",
                    "label",
                    "type",
                    "required"
                  ],
                  "additionalProperties": false
                }
              },
              "defaults": {
                "type": "object"
              }
            },
            "required": [
              "allowMultipleInstances",
              "fields",
              "defaults"
            ],
            "additionalProperties": false
          },
          "drilldowns": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "label": {
                  "type": "string",
                  "minLength": 1
                },
                "href": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "id",
                "label",
                "href"
              ],
              "additionalProperties": false
            }
          },
          "controls": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "label": {
                  "type": "string",
                  "minLength": 1
                },
                "actionId": {
                  "type": "string",
                  "minLength": 1
                },
                "resourceType": {
                  "type": "string",
                  "minLength": 1
                },
                "resourceId": {
                  "type": "string",
                  "minLength": 1
                },
                "input": {
                  "type": "object"
                },
                "requiresConfirmation": {
                  "type": "boolean"
                },
                "destructive": {
                  "type": "boolean"
                },
                "effects": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "verification": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "recovery": {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "enum": [
                        "not_applicable",
                        "retry",
                        "compensating_action"
                      ]
                    },
                    "actionId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "instructions": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "mode",
                    "instructions"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "id",
                "label",
                "actionId",
                "resourceType",
                "input",
                "requiresConfirmation",
                "destructive",
                "effects",
                "verification",
                "recovery"
              ],
              "additionalProperties": false
            }
          },
          "localization": {
            "type": "object",
            "properties": {
              "locale": {
                "type": "string",
                "minLength": 1
              },
              "titleKey": {
                "type": "string",
                "minLength": 1
              },
              "descriptionKey": {
                "type": "string",
                "minLength": 1
              },
              "title": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "locale",
              "titleKey"
            ],
            "additionalProperties": false
          },
          "accessibility": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "label"
            ],
            "additionalProperties": false
          },
          "contribution": {
            "type": "object",
            "properties": {
              "summary": {
                "type": "string",
                "minLength": 1
              },
              "identity": {
                "type": "object",
                "properties": {
                  "iconSource": {
                    "const": "catalog"
                  }
                },
                "required": [
                  "iconSource"
                ],
                "additionalProperties": false
              },
              "workspaceSelector": {
                "type": "object",
                "properties": {
                  "mode": {
                    "enum": [
                      "none",
                      "optional",
                      "required"
                    ]
                  },
                  "resourceType": {
                    "type": "string",
                    "minLength": 1
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1
                  },
                  "supportsMultiple": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "mode",
                  "resourceType",
                  "label",
                  "supportsMultiple"
                ],
                "additionalProperties": false
              },
              "metricDefinitions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "minLength": 1
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1
                    },
                    "unit": {
                      "type": "string",
                      "minLength": 1
                    },
                    "semantic": {
                      "enum": [
                        "gauge",
                        "counter",
                        "rate",
                        "duration",
                        "currency",
                        "percentage"
                      ]
                    },
                    "aggregation": {
                      "enum": [
                        "last",
                        "sum",
                        "average",
                        "minimum",
                        "maximum",
                        "count",
                        "distinct_count"
                      ]
                    }
                  },
                  "required": [
                    "key",
                    "label",
                    "description",
                    "unit",
                    "semantic",
                    "aggregation"
                  ],
                  "additionalProperties": false
                }
              },
              "seriesDefinitions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "minLength": 1
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1
                    },
                    "metricKey": {
                      "type": "string",
                      "minLength": 1
                    },
                    "unit": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "key",
                    "label",
                    "metricKey",
                    "unit"
                  ],
                  "additionalProperties": false
                }
              },
              "dimensions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "minLength": 1
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1
                    },
                    "valueType": {
                      "enum": [
                        "string",
                        "number",
                        "boolean",
                        "date",
                        "datetime"
                      ]
                    }
                  },
                  "required": [
                    "key",
                    "label",
                    "description",
                    "valueType"
                  ],
                  "additionalProperties": false
                }
              },
              "lifecycleStages": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "minLength": 1
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1
                    },
                    "order": {
                      "type": "number"
                    },
                    "terminal": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "key",
                    "label",
                    "order",
                    "terminal"
                  ],
                  "additionalProperties": false
                }
              },
              "events": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "minLength": 1
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "key",
                    "label",
                    "description"
                  ],
                  "additionalProperties": false
                }
              },
              "datasets": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1
                    },
                    "grain": {
                      "type": "string",
                      "minLength": 1
                    },
                    "metricKeys": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "seriesKeys": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "dimensionKeys": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "eventKeys": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "actionIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      }
                    }
                  },
                  "required": [
                    "id",
                    "label",
                    "description",
                    "grain",
                    "metricKeys",
                    "seriesKeys",
                    "dimensionKeys",
                    "eventKeys",
                    "actionIds"
                  ],
                  "additionalProperties": false
                }
              },
              "compatibleVisualizations": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "enum": [
                    "number",
                    "line",
                    "area",
                    "bar",
                    "donut",
                    "table",
                    "funnel",
                    "timeline",
                    "actions"
                  ]
                }
              },
              "defaultVisualization": {
                "enum": [
                  "number",
                  "line",
                  "area",
                  "bar",
                  "donut",
                  "table",
                  "funnel",
                  "timeline",
                  "actions"
                ]
              }
            },
            "required": [
              "summary",
              "identity",
              "workspaceSelector",
              "metricDefinitions",
              "seriesDefinitions",
              "dimensions",
              "lifecycleStages",
              "events",
              "datasets",
              "compatibleVisualizations",
              "defaultVisualization"
            ],
            "additionalProperties": false
          },
          "metrics": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "minLength": 1
                },
                "label": {
                  "type": "string",
                  "minLength": 1
                },
                "value": {
                  "type": "number"
                },
                "unit": {
                  "type": "string",
                  "minLength": 1
                },
                "semantic": {
                  "enum": [
                    "gauge",
                    "counter",
                    "rate",
                    "duration",
                    "currency",
                    "percentage"
                  ]
                },
                "aggregation": {
                  "enum": [
                    "last",
                    "sum",
                    "average",
                    "minimum",
                    "maximum",
                    "count",
                    "distinct_count"
                  ]
                },
                "period": {
                  "type": "object",
                  "properties": {
                    "start": {
                      "type": "string",
                      "minLength": 1
                    },
                    "end": {
                      "type": "string",
                      "minLength": 1
                    },
                    "timezone": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "start",
                    "end",
                    "timezone"
                  ],
                  "additionalProperties": false
                },
                "dimensions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string",
                        "minLength": 1
                      },
                      "label": {
                        "type": "string",
                        "minLength": 1
                      },
                      "value": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "key",
                      "label",
                      "value"
                    ],
                    "additionalProperties": false
                  }
                },
                "series": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1
                    },
                    "unit": {
                      "type": "string",
                      "minLength": 1
                    },
                    "points": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "timestamp": {
                            "type": "string",
                            "minLength": 1
                          },
                          "value": {
                            "type": "number"
                          },
                          "dimensions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "key": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "label": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "value": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "key",
                                "label",
                                "value"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "timestamp",
                          "value",
                          "dimensions"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "id",
                    "label",
                    "unit",
                    "points"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "key",
                "label",
                "value",
                "unit",
                "semantic",
                "aggregation",
                "period",
                "dimensions"
              ],
              "additionalProperties": false
            }
          },
          "chartType": {
            "enum": [
              "line",
              "bar",
              "area",
              "pie",
              "donut"
            ]
          },
          "series": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "label": {
                  "type": "string",
                  "minLength": 1
                },
                "unit": {
                  "type": "string",
                  "minLength": 1
                },
                "points": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "string",
                        "minLength": 1
                      },
                      "value": {
                        "type": "number"
                      },
                      "dimensions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string",
                              "minLength": 1
                            },
                            "label": {
                              "type": "string",
                              "minLength": 1
                            },
                            "value": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "key",
                            "label",
                            "value"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "timestamp",
                      "value",
                      "dimensions"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "id",
                "label",
                "unit",
                "points"
              ],
              "additionalProperties": false
            }
          },
          "activities": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "notifications": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "unreadCount": {
            "type": "number"
          },
          "actions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "label": {
                  "type": "string",
                  "minLength": 1
                },
                "actionId": {
                  "type": "string",
                  "minLength": 1
                },
                "resourceType": {
                  "type": "string",
                  "minLength": 1
                },
                "resourceId": {
                  "type": "string",
                  "minLength": 1
                },
                "input": {
                  "type": "object"
                },
                "requiresConfirmation": {
                  "type": "boolean"
                },
                "destructive": {
                  "type": "boolean"
                },
                "effects": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "verification": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "recovery": {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "enum": [
                        "not_applicable",
                        "retry",
                        "compensating_action"
                      ]
                    },
                    "actionId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "instructions": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "mode",
                    "instructions"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "id",
                "label",
                "actionId",
                "resourceType",
                "input",
                "requiresConfirmation",
                "destructive",
                "effects",
                "verification",
                "recovery"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "version",
          "appId",
          "serviceName",
          "lastUpdated",
          "type",
          "presentation",
          "resource",
          "state",
          "refresh",
          "configuration",
          "drilldowns",
          "controls",
          "localization",
          "accessibility",
          "contribution"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "type": {
                  "const": "stats"
                }
              }
            },
            "then": {
              "required": [
                "metrics"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "chart"
                }
              }
            },
            "then": {
              "required": [
                "chartType",
                "series"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "activity"
                }
              }
            },
            "then": {
              "required": [
                "activities"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "notifications"
                }
              }
            },
            "then": {
              "required": [
                "notifications",
                "unreadCount"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "actions"
                }
              }
            },
            "then": {
              "required": [
                "actions"
              ]
            }
          }
        ],
        "additionalProperties": false
      }
    },
    "workspace": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                }
              ]
            },
            "name": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "id",
            "name"
          ],
          "additionalProperties": true
        },
        {
          "type": "null"
        }
      ]
    },
    "workspaces": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "isDefault": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "success",
    "contractVersion",
    "appId",
    "serviceName",
    "generatedAt",
    "widgets"
  ],
  "additionalProperties": false
}

Worked examples

Actual exported Worker handlers with local Miniflare R2/KV. Auth, workspace grants, R2 multipart, notification, usage and semantic integrations are simulated at their configured test boundaries. Synthetic ids, timestamps and signed URLs confer no live access. No deployed provider outcome, external delivery or live grant is established. Upload-session credential values are explicitly redacted; binary responses use the tested SDK transport envelope. Replace synthetic identifiers through credential-scoped discovery. Refused scenarios document failure boundaries; they are not successful workflows.

Successful request

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{}

CLI:

topolo actions validate app_topolo_bytes.widget.get --data @payload.json --json
topolo actions plan app_topolo_bytes.widget.get --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_bytes.widget.get --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json

MCP tool and arguments:

{
  "tool": "topolo_read_action",
  "arguments": {
    "actionId": "app_topolo_bytes.widget.get",
    "input": {},
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>"
  }
}

Captured local response · HTTP 200:

{
  "success": true,
  "contractVersion": "3.0.0",
  "appId": "app_test",
  "serviceName": "Bytes",
  "generatedAt": "2026-10-04T01:57:56.294Z",
  "widgets": [
    {
      "id": "bytes.workspace-storage",
      "version": "3.0.0",
      "type": "stats",
      "presentation": {
        "title": "Bytes workspace storage",
        "description": "Bytes is reporting authenticated workspace storage activity.",
        "contexts": [
          "workspace"
        ],
        "supportedSizes": [
          "compact",
          "medium",
          "wide"
        ],
        "defaultSize": "medium"
      },
      "resource": {
        "resourceType": "workspace",
        "resourceId": "none",
        "requiredPermissions": [
          "files:read"
        ]
      },
      "state": {
        "status": "empty",
        "observedAt": "2026-10-04T01:57:56.294Z",
        "lastSuccessfulAt": "2026-10-04T01:57:56.294Z",
        "code": "no_workspace_selected",
        "message": "Select a Bytes workspace to see its storage."
      },
      "refresh": {
        "intervalSeconds": 60,
        "timeoutSeconds": 10,
        "maxAgeSeconds": 60,
        "staleWhileRevalidateSeconds": 120
      },
      "configuration": {
        "allowMultipleInstances": true,
        "fields": [
          {
            "key": "metricKeys",
            "label": "Metrics",
            "type": "multi-select",
            "required": true,
            "options": [
              {
                "value": "total_files",
                "label": "Total Files"
              },
              {
                "value": "storage_used",
                "label": "Storage Used"
              },
              {
                "value": "images",
                "label": "Images"
              },
              {
                "value": "videos",
                "label": "Videos"
              },
              {
                "value": "other_files",
                "label": "Other Files"
              },
              {
                "value": "listed_objects",
                "label": "Listed Objects"
              }
            ]
          }
        ],
        "defaults": {
          "metricKeys": [
            "total_files",
            "storage_used",
            "images",
            "videos",
            "other_files",
            "listed_objects"
          ]
        }
      },
      "drilldowns": [
        {
          "id": "browse",
          "label": "Browse files",
          "href": "/browse"
        },
        {
          "id": "getting-started",
          "label": "View Bytes getting started",
          "href": "/getting-started"
        }
      ],
      "controls": [],
      "localization": {
        "locale": "en",
        "titleKey": "bytes.api.widget.title",
        "descriptionKey": "bytes.api.widget.summary"
      },
      "accessibility": {
        "label": "Bytes workspace storage metrics",
        "description": "Bytes is reporting authenticated workspace storage activity."
      },
      "contribution": {
        "summary": "Workspace-scoped file inventory, media mix, and storage consumption.",
        "identity": {
          "iconSource": "catalog"
        },
        "workspaceSelector": {
          "mode": "required",
          "resourceType": "workspace",
          "label": "Bytes workspace",
          "supportsMultiple": false
        },
        "metricDefinitions": [
          {
            "key": "total_files",
            "label": "Total Files",
            "description": "Files stored in the selected Bytes workspace.",
            "unit": "count",
            "semantic": "gauge",
            "aggregation": "last"
          },
          {
            "key": "storage_used",
            "label": "Storage Used",
            "description": "Storage consumed by files in the selected Bytes workspace.",
            "unit": "megabytes",
            "semantic": "gauge",
            "aggregation": "last"
          },
          {
            "key": "images",
            "label": "Images",
            "description": "Image files stored in the selected Bytes workspace.",
            "unit": "count",
            "semantic": "gauge",
            "aggregation": "last"
          },
          {
            "key": "videos",
            "label": "Videos",
            "description": "Video files stored in the selected Bytes workspace.",
            "unit": "count",
            "semantic": "gauge",
            "aggregation": "last"
          },
          {
            "key": "other_files",
            "label": "Other Files",
            "description": "Non-image and non-video files stored in the selected Bytes workspace.",
            "unit": "count",
            "semantic": "gauge",
            "aggregation": "last"
          },
          {
            "key": "listed_objects",
            "label": "Listed Objects",
            "description": "Storage objects inspected while calculating the workspace metrics.",
            "unit": "count",
            "semantic": "counter",
            "aggregation": "sum"
          }
        ],
        "seriesDefinitions": [],
        "dimensions": [
          {
            "key": "workspace_scope",
            "label": "Bytes workspace",
            "description": "The Bytes workspace whose storage objects are included.",
            "valueType": "string"
          },
          {
            "key": "media_type",
            "label": "Media type",
            "description": "The file category represented by an inventory metric.",
            "valueType": "string"
          }
        ],
        "lifecycleStages": [],
        "events": [],
        "datasets": [
          {
            "id": "storage_inventory",
            "label": "Storage inventory",
            "description": "File totals, media mix, and storage consumption for the selected workspace.",
            "grain": "One aggregate row per Bytes workspace and media type.",
            "metricKeys": [
              "total_files",
              "storage_used",
              "images",
              "videos",
              "other_files",
              "listed_objects"
            ],
            "seriesKeys": [],
            "dimensionKeys": [
              "workspace_scope",
              "media_type"
            ],
            "eventKeys": [],
            "actionIds": []
          }
        ],
        "compatibleVisualizations": [
          "number",
          "bar",
          "table"
        ],
        "defaultVisualization": "bar"
      },
      "metrics": [
        {
          "key": "total_files",
          "label": "Total Files",
          "value": 0,
          "unit": "count",
          "semantic": "gauge",
          "aggregation": "last",
          "period": {
            "start": "2026-10-04T01:57:56.294Z",
            "end": "2026-10-04T01:57:56.294Z",
            "timezone": "UTC"
          },
          "dimensions": []
        },
        {
          "key": "storage_used",
          "label": "Storage Used",
          "value": 0,
          "unit": "megabytes",
          "semantic": "gauge",
          "aggregation": "last",
          "period": {
            "start": "2026-10-04T01:57:56.294Z",
            "end": "2026-10-04T01:57:56.294Z",
            "timezone": "UTC"
          },
          "dimensions": []
        },
        {
          "key": "images",
          "label": "Images",
          "value": 0,
          "unit": "count",
          "semantic": "gauge",
          "aggregation": "last",
          "period": {
            "start": "2026-10-04T01:57:56.294Z",
            "end": "2026-10-04T01:57:56.294Z",
            "timezone": "UTC"
          },
          "dimensions": []
        },
        {
          "key": "videos",
          "label": "Videos",
          "value": 0,
          "unit": "count",
          "semantic": "gauge",
          "aggregation": "last",
          "period": {
            "start": "2026-10-04T01:57:56.294Z",
            "end": "2026-10-04T01:57:56.294Z",
            "timezone": "UTC"
          },
          "dimensions": []
        },
        {
          "key": "other_files",
          "label": "Other Files",
          "value": 0,
          "unit": "count",
          "semantic": "gauge",
          "aggregation": "last",
          "period": {
            "start": "2026-10-04T01:57:56.294Z",
            "end": "2026-10-04T01:57:56.294Z",
            "timezone": "UTC"
          },
          "dimensions": []
        },
        {
          "key": "listed_objects",
          "label": "Listed Objects",
          "value": 0,
          "unit": "count",
          "semantic": "counter",
          "aggregation": "sum",
          "period": {
            "start": "2026-10-04T01:57:56.294Z",
            "end": "2026-10-04T01:57:56.294Z",
            "timezone": "UTC"
          },
          "dimensions": []
        }
      ],
      "appId": "app_test",
      "serviceName": "Bytes",
      "lastUpdated": "2026-10-04T01:57:56.294Z"
    }
  ]
}

HTTP 200. Validate the complete widget against the SDK v3 widget schema; counts reflect the widget builder, not a downloaded inventory.

Refused request · HTTP 401

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{}

CLI:

topolo actions validate app_topolo_bytes.widget.get --data @payload.json --json
topolo actions plan app_topolo_bytes.widget.get --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 401:

{
  "error": "No token"
}

HTTP 401. This request was refused; preserve the exact response and correct its cause before retrying.

Verify the result

  • Validate the complete widget against the SDK v3 widget schema; counts reflect the widget builder, not a downloaded inventory.

Errors and recovery

  • No token (HTTP 401): Refresh the authorized credential in the same environment and organization. A failed authentication is not a successful handler effect.

Authentication, the action-input validator or resource middleware can refuse a request before this handler. Preserve the exact request id, error and selected credential context. The fixtures establish no live credentials or configured provider.

Recovery boundary

No service state changes.

Evidence

Actual exported Worker handlers with local Miniflare R2/KV. Auth, workspace grants, R2 multipart, notification, usage and semantic integrations are simulated at their configured test boundaries. Synthetic ids, timestamps and signed URLs confer no live access. No deployed provider outcome, external delivery or live grant is established. Upload-session credential values are explicitly redacted; binary responses use the tested SDK transport envelope. Capture digests and test scenarios are retained in the source fixture records.