@jsm-mit/tigi-sharded-package 0.13.0 → 0.14.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/README.md CHANGED
@@ -12,7 +12,8 @@ demo lease and the one-time claim code; 0.4.0 (route line, 2026-10-24) adds the
12
12
  route on the map — the line of a tapped offer, the line of the ride — and the exact pin of
13
13
  an offer (`pinExact`); 0.5.0 (stage 7, ride history, 2026-10-24) adds the places of a past
14
14
  ride (Skąd, Dokąd) and the rating of a past ride from the history; 0.13.0 (2026-11-06) adds
15
- the map-routes pass of a driver (`mapPassAsyncUnsafe`). Version 0.1.0 was the first to
15
+ the map-routes pass of a driver (`mapPassAsyncUnsafe`); 0.14.0 (2026-11-07) adds the map
16
+ group of the environment (`mapRoutesCoordinatorAsyncUnsafe`). Version 0.1.0 was the first to
16
17
  publish.
17
18
 
18
19
  ## The rider
@@ -168,7 +169,8 @@ driver took over with a claim code (its owner on its own front). The answer has
168
169
  import { MapRoutesClient } from "@jsm-mit/map-routes-package";
169
170
 
170
171
  const canisters = new DriverCanistersActor(coordinatorId, identity, { host });
171
- const map = new MapRoutesClient({ coordinatorId: mapCoordinatorId, identity, passProvider: (r) => canisters.mapPassAsyncUnsafe(r) });
172
+ const mapCoordinatorId = await canisters.mapRoutesCoordinatorAsyncUnsafe(); // undefined: no map group here
173
+ const map = new MapRoutesClient({ coordinatorId: mapCoordinatorId!, identity, passProvider: (r) => canisters.mapPassAsyncUnsafe(r) });
172
174
  ```
173
175
 
174
176
  - The driver queries the map with the SAME identity that asked for the pass.
@@ -184,8 +184,9 @@ type TigiCore =
184
184
  setLoggingEnabled: (enabled: bool) -> (Result_2);
185
185
  /// The coordinator only: the balance below which the core asks for cycles.
186
186
  setLowCyclesBelow: (value: nat) -> (Result_2);
187
- /// C-28, admins: the map-routes group of this environment (its coordinator). The core must
188
- /// be registered there as a system (`setSystem` in the map coordinator's front).
187
+ /// C-28, admins: the map-routes group of this environment (its coordinator). The Tigi
188
+ /// coordinator is the system there (`setSystem` in the map coordinator's front); the core
189
+ /// names it in every `issuePass` (C-29).
189
190
  setMapRoutesConfig: (args: MapRoutesConfig) -> (Result_5);
190
191
  setMyProfile: (args: SetProfileArgs) -> (Result_4);
191
192
  /// F-21 (2026-10-24, route line): admins — the one principal that routes the simulator's
@@ -664,8 +664,9 @@ export interface TigiCore {
664
664
  */
665
665
  'setLowCyclesBelow' : ActorMethod<[bigint], Result_2>,
666
666
  /**
667
- * / C-28, admins: the map-routes group of this environment (its coordinator). The core must
668
- * / be registered there as a system (`setSystem` in the map coordinator's front).
667
+ * / C-28, admins: the map-routes group of this environment (its coordinator). The Tigi
668
+ * / coordinator is the system there (`setSystem` in the map coordinator's front); the core
669
+ * / names it in every `issuePass` (C-29).
669
670
  */
670
671
  'setMapRoutesConfig' : ActorMethod<[MapRoutesConfig], Result_5>,
671
672
  'setMyProfile' : ActorMethod<[SetProfileArgs], Result_4>,
@@ -92,6 +92,13 @@ export declare class DriverCanistersActor {
92
92
  * @throws Error with message `CriticalCanisterError` — the core could not be reached
93
93
  */
94
94
  claimAsyncUnsafe(canisterId: string, code: string): Promise<DriverCanisterView>;
95
+ /**
96
+ * C-28: the coordinator of the map-routes group of this environment (the `coordinatorId`
97
+ * of `MapRoutesClient`), or undefined when the environment has none
98
+ * (`setMapRoutesConfig` not set). A public query; any identity may ask.
99
+ * @throws Error with message `CriticalCanisterError` — the core could not be reached
100
+ */
101
+ mapRoutesCoordinatorAsyncUnsafe(): Promise<string | undefined>;
95
102
  /**
96
103
  * C-29, C-30: the map-routes pass of the calling driver (own or demo driver canister, not
97
104
  * blocked) for an area and a bbox. The core asks the map group's coordinator which pass
@@ -1 +1 @@
1
- {"version":3,"file":"driver-canisters-actor.d.ts","sourceRoot":"","sources":["../../src/actors/driver-canisters-actor.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,KAAK,EAAE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,SAAS,CAAC,GAAG,kBAAkB,CAUnJ;AAED,gBAAgB;AAChB,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,aAAa,CAEjE;AAED,qBAAa,oBAAoB;IAC7B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAY;gBAEtB,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,GAAE,YAAiB;IAIjF;;;;;;;;;OASG;IACU,oBAAoB,IAAI,OAAO,CAAC,aAAa,CAAC;IAS3D;;;;;;OAMG;IACU,qBAAqB,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAIjE;;;;;;OAMG;IACU,kBAAkB,IAAI,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC;IAS1E;;;;;;OAMG;IACU,gBAAgB,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAMjE;;;;;;;;;OASG;IACU,cAAc,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAI1D;;;;;;;OAOG;IACU,uBAAuB,IAAI,OAAO,CAAC,aAAa,CAAC;IAI9D;;;;;;;;;;;OAWG;IACU,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAW5F;;;;;OAKG;IACU,+BAA+B,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAM3E;;;;;;;;;;;;;OAaG;IACU,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC;CAGjF"}
@@ -10,7 +10,7 @@
10
10
  // The driver canister's id is the driver's own address (the link of his front), so these
11
11
  // views carry it — unlike the rider's views of other drivers (U-14).
12
12
  import { Principal } from "@icp-sdk/core/principal";
13
- import { errorKeyOf, executeAsyncUnsafe } from "../group/canister-actor.js";
13
+ import { errorKeyOf, executeAsyncUnsafe, transportAsync } from "../group/canister-actor.js";
14
14
  import { TigiGroup } from "../group/group.js";
15
15
  import { msOf } from "../mappers.js";
16
16
  /** The fragment key of a claim link: `https://<canister>.icp0.io/#claim=<code>`. */
@@ -169,6 +169,16 @@ export class DriverCanistersActor {
169
169
  }
170
170
  return driverCanisterOf(await executeAsyncUnsafe(async () => (await this.group.coreAsync()).claimDriverCanister({ canister, code })));
171
171
  }
172
+ /**
173
+ * C-28: the coordinator of the map-routes group of this environment (the `coordinatorId`
174
+ * of `MapRoutesClient`), or undefined when the environment has none
175
+ * (`setMapRoutesConfig` not set). A public query; any identity may ask.
176
+ * @throws Error with message `CriticalCanisterError` — the core could not be reached
177
+ */
178
+ async mapRoutesCoordinatorAsyncUnsafe() {
179
+ const answer = await transportAsync(async () => (await this.group.coreAsync()).getMapRoutesConfig());
180
+ return answer[0]?.coordinatorId.toText();
181
+ }
172
182
  /**
173
183
  * C-29, C-30: the map-routes pass of the calling driver (own or demo driver canister, not
174
184
  * blocked) for an area and a bbox. The core asks the map group's coordinator which pass
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsm-mit/tigi-sharded-package",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "The one package of the Tigi network group: takes the coordinator's id and hides the coordinator, the core and the workers — for a consumer the group is one canister; plus the rider's few driver-canister endpoints (U-14).",
5
5
  "homepage": "https://github.com/JSM-Tigi/tigi-sharded/tree/master/package#readme",
6
6
  "repository": {
@@ -61,7 +61,7 @@
61
61
  "tigiSharded": {
62
62
  "repo": "tigi-sharded",
63
63
  "repoUrl": "https://github.com/JSM-Tigi/tigi-sharded",
64
- "commit": "3c0098e53f0a5fa7eca8b5abd9c2ac9e0bafbbfe"
64
+ "commit": "d96b6f97e6ba8d5987e1e045cd2ebf195c06d77d"
65
65
  },
66
66
  "tigiDriverRust": {
67
67
  "repo": "tigi-driver-rust",