@ue-shed/map-history 0.1.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.
Files changed (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +47 -0
  3. package/dist/baseline-materialization.d.ts +17 -0
  4. package/dist/baseline-materialization.d.ts.map +1 -0
  5. package/dist/baseline-materialization.js +86 -0
  6. package/dist/baseline-materialization.js.map +1 -0
  7. package/dist/diff.d.ts +7 -0
  8. package/dist/diff.d.ts.map +1 -0
  9. package/dist/diff.js +159 -0
  10. package/dist/diff.js.map +1 -0
  11. package/dist/errors.d.ts +14 -0
  12. package/dist/errors.d.ts.map +1 -0
  13. package/dist/errors.js +27 -0
  14. package/dist/errors.js.map +1 -0
  15. package/dist/fast-history-target.d.ts +61 -0
  16. package/dist/fast-history-target.d.ts.map +1 -0
  17. package/dist/fast-history-target.js +248 -0
  18. package/dist/fast-history-target.js.map +1 -0
  19. package/dist/historical-project-tree.d.ts +18 -0
  20. package/dist/historical-project-tree.d.ts.map +1 -0
  21. package/dist/historical-project-tree.js +123 -0
  22. package/dist/historical-project-tree.js.map +1 -0
  23. package/dist/index.d.ts +14 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +14 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/map-history.d.ts +24 -0
  28. package/dist/map-history.d.ts.map +1 -0
  29. package/dist/map-history.js +365 -0
  30. package/dist/map-history.js.map +1 -0
  31. package/dist/package-correlation.d.ts +16 -0
  32. package/dist/package-correlation.d.ts.map +1 -0
  33. package/dist/package-correlation.js +76 -0
  34. package/dist/package-correlation.js.map +1 -0
  35. package/dist/perforce-map-scope.d.ts +56 -0
  36. package/dist/perforce-map-scope.d.ts.map +1 -0
  37. package/dist/perforce-map-scope.js +284 -0
  38. package/dist/perforce-map-scope.js.map +1 -0
  39. package/dist/perforce.d.ts +105 -0
  40. package/dist/perforce.d.ts.map +1 -0
  41. package/dist/perforce.js +441 -0
  42. package/dist/perforce.js.map +1 -0
  43. package/dist/playback.d.ts +60 -0
  44. package/dist/playback.d.ts.map +1 -0
  45. package/dist/playback.js +168 -0
  46. package/dist/playback.js.map +1 -0
  47. package/dist/revision-materialization.d.ts +14 -0
  48. package/dist/revision-materialization.d.ts.map +1 -0
  49. package/dist/revision-materialization.js +68 -0
  50. package/dist/revision-materialization.js.map +1 -0
  51. package/dist/revision-plan.d.ts +44 -0
  52. package/dist/revision-plan.d.ts.map +1 -0
  53. package/dist/revision-plan.js +84 -0
  54. package/dist/revision-plan.js.map +1 -0
  55. package/dist/schema.d.ts +7964 -0
  56. package/dist/schema.d.ts.map +1 -0
  57. package/dist/schema.js +292 -0
  58. package/dist/schema.js.map +1 -0
  59. package/dist/submitted-change-selection.d.ts +22 -0
  60. package/dist/submitted-change-selection.d.ts.map +1 -0
  61. package/dist/submitted-change-selection.js +101 -0
  62. package/dist/submitted-change-selection.js.map +1 -0
  63. package/package.json +57 -0
@@ -0,0 +1,248 @@
1
+ import { resolve } from "node:path";
2
+ import { Effect } from "effect";
3
+ import { actorIdentityKey, actorIdentityOf } from "./diff.js";
4
+ import { MapHistoryError } from "./errors.js";
5
+ import { PerforceHistorySource } from "./perforce.js";
6
+ import { depotPackageFileSpec, projectRelativePathForPackageName, resolvePresentDayMapScope } from "./perforce-map-scope.js";
7
+ const ZERO_GUID = /^0{8}-0{8}-0{8}-0{8}$/;
8
+ function targetError(message, recovery) {
9
+ return new MapHistoryError({
10
+ kind: "invalid_target",
11
+ message,
12
+ recovery,
13
+ retrySafe: false
14
+ });
15
+ }
16
+ function actorsMatchingIdentity(actors, identity) {
17
+ const key = actorIdentityKey(identity);
18
+ return actors.filter((actor) => actorIdentityKey(actorIdentityOf(actor)) === key);
19
+ }
20
+ function isUsableGuid(guid) {
21
+ return guid !== undefined && guid.length > 0 && !ZERO_GUID.test(guid);
22
+ }
23
+ function proveActorPackage(options) {
24
+ const { actor, identity, scope } = options;
25
+ const packageName = actor.packageName;
26
+ const inMapPackage = packageName === scope.mapPackageName;
27
+ let packageProjectRelativePath;
28
+ if (inMapPackage) {
29
+ packageProjectRelativePath = scope.mapProjectRelativePath;
30
+ }
31
+ else {
32
+ packageProjectRelativePath = projectRelativePathForPackageName(packageName, ".uasset");
33
+ if (packageProjectRelativePath === undefined) {
34
+ return targetError(`Actor package ${packageName} cannot be converted to a project-relative saved package path.`, "Confirm the SavedWorld actor projection reports a /Game package name.");
35
+ }
36
+ if (scope.sourceKind === "world_partition") {
37
+ const externalRoot = scope.externalActorProjectRoot;
38
+ if (externalRoot === undefined) {
39
+ return targetError("The World Partition map did not report an external-actor root for the Investigation Target.", "Confirm the map's saved external-actor layout can be read, then retry.");
40
+ }
41
+ if (packageProjectRelativePath !== externalRoot &&
42
+ !packageProjectRelativePath.startsWith(`${externalRoot}/`)) {
43
+ return targetError(`Actor package ${packageName} is outside the selected map's proven external-actor scope.`, "Select an actor that belongs to the map's matching World Partition external-actor subtree.");
44
+ }
45
+ }
46
+ else {
47
+ return targetError(`Conventional map actor package ${packageName} is not the selected map package.`, "Select an actor stored in the conventional map package, or use Deep History.");
48
+ }
49
+ }
50
+ return {
51
+ actor,
52
+ identity,
53
+ packageName,
54
+ packageProjectRelativePath
55
+ };
56
+ }
57
+ /**
58
+ * Proves one present-day SavedWorld actor is the Investigation Target and derives its package path
59
+ * from the existing actor projection. Returns a typed failure when continuity or package scope
60
+ * cannot be established without guessing.
61
+ */
62
+ export function proveFastHistoryActorTarget(options) {
63
+ if (options.target.kind !== "actor") {
64
+ return targetError("Fast History only supports a single-actor Investigation Target in this slice.", "Select one present-day actor by GUID or exact package/object path.");
65
+ }
66
+ const matches = actorsMatchingIdentity(options.world.actors, options.target.identity);
67
+ if (matches.length === 0) {
68
+ return targetError("The Investigation Target actor is not present in the selected map's current saved world.", "Choose an actor that exists in the present-day map projection, or use Deep History.");
69
+ }
70
+ if (matches.length > 1) {
71
+ return targetError("The Investigation Target matches multiple present-day actors, so its package scope is ambiguous.", "Identify the actor by a unique GUID or exact package and object path.");
72
+ }
73
+ const actor = matches[0];
74
+ if (actor === undefined) {
75
+ return targetError("The Investigation Target actor is not present in the selected map's current saved world.", "Choose an actor that exists in the present-day map projection, or use Deep History.");
76
+ }
77
+ return proveActorPackage({
78
+ actor,
79
+ identity: options.target.identity,
80
+ scope: options.scope
81
+ });
82
+ }
83
+ /** Proves every current actor in an exact class target without inferring historical membership. */
84
+ export function proveFastHistoryActorClassTargets(options) {
85
+ if (options.target.kind !== "actor_class") {
86
+ return targetError("Fast History class targeting requires an exact actor class path.", "Choose a class path or select one present-day actor.");
87
+ }
88
+ const classPath = options.target.classPath;
89
+ const matches = options.world.actors.filter((actor) => actor.classPath === classPath);
90
+ if (matches.length === 0) {
91
+ return targetError(`No current actors match class ${classPath} in the selected map.`, "Choose a class with current actors, or use Deep History to find deleted or reclassified actors.");
92
+ }
93
+ const proven = [];
94
+ for (const actor of matches) {
95
+ const target = proveActorPackage({
96
+ actor,
97
+ identity: actorIdentityOf(actor),
98
+ scope: options.scope
99
+ });
100
+ if (target instanceof MapHistoryError)
101
+ return target;
102
+ proven.push(target);
103
+ }
104
+ return proven;
105
+ }
106
+ /** Builds the explicit targeted-coverage document Fast History must return with every result. */
107
+ export function fastHistoryTargetedCoverage(options) {
108
+ const { actor, identity, packageName } = options.proven;
109
+ const mapPackage = {
110
+ depotFileSpec: options.mapDepotFileSpec,
111
+ packageName: options.mapPackageName,
112
+ role: "selected_map"
113
+ };
114
+ const acquiredPackages = packageName === options.mapPackageName
115
+ ? [mapPackage]
116
+ : [
117
+ mapPackage,
118
+ {
119
+ depotFileSpec: options.targetDepotFileSpec,
120
+ packageName,
121
+ role: "investigation_target_actor"
122
+ }
123
+ ];
124
+ return {
125
+ acquiredPackages,
126
+ claimsCompleteMapCoverage: false,
127
+ claimsHistoricalClassCoverage: false,
128
+ investigationTarget: {
129
+ ...(isUsableGuid(actor.actorGuid) ? { actorGuid: actor.actorGuid } : {}),
130
+ actorPath: actor.actorPath,
131
+ classPath: actor.classPath,
132
+ identity,
133
+ kind: "actor",
134
+ packageName
135
+ },
136
+ kind: "targeted"
137
+ };
138
+ }
139
+ /** Builds explicit coverage metadata for an exact current actor-class target. */
140
+ export function fastHistoryActorClassTargetedCoverage(options) {
141
+ const acquiredPackages = [
142
+ {
143
+ depotFileSpec: options.mapDepotFileSpec,
144
+ packageName: options.mapPackageName,
145
+ role: "selected_map"
146
+ }
147
+ ];
148
+ const acquiredPackageNames = new Set([options.mapPackageName]);
149
+ for (const targetPackage of options.targetPackages) {
150
+ if (acquiredPackageNames.has(targetPackage.proven.packageName))
151
+ continue;
152
+ acquiredPackageNames.add(targetPackage.proven.packageName);
153
+ acquiredPackages.push({
154
+ depotFileSpec: targetPackage.depotFileSpec,
155
+ packageName: targetPackage.proven.packageName,
156
+ role: "investigation_target_class"
157
+ });
158
+ }
159
+ return {
160
+ acquiredPackages,
161
+ claimsCompleteMapCoverage: false,
162
+ claimsHistoricalClassCoverage: false,
163
+ investigationTarget: {
164
+ classPath: options.target.classPath,
165
+ currentActorCount: options.proven.length,
166
+ kind: "actor_class"
167
+ },
168
+ kind: "targeted"
169
+ };
170
+ }
171
+ /**
172
+ * Resolves Fast History acquisition to the selected map plus proven Investigation Target packages.
173
+ * Unrelated external-actor packages never enter the Perforce file specs or allowlist.
174
+ */
175
+ export function resolvePerforceFastMapScope(query) {
176
+ return Effect.fn("MapHistory.resolvePerforceFastMapScope")(function* () {
177
+ const perforce = yield* PerforceHistorySource;
178
+ const { scope: mapScope, world } = yield* resolvePresentDayMapScope(query);
179
+ const provenTargets = query.target.kind === "actor"
180
+ ? (() => {
181
+ const proven = proveFastHistoryActorTarget({
182
+ scope: mapScope,
183
+ target: query.target,
184
+ world
185
+ });
186
+ return proven instanceof MapHistoryError ? proven : [proven];
187
+ })()
188
+ : proveFastHistoryActorClassTargets({
189
+ scope: mapScope,
190
+ target: query.target,
191
+ world
192
+ });
193
+ if (provenTargets instanceof MapHistoryError)
194
+ return yield* Effect.fail(provenTargets);
195
+ const proven = provenTargets[0];
196
+ if (proven === undefined) {
197
+ return yield* Effect.fail(targetError("Fast History could not prove any current Investigation Target package.", "Choose a current actor or class, then retry."));
198
+ }
199
+ const mapDepotFileSpec = depotPackageFileSpec(mapScope.mapDepotPath);
200
+ const targetPackages = [];
201
+ const mappedPackageNames = new Set();
202
+ for (const target of provenTargets) {
203
+ if (target.packageName === mapScope.mapPackageName ||
204
+ mappedPackageNames.has(target.packageName))
205
+ continue;
206
+ mappedPackageNames.add(target.packageName);
207
+ const targetLocalPath = resolve(query.projectRoot, target.packageProjectRelativePath);
208
+ const targetMapping = yield* perforce.resolveLocalPath(targetLocalPath);
209
+ targetPackages.push({
210
+ depotFileSpec: depotPackageFileSpec(targetMapping.depotPath),
211
+ proven: target
212
+ });
213
+ }
214
+ const allowedPackageNames = new Set([
215
+ mapScope.mapPackageName,
216
+ ...provenTargets.map((target) => target.packageName)
217
+ ]);
218
+ const fileSpecs = [
219
+ mapDepotFileSpec,
220
+ ...targetPackages.map((target) => target.depotFileSpec)
221
+ ];
222
+ const coverage = query.target.kind === "actor_class"
223
+ ? fastHistoryActorClassTargetedCoverage({
224
+ mapDepotFileSpec,
225
+ mapPackageName: mapScope.mapPackageName,
226
+ proven: provenTargets,
227
+ target: query.target,
228
+ targetPackages
229
+ })
230
+ : fastHistoryTargetedCoverage({
231
+ mapDepotFileSpec,
232
+ mapPackageName: mapScope.mapPackageName,
233
+ proven,
234
+ targetDepotFileSpec: targetPackages[0]?.depotFileSpec ?? mapDepotFileSpec
235
+ });
236
+ return {
237
+ coverage,
238
+ proven,
239
+ provenTargets,
240
+ scope: {
241
+ ...mapScope,
242
+ allowedPackageNames,
243
+ fileSpecs
244
+ }
245
+ };
246
+ })();
247
+ }
248
+ //# sourceMappingURL=fast-history-target.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fast-history-target.js","sourceRoot":"","sources":["../src/fast-history-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO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,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC;YACxE,cAAc,CAAC,IAAI,CAAC;gBACnB,aAAa,EAAE,oBAAoB,CAAC,aAAa,CAAC,SAAS,CAAsB;gBACjF,MAAM,EAAE,MAAM;aACd,CAAC,CAAC;QACJ,CAAC;QACD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;YACnC,QAAQ,CAAC,cAAc;YACvB,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC;SACpD,CAAC,CAAC;QACH,MAAM,SAAS,GAAG;YACjB,gBAAgB;YAChB,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC;SACvD,CAAC;QACF,MAAM,QAAQ,GACb,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa;YAClC,CAAC,CAAC,qCAAqC,CAAC;gBACtC,gBAAgB;gBAChB,cAAc,EAAE,QAAQ,CAAC,cAAc;gBACvC,MAAM,EAAE,aAAa;gBACrB,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,cAAc;aACd,CAAC;YACH,CAAC,CAAC,2BAA2B,CAAC;gBAC5B,gBAAgB;gBAChB,cAAc,EAAE,QAAQ,CAAC,cAAc;gBACvC,MAAM;gBACN,mBAAmB,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,aAAa,IAAI,gBAAgB;aACzE,CAAC,CAAC;QACN,OAAO;YACN,QAAQ;YACR,MAAM;YACN,aAAa;YACb,KAAK,EAAE;gBACN,GAAG,QAAQ;gBACX,mBAAmB;gBACnB,SAAS;aACT;SACD,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;AACN,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { Effect, Schema, Scope } from "effect";
2
+ import { MapHistoryError } from "./errors.js";
3
+ export declare const HistoricalFileMutation: Schema.Union<readonly [Schema.Struct<{
4
+ readonly action: Schema.Literals<readonly ["add", "edit"]>;
5
+ readonly materializedPath: Schema.NonEmptyString;
6
+ readonly projectRelativePath: Schema.NonEmptyString;
7
+ }>, Schema.Struct<{
8
+ readonly action: Schema.Literal<"delete">;
9
+ readonly projectRelativePath: Schema.NonEmptyString;
10
+ }>]>;
11
+ export type HistoricalFileMutation = Schema.Schema.Type<typeof HistoricalFileMutation>;
12
+ export interface HistoricalProjectTree {
13
+ readonly materializationRoot: string;
14
+ readonly projectRoot: string;
15
+ readonly applyRevision: (mutations: readonly HistoricalFileMutation[]) => Effect.Effect<void, MapHistoryError>;
16
+ }
17
+ export declare function acquireHistoricalProjectTree(): Effect.Effect<HistoricalProjectTree, MapHistoryError, Scope.Scope>;
18
+ //# sourceMappingURL=historical-project-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"historical-project-tree.d.ts","sourceRoot":"","sources":["../src/historical-project-tree.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAI9C,eAAO,MAAM,sBAAsB;;;;;;;IAUjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEvF,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,CACvB,SAAS,EAAE,SAAS,sBAAsB,EAAE,KACxC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;CAC1C;AAwHD,wBAAgB,4BAA4B,IAAI,MAAM,CAAC,MAAM,CAC5D,qBAAqB,EACrB,eAAe,EACf,KAAK,CAAC,KAAK,CACX,CAoBA"}
@@ -0,0 +1,123 @@
1
+ import { copyFile, mkdir, mkdtemp, rename, rm } from "node:fs/promises";
2
+ import { basename, dirname, isAbsolute, relative, resolve } from "node:path";
3
+ import { tmpdir } from "node:os";
4
+ import { Effect, Schema, Scope } from "effect";
5
+ import { MapHistoryError } from "./errors.js";
6
+ const TEMPORARY_PROJECT_PREFIX = "ue-shed-map-history-";
7
+ export const HistoricalFileMutation = Schema.Union([
8
+ Schema.Struct({
9
+ action: Schema.Literals(["add", "edit"]),
10
+ materializedPath: Schema.NonEmptyString,
11
+ projectRelativePath: Schema.NonEmptyString
12
+ }),
13
+ Schema.Struct({
14
+ action: Schema.Literal("delete"),
15
+ projectRelativePath: Schema.NonEmptyString
16
+ })
17
+ ]);
18
+ function temporaryStorageError(operation, path, cause) {
19
+ return new MapHistoryError({
20
+ cause,
21
+ kind: "temporary_storage",
22
+ message: `${operation} failed for ${path}: ${String(cause)}`,
23
+ recovery: "Check temporary-directory permissions and available disk space, then retry.",
24
+ retrySafe: true
25
+ });
26
+ }
27
+ function invalidTarget(path, message) {
28
+ return new MapHistoryError({
29
+ kind: "invalid_target",
30
+ message,
31
+ recovery: "Use a non-empty project-relative path contained by the historical project.",
32
+ retrySafe: false
33
+ });
34
+ }
35
+ function resolveContainedPath(projectRoot, projectRelativePath) {
36
+ if (projectRelativePath.length === 0 || isAbsolute(projectRelativePath)) {
37
+ throw invalidTarget(projectRelativePath, `Historical package path must be project-relative: ${projectRelativePath}`);
38
+ }
39
+ const target = resolve(projectRoot, projectRelativePath);
40
+ const relativeTarget = relative(projectRoot, target);
41
+ if (relativeTarget.length === 0 ||
42
+ relativeTarget === ".." ||
43
+ relativeTarget.startsWith(`..\\`) ||
44
+ relativeTarget.startsWith("../") ||
45
+ isAbsolute(relativeTarget)) {
46
+ throw invalidTarget(projectRelativePath, `Historical package path escapes the temporary project: ${projectRelativePath}`);
47
+ }
48
+ return target;
49
+ }
50
+ function isContainedPath(root, path) {
51
+ const contained = relative(resolve(root), resolve(path));
52
+ return (contained.length > 0 &&
53
+ contained !== ".." &&
54
+ !contained.startsWith("..\\") &&
55
+ !contained.startsWith("../") &&
56
+ !isAbsolute(contained));
57
+ }
58
+ function validateMutations(projectRoot, mutations) {
59
+ const targets = new Set();
60
+ return mutations.map((mutation) => {
61
+ const target = resolveContainedPath(projectRoot, mutation.projectRelativePath);
62
+ const key = target.toLocaleLowerCase("en-US");
63
+ if (targets.has(key)) {
64
+ throw invalidTarget(mutation.projectRelativePath, `Historical revision contains duplicate target ${mutation.projectRelativePath}.`);
65
+ }
66
+ targets.add(key);
67
+ return { mutation, target };
68
+ });
69
+ }
70
+ function makeHistoricalProjectTree(operationRoot) {
71
+ const projectRoot = resolve(operationRoot, "project");
72
+ const materializationRoot = resolve(operationRoot, "materialized");
73
+ const applyRevision = Effect.fn("HistoricalProjectTree.applyRevision")(function* (mutations) {
74
+ const validated = yield* Effect.try({
75
+ try: () => validateMutations(projectRoot, mutations),
76
+ catch: (cause) => cause instanceof MapHistoryError
77
+ ? cause
78
+ : invalidTarget("", `Historical revision targets are invalid: ${String(cause)}`)
79
+ });
80
+ for (const { mutation, target } of validated) {
81
+ if (mutation.action === "delete") {
82
+ yield* Effect.tryPromise({
83
+ try: () => rm(target, { force: true }),
84
+ catch: (cause) => temporaryStorageError("Delete historical package", target, cause)
85
+ });
86
+ continue;
87
+ }
88
+ yield* Effect.tryPromise({
89
+ try: async () => {
90
+ await mkdir(dirname(target), { recursive: true });
91
+ if (isContainedPath(materializationRoot, mutation.materializedPath)) {
92
+ await rm(target, { force: true });
93
+ await rename(mutation.materializedPath, target);
94
+ }
95
+ else {
96
+ await copyFile(mutation.materializedPath, target);
97
+ }
98
+ },
99
+ catch: (cause) => temporaryStorageError("Copy historical package", target, cause)
100
+ });
101
+ }
102
+ });
103
+ return { applyRevision, materializationRoot, projectRoot };
104
+ }
105
+ function isOwnedTemporaryProject(path) {
106
+ return (dirname(path) === resolve(tmpdir()) && basename(path).startsWith(TEMPORARY_PROJECT_PREFIX));
107
+ }
108
+ export function acquireHistoricalProjectTree() {
109
+ return Effect.acquireRelease(Effect.tryPromise({
110
+ try: async () => {
111
+ const operationRoot = await mkdtemp(resolve(tmpdir(), TEMPORARY_PROJECT_PREFIX));
112
+ await Promise.all([
113
+ mkdir(resolve(operationRoot, "materialized")),
114
+ mkdir(resolve(operationRoot, "project"))
115
+ ]);
116
+ return operationRoot;
117
+ },
118
+ catch: (cause) => temporaryStorageError("Create historical project", tmpdir(), cause)
119
+ }).pipe(Effect.map(makeHistoricalProjectTree)), (tree) => isOwnedTemporaryProject(dirname(tree.projectRoot))
120
+ ? Effect.promise(() => rm(dirname(tree.projectRoot), { force: true, recursive: true }))
121
+ : Effect.void);
122
+ }
123
+ //# sourceMappingURL=historical-project-tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"historical-project-tree.js","sourceRoot":"","sources":["../src/historical-project-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAExD,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,KAAK,CAAC;IAClD,MAAM,CAAC,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACxC,gBAAgB,EAAE,MAAM,CAAC,cAAc;QACvC,mBAAmB,EAAE,MAAM,CAAC,cAAc;KAC1C,CAAC;IACF,MAA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OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjD,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CACpB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAC/D;QACF,CAAC,CAAC,MAAM,CAAC,IAAI,CACf,CAAC;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ export * from "./baseline-materialization.js";
2
+ export * from "./diff.js";
3
+ export * from "./errors.js";
4
+ export * from "./fast-history-target.js";
5
+ export * from "./map-history.js";
6
+ export * from "./package-correlation.js";
7
+ export * from "./playback.js";
8
+ export * from "./perforce.js";
9
+ export * from "./perforce-map-scope.js";
10
+ export * from "./revision-plan.js";
11
+ export * from "./revision-materialization.js";
12
+ export * from "./schema.js";
13
+ export * from "./submitted-change-selection.js";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,aAAa,CAAC;AAC5B,cAAc,iCAAiC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ export * from "./baseline-materialization.js";
2
+ export * from "./diff.js";
3
+ export * from "./errors.js";
4
+ export * from "./fast-history-target.js";
5
+ export * from "./map-history.js";
6
+ export * from "./package-correlation.js";
7
+ export * from "./playback.js";
8
+ export * from "./perforce.js";
9
+ export * from "./perforce-map-scope.js";
10
+ export * from "./revision-plan.js";
11
+ export * from "./revision-materialization.js";
12
+ export * from "./schema.js";
13
+ export * from "./submitted-change-selection.js";
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,aAAa,CAAC;AAC5B,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { Context, Effect, Layer } from "effect";
2
+ import { AssetReader } from "@ue-shed/unreal-assets";
3
+ import { MapHistoryError } from "./errors.js";
4
+ import { PerforceHistorySource } from "./perforce.js";
5
+ import { type MapHistoryProgress, type PerforceFastMapHistory, type PerforceFastMapHistoryQuery, type PerforceMapHistory, type PerforceMapHistoryQuery } from "./schema.js";
6
+ export interface MapHistoryShape {
7
+ readonly progress: () => Effect.Effect<MapHistoryProgress>;
8
+ readonly readPerforceMapHistory: (query: PerforceMapHistoryQuery) => Effect.Effect<PerforceMapHistory, MapHistoryError>;
9
+ readonly readPerforceFastMapHistory: (query: PerforceFastMapHistoryQuery) => Effect.Effect<PerforceFastMapHistory, MapHistoryError>;
10
+ }
11
+ declare const MapHistory_base: Context.ServiceClass<MapHistory, "@ue-shed/map-history/MapHistory", MapHistoryShape>;
12
+ /** The Perforce-first Map History workflow. It owns no credentials or source-control policy. */
13
+ export declare class MapHistory extends MapHistory_base {
14
+ }
15
+ /** Builds Map History from injected snapshot and Perforce boundaries. */
16
+ export declare const mapHistoryLayer: Layer.Layer<MapHistory, never, AssetReader | PerforceHistorySource>;
17
+ /** The optional default layer uses the configured asset reader and local Perforce configuration. */
18
+ export declare const mapHistoryLiveLayer: Layer.Layer<MapHistory, import("effect/Config").ConfigError, never>;
19
+ export declare function makeMapHistoryTestLayer(service: MapHistoryShape): Layer.Layer<MapHistory>;
20
+ export declare function readPerforceMapHistory(query: PerforceMapHistoryQuery): Effect.Effect<PerforceMapHistory, MapHistoryError, MapHistory>;
21
+ export declare function readPerforceFastMapHistory(query: PerforceFastMapHistoryQuery): Effect.Effect<PerforceFastMapHistory, MapHistoryError, MapHistory>;
22
+ export declare function mapHistoryProgress(): Effect.Effect<MapHistoryProgress, never, MapHistory>;
23
+ export {};
24
+ //# sourceMappingURL=map-history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-history.d.ts","sourceRoot":"","sources":["../src/map-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAQ,KAAK,EAAO,MAAM,QAAQ,CAAC;AAC3D,OAAO,EAAE,WAAW,EAA0C,MAAM,wBAAwB,CAAC;AAI7F,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAI9C,OAAO,EAGN,qBAAqB,EAErB,MAAM,eAAe,CAAC;AAUvB,OAAO,EAEN,KAAK,kBAAkB,EAIvB,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAI5B,MAAM,aAAa,CAAC;AAGrB,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IAC3D,QAAQ,CAAC,sBAAsB,EAAE,CAChC,KAAK,EAAE,uBAAuB,KAC1B,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAC;IACxD,QAAQ,CAAC,0BAA0B,EAAE,CACpC,KAAK,EAAE,2BAA2B,KAC9B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