diff --git a/api/tangled/knotlistKeys.go b/api/tangled/knotlistKeys.go new file mode 100644 --- /dev/null +++ b/api/tangled/knotlistKeys.go @@ -0,0 +1,53 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.knot.listKeys + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + KnotListKeysNSID = "sh.tangled.knot.listKeys" +) + +// KnotListKeys_Output is the output of a sh.tangled.knot.listKeys call. +type KnotListKeys_Output struct { + // cursor: Pagination cursor for next page + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + Keys []*KnotListKeys_PublicKey `json:"keys" cborgen:"keys"` +} + +// KnotListKeys_PublicKey is a "publicKey" in the sh.tangled.knot.listKeys schema. +type KnotListKeys_PublicKey struct { + // createdAt: Key upload timestamp + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // did: DID associated with the public key + Did string `json:"did" cborgen:"did"` + // key: Public key contents + Key string `json:"key" cborgen:"key"` +} + +// KnotListKeys calls the XRPC method "sh.tangled.knot.listKeys". +// +// cursor: Pagination cursor +// limit: Maximum number of keys to return +func KnotListKeys(ctx context.Context, c util.LexClient, cursor string, limit int64) (*KnotListKeys_Output, error) { + var out KnotListKeys_Output + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.knot.listKeys", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/repoarchive.go b/api/tangled/repoarchive.go new file mode 100644 --- /dev/null +++ b/api/tangled/repoarchive.go @@ -0,0 +1,41 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.repo.archive + +import ( + "bytes" + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoArchiveNSID = "sh.tangled.repo.archive" +) + +// RepoArchive calls the XRPC method "sh.tangled.repo.archive". +// +// format: Archive format +// prefix: Prefix for files in the archive +// ref: Git reference (branch, tag, or commit SHA) +// repo: Repository identifier in format 'did:plc:.../repoName' +func RepoArchive(ctx context.Context, c util.LexClient, format string, prefix string, ref string, repo string) ([]byte, error) { + buf := new(bytes.Buffer) + + params := map[string]interface{}{} + if format != "" { + params["format"] = format + } + if prefix != "" { + params["prefix"] = prefix + } + params["ref"] = ref + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.archive", params, nil, buf); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} diff --git a/api/tangled/repoblob.go b/api/tangled/repoblob.go new file mode 100644 --- /dev/null +++ b/api/tangled/repoblob.go @@ -0,0 +1,80 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.repo.blob + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoBlobNSID = "sh.tangled.repo.blob" +) + +// RepoBlob_LastCommit is a "lastCommit" in the sh.tangled.repo.blob schema. +type RepoBlob_LastCommit struct { + Author *RepoBlob_Signature `json:"author,omitempty" cborgen:"author,omitempty"` + // hash: Commit hash + Hash string `json:"hash" cborgen:"hash"` + // message: Commit message + Message string `json:"message" cborgen:"message"` + // shortHash: Short commit hash + ShortHash *string `json:"shortHash,omitempty" cborgen:"shortHash,omitempty"` + // when: Commit timestamp + When string `json:"when" cborgen:"when"` +} + +// RepoBlob_Output is the output of a sh.tangled.repo.blob call. +type RepoBlob_Output struct { + // content: File content (base64 encoded for binary files) + Content string `json:"content" cborgen:"content"` + // encoding: Content encoding + Encoding *string `json:"encoding,omitempty" cborgen:"encoding,omitempty"` + // isBinary: Whether the file is binary + IsBinary *bool `json:"isBinary,omitempty" cborgen:"isBinary,omitempty"` + LastCommit *RepoBlob_LastCommit `json:"lastCommit,omitempty" cborgen:"lastCommit,omitempty"` + // mimeType: MIME type of the file + MimeType *string `json:"mimeType,omitempty" cborgen:"mimeType,omitempty"` + // path: The file path + Path string `json:"path" cborgen:"path"` + // ref: The git reference used + Ref string `json:"ref" cborgen:"ref"` + // size: File size in bytes + Size *int64 `json:"size,omitempty" cborgen:"size,omitempty"` +} + +// RepoBlob_Signature is a "signature" in the sh.tangled.repo.blob schema. +type RepoBlob_Signature struct { + // email: Author email + Email string `json:"email" cborgen:"email"` + // name: Author name + Name string `json:"name" cborgen:"name"` + // when: Author timestamp + When string `json:"when" cborgen:"when"` +} + +// RepoBlob calls the XRPC method "sh.tangled.repo.blob". +// +// path: Path to the file within the repository +// raw: Return raw file content instead of JSON response +// ref: Git reference (branch, tag, or commit SHA) +// repo: Repository identifier in format 'did:plc:.../repoName' +func RepoBlob(ctx context.Context, c util.LexClient, path string, raw bool, ref string, repo string) (*RepoBlob_Output, error) { + var out RepoBlob_Output + + params := map[string]interface{}{} + params["path"] = path + if raw { + params["raw"] = raw + } + params["ref"] = ref + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.blob", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/repobranch.go b/api/tangled/repobranch.go new file mode 100644 --- /dev/null +++ b/api/tangled/repobranch.go @@ -0,0 +1,59 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.repo.branch + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoBranchNSID = "sh.tangled.repo.branch" +) + +// RepoBranch_Output is the output of a sh.tangled.repo.branch call. +type RepoBranch_Output struct { + Author *RepoBranch_Signature `json:"author,omitempty" cborgen:"author,omitempty"` + // hash: Latest commit hash on this branch + Hash string `json:"hash" cborgen:"hash"` + // isDefault: Whether this is the default branch + IsDefault *bool `json:"isDefault,omitempty" cborgen:"isDefault,omitempty"` + // message: Latest commit message + Message *string `json:"message,omitempty" cborgen:"message,omitempty"` + // name: Branch name + Name string `json:"name" cborgen:"name"` + // shortHash: Short commit hash + ShortHash *string `json:"shortHash,omitempty" cborgen:"shortHash,omitempty"` + // when: Timestamp of latest commit + When string `json:"when" cborgen:"when"` +} + +// RepoBranch_Signature is a "signature" in the sh.tangled.repo.branch schema. +type RepoBranch_Signature struct { + // email: Author email + Email string `json:"email" cborgen:"email"` + // name: Author name + Name string `json:"name" cborgen:"name"` + // when: Author timestamp + When string `json:"when" cborgen:"when"` +} + +// RepoBranch calls the XRPC method "sh.tangled.repo.branch". +// +// name: Branch name to get information for +// repo: Repository identifier in format 'did:plc:.../repoName' +func RepoBranch(ctx context.Context, c util.LexClient, name string, repo string) (*RepoBranch_Output, error) { + var out RepoBranch_Output + + params := map[string]interface{}{} + params["name"] = name + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.branch", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/repobranches.go b/api/tangled/repobranches.go new file mode 100644 --- /dev/null +++ b/api/tangled/repobranches.go @@ -0,0 +1,39 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.repo.branches + +import ( + "bytes" + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoBranchesNSID = "sh.tangled.repo.branches" +) + +// RepoBranches calls the XRPC method "sh.tangled.repo.branches". +// +// cursor: Pagination cursor +// limit: Maximum number of branches to return +// repo: Repository identifier in format 'did:plc:.../repoName' +func RepoBranches(ctx context.Context, c util.LexClient, cursor string, limit int64, repo string) ([]byte, error) { + buf := new(bytes.Buffer) + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.branches", params, nil, buf); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} diff --git a/api/tangled/repocompare.go b/api/tangled/repocompare.go new file mode 100644 --- /dev/null +++ b/api/tangled/repocompare.go @@ -0,0 +1,35 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.repo.compare + +import ( + "bytes" + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoCompareNSID = "sh.tangled.repo.compare" +) + +// RepoCompare calls the XRPC method "sh.tangled.repo.compare". +// +// repo: Repository identifier in format 'did:plc:.../repoName' +// rev1: First revision (commit, branch, or tag) +// rev2: Second revision (commit, branch, or tag) +func RepoCompare(ctx context.Context, c util.LexClient, repo string, rev1 string, rev2 string) ([]byte, error) { + buf := new(bytes.Buffer) + + params := map[string]interface{}{} + params["repo"] = repo + params["rev1"] = rev1 + params["rev2"] = rev2 + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.compare", params, nil, buf); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} diff --git a/api/tangled/repodiff.go b/api/tangled/repodiff.go new file mode 100644 --- /dev/null +++ b/api/tangled/repodiff.go @@ -0,0 +1,33 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.repo.diff + +import ( + "bytes" + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoDiffNSID = "sh.tangled.repo.diff" +) + +// RepoDiff calls the XRPC method "sh.tangled.repo.diff". +// +// ref: Git reference (branch, tag, or commit SHA) +// repo: Repository identifier in format 'did:plc:.../repoName' +func RepoDiff(ctx context.Context, c util.LexClient, ref string, repo string) ([]byte, error) { + buf := new(bytes.Buffer) + + params := map[string]interface{}{} + params["ref"] = ref + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.diff", params, nil, buf); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} diff --git a/api/tangled/repogetDefaultBranch.go b/api/tangled/repogetDefaultBranch.go new file mode 100644 --- /dev/null +++ b/api/tangled/repogetDefaultBranch.go @@ -0,0 +1,55 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.repo.getDefaultBranch + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoGetDefaultBranchNSID = "sh.tangled.repo.getDefaultBranch" +) + +// RepoGetDefaultBranch_Output is the output of a sh.tangled.repo.getDefaultBranch call. +type RepoGetDefaultBranch_Output struct { + Author *RepoGetDefaultBranch_Signature `json:"author,omitempty" cborgen:"author,omitempty"` + // hash: Latest commit hash on default branch + Hash string `json:"hash" cborgen:"hash"` + // message: Latest commit message + Message *string `json:"message,omitempty" cborgen:"message,omitempty"` + // name: Default branch name + Name string `json:"name" cborgen:"name"` + // shortHash: Short commit hash + ShortHash *string `json:"shortHash,omitempty" cborgen:"shortHash,omitempty"` + // when: Timestamp of latest commit + When string `json:"when" cborgen:"when"` +} + +// RepoGetDefaultBranch_Signature is a "signature" in the sh.tangled.repo.getDefaultBranch schema. +type RepoGetDefaultBranch_Signature struct { + // email: Author email + Email string `json:"email" cborgen:"email"` + // name: Author name + Name string `json:"name" cborgen:"name"` + // when: Author timestamp + When string `json:"when" cborgen:"when"` +} + +// RepoGetDefaultBranch calls the XRPC method "sh.tangled.repo.getDefaultBranch". +// +// repo: Repository identifier in format 'did:plc:.../repoName' +func RepoGetDefaultBranch(ctx context.Context, c util.LexClient, repo string) (*RepoGetDefaultBranch_Output, error) { + var out RepoGetDefaultBranch_Output + + params := map[string]interface{}{} + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.getDefaultBranch", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/repolanguages.go b/api/tangled/repolanguages.go new file mode 100644 --- /dev/null +++ b/api/tangled/repolanguages.go @@ -0,0 +1,61 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.repo.languages + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoLanguagesNSID = "sh.tangled.repo.languages" +) + +// RepoLanguages_Language is a "language" in the sh.tangled.repo.languages schema. +type RepoLanguages_Language struct { + // color: Hex color code for this language + Color *string `json:"color,omitempty" cborgen:"color,omitempty"` + // extensions: File extensions associated with this language + Extensions []string `json:"extensions,omitempty" cborgen:"extensions,omitempty"` + // fileCount: Number of files in this language + FileCount *int64 `json:"fileCount,omitempty" cborgen:"fileCount,omitempty"` + // name: Programming language name + Name string `json:"name" cborgen:"name"` + // percentage: Percentage of total codebase (0-100) + Percentage int64 `json:"percentage" cborgen:"percentage"` + // size: Total size of files in this language (bytes) + Size int64 `json:"size" cborgen:"size"` +} + +// RepoLanguages_Output is the output of a sh.tangled.repo.languages call. +type RepoLanguages_Output struct { + Languages []*RepoLanguages_Language `json:"languages" cborgen:"languages"` + // ref: The git reference used + Ref string `json:"ref" cborgen:"ref"` + // totalFiles: Total number of files analyzed + TotalFiles *int64 `json:"totalFiles,omitempty" cborgen:"totalFiles,omitempty"` + // totalSize: Total size of all analyzed files in bytes + TotalSize *int64 `json:"totalSize,omitempty" cborgen:"totalSize,omitempty"` +} + +// RepoLanguages calls the XRPC method "sh.tangled.repo.languages". +// +// ref: Git reference (branch, tag, or commit SHA) +// repo: Repository identifier in format 'did:plc:.../repoName' +func RepoLanguages(ctx context.Context, c util.LexClient, ref string, repo string) (*RepoLanguages_Output, error) { + var out RepoLanguages_Output + + params := map[string]interface{}{} + if ref != "" { + params["ref"] = ref + } + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.languages", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/repolog.go b/api/tangled/repolog.go new file mode 100644 --- /dev/null +++ b/api/tangled/repolog.go @@ -0,0 +1,45 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.repo.log + +import ( + "bytes" + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoLogNSID = "sh.tangled.repo.log" +) + +// RepoLog calls the XRPC method "sh.tangled.repo.log". +// +// cursor: Pagination cursor (commit SHA) +// limit: Maximum number of commits to return +// path: Path to filter commits by +// ref: Git reference (branch, tag, or commit SHA) +// repo: Repository identifier in format 'did:plc:.../repoName' +func RepoLog(ctx context.Context, c util.LexClient, cursor string, limit int64, path string, ref string, repo string) ([]byte, error) { + buf := new(bytes.Buffer) + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + if path != "" { + params["path"] = path + } + params["ref"] = ref + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.log", params, nil, buf); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} diff --git a/api/tangled/repotags.go b/api/tangled/repotags.go new file mode 100644 --- /dev/null +++ b/api/tangled/repotags.go @@ -0,0 +1,39 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.repo.tags + +import ( + "bytes" + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoTagsNSID = "sh.tangled.repo.tags" +) + +// RepoTags calls the XRPC method "sh.tangled.repo.tags". +// +// cursor: Pagination cursor +// limit: Maximum number of tags to return +// repo: Repository identifier in format 'did:plc:.../repoName' +func RepoTags(ctx context.Context, c util.LexClient, cursor string, limit int64, repo string) ([]byte, error) { + buf := new(bytes.Buffer) + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.tags", params, nil, buf); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} diff --git a/api/tangled/repotree.go b/api/tangled/repotree.go new file mode 100644 --- /dev/null +++ b/api/tangled/repotree.go @@ -0,0 +1,72 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.repo.tree + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoTreeNSID = "sh.tangled.repo.tree" +) + +// RepoTree_LastCommit is a "lastCommit" in the sh.tangled.repo.tree schema. +type RepoTree_LastCommit struct { + // hash: Commit hash + Hash string `json:"hash" cborgen:"hash"` + // message: Commit message + Message string `json:"message" cborgen:"message"` + // when: Commit timestamp + When string `json:"when" cborgen:"when"` +} + +// RepoTree_Output is the output of a sh.tangled.repo.tree call. +type RepoTree_Output struct { + // dotdot: Parent directory path + Dotdot *string `json:"dotdot,omitempty" cborgen:"dotdot,omitempty"` + Files []*RepoTree_TreeEntry `json:"files" cborgen:"files"` + // parent: The parent path in the tree + Parent *string `json:"parent,omitempty" cborgen:"parent,omitempty"` + // ref: The git reference used + Ref string `json:"ref" cborgen:"ref"` +} + +// RepoTree_TreeEntry is a "treeEntry" in the sh.tangled.repo.tree schema. +type RepoTree_TreeEntry struct { + // is_file: Whether this entry is a file + Is_file bool `json:"is_file" cborgen:"is_file"` + // is_subtree: Whether this entry is a directory/subtree + Is_subtree bool `json:"is_subtree" cborgen:"is_subtree"` + Last_commit *RepoTree_LastCommit `json:"last_commit,omitempty" cborgen:"last_commit,omitempty"` + // mode: File mode + Mode string `json:"mode" cborgen:"mode"` + // name: Relative file or directory name + Name string `json:"name" cborgen:"name"` + // size: File size in bytes + Size int64 `json:"size" cborgen:"size"` +} + +// RepoTree calls the XRPC method "sh.tangled.repo.tree". +// +// path: Path within the repository tree +// ref: Git reference (branch, tag, or commit SHA) +// repo: Repository identifier in format 'did:plc:.../repoName' +func RepoTree(ctx context.Context, c util.LexClient, path string, ref string, repo string) (*RepoTree_Output, error) { + var out RepoTree_Output + + params := map[string]interface{}{} + if path != "" { + params["path"] = path + } + params["ref"] = ref + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.tree", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/lexicons/knot/listKeys.json b/lexicons/knot/listKeys.json new file mode 100644 --- /dev/null +++ b/lexicons/knot/listKeys.json @@ -0,0 +1,73 @@ +{ + "lexicon": 1, + "id": "sh.tangled.knot.listKeys", + "defs": { + "main": { + "type": "query", + "description": "List all public keys stored in the knot server", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "description": "Maximum number of keys to return", + "minimum": 1, + "maximum": 1000, + "default": 100 + }, + "cursor": { + "type": "string", + "description": "Pagination cursor" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["keys"], + "properties": { + "keys": { + "type": "array", + "items": { + "type": "ref", + "ref": "#publicKey" + } + }, + "cursor": { + "type": "string", + "description": "Pagination cursor for next page" + } + } + } + }, + "errors": [ + { + "name": "InternalServerError", + "description": "Failed to retrieve public keys" + } + ] + }, + "publicKey": { + "type": "object", + "required": ["did", "key", "createdAt"], + "properties": { + "did": { + "type": "string", + "format": "did", + "description": "DID associated with the public key" + }, + "key": { + "type": "string", + "maxLength": 4096, + "description": "Public key contents" + }, + "createdAt": { + "type": "string", + "format": "datetime", + "description": "Key upload timestamp" + } + } + } + } +} diff --git a/lexicons/repo/archive.json b/lexicons/repo/archive.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/archive.json @@ -0,0 +1,55 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.archive", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": ["repo", "ref"], + "properties": { + "repo": { + "type": "string", + "description": "Repository identifier in format 'did:plc:.../repoName'" + }, + "ref": { + "type": "string", + "description": "Git reference (branch, tag, or commit SHA)" + }, + "format": { + "type": "string", + "description": "Archive format", + "enum": ["tar", "zip", "tar.gz", "tar.bz2", "tar.xz"], + "default": "tar.gz" + }, + "prefix": { + "type": "string", + "description": "Prefix for files in the archive" + } + } + }, + "output": { + "encoding": "*/*", + "description": "Binary archive data" + }, + "errors": [ + { + "name": "RepoNotFound", + "description": "Repository not found or access denied" + }, + { + "name": "RefNotFound", + "description": "Git reference not found" + }, + { + "name": "InvalidRequest", + "description": "Invalid request parameters" + }, + { + "name": "ArchiveError", + "description": "Failed to create archive" + } + ] + } + } +} diff --git a/lexicons/repo/blob.json b/lexicons/repo/blob.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/blob.json @@ -0,0 +1,138 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.blob", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": ["repo", "ref", "path"], + "properties": { + "repo": { + "type": "string", + "description": "Repository identifier in format 'did:plc:.../repoName'" + }, + "ref": { + "type": "string", + "description": "Git reference (branch, tag, or commit SHA)" + }, + "path": { + "type": "string", + "description": "Path to the file within the repository" + }, + "raw": { + "type": "boolean", + "description": "Return raw file content instead of JSON response", + "default": false + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["ref", "path", "content"], + "properties": { + "ref": { + "type": "string", + "description": "The git reference used" + }, + "path": { + "type": "string", + "description": "The file path" + }, + "content": { + "type": "string", + "description": "File content (base64 encoded for binary files)" + }, + "encoding": { + "type": "string", + "description": "Content encoding", + "enum": ["utf-8", "base64"] + }, + "size": { + "type": "integer", + "description": "File size in bytes" + }, + "isBinary": { + "type": "boolean", + "description": "Whether the file is binary" + }, + "mimeType": { + "type": "string", + "description": "MIME type of the file" + }, + "lastCommit": { + "type": "ref", + "ref": "#lastCommit" + } + } + } + }, + "errors": [ + { + "name": "RepoNotFound", + "description": "Repository not found or access denied" + }, + { + "name": "RefNotFound", + "description": "Git reference not found" + }, + { + "name": "FileNotFound", + "description": "File not found at the specified path" + }, + { + "name": "InvalidRequest", + "description": "Invalid request parameters" + } + ] + }, + "lastCommit": { + "type": "object", + "required": ["hash", "message", "when"], + "properties": { + "hash": { + "type": "string", + "description": "Commit hash" + }, + "shortHash": { + "type": "string", + "description": "Short commit hash" + }, + "message": { + "type": "string", + "description": "Commit message" + }, + "author": { + "type": "ref", + "ref": "#signature" + }, + "when": { + "type": "string", + "format": "datetime", + "description": "Commit timestamp" + } + } + }, + "signature": { + "type": "object", + "required": ["name", "email", "when"], + "properties": { + "name": { + "type": "string", + "description": "Author name" + }, + "email": { + "type": "string", + "description": "Author email" + }, + "when": { + "type": "string", + "format": "datetime", + "description": "Author timestamp" + } + } + } + } +} diff --git a/lexicons/repo/branch.json b/lexicons/repo/branch.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/branch.json @@ -0,0 +1,94 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.branch", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": ["repo", "name"], + "properties": { + "repo": { + "type": "string", + "description": "Repository identifier in format 'did:plc:.../repoName'" + }, + "name": { + "type": "string", + "description": "Branch name to get information for" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["name", "hash", "when"], + "properties": { + "name": { + "type": "string", + "description": "Branch name" + }, + "hash": { + "type": "string", + "description": "Latest commit hash on this branch" + }, + "shortHash": { + "type": "string", + "description": "Short commit hash" + }, + "when": { + "type": "string", + "format": "datetime", + "description": "Timestamp of latest commit" + }, + "message": { + "type": "string", + "description": "Latest commit message" + }, + "author": { + "type": "ref", + "ref": "#signature" + }, + "isDefault": { + "type": "boolean", + "description": "Whether this is the default branch" + } + } + } + }, + "errors": [ + { + "name": "RepoNotFound", + "description": "Repository not found or access denied" + }, + { + "name": "BranchNotFound", + "description": "Branch not found" + }, + { + "name": "InvalidRequest", + "description": "Invalid request parameters" + } + ] + }, + "signature": { + "type": "object", + "required": ["name", "email", "when"], + "properties": { + "name": { + "type": "string", + "description": "Author name" + }, + "email": { + "type": "string", + "description": "Author email" + }, + "when": { + "type": "string", + "format": "datetime", + "description": "Author timestamp" + } + } + } + } +} diff --git a/lexicons/repo/branches.json b/lexicons/repo/branches.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/branches.json @@ -0,0 +1,43 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.branches", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": ["repo"], + "properties": { + "repo": { + "type": "string", + "description": "Repository identifier in format 'did:plc:.../repoName'" + }, + "limit": { + "type": "integer", + "description": "Maximum number of branches to return", + "minimum": 1, + "maximum": 100, + "default": 50 + }, + "cursor": { + "type": "string", + "description": "Pagination cursor" + } + } + }, + "output": { + "encoding": "*/*" + }, + "errors": [ + { + "name": "RepoNotFound", + "description": "Repository not found or access denied" + }, + { + "name": "InvalidRequest", + "description": "Invalid request parameters" + } + ] + } + } +} diff --git a/lexicons/repo/compare.json b/lexicons/repo/compare.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/compare.json @@ -0,0 +1,49 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.compare", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": ["repo", "rev1", "rev2"], + "properties": { + "repo": { + "type": "string", + "description": "Repository identifier in format 'did:plc:.../repoName'" + }, + "rev1": { + "type": "string", + "description": "First revision (commit, branch, or tag)" + }, + "rev2": { + "type": "string", + "description": "Second revision (commit, branch, or tag)" + } + } + }, + "output": { + "encoding": "*/*", + "description": "Compare output in application/json" + }, + "errors": [ + { + "name": "RepoNotFound", + "description": "Repository not found or access denied" + }, + { + "name": "RevisionNotFound", + "description": "One or both revisions not found" + }, + { + "name": "InvalidRequest", + "description": "Invalid request parameters" + }, + { + "name": "CompareError", + "description": "Failed to compare revisions" + } + ] + } + } +} diff --git a/lexicons/repo/diff.json b/lexicons/repo/diff.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/diff.json @@ -0,0 +1,40 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.diff", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": ["repo", "ref"], + "properties": { + "repo": { + "type": "string", + "description": "Repository identifier in format 'did:plc:.../repoName'" + }, + "ref": { + "type": "string", + "description": "Git reference (branch, tag, or commit SHA)" + } + } + }, + "output": { + "encoding": "*/*" + }, + "errors": [ + { + "name": "RepoNotFound", + "description": "Repository not found or access denied" + }, + { + "name": "RefNotFound", + "description": "Git reference not found" + }, + { + "name": "InvalidRequest", + "description": "Invalid request parameters" + } + ] + } + } +} diff --git a/lexicons/repo/getDefaultBranch.json b/lexicons/repo/getDefaultBranch.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/getDefaultBranch.json @@ -0,0 +1,82 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.getDefaultBranch", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": ["repo"], + "properties": { + "repo": { + "type": "string", + "description": "Repository identifier in format 'did:plc:.../repoName'" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["name", "hash", "when"], + "properties": { + "name": { + "type": "string", + "description": "Default branch name" + }, + "hash": { + "type": "string", + "description": "Latest commit hash on default branch" + }, + "shortHash": { + "type": "string", + "description": "Short commit hash" + }, + "when": { + "type": "string", + "format": "datetime", + "description": "Timestamp of latest commit" + }, + "message": { + "type": "string", + "description": "Latest commit message" + }, + "author": { + "type": "ref", + "ref": "#signature" + } + } + } + }, + "errors": [ + { + "name": "RepoNotFound", + "description": "Repository not found or access denied" + }, + { + "name": "InvalidRequest", + "description": "Invalid request parameters" + } + ] + }, + "signature": { + "type": "object", + "required": ["name", "email", "when"], + "properties": { + "name": { + "type": "string", + "description": "Author name" + }, + "email": { + "type": "string", + "description": "Author email" + }, + "when": { + "type": "string", + "format": "datetime", + "description": "Author timestamp" + } + } + } + } +} diff --git a/lexicons/repo/languages.json b/lexicons/repo/languages.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/languages.json @@ -0,0 +1,99 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.languages", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": ["repo"], + "properties": { + "repo": { + "type": "string", + "description": "Repository identifier in format 'did:plc:.../repoName'" + }, + "ref": { + "type": "string", + "description": "Git reference (branch, tag, or commit SHA)", + "default": "HEAD" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["ref", "languages"], + "properties": { + "ref": { + "type": "string", + "description": "The git reference used" + }, + "languages": { + "type": "array", + "items": { + "type": "ref", + "ref": "#language" + } + }, + "totalSize": { + "type": "integer", + "description": "Total size of all analyzed files in bytes" + }, + "totalFiles": { + "type": "integer", + "description": "Total number of files analyzed" + } + } + } + }, + "errors": [ + { + "name": "RepoNotFound", + "description": "Repository not found or access denied" + }, + { + "name": "RefNotFound", + "description": "Git reference not found" + }, + { + "name": "InvalidRequest", + "description": "Invalid request parameters" + } + ] + }, + "language": { + "type": "object", + "required": ["name", "size", "percentage"], + "properties": { + "name": { + "type": "string", + "description": "Programming language name" + }, + "size": { + "type": "integer", + "description": "Total size of files in this language (bytes)" + }, + "percentage": { + "type": "integer", + "description": "Percentage of total codebase (0-100)" + }, + "fileCount": { + "type": "integer", + "description": "Number of files in this language" + }, + "color": { + "type": "string", + "description": "Hex color code for this language" + }, + "extensions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "File extensions associated with this language" + } + } + } + } +} diff --git a/lexicons/repo/log.json b/lexicons/repo/log.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/log.json @@ -0,0 +1,60 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.log", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": ["repo", "ref"], + "properties": { + "repo": { + "type": "string", + "description": "Repository identifier in format 'did:plc:.../repoName'" + }, + "ref": { + "type": "string", + "description": "Git reference (branch, tag, or commit SHA)" + }, + "path": { + "type": "string", + "description": "Path to filter commits by", + "default": "" + }, + "limit": { + "type": "integer", + "description": "Maximum number of commits to return", + "minimum": 1, + "maximum": 100, + "default": 50 + }, + "cursor": { + "type": "string", + "description": "Pagination cursor (commit SHA)" + } + } + }, + "output": { + "encoding": "*/*" + }, + "errors": [ + { + "name": "RepoNotFound", + "description": "Repository not found or access denied" + }, + { + "name": "RefNotFound", + "description": "Git reference not found" + }, + { + "name": "PathNotFound", + "description": "Path not found in repository" + }, + { + "name": "InvalidRequest", + "description": "Invalid request parameters" + } + ] + } + } +} diff --git a/lexicons/repo/tags.json b/lexicons/repo/tags.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/tags.json @@ -0,0 +1,43 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.tags", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": ["repo"], + "properties": { + "repo": { + "type": "string", + "description": "Repository identifier in format 'did:plc:.../repoName'" + }, + "limit": { + "type": "integer", + "description": "Maximum number of tags to return", + "minimum": 1, + "maximum": 100, + "default": 50 + }, + "cursor": { + "type": "string", + "description": "Pagination cursor" + } + } + }, + "output": { + "encoding": "*/*" + }, + "errors": [ + { + "name": "RepoNotFound", + "description": "Repository not found or access denied" + }, + { + "name": "InvalidRequest", + "description": "Invalid request parameters" + } + ] + } + } +} diff --git a/lexicons/repo/tree.json b/lexicons/repo/tree.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/tree.json @@ -0,0 +1,123 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.tree", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": ["repo", "ref"], + "properties": { + "repo": { + "type": "string", + "description": "Repository identifier in format 'did:plc:.../repoName'" + }, + "ref": { + "type": "string", + "description": "Git reference (branch, tag, or commit SHA)" + }, + "path": { + "type": "string", + "description": "Path within the repository tree", + "default": "" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["ref", "files"], + "properties": { + "ref": { + "type": "string", + "description": "The git reference used" + }, + "parent": { + "type": "string", + "description": "The parent path in the tree" + }, + "dotdot": { + "type": "string", + "description": "Parent directory path" + }, + "files": { + "type": "array", + "items": { + "type": "ref", + "ref": "#treeEntry" + } + } + } + } + }, + "errors": [ + { + "name": "RepoNotFound", + "description": "Repository not found or access denied" + }, + { + "name": "RefNotFound", + "description": "Git reference not found" + }, + { + "name": "PathNotFound", + "description": "Path not found in repository tree" + }, + { + "name": "InvalidRequest", + "description": "Invalid request parameters" + } + ] + }, + "treeEntry": { + "type": "object", + "required": ["name", "mode", "size", "is_file", "is_subtree"], + "properties": { + "name": { + "type": "string", + "description": "Relative file or directory name" + }, + "mode": { + "type": "string", + "description": "File mode" + }, + "size": { + "type": "integer", + "description": "File size in bytes" + }, + "is_file": { + "type": "boolean", + "description": "Whether this entry is a file" + }, + "is_subtree": { + "type": "boolean", + "description": "Whether this entry is a directory/subtree" + }, + "last_commit": { + "type": "ref", + "ref": "#lastCommit" + } + } + }, + "lastCommit": { + "type": "object", + "required": ["hash", "message", "when"], + "properties": { + "hash": { + "type": "string", + "description": "Commit hash" + }, + "message": { + "type": "string", + "description": "Commit message" + }, + "when": { + "type": "string", + "format": "datetime", + "description": "Commit timestamp" + } + } + } + } +}