@octocodeai/octocode-core 1.0.2 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configLoader.d.ts +5 -1
- package/dist/data/compressed.js +1 -1
- package/dist/data/default.json +317 -0
- package/dist/index.d.ts +2 -6
- package/dist/index.js +1 -1
- package/dist/schemas/descriptions.d.ts +17 -0
- package/dist/schemas/descriptions.js +1 -0
- package/dist/schemas/extraTypes.d.ts +205 -0
- package/dist/schemas/index.d.ts +431 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/outputs.d.ts +817 -0
- package/dist/schemas/outputs.js +1 -0
- package/dist/schemas/runtime.d.ts +32 -0
- package/dist/schemas/runtime.js +1 -0
- package/dist/types/index.d.ts +383 -0
- package/dist/types/index.js +1 -0
- package/package.json +32 -9
- package/dist/latest/index.d.ts +0 -3
- package/dist/latest/index.js +0 -8
- package/dist/lib/deep-merge.d.ts +0 -7
- package/dist/lib/deep-merge.js +0 -1
- package/dist/metadata-types/metadata.d.ts +0 -44
- package/dist/schemes/base/baseSchema.d.ts +0 -24
- package/dist/schemes/base/baseSchema.js +0 -1
- package/dist/schemes/helpers/githubSchemaHelpers.d.ts +0 -158
- package/dist/schemes/helpers/githubSchemaHelpers.js +0 -1
- package/dist/schemes/helpers/localSchemaHelpers.d.ts +0 -164
- package/dist/schemes/helpers/localSchemaHelpers.js +0 -1
- package/dist/schemes/helpers/lspSchemaBuilders.d.ts +0 -20
- package/dist/schemes/helpers/lspSchemaBuilders.js +0 -1
- package/dist/schemes/helpers/lspSchemaDescriptions.d.ts +0 -5
- package/dist/schemes/helpers/lspSchemaDescriptions.js +0 -1
- package/dist/schemes/helpers/lspSchemaHelpers.d.ts +0 -52
- package/dist/schemes/helpers/lspSchemaHelpers.js +0 -1
- package/dist/schemes/helpers/schemaHelperFactory.d.ts +0 -3
- package/dist/schemes/helpers/schemaHelperFactory.js +0 -1
- package/dist/schemes/index.d.ts +0 -25
- package/dist/schemes/index.js +0 -1
- package/dist/schemes/input/githubCloneRepo.d.ts +0 -33
- package/dist/schemes/input/githubCloneRepo.js +0 -1
- package/dist/schemes/input/githubFetchContent.d.ts +0 -50
- package/dist/schemes/input/githubFetchContent.js +0 -1
- package/dist/schemes/input/githubSearchCode.d.ts +0 -46
- package/dist/schemes/input/githubSearchCode.js +0 -1
- package/dist/schemes/input/githubSearchPullRequests.d.ts +0 -140
- package/dist/schemes/input/githubSearchPullRequests.js +0 -1
- package/dist/schemes/input/githubSearchRepos.d.ts +0 -62
- package/dist/schemes/input/githubSearchRepos.js +0 -1
- package/dist/schemes/input/githubViewRepoStructure.d.ts +0 -40
- package/dist/schemes/input/githubViewRepoStructure.js +0 -1
- package/dist/schemes/input/localFindFiles.d.ts +0 -109
- package/dist/schemes/input/localFindFiles.js +0 -1
- package/dist/schemes/input/localGetFileContent.d.ts +0 -37
- package/dist/schemes/input/localGetFileContent.js +0 -1
- package/dist/schemes/input/localSearchCode.d.ts +0 -143
- package/dist/schemes/input/localSearchCode.js +0 -1
- package/dist/schemes/input/localViewStructure.d.ts +0 -65
- package/dist/schemes/input/localViewStructure.js +0 -1
- package/dist/schemes/input/lspCallHierarchy.d.ts +0 -45
- package/dist/schemes/input/lspCallHierarchy.js +0 -1
- package/dist/schemes/input/lspFindReferences.d.ts +0 -37
- package/dist/schemes/input/lspFindReferences.js +0 -1
- package/dist/schemes/input/lspGotoDefinition.d.ts +0 -31
- package/dist/schemes/input/lspGotoDefinition.js +0 -1
- package/dist/schemes/input/packageSearch.d.ts +0 -79
- package/dist/schemes/input/packageSearch.js +0 -1
- package/dist/schemes/output/outputSchemas.d.ts +0 -1311
- package/dist/schemes/output/outputSchemas.js +0 -1
- package/dist/schemes/output/outputTypes.d.ts +0 -66
- package/dist/schemes/output/outputTypes.js +0 -1
- package/dist/toolMetadata.d.ts +0 -2
- package/dist/toolMetadata.js +0 -1
- package/dist/types.d.ts +0 -54
- package/dist/types.js +0 -1
- package/dist/versionLoader.d.ts +0 -11
- package/dist/versionLoader.js +0 -1
- /package/dist/{metadata-types/metadata.js → schemas/extraTypes.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z as e}from"zod/v4";const t=e.object({id:e.string().min(1).describe("Stable query identifier matching the input query id")}).strict(),i=e.array(e.string()).optional().describe("Contextual hints and suggestions for next steps or better queries"),n=e.object({error:e.string().describe("GitHub API error message"),status:e.number().int().optional().describe("HTTP status code"),type:e.enum(["http","graphql","network","unknown"]).describe("GitHub API error category"),scopesSuggestion:e.string().optional().describe("Suggested scopes needed to resolve the error"),rateLimitRemaining:e.number().optional().describe("Remaining API requests in the current rate limit window"),rateLimitReset:e.number().optional().describe("Rate limit reset time in milliseconds since epoch"),retryAfter:e.number().optional().describe("Retry-after delay in seconds"),hints:e.array(e.string()).optional().describe("Provider-specific hints")}).strict();export const ErrorDataSchema=e.object({error:e.union([e.string(),n]).describe("Error message or API error object"),hints:e.array(e.string()).optional().describe("Recovery hints"),errorType:e.string().optional().describe("Tool-specific error type (e.g. symbol_not_found, size_limit)"),errorCode:e.string().optional().describe("Tool error code"),resolvedPath:e.string().optional().describe("Resolved filesystem path involved in the error"),cwd:e.string().optional().describe("Working directory relevant to the error"),searchRadius:e.number().optional().describe("LSP search radius when symbol not found")}).strict();export const EmptyDataSchema=e.object({}).catchall(e.unknown()).describe("Empty result metadata (may contain hints or paging details)");const r=e.object({currentPage:e.number().int().positive().describe("Current page number (1-indexed)"),totalPages:e.number().int().positive().describe("Total number of pages available"),hasMore:e.boolean().describe("Whether more pages are available after the current page")}).strict(),a=r.extend({perPage:e.number().int().positive().describe("Results returned per page"),totalMatches:e.number().int().nonnegative().describe("Total matching results across all pages")}).strict(),o=r.extend({filesPerPage:e.number().int().positive().describe("Files returned per page"),totalFiles:e.number().int().nonnegative().describe("Total matching files across all pages")}).strict(),s=r.extend({entriesPerPage:e.number().int().positive().describe("Directory entries returned per page"),totalEntries:e.number().int().nonnegative().describe("Total matching entries across all pages")}).strict(),c=r.extend({matchesPerPage:e.number().int().positive().describe("Matches returned per page within a single file"),totalMatches:e.number().int().nonnegative().describe("Total matches within the file")}).strict(),l=r.extend({charOffset:e.number().int().nonnegative().describe("Character offset of the current page"),charLength:e.number().int().nonnegative().describe("Character length of the current page"),totalChars:e.number().int().nonnegative().describe("Total number of characters in the full output")}).strict(),d=r.extend({byteOffset:e.number().int().nonnegative().optional().describe("Byte offset of the current page"),byteLength:e.number().int().nonnegative().optional().describe("Byte length of the current page"),totalBytes:e.number().int().nonnegative().optional().describe("Total number of bytes in the full output"),charOffset:e.number().int().nonnegative().optional().describe("Character offset of the current page"),charLength:e.number().int().nonnegative().optional().describe("Character length of the current page"),totalChars:e.number().int().nonnegative().optional().describe("Total number of characters in the full output")}).strict(),p=r.extend({totalResults:e.number().int().nonnegative().describe("Total matching locations or calls across all pages"),resultsPerPage:e.number().int().positive().describe("Locations or calls returned per page")}).strict(),b=e.object({line:e.number().int().nonnegative().describe("Zero-based line number"),character:e.number().int().nonnegative().describe("Zero-based character offset")}).strict(),u=e.object({start:b.describe("Start position of the range"),end:b.describe("End position of the range")}).strict().describe("A range in a text document expressed as start and end positions"),h=e.enum(["function","method","class","interface","type","variable","constant","property","enum","module","namespace","unknown"]),g=e.object({uri:e.string().describe("File URI where the code snippet is located"),range:u.describe("Position range of the symbol in the file"),content:e.string().describe("Source code content at the location with surrounding context"),symbolKind:h.optional().describe("LSP symbol kind (e.g. function, class, variable, method)")}).strict(),m=g.extend({isDefinition:e.boolean().optional().describe("Whether this reference is the symbol definition itself")}).strict(),f=e.object({name:e.string().describe("Function or method name"),kind:h.describe("Symbol kind of the item"),uri:e.string().describe("File URI containing the item"),range:u.describe("Range of the item in the file"),content:e.string().optional().describe("Source code context around the item")}).strict(),y=e.object({from:f.describe("Caller item"),fromRanges:e.array(u).describe("Ranges inside the caller where the target is called")}).strict(),v=e.object({to:f.describe("Callee item"),fromRanges:e.array(u).describe("Ranges inside the target where the outgoing call is made")}).strict(),S=e.object({path:e.string().describe("Relative path within the fetched directory"),size:e.number().int().nonnegative().describe("File size in bytes"),type:e.literal("file").describe("Directory fetch only returns files")}).strict(),P=e.object({start:e.number().int().nonnegative().describe("Start offset of match"),end:e.number().int().nonnegative().describe("End offset of match")}).strict(),w=e.object({value:e.string().describe("Matched code snippet context"),matchIndices:e.array(P).optional().describe("Character offset positions of matches within the snippet")}).strict(),x=e.object({path:e.string().describe("Path of the matching file in the repository"),owner:e.string().optional().describe("Repository owner"),repo:e.string().optional().describe("Repository name"),text_matches:e.array(e.union([e.string(),w])).optional().describe("Matched code snippets when searching file content"),lastModifiedAt:e.string().optional().describe("Last modified timestamp for the file")}).strict(),R=e.object({branch:e.string().describe("Default branch of the repository")}).strict(),L=e.object({id:e.string().describe("Comment identifier"),author:e.string().describe("Comment author username"),body:e.string().describe("Comment body"),createdAt:e.string().describe("Comment creation timestamp"),updatedAt:e.string().describe("Comment update timestamp")}).strict(),D=e.object({path:e.string().describe("File path inside the pull request diff"),status:e.string().describe("Git change status for the file"),additions:e.number().int().nonnegative().describe("Lines added in this file"),deletions:e.number().int().nonnegative().describe("Lines deleted in this file"),patch:e.string().optional().describe("Diff patch for the file")}).strict(),C=e.object({number:e.number().int().positive().describe("Pull request number"),title:e.string().describe("Pull request title"),body:e.string().nullable().optional().describe("Pull request body"),url:e.string().describe("Web URL for the pull request"),state:e.enum(["open","closed","merged"]).describe("Pull request state"),draft:e.boolean().describe("Whether the pull request is a draft"),author:e.string().describe("Author username"),assignees:e.array(e.string()).optional().describe("Assigned usernames"),labels:e.array(e.string()).optional().describe("Applied label names"),sourceBranch:e.string().describe("Source branch name"),targetBranch:e.string().describe("Target branch name"),sourceSha:e.string().optional().describe("Source branch commit SHA"),targetSha:e.string().optional().describe("Target branch commit SHA"),createdAt:e.string().describe("Creation timestamp"),updatedAt:e.string().describe("Last update timestamp"),closedAt:e.string().optional().describe("Closed timestamp"),mergedAt:e.string().optional().describe("Merged timestamp"),commentsCount:e.number().int().nonnegative().optional().describe("Number of comments on the pull request"),changedFilesCount:e.number().int().nonnegative().optional().describe("Number of changed files"),additions:e.number().int().nonnegative().optional().describe("Lines added across the pull request"),deletions:e.number().int().nonnegative().optional().describe("Lines deleted across the pull request"),comments:e.array(L).optional().describe("Expanded pull request comments"),fileChanges:e.array(D).optional().describe("Expanded changed-file details")}).strict(),j=e.object({owner:e.string().describe("Repository owner"),repo:e.string().describe("Repository name"),defaultBranch:e.string().optional().describe("Default branch of the repository"),stars:e.number().int().nonnegative().describe("Star count"),description:e.string().describe("Repository description"),url:e.string().describe("Web URL for the repository"),createdAt:e.string().describe("Creation timestamp"),updatedAt:e.string().describe("Last update timestamp"),pushedAt:e.string().describe("Last push timestamp"),visibility:e.enum(["public","private","internal"]).optional().describe("Repository visibility"),topics:e.array(e.string()).optional().describe("Repository topics"),forksCount:e.number().int().nonnegative().optional().describe("Fork count"),openIssuesCount:e.number().int().nonnegative().optional().describe("Open issues count"),language:e.string().optional().describe("Primary programming language of the repository")}).strict(),k=e.object({files:e.array(e.string()).describe("File names in the directory"),folders:e.array(e.string()).describe("Subdirectory names in the directory")}).strict(),q=e.object({totalFiles:e.number().int().nonnegative().describe("Total files included in the structure result"),totalFolders:e.number().int().nonnegative().describe("Total folders included in the structure result"),truncated:e.boolean().describe("Whether the provider truncated the structure result")}).strict(),F=e.object({requestedBranch:e.string().describe("Branch requested in the query"),actualBranch:e.string().describe("Branch actually used in the result"),defaultBranch:e.string().optional().describe("Repository default branch when known"),warning:e.string().describe("Human-readable explanation of the branch fallback")}).strict(),H=e.object({name:e.string().describe("Package name"),repository:e.string().nullable().optional().describe("Repository URL when available"),repoUrl:e.string().nullable().optional().describe("Normalized repository URL when available"),owner:e.string().optional().describe("Repository owner parsed from the repository URL"),repo:e.string().optional().describe("Repository name parsed from the repository URL"),path:e.string().optional().describe("NPM package path or repository subdirectory"),version:e.string().optional().describe("Package version"),description:e.string().nullable().optional().describe("Package description"),homepage:e.string().optional().describe("Package homepage"),mainEntry:e.string().nullable().optional().describe("Main entry point for NPM packages"),typeDefinitions:e.string().nullable().optional().describe("Type definition entry point for NPM packages"),lastPublished:e.string().optional().describe("Last published timestamp"),license:e.string().optional().describe("Package license"),weeklyDownloads:e.number().int().nonnegative().optional().describe("Weekly download count from npm registry"),author:e.string().optional().describe("Package author"),keywords:e.array(e.string()).optional().describe("Package keywords"),engines:e.record(e.string(),e.string()).optional().describe("Engine requirements"),dependencies:e.record(e.string(),e.string()).optional().describe("Declared dependencies"),peerDependencies:e.record(e.string(),e.string()).optional().describe("Declared peer dependencies")}).strict(),T=e.object({value:e.string().describe("Matched line content with surrounding context"),line:e.number().int().positive().describe("1-indexed line number of the match"),column:e.number().int().nonnegative().optional().describe("Zero-based column position of the match")}).strict(),G=e.object({path:e.string().describe("Absolute file path"),matchCount:e.number().int().nonnegative().describe("Total matches found in the file"),matches:e.array(T).describe("Matches returned for this file page"),modified:e.string().optional().describe("Last modified timestamp of the file"),pagination:c.optional().describe("Per-file match pagination when more matches are available")}).strict(),A=e.object({start:e.number().int().positive().describe("Start line number of a matched range"),end:e.number().int().positive().describe("End line number of a matched range")}).strict(),M=e.object({path:e.string().describe("Absolute file path"),type:e.enum(["file","directory","symlink"]).describe("Filesystem entry type"),size:e.number().int().nonnegative().optional().describe("Entry size in bytes"),sizeFormatted:e.string().optional().describe('Human-readable file size (e.g. "1.5KB", "3.2MB")'),modified:e.string().optional().describe("Last modified timestamp"),permissions:e.string().optional().describe("POSIX permissions string")}).strict(),O=e.object({name:e.string().describe("Entry name"),type:e.enum(["file","dir","link"]).describe("Directory entry type"),depth:e.number().int().nonnegative().optional().describe("Depth relative to the queried path"),size:e.string().optional().describe("Human-readable size when requested"),modified:e.string().optional().describe("Last modified timestamp when requested"),permissions:e.string().optional().describe("POSIX permissions string when requested")}).strict();function z(i){const n=t.extend({status:e.literal("hasResults").describe("Indicates the query returned results successfully"),data:i.describe("The tool-specific result data")}).strict(),r=t.extend({status:e.literal("empty").describe("Indicates the query returned no matching results"),data:EmptyDataSchema}).strict(),a=t.extend({status:e.literal("error").describe("Indicates the query encountered an error"),data:ErrorDataSchema.describe("Error details including message, type, and recovery hints")}).strict();return e.object({results:e.array(e.discriminatedUnion("status",[n,r,a])).describe("Array of results, one per input query, discriminated by status"),responsePagination:l.optional().describe("Pagination metadata for top-level bulk response pagination across results[]")}).strict()}const E=e.object({}).catchall(e.unknown());export const BulkToolOutputSchema=z(E);export const GitHubFetchContentDataSchema=e.object({resolvedBranch:e.string().optional().describe("Resolved branch used to fetch the content when it adds new information beyond the input query"),content:e.string().optional().describe("File content as text for single-file requests"),isPartial:e.boolean().optional().describe("Whether the returned file content is partial"),startLine:e.number().int().positive().optional().describe("Starting line number of the returned content"),endLine:e.number().int().positive().optional().describe("Ending line number of the returned content"),lastModified:e.string().optional().describe("Last modified timestamp for the file"),lastModifiedBy:e.string().optional().describe("Author of the last file modification"),localPath:e.string().optional().describe("Local filesystem path for directory fetch mode"),files:e.array(S).optional().describe("Files fetched in directory mode"),fileCount:e.number().int().nonnegative().optional().describe("Number of files fetched in directory mode"),totalSize:e.number().int().nonnegative().optional().describe("Total fetched size in bytes"),cached:e.boolean().optional().describe("Whether a cached fetch was reused"),pagination:d.optional().describe("Pagination metadata for partial file content"),hints:i}).strict();export const GitHubFetchContentOutputSchema=z(GitHubFetchContentDataSchema);export const GitHubSearchCodeDataSchema=e.object({files:e.array(x).optional().describe("Matching files with repository context and snippets"),repositoryContext:R.optional().describe("Repository context metadata for single-repository searches"),pagination:a.optional().describe("Pagination info for navigating through search results"),outputPagination:l.optional().describe("Payload pagination metadata when the result body was size-paginated"),hints:i}).strict();export const GitHubSearchCodeOutputSchema=z(GitHubSearchCodeDataSchema);export const GitHubSearchPullRequestsDataSchema=e.object({pull_requests:e.array(C).optional().describe("Pull request results"),total_count:e.number().int().nonnegative().optional().describe("Total number of matching pull requests"),pagination:a.optional().describe("Pagination info for navigating through pull request results"),outputPagination:l.optional().describe("Output pagination metadata when the rendered payload was truncated"),hints:i}).strict();export const GitHubSearchPullRequestsOutputSchema=z(GitHubSearchPullRequestsDataSchema);export const GitHubSearchRepositoriesDataSchema=e.object({repositories:e.array(j).describe("Matching repositories"),pagination:a.optional().describe("Pagination info for navigating through repository results"),outputPagination:l.optional().describe("Payload pagination metadata when the result body was size-paginated"),hints:i}).strict();export const GitHubSearchRepositoriesOutputSchema=z(GitHubSearchRepositoriesDataSchema);export const GitHubViewRepoStructureDataSchema=e.object({resolvedBranch:e.string().optional().describe("Resolved branch used when the input query omitted a branch"),branchFallback:F.optional().describe("Branch fallback details when the requested branch was not used"),structure:e.record(e.string(),k).optional().describe("Directory structure grouped by relative path"),summary:q.optional().describe("Summary statistics for the returned repository structure"),pagination:s.optional().describe("Pagination info for large directory listings"),outputPagination:l.optional().describe("Payload pagination metadata when the structure payload was size-paginated"),hints:i}).strict();export const GitHubViewRepoStructureOutputSchema=z(GitHubViewRepoStructureDataSchema);export const GitHubCloneRepoDataSchema=e.object({localPath:e.string().describe("Local filesystem path where the repository was cloned to"),resolvedBranch:e.string().optional().describe("Resolved branch used for the clone when it adds new information beyond the input query"),cached:e.boolean().optional().describe("Whether the clone was served from cache instead of a fresh clone"),outputPagination:l.optional().describe("Payload pagination metadata when the clone result body was size-paginated"),hints:i}).strict();export const GitHubCloneRepoOutputSchema=z(GitHubCloneRepoDataSchema);export const PackageSearchDataSchema=e.object({packages:e.array(H).describe("Matching packages"),totalFound:e.number().int().nonnegative().optional().describe("Total number of packages matching the search query"),outputPagination:l.optional().describe("Payload pagination metadata when the package list was size-paginated"),hints:i}).strict();export const PackageSearchOutputSchema=z(PackageSearchDataSchema);export const LocalSearchCodeDataSchema=e.object({files:e.array(G).optional().describe("Matching files grouped with their matches"),searchEngine:e.enum(["rg","grep"]).optional().describe("Search engine that produced the result"),pagination:o.optional().describe("Pagination info for navigating through matching files"),warnings:e.array(e.string()).optional().describe("Warnings about skipped files, permission errors, or truncated results"),outputPagination:l.optional().describe("Payload pagination metadata when the result body was size-paginated"),hints:i}).strict();export const LocalSearchCodeOutputSchema=z(LocalSearchCodeDataSchema);export const LocalGetFileContentDataSchema=e.object({content:e.string().optional().describe("File content (full or partial depending on request parameters)"),isPartial:e.boolean().optional().describe("Whether the returned content is a partial view of the file"),totalLines:e.number().int().nonnegative().optional().describe("Total number of lines in the file"),startLine:e.number().int().positive().optional().describe("Starting line number of the returned content (1-indexed)"),endLine:e.number().int().positive().optional().describe("Ending line number of the returned content (1-indexed)"),matchRanges:e.array(A).optional().describe("Matched line ranges when using matchString"),modified:e.string().optional().describe("Last modified timestamp of the file (ISO 8601)"),pagination:d.optional().describe("Pagination info for large files or matchString results"),warnings:e.array(e.string()).optional().describe("Warnings about truncation or auto-pagination"),hints:i}).strict();export const LocalGetFileContentOutputSchema=z(LocalGetFileContentDataSchema);export const LocalFindFilesDataSchema=e.object({files:e.array(M).optional().describe("Matching filesystem entries"),pagination:o.optional().describe("Pagination info for navigating through file results"),outputPagination:d.optional().describe("Payload pagination metadata when the result body was size-paginated"),charPagination:d.optional().describe("Legacy compatibility alias for outputPagination"),hints:i}).strict();export const LocalFindFilesOutputSchema=z(LocalFindFilesDataSchema);export const LocalViewStructureDataSchema=e.object({entries:e.array(O).optional().describe("Directory entries for the requested path"),summary:e.string().optional().describe("Human-readable summary of the directory structure"),pagination:s.optional().describe("Pagination info for large directory listings"),warnings:e.array(e.string()).optional().describe("Warnings about skipped or inaccessible entries"),outputPagination:l.optional().describe("Payload pagination metadata when the result body was size-paginated"),hints:i}).strict();export const LocalViewStructureOutputSchema=z(LocalViewStructureDataSchema);export const LspGotoDefinitionDataSchema=e.object({locations:e.array(g).optional().describe("Definition locations with snippets"),resolvedPosition:b.optional().describe("The exact position that was resolved for the symbol lookup"),searchRadius:e.number().int().nonnegative().optional().describe("Number of lines searched around the lineHint to find the symbol"),outputPagination:l.optional().describe("Pagination for large definition results"),hints:i}).strict();export const LspGotoDefinitionOutputSchema=z(LspGotoDefinitionDataSchema);export const LspFindReferencesDataSchema=e.object({locations:e.array(m).optional().describe("Reference locations with snippets"),pagination:p.optional().describe("Pagination info for navigating through reference results"),totalReferences:e.number().int().nonnegative().optional().describe("Total references found across all files"),hasMultipleFiles:e.boolean().optional().describe("Whether references span multiple files"),outputPagination:l.optional().describe("Payload pagination metadata when the result body was size-paginated"),hints:i}).strict();export const LspFindReferencesOutputSchema=z(LspFindReferencesDataSchema);export const LspCallHierarchyDataSchema=e.object({item:f.optional().describe("Target call hierarchy item"),incomingCalls:e.array(y).optional().describe("Callers of the target item"),outgoingCalls:e.array(v).optional().describe("Callees called by the target item"),pagination:p.optional().describe("Pagination info for navigating through call hierarchy results"),outputPagination:l.optional().describe("Pagination for large call hierarchy output"),direction:e.enum(["incoming","outgoing"]).optional().describe("Direction of the hierarchy traversal"),depth:e.number().int().positive().optional().describe("Traversal depth performed for the hierarchy search"),hints:i}).strict();export const LspCallHierarchyOutputSchema=z(LspCallHierarchyDataSchema);
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { z } from "zod/v4";
|
|
2
|
-
import { EmptyDataSchema, ErrorDataSchema, GitHubCloneRepoDataSchema, GitHubFetchContentDataSchema, GitHubSearchCodeDataSchema, GitHubSearchPullRequestsDataSchema, GitHubSearchRepositoriesDataSchema, GitHubViewRepoStructureDataSchema, PackageSearchDataSchema, LocalSearchCodeDataSchema, LocalGetFileContentDataSchema, LocalFindFilesDataSchema, LocalViewStructureDataSchema, LspGotoDefinitionDataSchema, LspFindReferencesDataSchema, LspCallHierarchyDataSchema } from "./outputSchemas.js";
|
|
3
|
-
export type OutputStatus = "hasResults" | "empty" | "error";
|
|
4
|
-
export type ErrorOutputData = z.infer<typeof ErrorDataSchema>;
|
|
5
|
-
export type EmptyOutputData = z.infer<typeof EmptyDataSchema>;
|
|
6
|
-
export type ToolResult<TData extends object> = {
|
|
7
|
-
status: OutputStatus;
|
|
8
|
-
} & Partial<TData & ErrorOutputData & EmptyOutputData>;
|
|
9
|
-
type ItemOf<TArray> = TArray extends Array<infer TItem> ? TItem : never;
|
|
10
|
-
type ValueOfRecord<TRecord> = TRecord extends Record<string, infer TValue> ? TValue : never;
|
|
11
|
-
export type GitHubCloneRepoData = z.infer<typeof GitHubCloneRepoDataSchema>;
|
|
12
|
-
export type GitHubCloneRepoToolResult = ToolResult<GitHubCloneRepoData>;
|
|
13
|
-
export type GitHubFetchContentData = z.infer<typeof GitHubFetchContentDataSchema>;
|
|
14
|
-
export type GitHubFetchContentToolResult = ToolResult<GitHubFetchContentData>;
|
|
15
|
-
export type GitHubDirectoryFileEntry = ItemOf<NonNullable<GitHubFetchContentData["files"]>>;
|
|
16
|
-
export type GitHubSearchCodeData = z.infer<typeof GitHubSearchCodeDataSchema>;
|
|
17
|
-
export type GitHubSearchCodeToolResult = ToolResult<GitHubSearchCodeData>;
|
|
18
|
-
export type GitHubCodeSearchFile = ItemOf<NonNullable<GitHubSearchCodeData["files"]>>;
|
|
19
|
-
export type GitHubSearchPullRequestsData = z.infer<typeof GitHubSearchPullRequestsDataSchema>;
|
|
20
|
-
export type GitHubSearchPullRequestsToolResult = ToolResult<GitHubSearchPullRequestsData>;
|
|
21
|
-
export type GitHubPullRequestOutput = ItemOf<NonNullable<GitHubSearchPullRequestsData["pull_requests"]>>;
|
|
22
|
-
export type GitHubSearchPullRequestsPagination = NonNullable<GitHubSearchPullRequestsData["pagination"]>;
|
|
23
|
-
export type GitHubSearchRepositoriesData = z.infer<typeof GitHubSearchRepositoriesDataSchema>;
|
|
24
|
-
export type GitHubSearchRepositoriesToolResult = ToolResult<GitHubSearchRepositoriesData>;
|
|
25
|
-
export type GitHubRepositoryOutput = ItemOf<GitHubSearchRepositoriesData["repositories"]>;
|
|
26
|
-
export type GitHubViewRepoStructureData = z.infer<typeof GitHubViewRepoStructureDataSchema>;
|
|
27
|
-
export type GitHubViewRepoStructureToolResult = ToolResult<GitHubViewRepoStructureData>;
|
|
28
|
-
export type GitHubRepoStructureDirectoryEntry = ValueOfRecord<NonNullable<GitHubViewRepoStructureData["structure"]>>;
|
|
29
|
-
export type PackageSearchData = z.infer<typeof PackageSearchDataSchema>;
|
|
30
|
-
export type PackageSearchToolResult = ToolResult<PackageSearchData>;
|
|
31
|
-
export type PackageSearchPackage = ItemOf<PackageSearchData["packages"]>;
|
|
32
|
-
export type LocalSearchCodeData = z.infer<typeof LocalSearchCodeDataSchema>;
|
|
33
|
-
export type LocalSearchCodeToolResult = ToolResult<LocalSearchCodeData>;
|
|
34
|
-
export type LocalSearchCodeFile = ItemOf<NonNullable<LocalSearchCodeData["files"]>>;
|
|
35
|
-
export type LocalSearchCodeMatch = ItemOf<NonNullable<LocalSearchCodeFile["matches"]>>;
|
|
36
|
-
export type LocalSearchCodePagination = NonNullable<LocalSearchCodeData["pagination"]>;
|
|
37
|
-
export type LocalSearchCodeMatchPagination = NonNullable<LocalSearchCodeFile["pagination"]>;
|
|
38
|
-
export type LocalGetFileContentData = z.infer<typeof LocalGetFileContentDataSchema>;
|
|
39
|
-
export type LocalGetFileContentToolResult = ToolResult<LocalGetFileContentData>;
|
|
40
|
-
export type LocalGetFileContentPagination = NonNullable<LocalGetFileContentData["pagination"]>;
|
|
41
|
-
export type LocalGetFileContentMatchRange = ItemOf<NonNullable<LocalGetFileContentData["matchRanges"]>>;
|
|
42
|
-
export type LocalFindFilesData = z.infer<typeof LocalFindFilesDataSchema>;
|
|
43
|
-
export type LocalFindFilesToolResult = ToolResult<LocalFindFilesData>;
|
|
44
|
-
export type LocalFindFilesEntry = ItemOf<NonNullable<LocalFindFilesData["files"]>>;
|
|
45
|
-
export type LocalFindFilesPagination = NonNullable<LocalFindFilesData["pagination"]>;
|
|
46
|
-
export type LocalViewStructureData = z.infer<typeof LocalViewStructureDataSchema>;
|
|
47
|
-
export type LocalViewStructureToolResult = ToolResult<LocalViewStructureData>;
|
|
48
|
-
export type LocalViewStructureEntry = ItemOf<NonNullable<LocalViewStructureData["entries"]>>;
|
|
49
|
-
export type LocalViewStructurePagination = NonNullable<LocalViewStructureData["pagination"]>;
|
|
50
|
-
export type LspGotoDefinitionData = z.infer<typeof LspGotoDefinitionDataSchema>;
|
|
51
|
-
export type LspGotoDefinitionToolResult = ToolResult<LspGotoDefinitionData>;
|
|
52
|
-
export type LspExactPosition = NonNullable<LspGotoDefinitionData["resolvedPosition"]>;
|
|
53
|
-
export type LspCodeSnippet = ItemOf<NonNullable<LspGotoDefinitionData["locations"]>>;
|
|
54
|
-
export type LspRange = LspCodeSnippet["range"];
|
|
55
|
-
export type LspSymbolKind = NonNullable<LspCodeSnippet["symbolKind"]>;
|
|
56
|
-
export type LspFindReferencesData = z.infer<typeof LspFindReferencesDataSchema>;
|
|
57
|
-
export type LspFindReferencesToolResult = ToolResult<LspFindReferencesData>;
|
|
58
|
-
export type LspReferenceLocation = ItemOf<NonNullable<LspFindReferencesData["locations"]>>;
|
|
59
|
-
export type LspFindReferencesPagination = NonNullable<LspFindReferencesData["pagination"]>;
|
|
60
|
-
export type LspCallHierarchyData = z.infer<typeof LspCallHierarchyDataSchema>;
|
|
61
|
-
export type LspCallHierarchyToolResult = ToolResult<LspCallHierarchyData>;
|
|
62
|
-
export type LspCallHierarchyItem = NonNullable<LspCallHierarchyData["item"]>;
|
|
63
|
-
export type LspIncomingCall = ItemOf<NonNullable<LspCallHierarchyData["incomingCalls"]>>;
|
|
64
|
-
export type LspOutgoingCall = ItemOf<NonNullable<LspCallHierarchyData["outgoingCalls"]>>;
|
|
65
|
-
export type LspCallHierarchyPagination = NonNullable<LspCallHierarchyData["pagination"]>;
|
|
66
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{};
|
package/dist/toolMetadata.d.ts
DELETED
package/dist/toolMetadata.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{config as e}from"./configLoader.js";export const completeMetadata={instructions:e.instructions,prompts:e.prompts,toolNames:e.toolNames,baseSchema:{mainResearchGoal:e.baseSchema.mainResearchGoal,researchGoal:e.baseSchema.researchGoal,reasoning:e.baseSchema.reasoning,bulkQuery:a=>e.baseSchema.bulkQueryTemplate.replace("{toolName}",a)},tools:e.tools,baseHints:e.baseHints,genericErrorHints:e.genericErrorHints,bulkOperations:e.bulkOperations};
|
package/dist/types.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
export interface PromptDefinition {
|
|
2
|
-
readonly name: string;
|
|
3
|
-
readonly description: string;
|
|
4
|
-
readonly content: string;
|
|
5
|
-
}
|
|
6
|
-
export type PromptKey = "generate" | "help" | "plan" | "research" | "research_local" | "reviewPR";
|
|
7
|
-
export type PromptMap = Record<PromptKey, PromptDefinition>;
|
|
8
|
-
export interface ToolHints {
|
|
9
|
-
readonly hasResults: readonly string[];
|
|
10
|
-
readonly empty: readonly string[];
|
|
11
|
-
readonly dynamic?: Readonly<Record<string, readonly string[]>>;
|
|
12
|
-
}
|
|
13
|
-
export interface ToolSchema {
|
|
14
|
-
readonly [param: string]: string;
|
|
15
|
-
}
|
|
16
|
-
export interface ToolDefinition {
|
|
17
|
-
readonly name: string;
|
|
18
|
-
readonly description: string;
|
|
19
|
-
readonly schema: ToolSchema;
|
|
20
|
-
readonly hints: ToolHints;
|
|
21
|
-
}
|
|
22
|
-
export type ToolKey = "githubGetFileContent" | "githubSearchCode" | "githubSearchPullRequests" | "githubSearchRepositories" | "githubViewRepoStructure" | "packageSearch" | "githubCloneRepo" | "localGetFileContent" | "localFindFiles" | "localSearchCode" | "localViewStructure" | "lspGotoDefinition" | "lspFindReferences" | "lspCallHierarchy";
|
|
23
|
-
export type ToolMap = Record<ToolKey, ToolDefinition>;
|
|
24
|
-
export type ToolNameKey = "GITHUB_FETCH_CONTENT" | "GITHUB_SEARCH_CODE" | "GITHUB_SEARCH_PULL_REQUESTS" | "GITHUB_SEARCH_REPOSITORIES" | "GITHUB_VIEW_REPO_STRUCTURE" | "PACKAGE_SEARCH" | "GITHUB_CLONE_REPO" | "LOCAL_RIPGREP" | "LOCAL_FETCH_CONTENT" | "LOCAL_FIND_FILES" | "LOCAL_VIEW_STRUCTURE" | "LSP_GOTO_DEFINITION" | "LSP_FIND_REFERENCES" | "LSP_CALL_HIERARCHY";
|
|
25
|
-
export type ToolNames = Record<ToolNameKey, string>;
|
|
26
|
-
export interface BaseSchema {
|
|
27
|
-
readonly mainResearchGoal: string;
|
|
28
|
-
readonly researchGoal: string;
|
|
29
|
-
readonly reasoning: string;
|
|
30
|
-
readonly bulkQueryTemplate: string;
|
|
31
|
-
}
|
|
32
|
-
export interface BaseHints {
|
|
33
|
-
readonly hasResults: readonly string[];
|
|
34
|
-
readonly empty: readonly string[];
|
|
35
|
-
}
|
|
36
|
-
export interface BulkOperationInstructions {
|
|
37
|
-
readonly base: string;
|
|
38
|
-
readonly hasResults: string;
|
|
39
|
-
readonly empty: string;
|
|
40
|
-
readonly error: string;
|
|
41
|
-
}
|
|
42
|
-
export interface BulkOperations {
|
|
43
|
-
readonly instructions: BulkOperationInstructions;
|
|
44
|
-
}
|
|
45
|
-
export interface OctocodeConfig {
|
|
46
|
-
readonly instructions: string;
|
|
47
|
-
readonly prompts: PromptMap;
|
|
48
|
-
readonly toolNames: ToolNames;
|
|
49
|
-
readonly baseSchema: BaseSchema;
|
|
50
|
-
readonly tools: ToolMap;
|
|
51
|
-
readonly baseHints: BaseHints;
|
|
52
|
-
readonly genericErrorHints: readonly string[];
|
|
53
|
-
readonly bulkOperations: BulkOperations;
|
|
54
|
-
}
|
package/dist/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{};
|
package/dist/versionLoader.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface ParsedVersion {
|
|
2
|
-
major: number;
|
|
3
|
-
minor: number;
|
|
4
|
-
patch: number;
|
|
5
|
-
raw: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function findClosestVersion(requestedVersion: string): Promise<ParsedVersion | null>;
|
|
8
|
-
export declare function loadVersionedMetadata<T extends object>(baseMetadata: T, version?: string): Promise<T>;
|
|
9
|
-
/** List all available version strings (synchronous). */
|
|
10
|
-
export declare function listAvailableVersions(): string[];
|
|
11
|
-
export {};
|
package/dist/versionLoader.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as t from"fs";import*as n from"path";import{fileURLToPath as r}from"url";import{deepMerge as o}from"./lib/deep-merge.js";const e="src/data",a=(()=>{try{return n.dirname(r(import.meta.url))}catch{return null}})(),i=/^[a-zA-Z0-9.-]+$/,s=/^(\d+)\.(\d+)\.(\d+)$/;function c(){const t=[];return a&&t.push(n.join(a,"data","default.json")),t.push(n.join(process.cwd(),e,"default.json")),t}function u(){const t=[];return a&&t.push(n.join(a,"data")),t.push(n.join(process.cwd(),e)),t}function f(t){const n=t.match(s);return n&&n[1]&&n[2]&&n[3]?{major:parseInt(n[1],10),minor:parseInt(n[2],10),patch:parseInt(n[3],10),raw:t}:null}function l(t,n){return t.major!==n.major?t.major-n.major:t.minor!==n.minor?t.minor-n.minor:t.patch-n.patch}function p(t){return t.filter(t=>t.endsWith(".json")).map(t=>f(t.replace(".json",""))).filter(t=>null!==t).sort((t,n)=>l(n,t))}async function m(n){try{return await t.promises.access(n),!0}catch{return!1}}export async function findClosestVersion(n){const r=f(n);if(!r)return null;const o=await async function(){for(const n of u()){if(!await m(n))continue;const r=p(await t.promises.readdir(n));if(r.length>0)return r}return[]}();if(0===o.length)return null;for(const t of o)if(l(t,r)<=0)return t;return null}async function d(r){for(const o of u()){const e=n.join(o,r);if(!await m(e))continue;const a=await t.promises.readFile(e,"utf-8");return JSON.parse(a)}return null}export async function loadVersionedMetadata(n,r){if(!r)return async function(n){for(const r of c())if(await m(r))try{const e=await t.promises.readFile(r,"utf-8"),a=JSON.parse(e);return o(a,n)}catch{}return n}(n);if(!i.test(r))return n;try{const e=await d(`${r}.json`);if(e)return o({...n},e);const a=await findClosestVersion(r);if(a){const t=await d(`${a.raw}.json`);if(t)return o({...n},t)}for(const r of c())if(await m(r)){const e=await t.promises.readFile(r,"utf-8"),a=JSON.parse(e);return o(a,n)}}catch{}return n}export function listAvailableVersions(){for(const n of u()){if(!t.existsSync(n))continue;const r=p(t.readdirSync(n));if(r.length>0)return r.map(t=>t.raw)}return[]}
|
|
File without changes
|