dsh-git-worktree 0.3.2 → 0.6.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/CHANGELOG.md +83 -0
- package/README.en.md +48 -18
- package/README.md +49 -18
- package/lib/adapters/git.js +8 -0
- package/lib/adapters/git.js.map +1 -1
- package/lib/adapters/registry.js +107 -2
- package/lib/adapters/registry.js.map +1 -1
- package/lib/checkpoint.d.ts +3 -0
- package/lib/checkpoint.js +29 -0
- package/lib/checkpoint.js.map +1 -0
- package/lib/client/WorktreeReviewRow.d.ts +1 -1
- package/lib/client/WorktreeReviewRow.js +26 -6
- package/lib/client/WorktreeReviewRow.js.map +1 -1
- package/lib/client/actions.d.ts +49 -4
- package/lib/client/actions.js +104 -0
- package/lib/client/actions.js.map +1 -1
- package/lib/client/console-remote/adapter.js +10 -3
- package/lib/client/console-remote/adapter.js.map +1 -1
- package/lib/client/review-console/DeliveryProof.d.ts +5 -0
- package/lib/client/review-console/DeliveryProof.js +32 -0
- package/lib/client/review-console/DeliveryProof.js.map +1 -0
- package/lib/client/review-console/PreflightStatus.d.ts +12 -0
- package/lib/client/review-console/PreflightStatus.js +31 -0
- package/lib/client/review-console/PreflightStatus.js.map +1 -0
- package/lib/client/review-console/ReviewActions.d.ts +4 -1
- package/lib/client/review-console/ReviewActions.js +657 -31
- package/lib/client/review-console/ReviewActions.js.map +1 -1
- package/lib/client/review-console/WorktreeReviewPanel.d.ts +3 -1
- package/lib/client/review-console/WorktreeReviewPanel.js +35 -5
- package/lib/client/review-console/WorktreeReviewPanel.js.map +1 -1
- package/lib/client/review-console/preflight-cache.d.ts +21 -0
- package/lib/client/review-console/preflight-cache.js +98 -0
- package/lib/client/review-console/preflight-cache.js.map +1 -0
- package/lib/client/review-console/preview-recovery-cache.d.ts +20 -0
- package/lib/client/review-console/preview-recovery-cache.js +103 -0
- package/lib/client/review-console/preview-recovery-cache.js.map +1 -0
- package/lib/client/review-console/recovery-continuation.d.ts +53 -0
- package/lib/client/review-console/recovery-continuation.js +483 -0
- package/lib/client/review-console/recovery-continuation.js.map +1 -0
- package/lib/client/review-console/review-console.styles.js +36 -4
- package/lib/client/review-console/review-console.styles.js.map +1 -1
- package/lib/client/target-console/TargetStatusAction.d.ts +4 -2
- package/lib/client/target-console/TargetStatusAction.js +196 -23
- package/lib/client/target-console/TargetStatusAction.js.map +1 -1
- package/lib/client/target-console/WorktreeConsoleView.d.ts +4 -2
- package/lib/client/target-console/WorktreeConsoleView.js +33 -73
- package/lib/client/target-console/WorktreeConsoleView.js.map +1 -1
- package/lib/client/target-console/WorktreeManagerModal.d.ts +13 -0
- package/lib/client/target-console/WorktreeManagerModal.js +8 -0
- package/lib/client/target-console/WorktreeManagerModal.js.map +1 -0
- package/lib/client/target-console/WorktreeReviewStatus.d.ts +3 -1
- package/lib/client/target-console/WorktreeReviewStatus.js +35 -15
- package/lib/client/target-console/WorktreeReviewStatus.js.map +1 -1
- package/lib/client/target-console/index.d.ts +2 -1
- package/lib/client/target-console/index.js +4 -3
- package/lib/client/target-console/index.js.map +1 -1
- package/lib/client/target-console/target-console.styles.js +22 -3
- package/lib/client/target-console/target-console.styles.js.map +1 -1
- package/lib/client.js +2976 -211
- package/lib/console-contract.d.ts +110 -1
- package/lib/console-contract.js.map +1 -1
- package/lib/console-host/control-plane.d.ts +6 -1
- package/lib/console-host/control-plane.js +363 -44
- package/lib/console-host/control-plane.js.map +1 -1
- package/lib/console-host/errors.d.ts +2 -2
- package/lib/console-host/errors.js +21 -5
- package/lib/console-host/errors.js.map +1 -1
- package/lib/console-host/projection.d.ts +5 -3
- package/lib/console-host/projection.js +103 -11
- package/lib/console-host/projection.js.map +1 -1
- package/lib/console-host/service.d.ts +10 -5
- package/lib/console-host/service.js +48 -6
- package/lib/console-host/service.js.map +1 -1
- package/lib/console-remote/descriptors.js +37 -1
- package/lib/console-remote/descriptors.js.map +1 -1
- package/lib/console-remote/remote.d.ts +10 -5
- package/lib/console-remote/remote.js.map +1 -1
- package/lib/console-remote/schemas.d.ts +103 -1
- package/lib/console-remote/schemas.js +166 -6
- package/lib/console-remote/schemas.js.map +1 -1
- package/lib/index.d.ts +13 -2
- package/lib/index.js.map +1 -1
- package/lib/ports.d.ts +79 -1
- package/lib/session-checkout-apply.d.ts +76 -0
- package/lib/session-checkout-apply.js +608 -143
- package/lib/session-checkout-apply.js.map +1 -1
- package/lib/session-checkout-module.js +775 -117
- package/lib/session-checkout-module.js.map +1 -1
- package/lib/types.d.ts +104 -3
- package/lib/types.js.map +1 -1
- package/package.json +14 -14
- package/scripts/check-publish.mjs +2 -2
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA0BH,2FAA2F;AAC3F,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACpC,IAAI,CAA0B;IAEvC;;;OAGG;IACH,YAAY,IAA8B,EAAE,OAAe;QACzD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAA;QAClC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF;AA6GD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,0BAA0B,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AE;QACnD,KAAK,MAAM,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACtC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAA;QAC7D,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACF,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;QACtC,KAAK,MAAM,CAAC,sBAAsB,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACnD,OAAO,CAAC,IAAI,CAAC,0DAA0D,EAAE,KAAK,CAAC,CAAA;QACjF,CAAC,CAAC,CAAA;IACJ,CAAC,EAAE,iCAAiC,CAAC,CAAA;IACrC,cAAc,CAAC,KAAK,EAAE,EAAE,CAAA;IACxB,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE;QACpB,gBAAgB,EAAE,CAAA;QAClB,aAAa,CAAC,cAAc,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/lib/ports.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ export interface SessionCheckoutGitPort {
|
|
|
44
44
|
retainApplyBase(localRoot: string, checkoutId: string, oid: string): Promise<void>;
|
|
45
45
|
releaseApplyBase(localRoot: string, checkoutId: string): Promise<void>;
|
|
46
46
|
retainInternalArtifact(localRoot: string, checkoutId: string, artifactName: string, oid: string): Promise<void>;
|
|
47
|
+
/** Read one retained internal ref without modifying refs or object storage. */
|
|
48
|
+
readInternalArtifact(localRoot: string, checkoutId: string, artifactName: string): Promise<string | null>;
|
|
47
49
|
releaseInternalArtifacts(localRoot: string, checkoutId: string, artifactPrefix?: string): Promise<void>;
|
|
48
50
|
/** Read-only ancestry proof; only accepts host-verified checkout roots and OIDs. */
|
|
49
51
|
isAncestor(root: string, ancestorOid: string, descendantOid: string): Promise<boolean>;
|
|
@@ -87,7 +89,7 @@ export interface ManagedCheckoutCreateJournal extends ManagedCheckoutJournalBase
|
|
|
87
89
|
step: 'creating_worktree';
|
|
88
90
|
}
|
|
89
91
|
export interface ManagedCheckoutMutationJournal extends ManagedCheckoutJournalBase {
|
|
90
|
-
operation: 'apply' | 'preview' | 'rollback_preview' | 'finish' | 'finalize_preview' | 'cleanup';
|
|
92
|
+
operation: 'apply' | 'preview' | 'checkpoint' | 'rollback_preview' | 'finish' | 'finalize_preview' | 'cleanup';
|
|
91
93
|
step: 'planning' | 'artifacts_retained' | 'writing_local' | 'updating_ref' | 'replacing_index' | 'removing_worktree';
|
|
92
94
|
baseOid?: string;
|
|
93
95
|
planRevision?: string;
|
|
@@ -100,7 +102,15 @@ export interface ManagedCheckoutMutationJournal extends ManagedCheckoutJournalBa
|
|
|
100
102
|
localHeadOid?: string;
|
|
101
103
|
isolatedHeadOid?: string;
|
|
102
104
|
commitOid?: string;
|
|
105
|
+
checkpointId?: string;
|
|
106
|
+
checkpointSequence?: number;
|
|
107
|
+
checkpointRequestId?: string;
|
|
108
|
+
checkpointRequestedRevision?: number;
|
|
109
|
+
checkpointMessage?: string;
|
|
110
|
+
checkpointIndexTreeOid?: string;
|
|
111
|
+
parentOid?: string;
|
|
103
112
|
retention?: WorktreeRetentionMode;
|
|
113
|
+
recoveryGeneration?: string;
|
|
104
114
|
/** rollback_preview crash recovery must preserve whether the review returns to working or ready_for_review. */
|
|
105
115
|
resumeRevision?: boolean;
|
|
106
116
|
changedFiles?: string[];
|
|
@@ -108,6 +118,32 @@ export interface ManagedCheckoutMutationJournal extends ManagedCheckoutJournalBa
|
|
|
108
118
|
cleanupQuarantinePath?: string;
|
|
109
119
|
}
|
|
110
120
|
export type ManagedCheckoutJournal = ManagedCheckoutCreateJournal | ManagedCheckoutMutationJournal;
|
|
121
|
+
export interface ManagedWorktreeCheckpointRecord {
|
|
122
|
+
checkpointId: string;
|
|
123
|
+
sequence: number;
|
|
124
|
+
reviewId: string;
|
|
125
|
+
/** Idempotency key for the exact user-confirmed checkpoint request. */
|
|
126
|
+
requestId?: string;
|
|
127
|
+
/** Review revision and Host generation accepted for the request. */
|
|
128
|
+
requestedRevision?: number;
|
|
129
|
+
generation?: string;
|
|
130
|
+
iteration: number;
|
|
131
|
+
createdAt: number;
|
|
132
|
+
commitOid: string;
|
|
133
|
+
parentOid: string;
|
|
134
|
+
summary: string;
|
|
135
|
+
commitMessage: string;
|
|
136
|
+
validationStatus: WorktreeValidationStatus;
|
|
137
|
+
changedFiles: string[];
|
|
138
|
+
}
|
|
139
|
+
/** Bounded context for the next cumulative review; never replaces the final diff as fact source. */
|
|
140
|
+
export interface ManagedWorktreePreviousReviewRecord {
|
|
141
|
+
reviewId: string;
|
|
142
|
+
iteration: number;
|
|
143
|
+
summary: string;
|
|
144
|
+
suggestedCommitMessage: string;
|
|
145
|
+
changedFiles: string[];
|
|
146
|
+
}
|
|
111
147
|
export interface ManagedWorktreeReviewRecord {
|
|
112
148
|
reviewId: string;
|
|
113
149
|
iteration: number;
|
|
@@ -147,7 +183,43 @@ export interface ManagedDeliveryProof {
|
|
|
147
183
|
localHeadBefore: string;
|
|
148
184
|
localHeadAfter: string;
|
|
149
185
|
changedFiles: string[];
|
|
186
|
+
/** Optional for backward compatibility with historical version-2 registries. */
|
|
187
|
+
validationStatus?: WorktreeValidationStatus;
|
|
188
|
+
validationSummary?: string;
|
|
189
|
+
}
|
|
190
|
+
export interface ManagedApplyConflictRecoveryContinuation {
|
|
191
|
+
kind: 'worktree_apply_conflict';
|
|
192
|
+
requestId: string;
|
|
193
|
+
reviewId: string;
|
|
194
|
+
readyRevision: number;
|
|
195
|
+
workingRevision: number;
|
|
196
|
+
localHeadOid: string;
|
|
197
|
+
conflictingFiles: string[];
|
|
198
|
+
}
|
|
199
|
+
export interface ManagedReviewRegenerationContinuation {
|
|
200
|
+
kind: 'worktree_review_regeneration';
|
|
201
|
+
requestId: string;
|
|
202
|
+
reviewId: string;
|
|
203
|
+
revision: number;
|
|
204
|
+
}
|
|
205
|
+
export interface ManagedPreviewRecoveryAnalysisContinuation {
|
|
206
|
+
kind: 'worktree_preview_recovery_analysis';
|
|
207
|
+
requestId: string;
|
|
208
|
+
reviewId: string;
|
|
209
|
+
previewId: string;
|
|
210
|
+
revision: number;
|
|
211
|
+
generation: string;
|
|
212
|
+
}
|
|
213
|
+
export interface ManagedPreviewRecoveryHandoffContinuation {
|
|
214
|
+
kind: 'worktree_preview_recovery_handoff';
|
|
215
|
+
requestId: string;
|
|
216
|
+
sourceCheckoutId: string;
|
|
217
|
+
reviewId: string;
|
|
218
|
+
previewId: string;
|
|
219
|
+
sourceRevision: number;
|
|
220
|
+
generation: string;
|
|
150
221
|
}
|
|
222
|
+
export type ManagedRecoveryContinuation = ManagedApplyConflictRecoveryContinuation | ManagedReviewRegenerationContinuation | ManagedPreviewRecoveryAnalysisContinuation | ManagedPreviewRecoveryHandoffContinuation;
|
|
151
223
|
export type ManagedCheckoutDelivery = {
|
|
152
224
|
state: 'working';
|
|
153
225
|
iteration: number;
|
|
@@ -214,6 +286,12 @@ export interface ManagedCheckoutRecord {
|
|
|
214
286
|
baseOid: string;
|
|
215
287
|
/** Last successfully applied isolated snapshot; does not change the user-visible Session Base. */
|
|
216
288
|
applyBaseOid?: string;
|
|
289
|
+
/** Bounded cumulative-review context retained after a review is invalidated. */
|
|
290
|
+
previousReview?: ManagedWorktreePreviousReviewRecord;
|
|
291
|
+
/** Linear saved stages that remain private to the managed Worktree. */
|
|
292
|
+
checkpoints?: ManagedWorktreeCheckpointRecord[];
|
|
293
|
+
/** Host-authoritative one-shot context for an explicitly resumed apply conflict. */
|
|
294
|
+
recoveryContinuation?: ManagedRecoveryContinuation;
|
|
217
295
|
sourceRef: string;
|
|
218
296
|
phase: SessionCheckoutPhase;
|
|
219
297
|
delivery: ManagedCheckoutDelivery;
|
|
@@ -95,6 +95,60 @@ export interface RollbackSuccessResult {
|
|
|
95
95
|
changedFiles: string[];
|
|
96
96
|
}
|
|
97
97
|
export type RollbackResult = RollbackSuccessResult | ApplyErrorResult;
|
|
98
|
+
export interface CheckpointInput {
|
|
99
|
+
isolatedPath: string;
|
|
100
|
+
expectedFingerprint: string;
|
|
101
|
+
expectedHeadOid: string;
|
|
102
|
+
commitMessage: string;
|
|
103
|
+
/** Persist the prepared commit and Host journal before detached HEAD/index mutation. */
|
|
104
|
+
beforeCommit?(prepared: {
|
|
105
|
+
commitOid: string;
|
|
106
|
+
parentOid: string;
|
|
107
|
+
indexTreeOid: string;
|
|
108
|
+
changedFiles: string[];
|
|
109
|
+
}): Promise<void>;
|
|
110
|
+
}
|
|
111
|
+
export interface CheckpointSuccessResult {
|
|
112
|
+
status: 'checkpointed';
|
|
113
|
+
commitOid: string;
|
|
114
|
+
parentOid: string;
|
|
115
|
+
changedFiles: string[];
|
|
116
|
+
isolatedFingerprint: string;
|
|
117
|
+
}
|
|
118
|
+
export type CheckpointResult = CheckpointSuccessResult | ApplyErrorResult;
|
|
119
|
+
export interface CheckpointRecoverySuccessResult {
|
|
120
|
+
status: 'checkpoint_recovered' | 'checkpoint_aborted';
|
|
121
|
+
isolatedFingerprint: string;
|
|
122
|
+
}
|
|
123
|
+
export type CheckpointRecoveryResult = CheckpointRecoverySuccessResult | ApplyErrorResult;
|
|
124
|
+
export type PreviewRecoveryActionBlockCode = 'stale_local' | 'preview_modified' | 'commit_isolation_conflict' | 'operation_not_allowed';
|
|
125
|
+
export interface PreviewRecoveryBlockedAction {
|
|
126
|
+
status: 'blocked';
|
|
127
|
+
code: PreviewRecoveryActionBlockCode;
|
|
128
|
+
message: string;
|
|
129
|
+
conflictingFiles?: string[];
|
|
130
|
+
}
|
|
131
|
+
export interface PreviewRecoverySafeRollback {
|
|
132
|
+
status: 'safe';
|
|
133
|
+
targetTreeOid: string;
|
|
134
|
+
}
|
|
135
|
+
export interface PreviewRecoverySafeFinalize {
|
|
136
|
+
status: 'safe';
|
|
137
|
+
taskTreeOid: string;
|
|
138
|
+
finalIndexTreeOid: string;
|
|
139
|
+
expectedWorkingTreeOid: string;
|
|
140
|
+
commitRequired: boolean;
|
|
141
|
+
}
|
|
142
|
+
export interface PreviewRecoveryAssessment {
|
|
143
|
+
localFingerprint: string;
|
|
144
|
+
localHeadOid: string;
|
|
145
|
+
localHeadRef: string | null;
|
|
146
|
+
localHeadTreeOid: string;
|
|
147
|
+
localIndexTreeOid: string;
|
|
148
|
+
localWorkingTreeOid: string;
|
|
149
|
+
rollback: PreviewRecoverySafeRollback | PreviewRecoveryBlockedAction;
|
|
150
|
+
finalize: PreviewRecoverySafeFinalize | PreviewRecoveryBlockedAction;
|
|
151
|
+
}
|
|
98
152
|
export interface InvalidInputApplyError {
|
|
99
153
|
code: 'invalid_input';
|
|
100
154
|
message: string;
|
|
@@ -114,6 +168,8 @@ export interface StaleIsolatedApplyError {
|
|
|
114
168
|
export interface GitApplyError {
|
|
115
169
|
code: 'git_error';
|
|
116
170
|
message: string;
|
|
171
|
+
/** Host may clear only a planning journal when the engine proved Local was restored exactly. */
|
|
172
|
+
recoveryState?: 'unchanged' | 'uncertain';
|
|
117
173
|
}
|
|
118
174
|
export interface CommitIsolationApplyError {
|
|
119
175
|
code: 'commit_isolation_conflict';
|
|
@@ -130,6 +186,13 @@ export interface PreviewModifiedApplyError {
|
|
|
130
186
|
export type ApplyError = InvalidInputApplyError | InvalidPlanApplyError | StaleLocalApplyError | StaleIsolatedApplyError | GitApplyError | CommitIsolationApplyError | OperationNotAllowedApplyError | PreviewModifiedApplyError;
|
|
131
187
|
export interface SessionCheckoutApplyEngine {
|
|
132
188
|
inspectReview(input: ApplyPlanInput): Promise<InspectReviewResult>;
|
|
189
|
+
checkpoint(input: CheckpointInput): Promise<CheckpointResult>;
|
|
190
|
+
recoverCheckpoint(input: {
|
|
191
|
+
isolatedPath: string;
|
|
192
|
+
commitOid: string;
|
|
193
|
+
parentOid: string;
|
|
194
|
+
expectedIndexTreeOid: string;
|
|
195
|
+
}): Promise<CheckpointRecoveryResult>;
|
|
133
196
|
/** 复用真实 Apply merge 计算,但不持久化可执行 plan,也不修改任一 checkout。 */
|
|
134
197
|
preflight(input: ApplyPlanInput): Promise<ApplyPlanResult>;
|
|
135
198
|
plan(input: ApplyPlanInput): Promise<ApplyPlanResult>;
|
|
@@ -144,9 +207,16 @@ export interface SessionCheckoutApplyEngine {
|
|
|
144
207
|
/** Local 写入前持久化 receipt artifacts/journal;失败时不得触碰 Local。 */
|
|
145
208
|
beforeWrite?(receipt: PreviewReceipt): Promise<void>;
|
|
146
209
|
}): Promise<PreviewResult>;
|
|
210
|
+
/** Strictly read-only detached Preview recovery assessment; it persists no executable plan. */
|
|
211
|
+
assessPreviewRecovery(input: {
|
|
212
|
+
localPath: string;
|
|
213
|
+
receipt: PreviewReceipt;
|
|
214
|
+
}): Promise<PreviewRecoveryAssessment | ApplyErrorResult>;
|
|
147
215
|
rollback(input: {
|
|
148
216
|
localPath: string;
|
|
149
217
|
receipt: PreviewReceipt;
|
|
218
|
+
/** Persists the mutation journal before the final Local CAS; no Local write may happen before it resolves. */
|
|
219
|
+
beforeWrite?(): Promise<void>;
|
|
150
220
|
}): Promise<RollbackResult>;
|
|
151
221
|
finalize(input: {
|
|
152
222
|
localPath: string;
|
|
@@ -159,5 +229,11 @@ export interface SessionCheckoutApplyEngine {
|
|
|
159
229
|
export interface SessionCheckoutApplyEngineOptions {
|
|
160
230
|
/** 测试/宿主 seam:在最后一次 Local fingerprint 校验前执行。 */
|
|
161
231
|
beforeFinalLocalValidation?(): Promise<void> | void;
|
|
232
|
+
/** 测试/宿主 seam:在 Local 写入完成、独立写后验证开始前执行。 */
|
|
233
|
+
afterLocalWriteBeforeVerification?(): Promise<void> | void;
|
|
234
|
+
/** Test seam immediately before the authoritative managed-Worktree checkpoint CAS. */
|
|
235
|
+
beforeFinalIsolatedValidation?(): Promise<void> | void;
|
|
236
|
+
/** Test seam after checkpoint HEAD/index writes and before independent verification. */
|
|
237
|
+
afterIsolatedWriteBeforeVerification?(): Promise<void> | void;
|
|
162
238
|
}
|
|
163
239
|
export declare function createSessionCheckoutApplyEngine(options?: SessionCheckoutApplyEngineOptions): SessionCheckoutApplyEngine;
|