@scolladon/tsgit 1.3.0 → 2.0.1
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 +3 -2
- package/dist/cjs/adapters/browser/index.cjs +1 -1
- package/dist/cjs/adapters/memory/index.cjs +1 -1
- package/dist/cjs/adapters/memory/index.cjs.map +1 -1
- package/dist/cjs/adapters/node/index.cjs +1 -1
- package/dist/cjs/chunks/adapter-detect-CD_LcgaH.cjs +2 -0
- package/dist/cjs/chunks/adapter-detect-CD_LcgaH.cjs.map +1 -0
- package/dist/cjs/chunks/{browser-http-transport-D4NH-8oJ.cjs → browser-http-transport-CiMRqtDS.cjs} +2 -2
- package/dist/cjs/chunks/browser-http-transport-CiMRqtDS.cjs.map +1 -0
- package/dist/cjs/chunks/error-CfjFO3x_.cjs +2 -0
- package/dist/cjs/chunks/error-CfjFO3x_.cjs.map +1 -0
- package/dist/cjs/chunks/index-BWCq_5BJ.cjs +2 -0
- package/dist/cjs/chunks/index-BWCq_5BJ.cjs.map +1 -0
- package/dist/cjs/chunks/memory-http-transport-BVL6VgB-.cjs +2 -0
- package/dist/cjs/chunks/memory-http-transport-BVL6VgB-.cjs.map +1 -0
- package/dist/cjs/chunks/node-http-transport-BvfVcf02.cjs +2 -0
- package/dist/cjs/chunks/node-http-transport-BvfVcf02.cjs.map +1 -0
- package/dist/cjs/chunks/{progress-Bj2w-90A.cjs → progress-CxU62NC1.cjs} +2 -2
- package/dist/cjs/chunks/{progress-Bj2w-90A.cjs.map → progress-CxU62NC1.cjs.map} +1 -1
- package/dist/cjs/chunks/repository-BEg2zNtx.cjs +2 -0
- package/dist/cjs/chunks/repository-BEg2zNtx.cjs.map +1 -0
- package/dist/cjs/chunks/walk-submodules-D2Sp7JEB.cjs +2 -0
- package/dist/cjs/chunks/walk-submodules-D2Sp7JEB.cjs.map +1 -0
- package/dist/cjs/commands/index.cjs +1 -1
- package/dist/cjs/index.browser.cjs +1 -1
- package/dist/cjs/index.browser.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.default.cjs +1 -1
- package/dist/cjs/index.default.cjs.map +1 -1
- package/dist/cjs/index.node.cjs +1 -1
- package/dist/cjs/index.node.cjs.map +1 -1
- package/dist/cjs/primitives/index.cjs +1 -1
- package/dist/cjs/primitives/index.cjs.map +1 -1
- package/dist/esm/adapters/browser/index.js +1 -1
- package/dist/esm/adapters/memory/index.js +1 -1
- package/dist/esm/adapters/memory/index.js.map +1 -1
- package/dist/esm/adapters/node/index.js +1 -1
- package/dist/esm/adapters/node/index.js.map +1 -1
- package/dist/esm/chunks/adapter-detect-DkZhhUhd.js +2 -0
- package/dist/esm/chunks/adapter-detect-DkZhhUhd.js.map +1 -0
- package/dist/esm/chunks/{browser-http-transport-DL8bkNdg.js → browser-http-transport-4rJkHcQu.js} +2 -2
- package/dist/esm/chunks/browser-http-transport-4rJkHcQu.js.map +1 -0
- package/dist/esm/chunks/error-Dc-SRSJK.js +2 -0
- package/dist/esm/chunks/error-Dc-SRSJK.js.map +1 -0
- package/dist/esm/chunks/index-jH0UMhh-.js +2 -0
- package/dist/esm/chunks/index-jH0UMhh-.js.map +1 -0
- package/dist/esm/chunks/memory-http-transport-CA1WxWBp.js +2 -0
- package/dist/esm/chunks/memory-http-transport-CA1WxWBp.js.map +1 -0
- package/dist/esm/chunks/node-http-transport-DPa2lK3T.js +2 -0
- package/dist/esm/chunks/node-http-transport-DPa2lK3T.js.map +1 -0
- package/dist/esm/chunks/progress-BZobfl7p.js +2 -0
- package/dist/esm/chunks/{progress-NePjO3Kd.js.map → progress-BZobfl7p.js.map} +1 -1
- package/dist/esm/chunks/repository-DF6ePd1x.js +2 -0
- package/dist/esm/chunks/repository-DF6ePd1x.js.map +1 -0
- package/dist/esm/chunks/walk-submodules-Dq9oGwP8.js +2 -0
- package/dist/esm/chunks/walk-submodules-Dq9oGwP8.js.map +1 -0
- package/dist/esm/commands/index.js +1 -1
- package/dist/esm/index.browser.js +1 -1
- package/dist/esm/index.browser.js.map +1 -1
- package/dist/esm/index.default.js +1 -1
- package/dist/esm/index.default.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.node.js +1 -1
- package/dist/esm/index.node.js.map +1 -1
- package/dist/esm/primitives/index.js +1 -1
- package/dist/esm/primitives/index.js.map +1 -1
- package/dist/types/adapters/browser/index.d.cts +5 -2
- package/dist/types/adapters/browser/index.d.ts +5 -2
- package/dist/types/adapters/memory/index.d.cts +17 -2
- package/dist/types/adapters/memory/index.d.ts +17 -2
- package/dist/types/adapters/node/index.d.cts +5 -2
- package/dist/types/adapters/node/index.d.ts +5 -2
- package/dist/types/chunks/{context-BORy7yXb.d.ts → context-CCL0_F8R.d.ts} +65 -39
- package/dist/types/chunks/{context-CMrHCVwK.d.cts → context-YDw6qicq.d.cts} +65 -39
- package/dist/types/chunks/{http-transport-DirKfK2S.d.cts → http-transport--_NdQOiw.d.cts} +1 -1
- package/dist/types/chunks/{http-transport-DirKfK2S.d.ts → http-transport--_NdQOiw.d.ts} +1 -1
- package/dist/types/chunks/index-entry-DtEbVpOG.d.cts +47 -0
- package/dist/types/chunks/index-entry-UD4dvtKh.d.ts +47 -0
- package/dist/types/chunks/progress-7KKiXXfX.d.ts +405 -0
- package/dist/types/chunks/progress-By8yFaUE.d.cts +405 -0
- package/dist/types/chunks/{reflog-entry-C2Hsdobk.d.ts → reflog-entry-BbNnXCTC.d.cts} +17 -3
- package/dist/types/chunks/{reflog-entry-DNvSz7S5.d.cts → reflog-entry-CSzjnZd4.d.ts} +17 -3
- package/dist/types/chunks/{repository-DCR_3RVt.d.cts → repository-BeifCqp0.d.cts} +48 -8
- package/dist/types/chunks/{repository-DFxFeYi3.d.ts → repository-FoS_Laoy.d.ts} +48 -8
- package/dist/types/chunks/{write-tree-CuhpWKFo.d.cts → write-tree-C3oNxOlX.d.cts} +78 -46
- package/dist/types/chunks/{write-tree-Dn1LtIh7.d.ts → write-tree-DRI-LzSr.d.ts} +78 -46
- package/dist/types/commands/index.d.cts +826 -95
- package/dist/types/commands/index.d.ts +826 -95
- package/dist/types/index.browser.d.cts +7 -6
- package/dist/types/index.browser.d.ts +7 -6
- package/dist/types/index.d.cts +278 -53
- package/dist/types/index.d.ts +278 -53
- package/dist/types/index.default.d.cts +7 -6
- package/dist/types/index.default.d.ts +7 -6
- package/dist/types/index.node.d.cts +7 -6
- package/dist/types/index.node.d.ts +7 -6
- package/dist/types/primitives/index.d.cts +260 -12
- package/dist/types/primitives/index.d.ts +260 -12
- package/dist/types/transport/index.d.cts +1 -1
- package/dist/types/transport/index.d.ts +1 -1
- package/package.json +25 -18
- package/dist/cjs/chunks/browser-http-transport-D4NH-8oJ.cjs.map +0 -1
- package/dist/cjs/chunks/error-CDLOBdNU.cjs +0 -2
- package/dist/cjs/chunks/error-CDLOBdNU.cjs.map +0 -1
- package/dist/cjs/chunks/index-BVArBKuk.cjs +0 -2
- package/dist/cjs/chunks/index-BVArBKuk.cjs.map +0 -1
- package/dist/cjs/chunks/index-DE9HSiWf.cjs +0 -2
- package/dist/cjs/chunks/index-DE9HSiWf.cjs.map +0 -1
- package/dist/cjs/chunks/logger-CVG0zcPH.cjs +0 -2
- package/dist/cjs/chunks/logger-CVG0zcPH.cjs.map +0 -1
- package/dist/cjs/chunks/memory-http-transport-DXwDGKtR.cjs +0 -2
- package/dist/cjs/chunks/memory-http-transport-DXwDGKtR.cjs.map +0 -1
- package/dist/cjs/chunks/node-http-transport-vrbnNEDb.cjs +0 -2
- package/dist/cjs/chunks/node-http-transport-vrbnNEDb.cjs.map +0 -1
- package/dist/cjs/chunks/repository-BJwTSiGf.cjs +0 -2
- package/dist/cjs/chunks/repository-BJwTSiGf.cjs.map +0 -1
- package/dist/esm/chunks/browser-http-transport-DL8bkNdg.js.map +0 -1
- package/dist/esm/chunks/error-MOmSzp9Z.js +0 -2
- package/dist/esm/chunks/error-MOmSzp9Z.js.map +0 -1
- package/dist/esm/chunks/index-BjmofbKE.js +0 -2
- package/dist/esm/chunks/index-BjmofbKE.js.map +0 -1
- package/dist/esm/chunks/index-Jh5R-UmU.js +0 -2
- package/dist/esm/chunks/index-Jh5R-UmU.js.map +0 -1
- package/dist/esm/chunks/logger-DP2cCpvL.js +0 -2
- package/dist/esm/chunks/logger-DP2cCpvL.js.map +0 -1
- package/dist/esm/chunks/memory-http-transport-COJU6VOL.js +0 -2
- package/dist/esm/chunks/memory-http-transport-COJU6VOL.js.map +0 -1
- package/dist/esm/chunks/node-http-transport-DYCFIJbc.js +0 -2
- package/dist/esm/chunks/node-http-transport-DYCFIJbc.js.map +0 -1
- package/dist/esm/chunks/progress-NePjO3Kd.js +0 -2
- package/dist/esm/chunks/repository-Cs-dbHqO.js +0 -2
- package/dist/esm/chunks/repository-Cs-dbHqO.js.map +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-
|
|
2
|
-
export { AdapterSet, consoleProgress, detectRuntime, isBrowser, isNode, noopProgress } from './
|
|
3
|
-
export { P as ProgressReporter } from './chunks/context-
|
|
1
|
+
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-BeifCqp0.cjs';
|
|
2
|
+
export { A as AdapterSet, c as consoleProgress, d as detectRuntime, i as isBrowser, a as isNode, n as noopProgress } from './chunks/progress-By8yFaUE.cjs';
|
|
3
|
+
export { P as ProgressReporter } from './chunks/context-YDw6qicq.cjs';
|
|
4
4
|
import './commands/index.cjs';
|
|
5
|
-
import './chunks/reflog-entry-
|
|
6
|
-
import './chunks/write-tree-
|
|
7
|
-
import './chunks/
|
|
5
|
+
import './chunks/reflog-entry-BbNnXCTC.cjs';
|
|
6
|
+
import './chunks/write-tree-C3oNxOlX.cjs';
|
|
7
|
+
import './chunks/index-entry-DtEbVpOG.cjs';
|
|
8
|
+
import './chunks/http-transport--_NdQOiw.cjs';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Browser-runtime extension to `OpenRepositoryOptions`. The browser cannot
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-
|
|
2
|
-
export { AdapterSet, consoleProgress, detectRuntime, isBrowser, isNode, noopProgress } from './
|
|
3
|
-
export { P as ProgressReporter } from './chunks/context-
|
|
1
|
+
import { O as OpenRepositoryOptions, R as Repository } from './chunks/repository-FoS_Laoy.js';
|
|
2
|
+
export { A as AdapterSet, c as consoleProgress, d as detectRuntime, i as isBrowser, a as isNode, n as noopProgress } from './chunks/progress-7KKiXXfX.js';
|
|
3
|
+
export { P as ProgressReporter } from './chunks/context-CCL0_F8R.js';
|
|
4
4
|
import './commands/index.js';
|
|
5
|
-
import './chunks/reflog-entry-
|
|
6
|
-
import './chunks/write-tree-
|
|
7
|
-
import './chunks/
|
|
5
|
+
import './chunks/reflog-entry-CSzjnZd4.js';
|
|
6
|
+
import './chunks/write-tree-DRI-LzSr.js';
|
|
7
|
+
import './chunks/index-entry-UD4dvtKh.js';
|
|
8
|
+
import './chunks/http-transport--_NdQOiw.js';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Browser-runtime extension to `OpenRepositoryOptions`. The browser cannot
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,68 +1,293 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { I as IndexResolver, b as Snapshot, e as IndexEntry, f as SnapshotEntry, T as TreeResolver, g as TreeEntry } from './chunks/progress-By8yFaUE.cjs';
|
|
2
|
+
export { A as AdapterSet, h as IndexSnapshot, R as ResolveOptions, S as SnapshotFactory, j as SnapshotFactoryDeps, k as SnapshotOptions, l as StashSnapshot, m as TreeSnapshot, W as WalkIgnorePredicate, o as WorkdirEntry, p as WorkdirEnumOptions, q as WorkdirEnumerator, r as WorkdirSnapshot, s as WorkdirSnapshotDeps, t as WorkdirSnapshotOptions, c as consoleProgress, u as createSnapshotFactory, v as createStashSnapshot, w as createWorkdirSnapshot, d as detectRuntime, i as isBrowser, a as isNode, n as noopProgress } from './chunks/progress-By8yFaUE.cjs';
|
|
3
|
+
export { AbortMergeResult, AddOptions, AddResult, BranchCreateInput, BranchCreateResult, BranchDeleteInput, BranchDeleteResult, BranchInfo, BranchListResult, BranchNamespace, BranchRenameInput, BranchRenameResult, CatFileInput, CatFileResult, ChangeEntry, ChangeKind, CheckoutOptions, CheckoutResult, CherryPickAbortResult, CherryPickConflict, CherryPickContinueInput, CherryPickNamespace, CherryPickResult, CherryPickRunInput, CherryPickedCommit, CloneOptions, CloneResult, CommitOptions, CommitResult, ConfigEntryView, ConfigGetAllInput, ConfigGetAllResult, ConfigGetInput, ConfigGetRegexpInput, ConfigGetRegexpResult, ConfigGetResult, ConfigListInput, ConfigListResult, ConfigNamespace, ConfigRemoveSectionInput, ConfigRemoveSectionResult, ConfigRenameSectionInput, ConfigRenameSectionResult, ConfigSetInput, ConfigSetResult, ConfigUnsetAllInput, ConfigUnsetAllResult, ConfigUnsetInput, ConfigUnsetResult, ContinueMergeOptions, ContinueMergeResult, DiffFormat, DiffOptions, DiffResult, FetchMissingOptions, FetchMissingResult, FetchOptions, FetchResult, InitOptions, InitResult, LogEntry, LogOptions, MergeOptions, MergeResult, MvMove, MvOptions, MvResult, MvSkipReason, MvSkipped, PatchResult, PullOptions, PullResult, PushOptions, PushResult, RebaseAbortResult, RebaseConflict, RebaseInstruction, RebaseInteractiveAction, RebaseNamespace, RebaseResult, RebaseRunInput, RebasedCommit, ReflogAction, ReflogResult, ReflogShowEntry, RemoteAddInput, RemoteAddResult, RemoteInfo, RemoteListResult, RemoteNamespace, RemoteRemoveInput, RemoteRemoveResult, RemoteRenameInput, RemoteRenameResult, RemoteSetUrlInput, RemoteSetUrlResult, RemoteShow, RemoteShowInput, RemoteShowResult, ResetMode, ResetOptions, ResetResult, RevertAbortResult, RevertConflict, RevertNamespace, RevertResult, RevertRunInput, RevertedCommit, RmOptions, RmResult, SparseCheckoutAddInput, SparseCheckoutAppliedResult, SparseCheckoutDisableInput, SparseCheckoutListResult, SparseCheckoutNamespace, SparseCheckoutReapplyInput, SparseCheckoutSetInput, StashApplyInput, StashApplyResult, StashConflict, StashDropInput, StashDropResult, StashListEntry, StashListResult, StashNamespace, StashPopResult, StashPushInput, StashPushResult, StatusResult, SubmodulesAction, SubmodulesResult, TagCreateInput, TagCreateResult, TagDeleteInput, TagDeleteResult, TagInfo, TagListResult, TagNamespace, abortMerge, add, bindBranchNamespace, bindCherryPickNamespace, bindConfigNamespace, bindRebaseNamespace, bindRemoteNamespace, bindRevertNamespace, bindSparseCheckoutNamespace, bindStashNamespace, bindTagNamespace, branchCreate, branchDelete, branchList, branchRename, catFile, checkout, cherryPickAbort, cherryPickContinue, cherryPickRun, cherryPickSkip, clone, commit, configGet, configGetAll, configGetRegexp, configList, configRemoveSection, configRenameSection, configSet, configUnset, configUnsetAll, continueMerge, createPromisorRemote, diff, fetch, fetchMissing, init, log, merge, mv, pull, push, rebaseAbort, rebaseContinue, rebaseRun, rebaseSkip, reflog, remoteAdd, remoteList, remoteRemove, remoteRename, remoteSetUrl, remoteShow, reset, revParse, revertAbort, revertContinue, revertRun, revertSkip, rm, sparseCheckoutAdd, sparseCheckoutDisable, sparseCheckoutList, sparseCheckoutReapply, sparseCheckoutSet, stashApply, stashDrop, stashList, stashPop, stashPush, status, submodules, tagCreate, tagDelete, tagList } from './commands/index.cjs';
|
|
4
|
+
import { c as FilePath, b as Context, O as ObjectId } from './chunks/context-YDw6qicq.cjs';
|
|
5
|
+
export { A as AuthStrategy, k as AuthorIdentity, C as Compressor, l as CreateContextParts, D as DirEntry, d as FileStat, F as FileSystem, H as HashService, f as Hasher, g as HookName, i as HookRequest, h as HookResult, a as HookRunner, L as Logger, P as ProgressReporter, m as PromisorFetchOutcome, n as PromisorRemote, R as RepositoryConfig, o as RepositoryLayout, p as createContext, q as noopLogger, w as wrapLoggerSanitizer } from './chunks/context-YDw6qicq.cjs';
|
|
6
|
+
export { a as HttpRequest, b as HttpResponse, H as HttpTransport } from './chunks/http-transport--_NdQOiw.cjs';
|
|
7
|
+
export { C as CatFileBatchEntry, S as SubmoduleEntry } from './chunks/reflog-entry-BbNnXCTC.cjs';
|
|
8
|
+
import './chunks/index-entry-DtEbVpOG.cjs';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Extracts the entry shape `E` from a `Snapshot<E>` constraint. Used by
|
|
12
|
+
* the join row types to project each slot's entry shape onto the merged
|
|
13
|
+
* row.
|
|
14
|
+
*/
|
|
15
|
+
type EntryOf<X> = X extends {
|
|
16
|
+
entries(opts?: unknown): AsyncIterable<infer E>;
|
|
17
|
+
} ? E : never;
|
|
18
|
+
/**
|
|
19
|
+
* Outer-join row — `path` is mandatory, every named slot is OPTIONAL.
|
|
20
|
+
* A slot is `undefined` for rows where that source did not contribute
|
|
21
|
+
* an entry at the given path.
|
|
22
|
+
*/
|
|
23
|
+
type OuterJoinRow<S> = {
|
|
24
|
+
readonly path: FilePath;
|
|
25
|
+
} & {
|
|
26
|
+
readonly [K in keyof S]?: EntryOf<S[K]>;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Inner-join row — `path` is mandatory and every named slot is REQUIRED
|
|
30
|
+
* (no `?`). Only rows where every source contributed an entry at the
|
|
31
|
+
* given path are emitted.
|
|
32
|
+
*/
|
|
33
|
+
type InnerJoinRow<S> = {
|
|
34
|
+
readonly path: FilePath;
|
|
35
|
+
} & {
|
|
36
|
+
readonly [K in keyof S]: EntryOf<S[K]>;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Discriminator for write-target categories used across the CQS port triple
|
|
41
|
+
* — `WriteEventEmitter` (command), `WriteEventStream` (subscribe), and
|
|
42
|
+
* `GenerationView` (query). See ADR-157 for the rationale of splitting
|
|
43
|
+
* those three concerns across separate port files; `WriteScope` lives in
|
|
44
|
+
* its own file so none of the three ports needs to import another's
|
|
45
|
+
* declaration, preserving the CQS split at the import-graph level.
|
|
46
|
+
*/
|
|
47
|
+
type WriteScope = 'index' | 'refs' | 'objects';
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Query side of the write-event triple (ADR-157). Read primitives depend on
|
|
51
|
+
* this interface only — they query the current generation per scope but
|
|
52
|
+
* cannot emit or subscribe.
|
|
53
|
+
*
|
|
54
|
+
* `current(scope)` is monotonic per scope: each successful `WriteEventEmitter.emit(scope)`
|
|
55
|
+
* increments the corresponding counter exactly once. Scopes are independent
|
|
56
|
+
* — `emit('index')` does not affect `current('refs')` or `current('objects')`.
|
|
57
|
+
*/
|
|
58
|
+
interface GenerationView {
|
|
59
|
+
current(scope: WriteScope): number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Command side of the write-event triple (ADR-157). Write-boundary primitives
|
|
64
|
+
* depend on this interface only — they cannot observe events, only emit them.
|
|
65
|
+
*
|
|
66
|
+
* Implementations MUST be called AFTER a successful write but BEFORE
|
|
67
|
+
* releasing any acquired lock. See `docs/understand/caching.md` for the
|
|
68
|
+
* lock-ordering protocol; in-process readers rely on the
|
|
69
|
+
* emit-before-release ordering to avoid TOCTOU windows.
|
|
70
|
+
*/
|
|
71
|
+
interface WriteEventEmitter {
|
|
72
|
+
emit(scope: WriteScope): void;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Disposable handle returned from `WriteEventStream.subscribe`. Matches the
|
|
77
|
+
* shape of TC39 Explicit Resource Management's `Disposable` so callers can
|
|
78
|
+
* use `using` syntax once the project's TS target supports it.
|
|
79
|
+
*/
|
|
80
|
+
interface Disposable {
|
|
81
|
+
dispose(): void;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Subscribe side of the write-event triple (ADR-157). Cache adapters depend
|
|
85
|
+
* on this interface only — they observe events but cannot emit them.
|
|
86
|
+
*
|
|
87
|
+
* Subscribers receive identical event sequences regardless of subscription
|
|
88
|
+
* order. Disposing a subscription removes the listener; the next event is
|
|
89
|
+
* not delivered to that listener.
|
|
90
|
+
*/
|
|
91
|
+
interface WriteEventStream {
|
|
92
|
+
subscribe(listener: (scope: WriteScope) => void): Disposable;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Emits a deprecation warning at most once per `callsite`. The set-based
|
|
97
|
+
* dedup keeps long-running daemons (e.g. an editor LSP) from spamming the
|
|
98
|
+
* log when the same deprecated path is hit thousands of times.
|
|
99
|
+
*
|
|
100
|
+
* Output is suppressed entirely when the `TSGIT_SUPPRESS_DEPRECATIONS=1`
|
|
101
|
+
* environment variable is set (per ADR-160). Defensive against browser
|
|
102
|
+
* contexts where `process` is undefined — the lookup never throws.
|
|
103
|
+
*
|
|
104
|
+
* See `docs/use/snapshots.md` for the deprecation policy that drives
|
|
105
|
+
* Wave 8 (legacy walker removal in tsgit 2.0).
|
|
106
|
+
*/
|
|
107
|
+
declare const warnDeprecated: (callsite: string, message: string) => void;
|
|
108
|
+
|
|
109
|
+
interface IndexSnapshotDeps {
|
|
110
|
+
readonly ctx: Context;
|
|
111
|
+
readonly indexResolver: IndexResolver;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Lazily evaluates `.git/index` via `IndexResolver`. The parsed `GitIndex`
|
|
115
|
+
* is captured on the first iteration and reused across subsequent
|
|
116
|
+
* iterations of the same handle (design §8.0 iteration stability):
|
|
117
|
+
*
|
|
118
|
+
* - First `entries()` call → resolver.resolve(ctx) → captured reference
|
|
119
|
+
* - All subsequent `entries()` calls → stream from captured reference,
|
|
120
|
+
* bypassing the resolver entirely; `emit('index')` events on the bus
|
|
121
|
+
* never disturb an in-flight iteration.
|
|
122
|
+
* - A fresh `repo.snapshot.index()` returns a new handle whose own first
|
|
123
|
+
* iteration sees the resolver's post-invalidation state.
|
|
124
|
+
*
|
|
125
|
+
* `bypassCache` forwards to the resolver only for the *first* resolve on
|
|
126
|
+
* this handle; once captured, subsequent calls use the captured reference.
|
|
127
|
+
*/
|
|
128
|
+
declare const createIndexSnapshot: (deps: IndexSnapshotDeps) => Snapshot<IndexEntry>;
|
|
129
|
+
|
|
130
|
+
type SnapshotMap = {
|
|
131
|
+
readonly [k: string]: Snapshot<SnapshotEntry>;
|
|
132
|
+
};
|
|
133
|
+
interface JoinOptions {
|
|
134
|
+
readonly concurrency?: number;
|
|
135
|
+
readonly signal?: AbortSignal;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Outer-join over an arbitrary record of snapshots, keyed by path. Every
|
|
139
|
+
* row carries the path plus one or more populated slot entries (a slot
|
|
140
|
+
* is `undefined` when that source had no entry at the path).
|
|
141
|
+
*
|
|
142
|
+
* Single-source joins take the short-circuit path (one alloc per row);
|
|
143
|
+
* multi-source joins delegate to the k-way merge in `path-merge.ts`.
|
|
144
|
+
*/
|
|
145
|
+
declare const join: <S extends SnapshotMap>(sources: S, opts?: JoinOptions) => AsyncIterable<OuterJoinRow<S>>;
|
|
146
|
+
/**
|
|
147
|
+
* Inner-join — yields rows only when every named slot has an entry at
|
|
148
|
+
* the given path. Useful for "files present in both X and Y" queries
|
|
149
|
+
* (e.g. unmerged paths in both index and workdir).
|
|
150
|
+
*/
|
|
151
|
+
declare const innerJoin: <S extends SnapshotMap>(sources: S, opts?: JoinOptions) => AsyncIterable<InnerJoinRow<S>>;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Unwrap a `Promise<T | null>` from a compound-state snapshot factory
|
|
155
|
+
* (`mergeHead`, `cherryPickHead`, `revertHead`, `fetchHead`, `stashEntry`).
|
|
156
|
+
*
|
|
157
|
+
* Calls that require the state to exist (e.g. `abortMerge` when no merge
|
|
158
|
+
* is in progress) use this helper to fail loudly with a `SNAPSHOT_REQUIRED`
|
|
159
|
+
* code carrying the caller's reason. Calls that tolerate absence keep the
|
|
160
|
+
* null-check in their own flow.
|
|
161
|
+
*
|
|
162
|
+
* Example:
|
|
163
|
+
*
|
|
164
|
+
* ```ts
|
|
165
|
+
* const theirs = await requireSnapshot(
|
|
166
|
+
* repo.snapshot.mergeHead(),
|
|
167
|
+
* 'no merge in progress',
|
|
168
|
+
* );
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
declare const requireSnapshot: <T>(promise: Promise<T | null>, reason: string) => Promise<T>;
|
|
172
|
+
|
|
173
|
+
interface TreeSnapshotDeps {
|
|
174
|
+
readonly ctx: Context;
|
|
175
|
+
readonly treeResolver: TreeResolver;
|
|
19
176
|
}
|
|
20
177
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
178
|
+
* Lazily evaluates a tree by its oid via `TreeResolver`. The root tree is
|
|
179
|
+
* resolved on the first iteration and reused across subsequent iterations
|
|
180
|
+
* for stability. Trees are content-addressed, so the captured reference
|
|
181
|
+
* is independent of any external cache invalidation.
|
|
25
182
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
183
|
+
* Only leaf entries (files, symlinks, gitlinks/submodules) are yielded.
|
|
184
|
+
* Directories are descended into but never yielded as their own row —
|
|
185
|
+
* `kind` is therefore narrowed to `'file' | 'symlink' | 'submodule'`.
|
|
186
|
+
*/
|
|
187
|
+
declare const createTreeSnapshot: (deps: TreeSnapshotDeps, treeId: ObjectId) => Snapshot<TreeEntry>;
|
|
188
|
+
|
|
189
|
+
interface DirGroup<R> {
|
|
190
|
+
readonly path: FilePath;
|
|
191
|
+
readonly rows: ReadonlyArray<R>;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Groups consecutive rows by their parent directory. Because the row
|
|
195
|
+
* stream is sorted by path (`assertOrdered` enforced upstream), entries
|
|
196
|
+
* sharing a directory always arrive contiguously — no buffering of
|
|
197
|
+
* unrelated rows is required.
|
|
29
198
|
*/
|
|
30
|
-
declare const
|
|
199
|
+
declare const groupByDir: <R extends {
|
|
200
|
+
readonly path: FilePath;
|
|
201
|
+
}>() => (source: AsyncIterable<R>) => AsyncIterable<DirGroup<R>>;
|
|
202
|
+
|
|
203
|
+
interface HashSlotOptions {
|
|
204
|
+
readonly concurrency?: number;
|
|
205
|
+
readonly signal?: AbortSignal;
|
|
206
|
+
}
|
|
207
|
+
type SlotKeyedRow$2 = {
|
|
208
|
+
readonly path: FilePath;
|
|
209
|
+
};
|
|
31
210
|
/**
|
|
32
|
-
*
|
|
33
|
-
* `
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
211
|
+
* Generic slot-hashing operator. For each row whose named slot has an
|
|
212
|
+
* entry exposing `hash()`, invokes the method to warm the entry's
|
|
213
|
+
* hash (most relevant for WorkdirEntry, where `hash()` reads the file
|
|
214
|
+
* and computes the git blob hash).
|
|
215
|
+
*
|
|
216
|
+
* Row typing is intentionally loose (`R extends { path: FilePath }`):
|
|
217
|
+
* the operator is a pure pipeline stage and does not constrain the
|
|
218
|
+
* shape of slot entries beyond an optional `hash()` method. Concrete
|
|
219
|
+
* join callers narrow at the type-projection boundary.
|
|
37
220
|
*/
|
|
38
|
-
declare const
|
|
221
|
+
declare const hashSlot: <R extends SlotKeyedRow$2>(slot: string, opts?: HashSlotOptions) => (source: AsyncIterable<R>) => AsyncIterable<R>;
|
|
39
222
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* with jsdom + a real Node process).
|
|
223
|
+
* Conventional wrapper for the 95% case (slot named `workdir`).
|
|
224
|
+
* See design §12.1.
|
|
43
225
|
*/
|
|
44
|
-
declare const
|
|
226
|
+
declare const hashWorkdir: <R extends SlotKeyedRow$2>(opts?: HashSlotOptions) => ((source: AsyncIterable<R>) => AsyncIterable<R>);
|
|
45
227
|
|
|
46
|
-
|
|
47
|
-
|
|
228
|
+
interface LoadBlobOptions {
|
|
229
|
+
readonly concurrency?: number;
|
|
230
|
+
readonly maxInflightBytes?: number;
|
|
231
|
+
readonly signal?: AbortSignal;
|
|
232
|
+
}
|
|
233
|
+
type SlotKeyedRow$1 = {
|
|
234
|
+
readonly path: FilePath;
|
|
235
|
+
};
|
|
48
236
|
/**
|
|
49
|
-
*
|
|
237
|
+
* Reads the blob bytes for a named slot, with a bounded in-flight byte
|
|
238
|
+
* budget. The operator preserves order and forwards rows verbatim;
|
|
239
|
+
* downstream consumers can rely on the `read()` cache being warm.
|
|
50
240
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
241
|
+
* `maxInflightBytes` (default: 64 MiB) caps the total size of in-flight
|
|
242
|
+
* reads. When the budget is exhausted, oldest reads are awaited before
|
|
243
|
+
* issuing new ones. This protects against memory blow-up on repos with
|
|
244
|
+
* occasional multi-GiB blobs.
|
|
245
|
+
*/
|
|
246
|
+
declare const loadBlob: <R extends SlotKeyedRow$1>(slot: string, opts?: LoadBlobOptions) => (source: AsyncIterable<R>) => AsyncIterable<R>;
|
|
247
|
+
|
|
248
|
+
interface TerminalOptions {
|
|
249
|
+
readonly signal?: AbortSignal;
|
|
250
|
+
}
|
|
251
|
+
declare const count: <T>(source: AsyncIterable<T>, opts?: TerminalOptions) => Promise<number>;
|
|
252
|
+
declare const toArray: <T>(source: AsyncIterable<T>, opts?: TerminalOptions) => Promise<ReadonlyArray<T>>;
|
|
253
|
+
declare const first: <T>(source: AsyncIterable<T>, opts?: TerminalOptions) => Promise<T | null>;
|
|
254
|
+
|
|
255
|
+
type VerifyRaceAction = 'throw' | 'skip' | 'emit';
|
|
256
|
+
interface VerifyOptions {
|
|
257
|
+
readonly onRace?: VerifyRaceAction;
|
|
258
|
+
readonly signal?: AbortSignal;
|
|
259
|
+
}
|
|
260
|
+
type SlotKeyedRow = {
|
|
261
|
+
readonly path: FilePath;
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* Marker added to a row by `verifyWorkdir({ onRace: 'emit' })` when the
|
|
265
|
+
* per-row `verify()` rejects. Consumers narrow with `'_raced' in row` to
|
|
266
|
+
* branch on race status without an unsafe cast.
|
|
267
|
+
*/
|
|
268
|
+
interface RacedRow {
|
|
269
|
+
readonly _raced: true;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Output row type for `verifyWorkdir`. In `'throw'` and `'skip'` modes
|
|
273
|
+
* the operator only ever yields the original `R`. In `'emit'` mode it
|
|
274
|
+
* may additionally yield `R & RacedRow` for rows whose `verify()`
|
|
275
|
+
* rejected.
|
|
276
|
+
*/
|
|
277
|
+
type VerifyOutput<R> = R | (R & RacedRow);
|
|
278
|
+
/**
|
|
279
|
+
* Re-lstats workdir entries during iteration via `WorkdirEntry.verify()`.
|
|
58
280
|
*
|
|
59
|
-
* `
|
|
60
|
-
*
|
|
281
|
+
* - `'throw'` (default) — propagate the `WORKDIR_RACE` error.
|
|
282
|
+
* - `'skip'` — silently drop racy rows.
|
|
283
|
+
* - `'emit'` — yield the row unchanged plus a `_raced: true` marker;
|
|
284
|
+
* consumers narrow with `'_raced' in row` to branch on race status.
|
|
61
285
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
286
|
+
* Workdir snapshot remains race-prone by design (ADR-153); this operator
|
|
287
|
+
* is the opt-in guard for "no race tolerated" workflows like
|
|
288
|
+
* `add -p` and `checkout --detect-races`.
|
|
64
289
|
*/
|
|
65
|
-
declare const
|
|
290
|
+
declare const verifyWorkdir: <R extends SlotKeyedRow>(opts?: VerifyOptions) => (source: AsyncIterable<R>) => AsyncIterable<VerifyOutput<R>>;
|
|
66
291
|
|
|
67
|
-
export {
|
|
68
|
-
export type {
|
|
292
|
+
export { Context, IndexEntry, IndexResolver, Snapshot, SnapshotEntry, TreeEntry, TreeResolver, count, createIndexSnapshot, createTreeSnapshot, first, groupByDir, hashSlot, hashWorkdir, innerJoin, join, loadBlob, requireSnapshot, toArray, verifyWorkdir, warnDeprecated };
|
|
293
|
+
export type { DirGroup, Disposable, GenerationView, HashSlotOptions, IndexSnapshotDeps, JoinOptions, LoadBlobOptions, TerminalOptions, TreeSnapshotDeps, VerifyOptions, VerifyRaceAction, WriteEventEmitter, WriteEventStream, WriteScope };
|