@evandu/super-pi-server 0.0.0-stage → 0.1.260
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/README.md +250 -3
- package/agents/code-auditor.md +64 -0
- package/agents/code-designer.md +64 -0
- package/agents/coder.md +24 -0
- package/agents/critic.md +24 -0
- package/agents/document-organizer.md +48 -0
- package/agents/patcher.md +27 -0
- package/agents/planner.md +30 -0
- package/agents/project-leader.md +28 -0
- package/agents/reviewer.md +27 -0
- package/agents/scout.md +27 -0
- package/agents/solution-designer.md +62 -0
- package/agents/super-pi-documents/index.ts +92 -0
- package/agents/super-pi-feishu/index.ts +88 -0
- package/agents/super-pi-knowledge/index.ts +70 -0
- package/agents/super-pi-managed-model/index.ts +9 -0
- package/agents/super-pi-memory/index.ts +75 -0
- package/agents/super-pi-native-tools/index.ts +1 -0
- package/agents/super-pi-task/core.ts +2262 -0
- package/agents/super-pi-task/index.ts +814 -0
- package/agents/super-pi-task/workflow-schema.ts +34 -0
- package/agents/super-pi-web/index.ts +32 -0
- package/agents/verifier.md +25 -0
- package/assets/fonts/LICENSE +92 -0
- package/assets/fonts/NotoSansSC-Bold.otf +0 -0
- package/assets/fonts/NotoSansSC-Regular.otf +0 -0
- package/assets/knowledge-model/README.md +37 -0
- package/assets/knowledge-model/Xenova/bge-small-zh-v1.5/config.json +31 -0
- package/assets/knowledge-model/Xenova/bge-small-zh-v1.5/onnx/model_quantized.onnx +0 -0
- package/assets/knowledge-model/Xenova/bge-small-zh-v1.5/special_tokens_map.json +7 -0
- package/assets/knowledge-model/Xenova/bge-small-zh-v1.5/tokenizer.json +21278 -0
- package/assets/knowledge-model/Xenova/bge-small-zh-v1.5/tokenizer_config.json +15 -0
- package/assets/knowledge-model/Xenova/bge-small-zh-v1.5/vocab.txt +21128 -0
- package/bin/npm-prefix.d.ts +1 -0
- package/bin/npm-prefix.js +10 -0
- package/bin/super-pi.js +349 -0
- package/dist/client/.super-pi-client-sources.json +82 -0
- package/dist/client/assets/CodeMirrorEditor-mi9rGUce.js +2 -0
- package/dist/client/assets/GitDiffEditor-CpoDDQrA.css +1 -0
- package/dist/client/assets/GitDiffEditor-FQBfGxOY.js +29 -0
- package/dist/client/assets/diff-ChtP43wD.js +1 -0
- package/dist/client/assets/dist-AW5lyI3I.js +1 -0
- package/dist/client/assets/dist-B3-a6uF0.js +7 -0
- package/dist/client/assets/dist-BGxkyh6e.js +1 -0
- package/dist/client/assets/dist-BJxfd7yb.js +11 -0
- package/dist/client/assets/dist-BRVQKlcp.js +1 -0
- package/dist/client/assets/dist-BV64A9Ji.js +1 -0
- package/dist/client/assets/dist-BXAOrsjq.js +1 -0
- package/dist/client/assets/dist-CKF2Jksy.js +1 -0
- package/dist/client/assets/dist-CX_Hm4GS.js +1 -0
- package/dist/client/assets/dist-Cus6_oaF.js +2 -0
- package/dist/client/assets/dist-Cx00EZKR.js +23 -0
- package/dist/client/assets/dist-D71y2EI1.js +1 -0
- package/dist/client/assets/dist-D978o95T.js +5 -0
- package/dist/client/assets/dist-Dc1MBGAG.js +1 -0
- package/dist/client/assets/dist-Dds-qLxY.js +9 -0
- package/dist/client/assets/dist-DeD9copn.js +1 -0
- package/dist/client/assets/dist-DuvGReu-.js +6 -0
- package/dist/client/assets/dist-Dvb0SqcK.js +2 -0
- package/dist/client/assets/dist-J6XWqRpB.js +3 -0
- package/dist/client/assets/dist-QzbOCAU6.js +1 -0
- package/dist/client/assets/dist-moiMRpw_.js +1 -0
- package/dist/client/assets/dist-scBkrwv-.js +2 -0
- package/dist/client/assets/dockerfile-BDePf5PZ.js +1 -0
- package/dist/client/assets/index-Cn7hdrDw.js +350 -0
- package/dist/client/assets/index-UfzqdECL.css +1 -0
- package/dist/client/assets/powershell-D8WpQPaX.js +1 -0
- package/dist/client/assets/properties-C357ku5U.js +1 -0
- package/dist/client/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/client/assets/ruby-ChfNwlCY.js +1 -0
- package/dist/client/assets/shell-DwuoZtxw.js +1 -0
- package/dist/client/assets/swift-DKB6_1j6.js +1 -0
- package/dist/client/assets/toml-BPTmHmyx.js +1 -0
- package/dist/client/favicon.ico +0 -0
- package/dist/client/favicon.png +0 -0
- package/dist/client/favicon.svg +10 -0
- package/dist/client/index.html +18 -0
- package/dist/extension.d.ts +15 -0
- package/dist/extension.js +126 -0
- package/dist/server/active-memory.d.ts +247 -0
- package/dist/server/active-memory.js +669 -0
- package/dist/server/agents.d.ts +245 -0
- package/dist/server/agents.js +701 -0
- package/dist/server/application/catalog-service.d.ts +98 -0
- package/dist/server/application/catalog-service.js +245 -0
- package/dist/server/application/conversation-service.d.ts +245 -0
- package/dist/server/application/conversation-service.js +654 -0
- package/dist/server/application/document-service.d.ts +68 -0
- package/dist/server/application/document-service.js +120 -0
- package/dist/server/application/extension-ui-service.d.ts +44 -0
- package/dist/server/application/extension-ui-service.js +135 -0
- package/dist/server/application/feishu-service.d.ts +179 -0
- package/dist/server/application/feishu-service.js +358 -0
- package/dist/server/application/group-chat-service.d.ts +75 -0
- package/dist/server/application/group-chat-service.js +953 -0
- package/dist/server/application/group-execution.d.ts +15 -0
- package/dist/server/application/group-execution.js +77 -0
- package/dist/server/application/project-service.d.ts +464 -0
- package/dist/server/application/project-service.js +2523 -0
- package/dist/server/application/provider-service.d.ts +174 -0
- package/dist/server/application/provider-service.js +510 -0
- package/dist/server/application/run-service.d.ts +547 -0
- package/dist/server/application/run-service.js +2683 -0
- package/dist/server/application/scheduled-task-service.d.ts +184 -0
- package/dist/server/application/scheduled-task-service.js +391 -0
- package/dist/server/application/session-orchestrator-service.d.ts +388 -0
- package/dist/server/application/session-orchestrator-service.js +1146 -0
- package/dist/server/application/session-reminder-service.d.ts +59 -0
- package/dist/server/application/session-reminder-service.js +141 -0
- package/dist/server/application/session-watchdog.d.ts +171 -0
- package/dist/server/application/session-watchdog.js +284 -0
- package/dist/server/application/workspace-service.d.ts +52 -0
- package/dist/server/application/workspace-service.js +186 -0
- package/dist/server/application/worktree-service.d.ts +13 -0
- package/dist/server/application/worktree-service.js +76 -0
- package/dist/server/browser-access.d.ts +34 -0
- package/dist/server/browser-access.js +89 -0
- package/dist/server/capability.d.ts +105 -0
- package/dist/server/capability.js +170 -0
- package/dist/server/command-handler.d.ts +93 -0
- package/dist/server/command-handler.js +540 -0
- package/dist/server/content-search.d.ts +16 -0
- package/dist/server/content-search.js +235 -0
- package/dist/server/conversation-usage.d.ts +22 -0
- package/dist/server/conversation-usage.js +43 -0
- package/dist/server/documents.d.ts +152 -0
- package/dist/server/documents.js +998 -0
- package/dist/server/engineering-learning.d.ts +30 -0
- package/dist/server/engineering-learning.js +106 -0
- package/dist/server/exec-service.d.ts +45 -0
- package/dist/server/exec-service.js +167 -0
- package/dist/server/explicit-file-open.d.ts +34 -0
- package/dist/server/explicit-file-open.js +105 -0
- package/dist/server/failure-text.d.ts +18 -0
- package/dist/server/failure-text.js +44 -0
- package/dist/server/feishu-cli.d.ts +223 -0
- package/dist/server/feishu-cli.js +464 -0
- package/dist/server/file-changes.d.ts +119 -0
- package/dist/server/file-changes.js +280 -0
- package/dist/server/file-diff.d.ts +41 -0
- package/dist/server/file-diff.js +97 -0
- package/dist/server/file-index.d.ts +100 -0
- package/dist/server/file-index.js +296 -0
- package/dist/server/file-name-index.d.ts +160 -0
- package/dist/server/file-name-index.js +411 -0
- package/dist/server/files.d.ts +269 -0
- package/dist/server/files.js +748 -0
- package/dist/server/git.d.ts +245 -0
- package/dist/server/git.js +903 -0
- package/dist/server/http-server.d.ts +45 -0
- package/dist/server/http-server.js +3830 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +485 -0
- package/dist/server/inline-thinking.d.ts +90 -0
- package/dist/server/inline-thinking.js +181 -0
- package/dist/server/json-comments.d.ts +14 -0
- package/dist/server/json-comments.js +71 -0
- package/dist/server/knowledge-embedding-worker.d.ts +1 -0
- package/dist/server/knowledge-embedding-worker.js +27 -0
- package/dist/server/knowledge-vectors.d.ts +150 -0
- package/dist/server/knowledge-vectors.js +385 -0
- package/dist/server/knowledge.d.ts +273 -0
- package/dist/server/knowledge.js +848 -0
- package/dist/server/length-continuation.d.ts +83 -0
- package/dist/server/length-continuation.js +118 -0
- package/dist/server/logging.d.ts +32 -0
- package/dist/server/logging.js +185 -0
- package/dist/server/managed-http-tunnel.d.ts +6 -0
- package/dist/server/managed-http-tunnel.js +85 -0
- package/dist/server/managed-http.d.ts +4 -0
- package/dist/server/managed-http.js +85 -0
- package/dist/server/managed-model-adapter.d.ts +17 -0
- package/dist/server/managed-model-adapter.js +75 -0
- package/dist/server/managed-model-gateway.d.ts +49 -0
- package/dist/server/managed-model-gateway.js +73 -0
- package/dist/server/managed-servers.d.ts +55 -0
- package/dist/server/managed-servers.js +396 -0
- package/dist/server/managed-ssh.d.ts +26 -0
- package/dist/server/managed-ssh.js +73 -0
- package/dist/server/manager-vault.d.ts +11 -0
- package/dist/server/manager-vault.js +67 -0
- package/dist/server/memory-recall.d.ts +25 -0
- package/dist/server/memory-recall.js +45 -0
- package/dist/server/memory.d.ts +67 -0
- package/dist/server/memory.js +216 -0
- package/dist/server/message-media.d.ts +7 -0
- package/dist/server/message-media.js +54 -0
- package/dist/server/model-context-window.d.ts +186 -0
- package/dist/server/model-context-window.js +444 -0
- package/dist/server/model-filter.d.ts +23 -0
- package/dist/server/model-filter.js +48 -0
- package/dist/server/models-store.d.ts +36 -0
- package/dist/server/models-store.js +132 -0
- package/dist/server/native-tool-settings.d.ts +25 -0
- package/dist/server/native-tool-settings.js +41 -0
- package/dist/server/native-tools-extension.d.ts +2 -0
- package/dist/server/native-tools-extension.js +39 -0
- package/dist/server/native-tools-service.d.ts +39 -0
- package/dist/server/native-tools-service.js +240 -0
- package/dist/server/persistence/app-state-repository.d.ts +65 -0
- package/dist/server/persistence/app-state-repository.js +1 -0
- package/dist/server/persistence/json-state-repository.d.ts +14 -0
- package/dist/server/persistence/json-state-repository.js +43 -0
- package/dist/server/persistence/open-state-store.d.ts +3 -0
- package/dist/server/persistence/open-state-store.js +35 -0
- package/dist/server/persistence/rename.d.ts +22 -0
- package/dist/server/persistence/rename.js +44 -0
- package/dist/server/persistence/sqlite-state-repository.d.ts +12 -0
- package/dist/server/persistence/sqlite-state-repository.js +264 -0
- package/dist/server/pi-command.d.ts +94 -0
- package/dist/server/pi-command.js +265 -0
- package/dist/server/pi-native.d.ts +12 -0
- package/dist/server/pi-native.js +16 -0
- package/dist/server/pi-session-events.d.ts +158 -0
- package/dist/server/pi-session-events.js +373 -0
- package/dist/server/pi-session-pool.d.ts +233 -0
- package/dist/server/pi-session-pool.js +382 -0
- package/dist/server/pi-session.d.ts +642 -0
- package/dist/server/pi-session.js +655 -0
- package/dist/server/presentations/schema.d.ts +120 -0
- package/dist/server/presentations/schema.js +128 -0
- package/dist/server/provider-network.d.ts +16 -0
- package/dist/server/provider-network.js +106 -0
- package/dist/server/provider-proxy.d.ts +18 -0
- package/dist/server/provider-proxy.js +200 -0
- package/dist/server/providers.d.ts +333 -0
- package/dist/server/providers.js +989 -0
- package/dist/server/remote-bootstrap.d.ts +17 -0
- package/dist/server/remote-bootstrap.js +119 -0
- package/dist/server/rpc-channel.d.ts +131 -0
- package/dist/server/rpc-channel.js +135 -0
- package/dist/server/runtime.d.ts +1393 -0
- package/dist/server/runtime.js +3286 -0
- package/dist/server/scheduled-tasks.d.ts +101 -0
- package/dist/server/scheduled-tasks.js +138 -0
- package/dist/server/server-context.d.ts +119 -0
- package/dist/server/server-context.js +1 -0
- package/dist/server/session-cwd.d.ts +19 -0
- package/dist/server/session-cwd.js +58 -0
- package/dist/server/session-ledger.d.ts +67 -0
- package/dist/server/session-ledger.js +76 -0
- package/dist/server/session-memory-scope.d.ts +4 -0
- package/dist/server/session-memory-scope.js +30 -0
- package/dist/server/session-repository.d.ts +100 -0
- package/dist/server/session-repository.js +246 -0
- package/dist/server/session-tree-scope.d.ts +125 -0
- package/dist/server/session-tree-scope.js +337 -0
- package/dist/server/skills.d.ts +23 -0
- package/dist/server/skills.js +190 -0
- package/dist/server/store.d.ts +1062 -0
- package/dist/server/store.js +3305 -0
- package/dist/server/subagent-runs.d.ts +185 -0
- package/dist/server/subagent-runs.js +383 -0
- package/dist/server/subagents.d.ts +200 -0
- package/dist/server/subagents.js +619 -0
- package/dist/server/task-tool.d.ts +282 -0
- package/dist/server/task-tool.js +507 -0
- package/dist/server/tavily.d.ts +32 -0
- package/dist/server/tavily.js +136 -0
- package/dist/server/team-context.d.ts +12 -0
- package/dist/server/team-context.js +180 -0
- package/dist/server/terminal.d.ts +163 -0
- package/dist/server/terminal.js +557 -0
- package/dist/server/thinking-level-discovery.d.ts +38 -0
- package/dist/server/thinking-level-discovery.js +183 -0
- package/dist/server/time-zone.d.ts +20 -0
- package/dist/server/time-zone.js +32 -0
- package/dist/server/tool-calls.d.ts +130 -0
- package/dist/server/tool-calls.js +341 -0
- package/dist/server/tool-llm.d.ts +72 -0
- package/dist/server/tool-llm.js +146 -0
- package/dist/server/tool-registry.d.ts +129 -0
- package/dist/server/tool-registry.js +249 -0
- package/dist/server/tool-runner.d.ts +112 -0
- package/dist/server/tool-runner.js +306 -0
- package/dist/server/turn-failure.d.ts +48 -0
- package/dist/server/turn-failure.js +148 -0
- package/dist/server/types.d.ts +2315 -0
- package/dist/server/types.js +11 -0
- package/dist/server/update-status.d.ts +14 -0
- package/dist/server/update-status.js +69 -0
- package/dist/server/update.d.ts +46 -0
- package/dist/server/update.js +104 -0
- package/dist/server/upload.d.ts +35 -0
- package/dist/server/upload.js +177 -0
- package/dist/server/version.d.ts +33 -0
- package/dist/server/version.js +111 -0
- package/dist/server/web.d.ts +27 -0
- package/dist/server/web.js +183 -0
- package/dist/server/workflow-engine.d.ts +47 -0
- package/dist/server/workflow-engine.js +255 -0
- package/dist/server/workflow.d.ts +329 -0
- package/dist/server/workflow.js +469 -0
- package/dist/server/workspace-file-indexes.d.ts +2 -0
- package/dist/server/workspace-file-indexes.js +61 -0
- package/dist/server/workspace-file-operations.d.ts +36 -0
- package/dist/server/workspace-file-operations.js +281 -0
- package/dist/server/workspace-file-response.d.ts +7 -0
- package/dist/server/workspace-file-response.js +79 -0
- package/dist/server/ws-server.d.ts +149 -0
- package/dist/server/ws-server.js +640 -0
- package/dist/shared/agent-order.d.ts +44 -0
- package/dist/shared/agent-order.js +50 -0
- package/dist/shared/archive-decisions.d.ts +44 -0
- package/dist/shared/archive-decisions.js +98 -0
- package/dist/shared/background-task.d.ts +25 -0
- package/dist/shared/background-task.js +183 -0
- package/dist/shared/child-session-lock.d.ts +37 -0
- package/dist/shared/child-session-lock.js +59 -0
- package/dist/shared/content-search.d.ts +22 -0
- package/dist/shared/content-search.js +1 -0
- package/dist/shared/conversation-title.d.ts +4 -0
- package/dist/shared/conversation-title.js +4 -0
- package/dist/shared/file-mentions.d.ts +17 -0
- package/dist/shared/file-mentions.js +91 -0
- package/dist/shared/git-commit.d.ts +11 -0
- package/dist/shared/git-commit.js +1 -0
- package/dist/shared/git-graph.d.ts +42 -0
- package/dist/shared/git-graph.js +30 -0
- package/dist/shared/group-chat.d.ts +132 -0
- package/dist/shared/group-chat.js +6 -0
- package/dist/shared/managed-servers.d.ts +36 -0
- package/dist/shared/managed-servers.js +1 -0
- package/dist/shared/message-media.d.ts +12 -0
- package/dist/shared/message-media.js +27 -0
- package/dist/shared/model-window-label.d.ts +39 -0
- package/dist/shared/model-window-label.js +55 -0
- package/dist/shared/native-tools.d.ts +43 -0
- package/dist/shared/native-tools.js +1 -0
- package/dist/shared/pi-cache-warming.d.ts +9 -0
- package/dist/shared/pi-cache-warming.js +4 -0
- package/dist/shared/project-overview.d.ts +107 -0
- package/dist/shared/project-overview.js +92 -0
- package/dist/shared/project-presentation.d.ts +55 -0
- package/dist/shared/project-presentation.js +111 -0
- package/dist/shared/provider-network.d.ts +30 -0
- package/dist/shared/provider-network.js +1 -0
- package/dist/shared/session-reporting.d.ts +40 -0
- package/dist/shared/session-reporting.js +97 -0
- package/dist/shared/session-search.d.ts +14 -0
- package/dist/shared/session-search.js +1 -0
- package/dist/shared/team-context-view.d.ts +33 -0
- package/dist/shared/team-context-view.js +49 -0
- package/dist/shared/team-context.d.ts +59 -0
- package/dist/shared/team-context.js +3 -0
- package/dist/shared/terminal-protocol.d.ts +71 -0
- package/dist/shared/terminal-protocol.js +1 -0
- package/dist/shared/thinking-levels.d.ts +53 -0
- package/dist/shared/thinking-levels.js +85 -0
- package/dist/shared/tool-glyph.d.ts +7 -0
- package/dist/shared/tool-glyph.js +19 -0
- package/dist/shared/transcript-order.d.ts +7 -0
- package/dist/shared/transcript-order.js +12 -0
- package/dist/shared/update-status.d.ts +28 -0
- package/dist/shared/update-status.js +1 -0
- package/dist/shared/workspace-file-preview.d.ts +4 -0
- package/dist/shared/workspace-file-preview.js +28 -0
- package/package.json +450 -4
- package/scripts/diagnose.mjs +603 -0
- package/scripts/patch-brace-expansion.mjs +260 -0
- package/scripts/restart-server.mjs +104 -0
- package/skills/presentation/SKILL.md +30 -0
- package/skills/presentation/references/data.md +10 -0
- package/skills/presentation/references/quality.md +12 -0
- package/skills/presentation/references/story.md +12 -0
- package/skills/presentation/references/templates-and-editing.md +11 -0
- package/skills/presentation/references/visual-system.md +10 -0
- package/skills/super-pi-agent-development/SKILL.md +25 -0
- package/skills/super-pi-development/SKILL.md +31 -0
- package/skills/super-pi-tool-development/SKILL.md +39 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import type { GitCommitDetail } from "../shared/git-commit.js";
|
|
2
|
+
import type { GitGraphResponse } from "../shared/git-graph.js";
|
|
3
|
+
export type GitWorkspace = {
|
|
4
|
+
branch: string | null;
|
|
5
|
+
detached: boolean;
|
|
6
|
+
unborn: boolean;
|
|
7
|
+
ahead: number | null;
|
|
8
|
+
behind: number | null;
|
|
9
|
+
staged: GitFile[];
|
|
10
|
+
unstaged: GitFile[];
|
|
11
|
+
untracked: GitFile[];
|
|
12
|
+
};
|
|
13
|
+
export type GitFile = {
|
|
14
|
+
path: string;
|
|
15
|
+
name: string;
|
|
16
|
+
xy: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function gitStatus(root: string, cwd?: string): Promise<GitWorkspace>;
|
|
19
|
+
export declare function gitLog(root: string, limit: number, cwd?: string, query?: string, offset?: number): Promise<{
|
|
20
|
+
commits: {
|
|
21
|
+
hash: string;
|
|
22
|
+
short: string;
|
|
23
|
+
subject: string;
|
|
24
|
+
author: string;
|
|
25
|
+
date: string;
|
|
26
|
+
}[];
|
|
27
|
+
truncated: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
export declare function gitGraph(root: string, limit: number, offset: number, snapshot: string, after: string, knownSnapshot?: string): Promise<GitGraphResponse>;
|
|
30
|
+
export declare function gitCommit(root: string, cwd: string, hash: string): Promise<GitCommitDetail>;
|
|
31
|
+
export declare function gitCommitDiff(root: string, cwd: string, hash: string, path: string, fullContext?: boolean): Promise<{
|
|
32
|
+
path: string;
|
|
33
|
+
staged: boolean;
|
|
34
|
+
kind: "binary" | "text";
|
|
35
|
+
diff: string | null;
|
|
36
|
+
}>;
|
|
37
|
+
export type GitWorktree = {
|
|
38
|
+
id: string;
|
|
39
|
+
path: string;
|
|
40
|
+
name: string;
|
|
41
|
+
branch: string | null;
|
|
42
|
+
head: string;
|
|
43
|
+
current: boolean;
|
|
44
|
+
primary: boolean;
|
|
45
|
+
locked: boolean;
|
|
46
|
+
missing: boolean;
|
|
47
|
+
};
|
|
48
|
+
export declare function parseWorktreePorcelain(raw: string, nul: boolean): {
|
|
49
|
+
path: string;
|
|
50
|
+
head: string;
|
|
51
|
+
index: number;
|
|
52
|
+
branch: string | null;
|
|
53
|
+
locked: boolean;
|
|
54
|
+
prunable: boolean;
|
|
55
|
+
}[];
|
|
56
|
+
export declare function gitWorktrees(root: string): Promise<{
|
|
57
|
+
worktrees: GitWorktree[];
|
|
58
|
+
commonDir: string;
|
|
59
|
+
}>;
|
|
60
|
+
export declare function resolveGitWorktree(root: string, id: string): Promise<{
|
|
61
|
+
path: string;
|
|
62
|
+
entry: GitWorktree;
|
|
63
|
+
base: GitWorktree | undefined;
|
|
64
|
+
}>;
|
|
65
|
+
export declare function createGitWorktree(root: string, storage: string, requestKey: string, options: {
|
|
66
|
+
branch?: string;
|
|
67
|
+
base?: string;
|
|
68
|
+
}): Promise<GitWorktree>;
|
|
69
|
+
export declare function inspectGitWorktree(path: string, base: GitWorktree | undefined): Promise<{
|
|
70
|
+
status: GitWorkspace;
|
|
71
|
+
comparison: null;
|
|
72
|
+
} | {
|
|
73
|
+
status: GitWorkspace;
|
|
74
|
+
comparison: {
|
|
75
|
+
base: string;
|
|
76
|
+
ahead: number;
|
|
77
|
+
behind: number;
|
|
78
|
+
commits: {
|
|
79
|
+
hash: string;
|
|
80
|
+
short: string;
|
|
81
|
+
subject: string;
|
|
82
|
+
author: string;
|
|
83
|
+
date: string;
|
|
84
|
+
}[];
|
|
85
|
+
truncated: boolean;
|
|
86
|
+
files: GitFile[];
|
|
87
|
+
};
|
|
88
|
+
}>;
|
|
89
|
+
export declare function gitWorktreeCommittedDiff(root: string, base: GitWorktree | undefined, path: string, fullContext?: boolean): Promise<{
|
|
90
|
+
path: string;
|
|
91
|
+
staged: boolean;
|
|
92
|
+
kind: "text";
|
|
93
|
+
diff: string;
|
|
94
|
+
} | {
|
|
95
|
+
path: string;
|
|
96
|
+
staged: boolean;
|
|
97
|
+
kind: "binary";
|
|
98
|
+
diff: null;
|
|
99
|
+
}>;
|
|
100
|
+
export declare function gitBranches(root: string, cwd: string, query: string, offset: number): Promise<{
|
|
101
|
+
branches: {
|
|
102
|
+
name: string;
|
|
103
|
+
local: boolean;
|
|
104
|
+
current: boolean;
|
|
105
|
+
}[];
|
|
106
|
+
total: number;
|
|
107
|
+
matches: number;
|
|
108
|
+
canWrite: boolean;
|
|
109
|
+
}>;
|
|
110
|
+
export declare function gitStashes(root: string, cwd: string, query?: string, offset?: number): Promise<{
|
|
111
|
+
stashes: {
|
|
112
|
+
hash: string;
|
|
113
|
+
ref: string;
|
|
114
|
+
subject: string;
|
|
115
|
+
date: string;
|
|
116
|
+
}[];
|
|
117
|
+
total: number;
|
|
118
|
+
matches: number;
|
|
119
|
+
canWrite: boolean;
|
|
120
|
+
}>;
|
|
121
|
+
export declare function gitStagedDraftInput(root: string, cwd: string): Promise<{
|
|
122
|
+
patch: string;
|
|
123
|
+
truncated: boolean;
|
|
124
|
+
}>;
|
|
125
|
+
export declare function gitDiff(root: string, path: string, staged: boolean, fullContext?: boolean): Promise<{
|
|
126
|
+
path: string;
|
|
127
|
+
staged: boolean;
|
|
128
|
+
diff: null;
|
|
129
|
+
kind: "untracked";
|
|
130
|
+
currentExists: boolean;
|
|
131
|
+
} | {
|
|
132
|
+
path: string;
|
|
133
|
+
staged: boolean;
|
|
134
|
+
diff: string;
|
|
135
|
+
kind: "binary" | "text";
|
|
136
|
+
currentExists: boolean;
|
|
137
|
+
}>;
|
|
138
|
+
/** Read the index version for the editable working-tree comparison. The path is resolved beneath the
|
|
139
|
+
* workspace before it becomes a Git object expression, and the blob stays within the file editor's
|
|
140
|
+
* existing size limit. */
|
|
141
|
+
export declare function gitIndexFileContent(root: string, path: string): Promise<string>;
|
|
142
|
+
/**
|
|
143
|
+
* The content of a file AS IT WAS COMMITTED, or `null` when there is no such version.
|
|
144
|
+
*
|
|
145
|
+
* WHY THIS EXISTS ALONGSIDE `gitDiff`. `gitDiff` answers "what changed relative to HEAD" as a PATCH -
|
|
146
|
+
* which is a good thing to read and a bad thing to diff against: a patch is a set of hunks, and
|
|
147
|
+
* reconstructing the "before" text from it is a lossy operation that a review view should not depend on.
|
|
148
|
+
* The review view needs the two TEXTS, so that the difference between them is computed by one
|
|
149
|
+
* well-tested algorithm rather than by two different ones.
|
|
150
|
+
*
|
|
151
|
+
* `null` covers three different situations, and the caller must not confuse them: the repository has no
|
|
152
|
+
* commits yet (`unborn`), the file was never committed (it is new or untracked), or the file is not in
|
|
153
|
+
* this repository at all. The first two are the same answer for a review - "there is no committed
|
|
154
|
+
* version to compare against" - and the third is a refusal, which the caller reports.
|
|
155
|
+
*/
|
|
156
|
+
export declare function gitHeadContent(root: string, path: string): Promise<string | null>;
|
|
157
|
+
/**
|
|
158
|
+
* A file larger than this is refused for blame (`too_large`) rather than blamed. Blame's cost scales
|
|
159
|
+
* with a text file's LINE count, and a file this size can carry millions of them, so the bound is
|
|
160
|
+
* checked from `stat` (working tree) or `git cat-file -s` (a revision) BEFORE any content is read -
|
|
161
|
+
* an oversized file costs one stat, never a buffer.
|
|
162
|
+
*/
|
|
163
|
+
export declare const MAX_BLAME_FILE_BYTES: number;
|
|
164
|
+
/**
|
|
165
|
+
* The most lines one blame response may carry. `--line-porcelain` emits roughly 300-500 bytes of
|
|
166
|
+
* metadata per line, so this cap bounds the response and the parse to single-digit megabytes. A
|
|
167
|
+
* whole-file request for a longer file is answered with the FIRST `MAX_BLAME_LINES` entries and
|
|
168
|
+
* `truncated: true`; a caller that wants more asks for an explicit `startLine`/`endLine` window -
|
|
169
|
+
* which is what the gutter does anyway, and a window may not exceed this cap either.
|
|
170
|
+
*/
|
|
171
|
+
export declare const MAX_BLAME_LINES = 20000;
|
|
172
|
+
export type GitBlameLine = {
|
|
173
|
+
/** 1-based line number in the file AS BLAMED - the working tree by default, or the requested revision. */
|
|
174
|
+
line: number;
|
|
175
|
+
commit: string | null;
|
|
176
|
+
shortCommit: string | null;
|
|
177
|
+
author: string | null;
|
|
178
|
+
authorEmail: string | null;
|
|
179
|
+
/** Author time as an ISO instant, or `null` when git did not supply a parseable one. */
|
|
180
|
+
date: string | null;
|
|
181
|
+
/** First line of the commit message. */
|
|
182
|
+
summary: string | null;
|
|
183
|
+
/** The line differs from the blame anchor and exists only in the working tree - git reported the
|
|
184
|
+
* all-zero commit for it. Such lines carry `null` for every other field: there is no commit to
|
|
185
|
+
* name, and inventing "Not Committed Yet" placeholders would put git's English prose into a
|
|
186
|
+
* structured contract the client is meant to phrase in its own words. */
|
|
187
|
+
isUncommitted: boolean;
|
|
188
|
+
};
|
|
189
|
+
/** Why blame is not available for a file that otherwise exists. Reported as `supported: false` inside
|
|
190
|
+
* a 200, NOT thrown: these are facts about the file or repository a gutter renders as a state word,
|
|
191
|
+
* not request errors. (`not_a_repo` is deliberately NOT one of these - it is thrown, so it maps to
|
|
192
|
+
* the same 404 the other /api/git ops return, per the endpoint's one shared error vocabulary.) */
|
|
193
|
+
export type GitBlameUnsupportedReason = "untracked" | "binary" | "too_large" | "no_head" | "not_in_revision";
|
|
194
|
+
export type GitBlameResponse = {
|
|
195
|
+
/** Workspace-relative path, always `/`-separated: the canonical form of what was requested, not an
|
|
196
|
+
* echo of it - `sub\inner.txt` and `sub/../sub/inner.txt` both come back as `sub/inner.txt`. */
|
|
197
|
+
path: string;
|
|
198
|
+
/** The revision blame was anchored to: the requested one, or `"HEAD"` for the default - which blames
|
|
199
|
+
* the WORKING TREE, which is why uncommitted lines can appear (flagged `isUncommitted`). */
|
|
200
|
+
revision: string;
|
|
201
|
+
lines: GitBlameLine[];
|
|
202
|
+
/** Lines in the file as blamed, including lines outside a requested window. */
|
|
203
|
+
totalLines: number;
|
|
204
|
+
/** True when a WHOLE-FILE request was cut at `MAX_BLAME_LINES`. A windowed request is never
|
|
205
|
+
* `truncated`: the caller asked for exactly what it got. */
|
|
206
|
+
truncated: boolean;
|
|
207
|
+
supported: boolean;
|
|
208
|
+
reason?: GitBlameUnsupportedReason;
|
|
209
|
+
};
|
|
210
|
+
export type GitBlameOptions = {
|
|
211
|
+
/** A commit-ish to blame instead of the working tree. Resolved through `rev-parse --verify` before
|
|
212
|
+
* anything else uses it; a revision git cannot resolve is a `bad_revision` error. */
|
|
213
|
+
revision?: string;
|
|
214
|
+
/** 1-based inclusive window. Both or neither; positive integers; start <= end; end <= totalLines;
|
|
215
|
+
* the span may not exceed `MAX_BLAME_LINES`. Violations throw `bad_range` with the bound named. */
|
|
216
|
+
startLine?: number;
|
|
217
|
+
endLine?: number;
|
|
218
|
+
/** RESERVED, currently a no-op: blame follows the requested path name only and does not aggregate
|
|
219
|
+
* history across renames. The field exists so a caller can state its intent without this contract
|
|
220
|
+
* growing a second shape on the day rename support lands. */
|
|
221
|
+
follow?: boolean;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* Line-by-line provenance for one file: who last touched each line, in which commit.
|
|
225
|
+
*
|
|
226
|
+
* SECURITY BOUNDARY. `path` arrives from a browser and is contained exactly as `gitDiff` and
|
|
227
|
+
* `gitHeadContent` contain it - resolve against the workspace root, refuse anything that lands
|
|
228
|
+
* outside. Backslashes are normalised to `/` FIRST, so a Windows-spelled relative path resolves like
|
|
229
|
+
* the same request spelled with `/` and the git invocation and the response share the one separator
|
|
230
|
+
* this API speaks. `revision` arrives from the same untrusted place: it may not start with `-` (that
|
|
231
|
+
* is how an argument becomes a git FLAG) and may not carry whitespace or NUL. Every git call here is
|
|
232
|
+
* `execFile` with an argument array - no shell, no string interpolation into a command line - and the
|
|
233
|
+
* path always travels after a bare `--`, so no path can be read as an option.
|
|
234
|
+
*
|
|
235
|
+
* FAILURE SHAPE. Facts about the file or repository (`untracked`, `binary`, `too_large`, `no_head`,
|
|
236
|
+
* `not_in_revision`) come back as `supported: false` - the gutter renders them, it does not error on
|
|
237
|
+
* them. Request mistakes (path escapes, a missing file, a bad revision, an illegal range) throw with
|
|
238
|
+
* a stable `code` for the HTTP layer to map. Git's raw stderr never reaches a caller: expected
|
|
239
|
+
* failures are thrown as written sentences, and an unexpected git failure is logged here and thrown
|
|
240
|
+
* as one stable sentence.
|
|
241
|
+
*/
|
|
242
|
+
export declare function gitBlame(root: string, path: string, options?: GitBlameOptions): Promise<GitBlameResponse>;
|
|
243
|
+
/** Whether the directory is a git repository at all. The review view asks before it offers a git baseline. */
|
|
244
|
+
export declare function isGitRepository(root: string): Promise<boolean>;
|
|
245
|
+
export declare function gitMutate(root: string, op: string, path?: string, message?: string, cwd?: string, target?: string): Promise<GitWorkspace>;
|