@scrolled/nav-graph 0.1.0 → 0.1.1-dev.3bb0204

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.
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import type { GroupId, NodeId, Requirement } from './types';
3
3
  declare const nodeIdSchema: z.ZodEffects<z.ZodString, NodeId, string>;
4
4
  declare const groupIdSchema: z.ZodEffects<z.ZodString, GroupId, string>;
5
- declare const travelMethodSchema: z.ZodEnum<["walk", "portal", "npc", "item", "skill", "other"]>;
5
+ declare const travelMethodSchema: z.ZodEnum<["walk", "transport", "portal", "npc", "item", "skill", "scroll", "other"]>;
6
6
  declare const requirementSchema: z.ZodType<Requirement>;
7
7
  declare const entityRefsSchema: z.ZodObject<{
8
8
  itemId: z.ZodOptional<z.ZodNumber>;
@@ -21,22 +21,25 @@ declare const areaNodeSchema: z.ZodObject<{
21
21
  id: z.ZodEffects<z.ZodString, NodeId, string>;
22
22
  name: z.ZodString;
23
23
  group: z.ZodOptional<z.ZodEffects<z.ZodString, GroupId, string>>;
24
+ nearestTown: z.ZodOptional<z.ZodEffects<z.ZodString, NodeId, string>>;
24
25
  }, "strip", z.ZodTypeAny, {
25
26
  id: string & {
26
27
  readonly __brand: "NodeId";
27
28
  };
28
29
  name: string;
29
30
  group?: GroupId | undefined;
31
+ nearestTown?: NodeId | undefined;
30
32
  }, {
31
33
  id: string;
32
34
  name: string;
33
35
  group?: string | undefined;
36
+ nearestTown?: string | undefined;
34
37
  }>;
35
- declare const travelEdgeSchema: z.ZodObject<{
38
+ declare const travelEdgeSchema: z.ZodEffects<z.ZodObject<{
36
39
  from: z.ZodEffects<z.ZodString, NodeId, string>;
37
40
  to: z.ZodEffects<z.ZodString, NodeId, string>;
38
41
  bidirectional: z.ZodOptional<z.ZodBoolean>;
39
- method: z.ZodEnum<["walk", "portal", "npc", "item", "skill", "other"]>;
42
+ method: z.ZodEnum<["walk", "transport", "portal", "npc", "item", "skill", "scroll", "other"]>;
40
43
  via: z.ZodOptional<z.ZodString>;
41
44
  refs: z.ZodOptional<z.ZodObject<{
42
45
  itemId: z.ZodOptional<z.ZodNumber>;
@@ -52,8 +55,9 @@ declare const travelEdgeSchema: z.ZodObject<{
52
55
  npcId?: number | undefined;
53
56
  }>>;
54
57
  requirements: z.ZodOptional<z.ZodArray<z.ZodType<Requirement, z.ZodTypeDef, Requirement>, "many">>;
55
- weight: z.ZodOptional<z.ZodNumber>;
58
+ seconds: z.ZodOptional<z.ZodNumber>;
56
59
  notes: z.ZodOptional<z.ZodString>;
60
+ minor: z.ZodOptional<z.ZodBoolean>;
57
61
  }, "strip", z.ZodTypeAny, {
58
62
  from: string & {
59
63
  readonly __brand: "NodeId";
@@ -61,7 +65,7 @@ declare const travelEdgeSchema: z.ZodObject<{
61
65
  to: string & {
62
66
  readonly __brand: "NodeId";
63
67
  };
64
- method: "walk" | "portal" | "npc" | "item" | "skill" | "other";
68
+ method: "walk" | "transport" | "portal" | "npc" | "item" | "skill" | "scroll" | "other";
65
69
  bidirectional?: boolean | undefined;
66
70
  via?: string | undefined;
67
71
  refs?: {
@@ -70,12 +74,13 @@ declare const travelEdgeSchema: z.ZodObject<{
70
74
  npcId?: number | undefined;
71
75
  } | undefined;
72
76
  requirements?: Requirement[] | undefined;
73
- weight?: number | undefined;
77
+ seconds?: number | undefined;
74
78
  notes?: string | undefined;
79
+ minor?: boolean | undefined;
75
80
  }, {
76
81
  from: string;
77
82
  to: string;
78
- method: "walk" | "portal" | "npc" | "item" | "skill" | "other";
83
+ method: "walk" | "transport" | "portal" | "npc" | "item" | "skill" | "scroll" | "other";
79
84
  bidirectional?: boolean | undefined;
80
85
  via?: string | undefined;
81
86
  refs?: {
@@ -84,8 +89,43 @@ declare const travelEdgeSchema: z.ZodObject<{
84
89
  npcId?: number | undefined;
85
90
  } | undefined;
86
91
  requirements?: Requirement[] | undefined;
87
- weight?: number | undefined;
92
+ seconds?: number | undefined;
88
93
  notes?: string | undefined;
94
+ minor?: boolean | undefined;
95
+ }>, {
96
+ from: string & {
97
+ readonly __brand: "NodeId";
98
+ };
99
+ to: string & {
100
+ readonly __brand: "NodeId";
101
+ };
102
+ method: "walk" | "transport" | "portal" | "npc" | "item" | "skill" | "scroll" | "other";
103
+ bidirectional?: boolean | undefined;
104
+ via?: string | undefined;
105
+ refs?: {
106
+ itemId?: number | undefined;
107
+ questId?: number | undefined;
108
+ npcId?: number | undefined;
109
+ } | undefined;
110
+ requirements?: Requirement[] | undefined;
111
+ seconds?: number | undefined;
112
+ notes?: string | undefined;
113
+ minor?: boolean | undefined;
114
+ }, {
115
+ from: string;
116
+ to: string;
117
+ method: "walk" | "transport" | "portal" | "npc" | "item" | "skill" | "scroll" | "other";
118
+ bidirectional?: boolean | undefined;
119
+ via?: string | undefined;
120
+ refs?: {
121
+ itemId?: number | undefined;
122
+ questId?: number | undefined;
123
+ npcId?: number | undefined;
124
+ } | undefined;
125
+ requirements?: Requirement[] | undefined;
126
+ seconds?: number | undefined;
127
+ notes?: string | undefined;
128
+ minor?: boolean | undefined;
89
129
  }>;
90
130
  declare const groupDefSchema: z.ZodObject<{
91
131
  id: z.ZodEffects<z.ZodString, GroupId, string>;
@@ -105,22 +145,25 @@ export declare const navGraphSourceSchema: z.ZodObject<{
105
145
  id: z.ZodEffects<z.ZodString, NodeId, string>;
106
146
  name: z.ZodString;
107
147
  group: z.ZodOptional<z.ZodEffects<z.ZodString, GroupId, string>>;
148
+ nearestTown: z.ZodOptional<z.ZodEffects<z.ZodString, NodeId, string>>;
108
149
  }, "strip", z.ZodTypeAny, {
109
150
  id: string & {
110
151
  readonly __brand: "NodeId";
111
152
  };
112
153
  name: string;
113
154
  group?: GroupId | undefined;
155
+ nearestTown?: NodeId | undefined;
114
156
  }, {
115
157
  id: string;
116
158
  name: string;
117
159
  group?: string | undefined;
160
+ nearestTown?: string | undefined;
118
161
  }>, "many">;
119
- edges: z.ZodArray<z.ZodObject<{
162
+ edges: z.ZodArray<z.ZodEffects<z.ZodObject<{
120
163
  from: z.ZodEffects<z.ZodString, NodeId, string>;
121
164
  to: z.ZodEffects<z.ZodString, NodeId, string>;
122
165
  bidirectional: z.ZodOptional<z.ZodBoolean>;
123
- method: z.ZodEnum<["walk", "portal", "npc", "item", "skill", "other"]>;
166
+ method: z.ZodEnum<["walk", "transport", "portal", "npc", "item", "skill", "scroll", "other"]>;
124
167
  via: z.ZodOptional<z.ZodString>;
125
168
  refs: z.ZodOptional<z.ZodObject<{
126
169
  itemId: z.ZodOptional<z.ZodNumber>;
@@ -136,8 +179,9 @@ export declare const navGraphSourceSchema: z.ZodObject<{
136
179
  npcId?: number | undefined;
137
180
  }>>;
138
181
  requirements: z.ZodOptional<z.ZodArray<z.ZodType<Requirement, z.ZodTypeDef, Requirement>, "many">>;
139
- weight: z.ZodOptional<z.ZodNumber>;
182
+ seconds: z.ZodOptional<z.ZodNumber>;
140
183
  notes: z.ZodOptional<z.ZodString>;
184
+ minor: z.ZodOptional<z.ZodBoolean>;
141
185
  }, "strip", z.ZodTypeAny, {
142
186
  from: string & {
143
187
  readonly __brand: "NodeId";
@@ -145,7 +189,41 @@ export declare const navGraphSourceSchema: z.ZodObject<{
145
189
  to: string & {
146
190
  readonly __brand: "NodeId";
147
191
  };
148
- method: "walk" | "portal" | "npc" | "item" | "skill" | "other";
192
+ method: "walk" | "transport" | "portal" | "npc" | "item" | "skill" | "scroll" | "other";
193
+ bidirectional?: boolean | undefined;
194
+ via?: string | undefined;
195
+ refs?: {
196
+ itemId?: number | undefined;
197
+ questId?: number | undefined;
198
+ npcId?: number | undefined;
199
+ } | undefined;
200
+ requirements?: Requirement[] | undefined;
201
+ seconds?: number | undefined;
202
+ notes?: string | undefined;
203
+ minor?: boolean | undefined;
204
+ }, {
205
+ from: string;
206
+ to: string;
207
+ method: "walk" | "transport" | "portal" | "npc" | "item" | "skill" | "scroll" | "other";
208
+ bidirectional?: boolean | undefined;
209
+ via?: string | undefined;
210
+ refs?: {
211
+ itemId?: number | undefined;
212
+ questId?: number | undefined;
213
+ npcId?: number | undefined;
214
+ } | undefined;
215
+ requirements?: Requirement[] | undefined;
216
+ seconds?: number | undefined;
217
+ notes?: string | undefined;
218
+ minor?: boolean | undefined;
219
+ }>, {
220
+ from: string & {
221
+ readonly __brand: "NodeId";
222
+ };
223
+ to: string & {
224
+ readonly __brand: "NodeId";
225
+ };
226
+ method: "walk" | "transport" | "portal" | "npc" | "item" | "skill" | "scroll" | "other";
149
227
  bidirectional?: boolean | undefined;
150
228
  via?: string | undefined;
151
229
  refs?: {
@@ -154,12 +232,13 @@ export declare const navGraphSourceSchema: z.ZodObject<{
154
232
  npcId?: number | undefined;
155
233
  } | undefined;
156
234
  requirements?: Requirement[] | undefined;
157
- weight?: number | undefined;
235
+ seconds?: number | undefined;
158
236
  notes?: string | undefined;
237
+ minor?: boolean | undefined;
159
238
  }, {
160
239
  from: string;
161
240
  to: string;
162
- method: "walk" | "portal" | "npc" | "item" | "skill" | "other";
241
+ method: "walk" | "transport" | "portal" | "npc" | "item" | "skill" | "scroll" | "other";
163
242
  bidirectional?: boolean | undefined;
164
243
  via?: string | undefined;
165
244
  refs?: {
@@ -168,8 +247,9 @@ export declare const navGraphSourceSchema: z.ZodObject<{
168
247
  npcId?: number | undefined;
169
248
  } | undefined;
170
249
  requirements?: Requirement[] | undefined;
171
- weight?: number | undefined;
250
+ seconds?: number | undefined;
172
251
  notes?: string | undefined;
252
+ minor?: boolean | undefined;
173
253
  }>, "many">;
174
254
  groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
175
255
  id: z.ZodEffects<z.ZodString, GroupId, string>;
@@ -191,6 +271,7 @@ export declare const navGraphSourceSchema: z.ZodObject<{
191
271
  };
192
272
  name: string;
193
273
  group?: GroupId | undefined;
274
+ nearestTown?: NodeId | undefined;
194
275
  }[];
195
276
  edges: {
196
277
  from: string & {
@@ -199,7 +280,7 @@ export declare const navGraphSourceSchema: z.ZodObject<{
199
280
  to: string & {
200
281
  readonly __brand: "NodeId";
201
282
  };
202
- method: "walk" | "portal" | "npc" | "item" | "skill" | "other";
283
+ method: "walk" | "transport" | "portal" | "npc" | "item" | "skill" | "scroll" | "other";
203
284
  bidirectional?: boolean | undefined;
204
285
  via?: string | undefined;
205
286
  refs?: {
@@ -208,8 +289,9 @@ export declare const navGraphSourceSchema: z.ZodObject<{
208
289
  npcId?: number | undefined;
209
290
  } | undefined;
210
291
  requirements?: Requirement[] | undefined;
211
- weight?: number | undefined;
292
+ seconds?: number | undefined;
212
293
  notes?: string | undefined;
294
+ minor?: boolean | undefined;
213
295
  }[];
214
296
  groups?: {
215
297
  id: string & {
@@ -223,11 +305,12 @@ export declare const navGraphSourceSchema: z.ZodObject<{
223
305
  id: string;
224
306
  name: string;
225
307
  group?: string | undefined;
308
+ nearestTown?: string | undefined;
226
309
  }[];
227
310
  edges: {
228
311
  from: string;
229
312
  to: string;
230
- method: "walk" | "portal" | "npc" | "item" | "skill" | "other";
313
+ method: "walk" | "transport" | "portal" | "npc" | "item" | "skill" | "scroll" | "other";
231
314
  bidirectional?: boolean | undefined;
232
315
  via?: string | undefined;
233
316
  refs?: {
@@ -236,8 +319,9 @@ export declare const navGraphSourceSchema: z.ZodObject<{
236
319
  npcId?: number | undefined;
237
320
  } | undefined;
238
321
  requirements?: Requirement[] | undefined;
239
- weight?: number | undefined;
322
+ seconds?: number | undefined;
240
323
  notes?: string | undefined;
324
+ minor?: boolean | undefined;
241
325
  }[];
242
326
  groups?: {
243
327
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/ir/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG5D,QAAA,MAAM,YAAY,2CAIc,CAAC;AAEjC,QAAA,MAAM,aAAa,4CAIc,CAAC;AAElC,QAAA,MAAM,k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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBlB,CAAC;AAEL,QAAA,MAAM,cAAc;;;;;;;;;;;EAGlB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK/B,CAAC;AAEH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GACnB,CAAC"}
package/dist/ir/schema.js CHANGED
@@ -34,8 +34,10 @@ const areaNodeSchema = z.object({
34
34
  id: nodeIdSchema,
35
35
  name: z.string().min(1),
36
36
  group: groupIdSchema.optional(),
37
+ nearestTown: nodeIdSchema.optional(),
37
38
  });
38
- const travelEdgeSchema = z.object({
39
+ const travelEdgeSchema = z
40
+ .object({
39
41
  from: nodeIdSchema,
40
42
  to: nodeIdSchema,
41
43
  bidirectional: z.boolean().optional(),
@@ -43,8 +45,20 @@ const travelEdgeSchema = z.object({
43
45
  via: z.string().optional(),
44
46
  refs: entityRefsSchema.optional(),
45
47
  requirements: z.array(requirementSchema).optional(),
46
- weight: z.number().nonnegative().optional(),
48
+ seconds: z.number().positive().optional(),
47
49
  notes: z.string().optional(),
50
+ minor: z.boolean().optional(),
51
+ })
52
+ .superRefine((edge, ctx) => {
53
+ if (edge.seconds !== undefined &&
54
+ edge.method !== 'walk' &&
55
+ edge.method !== 'transport') {
56
+ ctx.addIssue({
57
+ code: z.ZodIssueCode.custom,
58
+ path: ['seconds'],
59
+ message: `seconds is only valid on walk or transport edges; "${edge.method}" transitions are instant.`,
60
+ });
61
+ }
48
62
  });
49
63
  const groupDefSchema = z.object({
50
64
  id: groupIdSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/ir/schema.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,8EAA8E;AAC9E,6EAA6E;AAE7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,YAAY,GAAG,CAAC;KACnB,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,KAAK,CAAC,sBAAsB,EAAE,8CAA8C,CAAC;KAC7E,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAW,CAAC,CAAC;AAEjC,MAAM,aAAa,GAAG,CAAC;KACpB,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,KAAK,CAAC,sBAAsB,EAAE,+CAA+C,CAAC;KAC9E,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAY,CAAC,CAAC;AAElC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAElD,MAAM,iBAAiB,GAA2B,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC7E,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;IAC7E,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QACvB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;QACnC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;QACrB,QAAQ,EAAE,CAAC,C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string & {
7
7
  readonly __brand: 'GroupId';
8
8
  };
9
- export declare const TRAVEL_METHODS: readonly ["walk", "portal", "npc", "item", "skill", "other"];
9
+ export declare const TRAVEL_METHODS: readonly ["walk", "transport", "portal", "npc", "item", "skill", "scroll", "other"];
10
10
  export type TravelMethod = (typeof TRAVEL_METHODS)[number];
11
11
  export type Requirement = {
12
12
  kind: 'meso';
@@ -27,6 +27,15 @@ export interface AreaNode {
27
27
  id: NodeId;
28
28
  name: string;
29
29
  group?: GroupId;
30
+ /**
31
+ * The town a "return to nearest town" scroll sends you to from this node.
32
+ * Every node is a town, so this defaults to the node itself (a scroll there
33
+ * is a no-op). Set it when the game routes the scroll elsewhere — e.g. a
34
+ * dungeon whose scroll drops you at its continent's hub town. Must reference
35
+ * a declared node. Enables an optional `scroll` edge used only when the
36
+ * traveller has declared they carry return scrolls (see findPath).
37
+ */
38
+ nearestTown?: NodeId;
30
39
  }
31
40
  export interface EntityRefs {
32
41
  itemId?: number;
@@ -43,9 +52,24 @@ export interface TravelEdge {
43
52
  via?: string;
44
53
  refs?: EntityRefs;
45
54
  requirements?: Requirement[];
46
- /** Reserved for the future weighted-cost model; BFS ignores it. */
47
- weight?: number;
55
+ /**
56
+ * Estimated travel time for this edge, in seconds. Valid only on the timed
57
+ * methods — `walk` and `transport` (boats/trains/carpets); every other method
58
+ * is an instant transition and the schema rejects `seconds` on it. Pathfinding
59
+ * minimizes the summed time of a route (Dijkstra). Omit when unknown — untimed
60
+ * timed-edges fall back to their method default, so a graph with no times set
61
+ * still routes sensibly. A `transport` edge's time is waived entirely when the
62
+ * route is found with fast travel enabled (see `findPath`).
63
+ */
64
+ seconds?: number;
48
65
  notes?: string;
66
+ /**
67
+ * Hide this edge from the default map to reduce clutter. Purely a rendering
68
+ * hint — pathfinding ignores it, so a `minor` edge is still routable and is
69
+ * drawn (highlighted) whenever it lies on the computed route. Use it for
70
+ * noisy or rarely-taken connections that would otherwise crowd the graph.
71
+ */
72
+ minor?: boolean;
49
73
  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C,EAAE,QAAQ,EAAE,CAAC;CACrB;AAED,oEAAoE;AACpE,eAAO,MAAM,QAAQ,GAAI,GAAG,MAAM,KAAG,MAAqB,CAAC;AAC3D,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,KAAG,OAAuB,CAAC"}
package/dist/ir/types.js CHANGED
@@ -2,7 +2,16 @@
2
2
  // autocomplete, and compile errors instead of writing JSON or a query language.
3
3
  // The shapes here are the schema the rest of the package operates on; the
4
4
  // runtime mirror lives next door in `schema.ts` (Zod).
5
- export const TRAVEL_METHODS = ['walk', 'portal', 'npc', 'item', 'skill', 'other'];
5
+ export const TRAVEL_METHODS = [
6
+ 'walk',
7
+ 'transport',
8
+ 'portal',
9
+ 'npc',
10
+ 'item',
11
+ 'skill',
12
+ 'scroll',
13
+ 'other',
14
+ ];
6
15
  /** Helper for narrowing string literals to the branded id types. */
7
16
  export const asNodeId = (s) => s;
8
17
  export const asGroupId = (s) => s;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/ir/types.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,gFAAgF;AAChF,0EAA0E;AAC1E,uDAAuD;AAQvD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAU,CAAC;AAgD3F,oEAAoE;AACpE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAW,CAAC;AAC3D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAS,EAAW,EAAE,CAAC,CAAY,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/ir/types.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,gFAAgF;AAChF,0EAA0E;AAC1E,uDAAuD;AAQvD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM;IACN,WAAW;IACX,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,QAAQ;IACR,OAAO;CACC,CAAC;AAwEX,oEAAoE;AACpE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAW,CAAC;AAC3D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAS,EAAW,EAAE,CAAC,CAAY,CAAC"}
@@ -1,16 +1,49 @@
1
1
  import type { NavGraph } from '../compile/compileGraph';
2
2
  import type { NodeId, TravelEdge } from '../ir/types';
3
+ /** Assumed travel time, in seconds, for a walk edge that declares no `seconds`. */
4
+ export declare const DEFAULT_WALK_SECONDS = 60;
5
+ /**
6
+ * Assumed ride time, in seconds, for a transport edge that declares no
7
+ * `seconds`. Longer than a walk hop: boarding a boat/train means waiting for it.
8
+ */
9
+ export declare const DEFAULT_TRANSPORT_SECONDS = 300;
10
+ /** Cost inputs that depend on the traveller, not the edge. */
11
+ export interface EdgeCostOptions {
12
+ /** When true, `transport` hops are instant (the player has a fast-travel ticket). */
13
+ fastTravel?: boolean;
14
+ }
15
+ /**
16
+ * Travel time an edge contributes to a route. `walk` always costs time;
17
+ * `transport` costs its ride time unless `fastTravel` waives it; portal / npc /
18
+ * item / skill transitions teleport the player instantly.
19
+ */
20
+ export declare function edgeSeconds(edge: TravelEdge, opts?: EdgeCostOptions): number;
3
21
  export interface PathResult {
4
22
  status: 'found' | 'unreachable' | 'unreachable-when-filtered';
5
23
  steps: TravelEdge[];
24
+ /** Total estimated travel time of `steps`, in seconds. 0 when `steps` empty. */
25
+ totalSeconds: number;
6
26
  fallback?: {
7
27
  steps: TravelEdge[];
28
+ totalSeconds: number;
8
29
  /** Indices into `fallback.steps` whose eligibility predicate failed. */
9
30
  blocked: number[];
10
31
  };
11
32
  }
12
33
  export interface FindPathOptions {
13
34
  eligible?: (edge: TravelEdge) => boolean;
35
+ /**
36
+ * When true, `transport` hops (boats/trains/carpets) are treated as instant —
37
+ * the traveller holds a fast-travel ticket. Affects route *cost*, never
38
+ * *reachability*: transports are always traversable either way.
39
+ */
40
+ fastTravel?: boolean;
41
+ /**
42
+ * When true, `scroll` edges (return to nearest town) are traversable — the
43
+ * traveller carries return scrolls. When false (default) they are skipped
44
+ * entirely, so a route never assumes a scroll the player doesn't have.
45
+ */
46
+ nearestTownScroll?: boolean;
14
47
  }
15
48
  export declare function findPath(graph: NavGraph, from: NodeId, to: NodeId, opts?: FindPathOptions): PathResult;
16
49
  //# sourceMappingURL=findPath.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"findPath.d.ts","sourceRoot":"","sources":["../../src/path/findPath.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,OAAO,GAAG,aAAa,GAAG,2BAA2B,CAAC;IAC9D,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,UAAU,EAAE,CAAC;QACpB,wEAAwE;QACxE,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC;CAC1C;AAED,wBAAgB,QAAQ,CACtB,KAAK,EAAE,QAAQ,EACf,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,eAAoB,GACzB,UAAU,CAyBZ"}
1
+ {"version":3,"file":"findPath.d.ts","sourceRoot":"","sources":["../../src/path/findPath.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtD,mFAAmF;AACnF,eAAO,MAAM,o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