···44 "defs": {
55 "main": {
66 "type": "procedure",
77- "description": "like calling an xrpc query directly, but the response comes back with a stats sidecar: aggregate counts (stars, follows, issues...) for every did / at-uri / strong-ref found in the response. counts are computed synchronously from the server's local index, so there are no pending states to resolve later. any GET query the server implements can be hydrated, including queries it proxies elsewhere.",
77+ "description": "Run an XRPC query and hydrate its response with a data sidecar: typed payloads for every did / at-uri / strong-ref found in the response.",
88 "input": {
99 "encoding": "application/json",
1010 "schema": {
1111 "type": "object",
1212- "required": [
1313- "xrpc",
1414- "enrich"
1515- ],
1212+ "required": ["xrpc", "enrich"],
1613 "properties": {
1714 "xrpc": {
1815 "type": "string",
···2926 "type": "ref",
3027 "ref": "#linkDescriptor"
3128 },
3232- "description": "Counts to compute for each found reference. A descriptor only applies to references it can meaningfully point at: a did can carry author-side counts (.repo), an at-uri can carry subject-side counts."
2929+ "description": "Payloads to compute for each found reference."
3330 },
3431 "sources": {
3532 "type": "array",
3633 "items": {
3734 "type": "string"
3835 },
3939- "description": "RecordPaths into the inner response restricting which references get counted. When omitted, every did / at-uri / strong-ref in the response is counted. Paths that match nothing yield empty stats rather than an error."
3636+ "description": "Record paths into the inner response restricting which references get payloads. All references are enriched when omitted."
4037 },
4138 "viewer": {
4239 "type": "string",
4340 "format": "did",
4444- "description": "DID whose own relation to each reference is looked up for viewer-type descriptors, e.g. whether this did starred the found repo and with which record. Required when any enrich descriptor uses type viewer."
4141+ "description": "DID whose own relation to each reference is looked up for viewer payloads. Required when any descriptor requests one."
4542 }
4643 }
4744 }
···5047 "encoding": "application/json",
5148 "schema": {
5249 "type": "object",
5353- "required": [
5454- "output",
5555- "stats"
5656- ],
5050+ "required": ["output", "data"],
5751 "properties": {
5852 "output": {
5953 "type": "unknown",
6054 "description": "The inner query's response, unmodified."
6155 },
6262- "stats": {
5656+ "data": {
6357 "type": "unknown",
6464- "description": "Reference value (did or at-uri) -> link source (echoed verbatim from the request) -> aggregation results. Example: stats[\"did:plc:...\"][\"sh.tangled.graph.follow:subject\"] = {\"count\": 12, \"distinctAuthors\": 11}."
5858+ "description": "Reference (did or at-uri) -> link source -> payload type nsid -> payload. References no descriptor applies to are absent."
6559 }
6660 }
6761 }
···6963 "errors": [
7064 {
7165 "name": "UnknownQuery",
7272- "description": "The xrpc parameter does not name a query this server can execute."
6666+ "description": "The xrpc parameter does not name a query this server can execute"
7367 },
7468 {
7569 "name": "InvalidSourcePath",
7676- "description": "A sources entry is not valid RecordPath syntax."
7070+ "description": "A sources entry is not a valid record path"
7771 },
7872 {
7973 "name": "InvalidLinkDescriptor",
8080- "description": "An enrich entry names an unknown collection, or a path the server's index does not support."
7474+ "description": "An enrich entry names an unknown payload type, collection, or path"
8175 }
8276 ]
8377 },
8478 "linkDescriptor": {
8579 "type": "object",
8686- "required": [
8787- "source",
8888- "type"
8989- ],
9090- "description": "one aggregate count: records whose reference field equals the found reference, addressed by a constellation-style link source (\"collection:recordpath\"). envelope paths (.repo etc.) address the record's own metadata instead of its contents.",
8080+ "required": ["source", "type"],
8181+ "description": "One sidecar payload, computed from the records at a link source whose reference equals the found reference.",
9182 "properties": {
9283 "source": {
9384 "type": "string",
9494- "description": "Link source: the collection whose records are counted, a colon, then a RecordPath naming the reference field (e.g. sh.tangled.feed.star:subject, sh.tangled.feed.star:subject.uri), or an envelope field: .repo (authoring repo), .collection, .rkey, or bare . (the record's own at-uri)."
8585+ "description": "Collection whose records are linked, a colon, then an index-backed path (subject or .repo)."
9586 },
9687 "type": {
9788 "type": "string",
9898- "knownValues": ["count", "distinctAuthors", "viewer"],
9999- "description": "What to compute over matching records: how many records (count), how many distinct authors (distinctAuthors), or the viewer's own record among the matches (viewer, requires the top-level viewer param). Results land in the stats sidecar at stats[ref][source][type]."
8989+ "knownValues": [
9090+ "sh.tangled.query.enrichResponse#count",
9191+ "sh.tangled.query.enrichResponse#distinctAuthors",
9292+ "sh.tangled.query.enrichResponse#viewer",
9393+ "com.bad-example.identity.miniDoc"
9494+ ],
9595+ "description": "NSID of the payload type to produce, which also defines the payload's shape. Results land at data[ref][source][type]."
10096 }
10197 }
10298 }
···11+export * as ShTangledActorDefs from "./types/sh/tangled/actor/defs.js";
12export * as ShTangledActorGetProfile from "./types/sh/tangled/actor/getProfile.js";
23export * as ShTangledActorGetProfiles from "./types/sh/tangled/actor/getProfiles.js";
34export * as ShTangledActorProfile from "./types/sh/tangled/actor/profile.js";
···1617export * as ShTangledFeedCountStars from "./types/sh/tangled/feed/countStars.js";
1718export * as ShTangledFeedCountStarsBy from "./types/sh/tangled/feed/countStarsBy.js";
1819export * as ShTangledFeedGetStar from "./types/sh/tangled/feed/getStar.js";
2020+export * as ShTangledFeedGetTimeline from "./types/sh/tangled/feed/getTimeline.js";
1921export * as ShTangledFeedListComments from "./types/sh/tangled/feed/listComments.js";
2022export * as ShTangledFeedListCommentsBy from "./types/sh/tangled/feed/listCommentsBy.js";
2123export * as ShTangledFeedListReactions from "./types/sh/tangled/feed/listReactions.js";
···116118export * as ShTangledRepoCountPullsBy from "./types/sh/tangled/repo/countPullsBy.js";
117119export * as ShTangledRepoCountRepos from "./types/sh/tangled/repo/countRepos.js";
118120export * as ShTangledRepoCreate from "./types/sh/tangled/repo/create.js";
121121+export * as ShTangledRepoDefs from "./types/sh/tangled/repo/defs.js";
119122export * as ShTangledRepoDelete from "./types/sh/tangled/repo/delete.js";
120123export * as ShTangledRepoDeleteBranch from "./types/sh/tangled/repo/deleteBranch.js";
121124export * as ShTangledRepoDescribeRepo from "./types/sh/tangled/repo/describeRepo.js";
···77 /*#__PURE__*/ v.literal("sh.tangled.query.enrichResponse#linkDescriptor"),
88 ),
99 /**
1010- * Link source: the collection whose records are counted, a colon, then a RecordPath naming the reference field (e.g. sh.tangled.feed.star:subject, sh.tangled.feed.star:subject.uri), or an envelope field: .repo (authoring repo), .collection, .rkey, or bare . (the record's own at-uri).
1010+ * Link source: collection whose records are linked, a colon, then an index-backed path (subject or .repo).
1111 */
1212 source: /*#__PURE__*/ v.string(),
1313 /**
1414- * What to compute over matching records: how many records (count), how many distinct authors (distinctAuthors), or the viewer's own record among the matches (viewer, requires the top-level viewer param). Results land in the stats sidecar at stats[ref][source][type].
1414+ * NSID of the payload type to produce, which also defines the payload's shape. Results land at data[ref][source][type].
1515 */
1616 type: /*#__PURE__*/ v.string<
1717- "count" | "distinctAuthors" | "viewer" | (string & {})
1717+ | "com.bad-example.identity.miniDoc"
1818+ | "sh.tangled.query.enrichResponse#count"
1919+ | "sh.tangled.query.enrichResponse#distinctAuthors"
2020+ | "sh.tangled.query.enrichResponse#viewer"
2121+ | (string & {})
1822 >(),
1923});
2024const _mainSchema = /*#__PURE__*/ v.procedure(
···2529 type: "lex",
2630 schema: /*#__PURE__*/ v.object({
2731 /**
2828- * Counts to compute for each found reference. A descriptor only applies to references it can meaningfully point at: a did can carry author-side counts (.repo), an at-uri can carry subject-side counts.
3232+ * Payloads to compute for each found reference.
2933 */
3034 get enrich() {
3135 return /*#__PURE__*/ v.array(linkDescriptorSchema);
···3539 */
3640 params: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.unknown()),
3741 /**
3838- * RecordPaths into the inner response restricting which references get counted. When omitted, every did / at-uri / strong-ref in the response is counted. Paths that match nothing yield empty stats rather than an error.
4242+ * Record paths into the inner response restricting which references get payloads. All references are enriched when omitted.
3943 */
4044 sources: /*#__PURE__*/ v.optional(
4145 /*#__PURE__*/ v.array(/*#__PURE__*/ v.string()),
4246 ),
4347 /**
4444- * DID whose own relation to each reference is looked up for viewer-type descriptors, e.g. whether this did starred the found repo and with which record. Required when any enrich descriptor uses type viewer.
4848+ * DID whose own relation to each reference is looked up for viewer payloads. Required when any descriptor requests one.
4549 */
4650 viewer: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.didString()),
4751 /**
···5458 type: "lex",
5559 schema: /*#__PURE__*/ v.object({
5660 /**
5757- * The inner query's response, unmodified.
6161+ * Reference (did or at-uri) -> link source -> payload type nsid -> payload. References no descriptor applies to are absent.
5862 */
5959- output: /*#__PURE__*/ v.unknown(),
6363+ data: /*#__PURE__*/ v.unknown(),
6064 /**
6161- * Reference value (did or at-uri) -> link source (echoed verbatim from the request) -> aggregation results. Example: stats["did:plc:..."]["sh.tangled.graph.follow:subject"] = {"count": 12, "distinctAuthors": 11}.
6565+ * The inner query's response, unmodified.
6266 */
6363- stats: /*#__PURE__*/ v.unknown(),
6767+ output: /*#__PURE__*/ v.unknown(),
6468 }),
6569 },
6670 },