@jsm-mit/tigi-sharded-package 0.2.0 → 0.3.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 +45 -2
- package/declarations/core/core.did +83 -43
- package/declarations/core/core.did.d.ts +78 -41
- package/declarations/core/core.did.js +65 -40
- package/dist/actors/driver-canisters-actor.d.ts +77 -0
- package/dist/actors/driver-canisters-actor.d.ts.map +1 -0
- package/dist/actors/driver-canisters-actor.js +147 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/interfaces.d.ts +28 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -7,7 +7,8 @@ carries the rider's few driver-canister endpoints (U-14: `getRide`, `cancelRide`
|
|
|
7
7
|
canister's id.
|
|
8
8
|
|
|
9
9
|
Status: the rider's side (night 1, U-42); 0.2.0 (stage 2a, U-43) adds the rider's own
|
|
10
|
-
rating and WHERE the chat with a driver is
|
|
10
|
+
rating and WHERE the chat with a driver is; 0.3.0 (U-45) adds `DriverCanistersActor` — the
|
|
11
|
+
demo lease and the one-time claim code. Version 0.1.0 was the first to publish.
|
|
11
12
|
|
|
12
13
|
## The rider
|
|
13
14
|
|
|
@@ -96,6 +97,44 @@ const driverPlace = await new ChatPlacesActor(coordinatorId, identity, { host })
|
|
|
96
97
|
- The room may appear a few seconds after the driver's canister (the core's outbox);
|
|
97
98
|
`openChatAsyncUnsafe` answers `NotFound` until then — try again.
|
|
98
99
|
|
|
100
|
+
## For the fronts: the driver's own canister (U-45)
|
|
101
|
+
|
|
102
|
+
Internet Identity gives one person a different principal on every origin. The demo lease is
|
|
103
|
+
taken on the rider's site; the driver signs in on the canister's own front
|
|
104
|
+
(`https://<canister>.icp0.io`) with another principal. A fresh lease answers a one-time
|
|
105
|
+
claim code (15 min, single use; the core keeps only its sha256) that hands the canister to
|
|
106
|
+
whoever claims it there (`fabryka.md` F-20).
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
import { DriverCanistersActor, claimLinkOf, claimCodeOfHash } from "@jsm-mit/tigi-sharded-package";
|
|
110
|
+
|
|
111
|
+
// The rider's site (the lease holder).
|
|
112
|
+
const canisters = new DriverCanistersActor(coordinatorId, identity, { host });
|
|
113
|
+
const lease = await canisters.leaseDemoAsyncUnsafe(); // { kind: "leased", canister, claim? } | { kind: "busy", untilMs }
|
|
114
|
+
if (lease.kind === "leased" && lease.claim) {
|
|
115
|
+
link = claimLinkOf(lease.canister.canisterId, lease.claim.code); // "Otwórz swój kanister"
|
|
116
|
+
}
|
|
117
|
+
const fresh = await canisters.newClaimCodeAsyncUnsafe(); // "Nowy link": the old code stops working
|
|
118
|
+
await canisters.extendDemoAsyncUnsafe(); // F-8: 15 min more
|
|
119
|
+
await canisters.getMineAsyncUnsafe(); // the held demo canister (or the own one) | undefined
|
|
120
|
+
|
|
121
|
+
// The driver's front, signed in as a non-owner, with #claim=<code> in the address.
|
|
122
|
+
const code = claimCodeOfHash(window.location.hash);
|
|
123
|
+
if (code) {
|
|
124
|
+
await new DriverCanistersActor(coordinatorId, identity, { host }).claimAsyncUnsafe(canisterId, code);
|
|
125
|
+
// clear the fragment, reload: the driver is the owner now
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
- A refused claim is always `CanisterError` `NotAuthorized` — wrong, expired, used or not
|
|
130
|
+
this canister's code alike.
|
|
131
|
+
- The lease stays with its holder: `getMineAsyncUnsafe`, `extendDemoAsyncUnsafe` and
|
|
132
|
+
`newClaimCodeAsyncUnsafe` keep working from the rider's site; `ownerPrincipal` names
|
|
133
|
+
the driver after the claim. The chat room of the canister gets the driver as its
|
|
134
|
+
recipient.
|
|
135
|
+
- The same holder leasing again (no reinstall) gets no code: `newClaimCodeAsyncUnsafe`.
|
|
136
|
+
- These views carry the driver canister's id: it is the driver's own address.
|
|
137
|
+
|
|
99
138
|
The Test Manager (stage and the test modes): `TestManagerActor.hasSimulatedDriversAsyncUnsafe`,
|
|
100
139
|
`spawnDriversAsyncUnsafe` (12 drivers), `setSpeedUpAsyncUnsafe(request, 10)` before choosing.
|
|
101
140
|
Offers of the simulator have `simulated: true`.
|
|
@@ -108,7 +147,9 @@ npm run test-unit # no replica needed
|
|
|
108
147
|
npm run test-drivers # (a) 5 real driver canisters, driver-bots, route-stub
|
|
109
148
|
npm run test-simulator # (b) the simulator, 20 requests, 20 rides
|
|
110
149
|
npm run test-split # (c) an area split during traffic
|
|
150
|
+
npm run test-claim # (d) the demo lease and the claim code (U-45)
|
|
111
151
|
npm run test-smoke # one whole ride with the simulator (run by publish-public)
|
|
152
|
+
npm run load-local # the load test: 200 simulated drivers, 100 riders (docs/load-test-2026-10-24.md)
|
|
112
153
|
npm run publish-public # human-run: publish from master (see below)
|
|
113
154
|
npm run sync-declarations # after a change of a .did (`… protocol` for the protocol and the simulator only)
|
|
114
155
|
```
|
|
@@ -116,7 +157,9 @@ npm run sync-declarations # after a change of a .did (`… protocol` for the pr
|
|
|
116
157
|
The end-to-end suites run on the LOCAL replica only (`scripts/run-tests-local.sh`): a fresh
|
|
117
158
|
group, local cycles, the driver and simulator wasms of `../../tigi-driver-rust` (built
|
|
118
159
|
there, never changed). Logs and measurements go to `/tmp/claude-1000/tigi/`
|
|
119
|
-
(`TEST_LOG_DIR`).
|
|
160
|
+
(`TEST_LOG_DIR`). The load test builds its group with its own coordinator
|
|
161
|
+
(`tigi-sharded-coordinator-load`), so the shared local group stays; its settings are
|
|
162
|
+
environment variables (`scripts/load-local.ts`, `scripts/run-load-local.sh`).
|
|
120
163
|
|
|
121
164
|
## Publishing
|
|
122
165
|
|
|
@@ -40,54 +40,58 @@ type TigiCore =
|
|
|
40
40
|
/// Admins: an admin more (the coordinator adds the people who rule the group).
|
|
41
41
|
addAdmin: (args: PrincipalArgs) -> (Result_2);
|
|
42
42
|
/// Admins: a canister the core controls joins the demo pool (U-35).
|
|
43
|
-
addPoolCanister: (args: CanisterArgs) -> (
|
|
43
|
+
addPoolCanister: (args: CanisterArgs) -> (Result_17);
|
|
44
44
|
/// Admins: a driver canister, or one driver in it (`driverKey`), is blocked; the workers
|
|
45
45
|
/// drop it at once (WO-2).
|
|
46
46
|
blockDriver: (args: BlockDriverArgs) -> (Result_2);
|
|
47
47
|
/// Admins: a rider is blocked (core.md, accepted 2026-10-22).
|
|
48
48
|
blockRider: (args: BlockRiderArgs) -> (Result_2);
|
|
49
|
+
/// F-20 (U-45): the caller — the driver signed in on the canister's own front — takes
|
|
50
|
+
/// over the demo canister with the code of the link. Single use, 15 min; every refusal
|
|
51
|
+
/// answers the same NotAuthorized. The room of the canister gets the caller (C-15).
|
|
52
|
+
claimDriverCanister: (args: ClaimArgs) -> (Result_17);
|
|
49
53
|
clearLogs: () -> ();
|
|
50
54
|
/// Admins: the chunks become THE module of their kind. A new driver wasm is released
|
|
51
55
|
/// (F-11) and its hash goes to the workers.
|
|
52
|
-
commitDriverWasm: (args: WasmCommitArgs) -> (
|
|
56
|
+
commitDriverWasm: (args: WasmCommitArgs) -> (Result_23);
|
|
53
57
|
/// Admins, localTest: an empty canister from the core's cycles joins the demo pool.
|
|
54
|
-
createLocalPoolCanister: () -> (
|
|
58
|
+
createLocalPoolCanister: () -> (Result_17);
|
|
55
59
|
/// F-2 … F-4, F-10: the caller's own driver canister (localTest: from the core's cycles).
|
|
56
|
-
createMyDriverCanister: () -> (
|
|
60
|
+
createMyDriverCanister: () -> (Result_17);
|
|
57
61
|
/// Admins: the simulator, created once (F-18).
|
|
58
|
-
ensureSimulator: () -> (
|
|
62
|
+
ensureSimulator: () -> (Result_22);
|
|
59
63
|
/// F-8: 15 min more for the holder of a demo canister.
|
|
60
|
-
extendDemoLease: () -> (
|
|
61
|
-
getAdmins: () -> (
|
|
64
|
+
extendDemoLease: () -> (Result_17);
|
|
65
|
+
getAdmins: () -> (Result_21) query;
|
|
62
66
|
/// For the fronts (through the package): where the chat of this environment is. Null =
|
|
63
67
|
/// no chat here yet. The room of a driver is `ChatRoomFunctions.driverRoomId`.
|
|
64
68
|
getChatConfig: () -> (opt ChatConfig) query;
|
|
65
69
|
/// Admins: how far the driver rooms are (C-15).
|
|
66
|
-
getChatRoomsStatus: () -> (
|
|
70
|
+
getChatRoomsStatus: () -> (Result_20) query;
|
|
67
71
|
/// WO-1, WO-2: what the core knows of a canister — for the workers and anybody.
|
|
68
72
|
getDriverCanisterStatus: (args: CanisterArgs) ->
|
|
69
73
|
(DriverCanisterStatus) query;
|
|
70
|
-
getDriverRollout: () -> (
|
|
71
|
-
getFactoryStatus: () -> (
|
|
74
|
+
getDriverRollout: () -> (Result_19) query;
|
|
75
|
+
getFactoryStatus: () -> (Result_18) query;
|
|
72
76
|
getLogs: () -> (text) query;
|
|
73
77
|
/// The caller's own canister, or the demo canister the caller holds now.
|
|
74
|
-
getMyDriverCanister: () -> (
|
|
78
|
+
getMyDriverCanister: () -> (Result_17) query;
|
|
75
79
|
getMyProfile: () -> (Result_4) query;
|
|
76
80
|
/// C-16, PF-4: the caller's own rating as a rider (sum and count of stars; null = no
|
|
77
81
|
/// rating yet). Ratings reach the core in the workers' batches, up to a minute late.
|
|
78
|
-
getMyRating: () -> (
|
|
82
|
+
getMyRating: () -> (Result_16) query;
|
|
79
83
|
/// C-8: the caller's rides, newest first.
|
|
80
|
-
getMyRides: (args: RidesPageArgs) -> (
|
|
84
|
+
getMyRides: (args: RidesPageArgs) -> (Result_15) query;
|
|
81
85
|
/// C-3: the names of up to MAX_PROFILES_PER_CALL principals; unknown ones are left out.
|
|
82
|
-
getProfiles: (args: ProfilesArgs) -> (
|
|
86
|
+
getProfiles: (args: ProfilesArgs) -> (Result_14) query;
|
|
83
87
|
/// F-11: the driver wasms released so far, oldest first.
|
|
84
88
|
getReleasedDriverWasms: () -> (vec ReleasedWasm) query;
|
|
85
89
|
/// F-18: the simulator of this group; none in prod or before ensureSimulator.
|
|
86
90
|
getSimulator: () -> (opt principal) query;
|
|
87
91
|
/// Admins: the coordinator, the workers confirmed so far, the mode.
|
|
88
|
-
getWiring: () -> (
|
|
92
|
+
getWiring: () -> (Result_13) query;
|
|
89
93
|
/// Admins: how far the outbox to the workers is (C-6, C-7).
|
|
90
|
-
getWorkerOutbox: () -> (
|
|
94
|
+
getWorkerOutbox: () -> (Result_12) query;
|
|
91
95
|
/// Workers of the group: the core asks the coordinator once and remembers the worker,
|
|
92
96
|
/// which then gets the network state through the outbox. A worker calls it once after
|
|
93
97
|
/// its install. Answers true.
|
|
@@ -95,23 +99,30 @@ type TigiCore =
|
|
|
95
99
|
/// Workers of the group: finished rides and ratings, at most MAX_RIDE_BATCH (C-4, C-5).
|
|
96
100
|
/// Idempotent: a known requestId and a counted rating count once. Invalid entries are
|
|
97
101
|
/// rejected and logged; the worker drops the whole batch after an ok.
|
|
98
|
-
ingestRideBatch: (batch: RideBatch) -> (
|
|
102
|
+
ingestRideBatch: (batch: RideBatch) -> (Result_11);
|
|
99
103
|
/// C-14: the accounts gate of the chat (U-43). The chat core asks this group's
|
|
100
104
|
/// coordinator WHERE (`accountsCanisterFor` → this core) and asks here: true = an
|
|
101
105
|
/// account with a name exists for the principal and the rider is not blocked.
|
|
102
106
|
isUser: ("principal": principal) -> (bool) query;
|
|
103
|
-
/// F-5 … F-7: a demo canister for 15 min (outside prod).
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
/// F-5 … F-7: a demo canister for 15 min (outside prod). A fresh lease comes with a
|
|
108
|
+
/// one-time claim code (F-20, U-45).
|
|
109
|
+
leaseDemoDriverCanister: () -> (Result_10);
|
|
110
|
+
listBlocks: (args: PageArgs) -> (Result_9) query;
|
|
111
|
+
listDriverCanisters: (args: PageArgs) -> (Result_8) query;
|
|
107
112
|
/// Admins: the driver rooms as the core wants them, 100 a page at most.
|
|
108
|
-
listDriverRooms: (args: PageArgs) -> (
|
|
113
|
+
listDriverRooms: (args: PageArgs) -> (Result_7) query;
|
|
114
|
+
/// F-20: a fresh claim code for the caller's running demo lease; the old one stops
|
|
115
|
+
/// working.
|
|
116
|
+
newClaimCode: () -> (Result_6);
|
|
109
117
|
removeAdmin: (args: PrincipalArgs) -> (Result_2);
|
|
110
118
|
resumeDriverRollout: () -> (Result_3);
|
|
111
119
|
/// Admins: the chat of this environment — the chat group's coordinator and the project
|
|
112
120
|
/// (whose admin and accounts field are this group's coordinator). Every call sends every
|
|
113
121
|
/// driver room again (a new project, a chat group set up again).
|
|
114
122
|
setChatConfig: (args: ChatConfig) -> (Result_5);
|
|
123
|
+
/// Admins, localTest only: new claim codes live this long (the local check of an
|
|
124
|
+
/// expired code). Heap only: an upgrade brings back 15 min.
|
|
125
|
+
setClaimCodeTtl: (args: ClaimTtlArgs) -> (Result);
|
|
115
126
|
setLoggingEnabled: (enabled: bool) -> (Result_2);
|
|
116
127
|
/// The coordinator only: the balance below which the core asks for cycles.
|
|
117
128
|
setLowCyclesBelow: (value: nat) -> (Result_2);
|
|
@@ -194,22 +205,22 @@ type RideBatch =
|
|
|
194
205
|
type Result_9 =
|
|
195
206
|
variant {
|
|
196
207
|
err: Error;
|
|
197
|
-
ok:
|
|
208
|
+
ok: vec Block;
|
|
198
209
|
};
|
|
199
210
|
type Result_8 =
|
|
200
211
|
variant {
|
|
201
212
|
err: Error;
|
|
202
|
-
ok:
|
|
213
|
+
ok: DriverCanistersPage;
|
|
203
214
|
};
|
|
204
215
|
type Result_7 =
|
|
205
216
|
variant {
|
|
206
217
|
err: Error;
|
|
207
|
-
ok:
|
|
218
|
+
ok: vec DriverRoomView;
|
|
208
219
|
};
|
|
209
220
|
type Result_6 =
|
|
210
221
|
variant {
|
|
211
222
|
err: Error;
|
|
212
|
-
ok:
|
|
223
|
+
ok: ClaimCode;
|
|
213
224
|
};
|
|
214
225
|
type Result_5 =
|
|
215
226
|
variant {
|
|
@@ -226,67 +237,67 @@ type Result_3 =
|
|
|
226
237
|
err: Error;
|
|
227
238
|
ok: RolloutView;
|
|
228
239
|
};
|
|
229
|
-
type
|
|
240
|
+
type Result_23 =
|
|
230
241
|
variant {
|
|
231
242
|
err: Error;
|
|
232
243
|
ok: WasmInfo;
|
|
233
244
|
};
|
|
234
|
-
type
|
|
245
|
+
type Result_22 =
|
|
235
246
|
variant {
|
|
236
247
|
err: Error;
|
|
237
248
|
ok: principal;
|
|
238
249
|
};
|
|
239
|
-
type
|
|
250
|
+
type Result_21 =
|
|
240
251
|
variant {
|
|
241
252
|
err: Error;
|
|
242
253
|
ok: vec principal;
|
|
243
254
|
};
|
|
244
|
-
type
|
|
255
|
+
type Result_20 =
|
|
245
256
|
variant {
|
|
246
257
|
err: Error;
|
|
247
|
-
ok:
|
|
258
|
+
ok: ChatRoomsStatus;
|
|
248
259
|
};
|
|
249
|
-
type
|
|
260
|
+
type Result_2 =
|
|
250
261
|
variant {
|
|
251
262
|
err: Error;
|
|
252
|
-
ok:
|
|
263
|
+
ok: bool;
|
|
253
264
|
};
|
|
254
|
-
type
|
|
265
|
+
type Result_19 =
|
|
255
266
|
variant {
|
|
256
267
|
err: Error;
|
|
257
268
|
ok: opt RolloutView;
|
|
258
269
|
};
|
|
259
|
-
type
|
|
270
|
+
type Result_18 =
|
|
260
271
|
variant {
|
|
261
272
|
err: Error;
|
|
262
273
|
ok: FactoryStatus;
|
|
263
274
|
};
|
|
264
|
-
type
|
|
275
|
+
type Result_17 =
|
|
265
276
|
variant {
|
|
266
277
|
err: Error;
|
|
267
278
|
ok: DriverCanister;
|
|
268
279
|
};
|
|
269
|
-
type
|
|
280
|
+
type Result_16 =
|
|
270
281
|
variant {
|
|
271
282
|
err: Error;
|
|
272
283
|
ok: opt Rating;
|
|
273
284
|
};
|
|
274
|
-
type
|
|
285
|
+
type Result_15 =
|
|
275
286
|
variant {
|
|
276
287
|
err: Error;
|
|
277
288
|
ok: RidesPage;
|
|
278
289
|
};
|
|
279
|
-
type
|
|
290
|
+
type Result_14 =
|
|
280
291
|
variant {
|
|
281
292
|
err: Error;
|
|
282
293
|
ok: vec ProfileEntry;
|
|
283
294
|
};
|
|
284
|
-
type
|
|
295
|
+
type Result_13 =
|
|
285
296
|
variant {
|
|
286
297
|
err: Error;
|
|
287
298
|
ok: Wiring;
|
|
288
299
|
};
|
|
289
|
-
type
|
|
300
|
+
type Result_12 =
|
|
290
301
|
variant {
|
|
291
302
|
err: Error;
|
|
292
303
|
ok:
|
|
@@ -297,11 +308,16 @@ type Result_11 =
|
|
|
297
308
|
subjects: nat;
|
|
298
309
|
};
|
|
299
310
|
};
|
|
300
|
-
type
|
|
311
|
+
type Result_11 =
|
|
301
312
|
variant {
|
|
302
313
|
err: Error;
|
|
303
314
|
ok: RideBatchResult;
|
|
304
315
|
};
|
|
316
|
+
type Result_10 =
|
|
317
|
+
variant {
|
|
318
|
+
err: Error;
|
|
319
|
+
ok: LeaseAnswer;
|
|
320
|
+
};
|
|
305
321
|
type Result_1 =
|
|
306
322
|
variant {
|
|
307
323
|
err: Error;
|
|
@@ -367,10 +383,22 @@ type Mode =
|
|
|
367
383
|
stage;
|
|
368
384
|
test;
|
|
369
385
|
};
|
|
386
|
+
type LeasedCanister =
|
|
387
|
+
record {
|
|
388
|
+
blocked: bool;
|
|
389
|
+
canister: principal;
|
|
390
|
+
claim: opt ClaimCode;
|
|
391
|
+
createdAtNs: int;
|
|
392
|
+
installedAtNs: opt int;
|
|
393
|
+
kind: DriverCanisterKind;
|
|
394
|
+
leaseUntilNs: opt int;
|
|
395
|
+
moduleHash: opt blob;
|
|
396
|
+
owner: principal;
|
|
397
|
+
};
|
|
370
398
|
type LeaseAnswer =
|
|
371
399
|
variant {
|
|
372
400
|
busy: record {untilNs: int;};
|
|
373
|
-
leased:
|
|
401
|
+
leased: LeasedCanister;
|
|
374
402
|
};
|
|
375
403
|
type InitArgs =
|
|
376
404
|
record {
|
|
@@ -441,6 +469,18 @@ type DriverCanister =
|
|
|
441
469
|
moduleHash: opt blob;
|
|
442
470
|
owner: principal;
|
|
443
471
|
};
|
|
472
|
+
type ClaimTtlArgs = record {seconds: nat;};
|
|
473
|
+
type ClaimCode =
|
|
474
|
+
record {
|
|
475
|
+
canister: principal;
|
|
476
|
+
code: text;
|
|
477
|
+
expiresAtNs: int;
|
|
478
|
+
};
|
|
479
|
+
type ClaimArgs =
|
|
480
|
+
record {
|
|
481
|
+
canister: principal;
|
|
482
|
+
code: text;
|
|
483
|
+
};
|
|
444
484
|
type ChatRoomsStatus =
|
|
445
485
|
record {
|
|
446
486
|
config: opt ChatConfig;
|
|
@@ -30,6 +30,13 @@ export interface ChatRoomsStatus {
|
|
|
30
30
|
'pendingSinceNs' : [] | [bigint],
|
|
31
31
|
'rooms' : bigint,
|
|
32
32
|
}
|
|
33
|
+
export interface ClaimArgs { 'code' : string, 'canister' : Principal }
|
|
34
|
+
export interface ClaimCode {
|
|
35
|
+
'expiresAtNs' : bigint,
|
|
36
|
+
'code' : string,
|
|
37
|
+
'canister' : Principal,
|
|
38
|
+
}
|
|
39
|
+
export interface ClaimTtlArgs { 'seconds' : bigint }
|
|
33
40
|
export interface DriverCanister {
|
|
34
41
|
'moduleHash' : [] | [Uint8Array | number[]],
|
|
35
42
|
'owner' : Principal,
|
|
@@ -84,7 +91,18 @@ export interface InitArgs {
|
|
|
84
91
|
'coordinator' : [] | [Principal],
|
|
85
92
|
}
|
|
86
93
|
export type LeaseAnswer = { 'busy' : { 'untilNs' : bigint } } |
|
|
87
|
-
{ 'leased' :
|
|
94
|
+
{ 'leased' : LeasedCanister };
|
|
95
|
+
export interface LeasedCanister {
|
|
96
|
+
'moduleHash' : [] | [Uint8Array | number[]],
|
|
97
|
+
'owner' : Principal,
|
|
98
|
+
'blocked' : boolean,
|
|
99
|
+
'kind' : DriverCanisterKind,
|
|
100
|
+
'claim' : [] | [ClaimCode],
|
|
101
|
+
'createdAtNs' : bigint,
|
|
102
|
+
'canister' : Principal,
|
|
103
|
+
'installedAtNs' : [] | [bigint],
|
|
104
|
+
'leaseUntilNs' : [] | [bigint],
|
|
105
|
+
}
|
|
88
106
|
export type Mode = { 'localTest' : null } |
|
|
89
107
|
{ 'prod' : null } |
|
|
90
108
|
{ 'test' : null } |
|
|
@@ -119,9 +137,11 @@ export type Result = { 'ok' : bigint } |
|
|
|
119
137
|
{ 'err' : Error };
|
|
120
138
|
export type Result_1 = { 'ok' : Uint8Array | number[] } |
|
|
121
139
|
{ 'err' : Error };
|
|
122
|
-
export type Result_10 = { 'ok' :
|
|
140
|
+
export type Result_10 = { 'ok' : LeaseAnswer } |
|
|
141
|
+
{ 'err' : Error };
|
|
142
|
+
export type Result_11 = { 'ok' : RideBatchResult } |
|
|
123
143
|
{ 'err' : Error };
|
|
124
|
-
export type
|
|
144
|
+
export type Result_12 = {
|
|
125
145
|
'ok' : {
|
|
126
146
|
'subjects' : bigint,
|
|
127
147
|
'headSeq' : bigint,
|
|
@@ -130,29 +150,29 @@ export type Result_11 = {
|
|
|
130
150
|
}
|
|
131
151
|
} |
|
|
132
152
|
{ 'err' : Error };
|
|
133
|
-
export type
|
|
134
|
-
{ 'err' : Error };
|
|
135
|
-
export type Result_13 = { 'ok' : Array<ProfileEntry> } |
|
|
153
|
+
export type Result_13 = { 'ok' : Wiring } |
|
|
136
154
|
{ 'err' : Error };
|
|
137
|
-
export type Result_14 = { 'ok' :
|
|
155
|
+
export type Result_14 = { 'ok' : Array<ProfileEntry> } |
|
|
138
156
|
{ 'err' : Error };
|
|
139
|
-
export type Result_15 = { 'ok' :
|
|
157
|
+
export type Result_15 = { 'ok' : RidesPage } |
|
|
140
158
|
{ 'err' : Error };
|
|
141
|
-
export type Result_16 = { 'ok' :
|
|
159
|
+
export type Result_16 = { 'ok' : [] | [Rating] } |
|
|
142
160
|
{ 'err' : Error };
|
|
143
|
-
export type Result_17 = { 'ok' :
|
|
161
|
+
export type Result_17 = { 'ok' : DriverCanister } |
|
|
144
162
|
{ 'err' : Error };
|
|
145
|
-
export type Result_18 = { 'ok' :
|
|
163
|
+
export type Result_18 = { 'ok' : FactoryStatus } |
|
|
146
164
|
{ 'err' : Error };
|
|
147
|
-
export type Result_19 = { 'ok' :
|
|
165
|
+
export type Result_19 = { 'ok' : [] | [RolloutView] } |
|
|
148
166
|
{ 'err' : Error };
|
|
149
167
|
export type Result_2 = { 'ok' : boolean } |
|
|
150
168
|
{ 'err' : Error };
|
|
151
|
-
export type Result_20 = { 'ok' :
|
|
169
|
+
export type Result_20 = { 'ok' : ChatRoomsStatus } |
|
|
152
170
|
{ 'err' : Error };
|
|
153
|
-
export type Result_21 = { 'ok' : Principal } |
|
|
171
|
+
export type Result_21 = { 'ok' : Array<Principal> } |
|
|
154
172
|
{ 'err' : Error };
|
|
155
|
-
export type Result_22 = { 'ok' :
|
|
173
|
+
export type Result_22 = { 'ok' : Principal } |
|
|
174
|
+
{ 'err' : Error };
|
|
175
|
+
export type Result_23 = { 'ok' : WasmInfo } |
|
|
156
176
|
{ 'err' : Error };
|
|
157
177
|
export type Result_3 = { 'ok' : RolloutView } |
|
|
158
178
|
{ 'err' : Error };
|
|
@@ -160,13 +180,13 @@ export type Result_4 = { 'ok' : Profile } |
|
|
|
160
180
|
{ 'err' : Error };
|
|
161
181
|
export type Result_5 = { 'ok' : ChatConfig } |
|
|
162
182
|
{ 'err' : Error };
|
|
163
|
-
export type Result_6 = { 'ok' :
|
|
183
|
+
export type Result_6 = { 'ok' : ClaimCode } |
|
|
164
184
|
{ 'err' : Error };
|
|
165
|
-
export type Result_7 = { 'ok' :
|
|
185
|
+
export type Result_7 = { 'ok' : Array<DriverRoomView> } |
|
|
166
186
|
{ 'err' : Error };
|
|
167
|
-
export type Result_8 = { 'ok' :
|
|
187
|
+
export type Result_8 = { 'ok' : DriverCanistersPage } |
|
|
168
188
|
{ 'err' : Error };
|
|
169
|
-
export type Result_9 = { 'ok' :
|
|
189
|
+
export type Result_9 = { 'ok' : Array<Block> } |
|
|
170
190
|
{ 'err' : Error };
|
|
171
191
|
export interface RideBatch {
|
|
172
192
|
'ratings' : Array<RatingEntry>,
|
|
@@ -229,7 +249,7 @@ export interface TigiCore {
|
|
|
229
249
|
/**
|
|
230
250
|
* / Admins: a canister the core controls joins the demo pool (U-35).
|
|
231
251
|
*/
|
|
232
|
-
'addPoolCanister' : ActorMethod<[CanisterArgs],
|
|
252
|
+
'addPoolCanister' : ActorMethod<[CanisterArgs], Result_17>,
|
|
233
253
|
/**
|
|
234
254
|
* / Admins: a driver canister, or one driver in it (`driverKey`), is blocked; the workers
|
|
235
255
|
* / drop it at once (WO-2).
|
|
@@ -239,29 +259,35 @@ export interface TigiCore {
|
|
|
239
259
|
* / Admins: a rider is blocked (core.md, accepted 2026-10-22).
|
|
240
260
|
*/
|
|
241
261
|
'blockRider' : ActorMethod<[BlockRiderArgs], Result_2>,
|
|
262
|
+
/**
|
|
263
|
+
* / F-20 (U-45): the caller — the driver signed in on the canister's own front — takes
|
|
264
|
+
* / over the demo canister with the code of the link. Single use, 15 min; every refusal
|
|
265
|
+
* / answers the same NotAuthorized. The room of the canister gets the caller (C-15).
|
|
266
|
+
*/
|
|
267
|
+
'claimDriverCanister' : ActorMethod<[ClaimArgs], Result_17>,
|
|
242
268
|
'clearLogs' : ActorMethod<[], undefined>,
|
|
243
269
|
/**
|
|
244
270
|
* / Admins: the chunks become THE module of their kind. A new driver wasm is released
|
|
245
271
|
* / (F-11) and its hash goes to the workers.
|
|
246
272
|
*/
|
|
247
|
-
'commitDriverWasm' : ActorMethod<[WasmCommitArgs],
|
|
273
|
+
'commitDriverWasm' : ActorMethod<[WasmCommitArgs], Result_23>,
|
|
248
274
|
/**
|
|
249
275
|
* / Admins, localTest: an empty canister from the core's cycles joins the demo pool.
|
|
250
276
|
*/
|
|
251
|
-
'createLocalPoolCanister' : ActorMethod<[],
|
|
277
|
+
'createLocalPoolCanister' : ActorMethod<[], Result_17>,
|
|
252
278
|
/**
|
|
253
279
|
* / F-2 … F-4, F-10: the caller's own driver canister (localTest: from the core's cycles).
|
|
254
280
|
*/
|
|
255
|
-
'createMyDriverCanister' : ActorMethod<[],
|
|
281
|
+
'createMyDriverCanister' : ActorMethod<[], Result_17>,
|
|
256
282
|
/**
|
|
257
283
|
* / Admins: the simulator, created once (F-18).
|
|
258
284
|
*/
|
|
259
|
-
'ensureSimulator' : ActorMethod<[],
|
|
285
|
+
'ensureSimulator' : ActorMethod<[], Result_22>,
|
|
260
286
|
/**
|
|
261
287
|
* / F-8: 15 min more for the holder of a demo canister.
|
|
262
288
|
*/
|
|
263
|
-
'extendDemoLease' : ActorMethod<[],
|
|
264
|
-
'getAdmins' : ActorMethod<[],
|
|
289
|
+
'extendDemoLease' : ActorMethod<[], Result_17>,
|
|
290
|
+
'getAdmins' : ActorMethod<[], Result_21>,
|
|
265
291
|
/**
|
|
266
292
|
* / For the fronts (through the package): where the chat of this environment is. Null =
|
|
267
293
|
* / no chat here yet. The room of a driver is `ChatRoomFunctions.driverRoomId`.
|
|
@@ -270,32 +296,32 @@ export interface TigiCore {
|
|
|
270
296
|
/**
|
|
271
297
|
* / Admins: how far the driver rooms are (C-15).
|
|
272
298
|
*/
|
|
273
|
-
'getChatRoomsStatus' : ActorMethod<[],
|
|
299
|
+
'getChatRoomsStatus' : ActorMethod<[], Result_20>,
|
|
274
300
|
/**
|
|
275
301
|
* / WO-1, WO-2: what the core knows of a canister — for the workers and anybody.
|
|
276
302
|
*/
|
|
277
303
|
'getDriverCanisterStatus' : ActorMethod<[CanisterArgs], DriverCanisterStatus>,
|
|
278
|
-
'getDriverRollout' : ActorMethod<[],
|
|
279
|
-
'getFactoryStatus' : ActorMethod<[],
|
|
304
|
+
'getDriverRollout' : ActorMethod<[], Result_19>,
|
|
305
|
+
'getFactoryStatus' : ActorMethod<[], Result_18>,
|
|
280
306
|
'getLogs' : ActorMethod<[], string>,
|
|
281
307
|
/**
|
|
282
308
|
* / The caller's own canister, or the demo canister the caller holds now.
|
|
283
309
|
*/
|
|
284
|
-
'getMyDriverCanister' : ActorMethod<[],
|
|
310
|
+
'getMyDriverCanister' : ActorMethod<[], Result_17>,
|
|
285
311
|
'getMyProfile' : ActorMethod<[], Result_4>,
|
|
286
312
|
/**
|
|
287
313
|
* / C-16, PF-4: the caller's own rating as a rider (sum and count of stars; null = no
|
|
288
314
|
* / rating yet). Ratings reach the core in the workers' batches, up to a minute late.
|
|
289
315
|
*/
|
|
290
|
-
'getMyRating' : ActorMethod<[],
|
|
316
|
+
'getMyRating' : ActorMethod<[], Result_16>,
|
|
291
317
|
/**
|
|
292
318
|
* / C-8: the caller's rides, newest first.
|
|
293
319
|
*/
|
|
294
|
-
'getMyRides' : ActorMethod<[RidesPageArgs],
|
|
320
|
+
'getMyRides' : ActorMethod<[RidesPageArgs], Result_15>,
|
|
295
321
|
/**
|
|
296
322
|
* / C-3: the names of up to MAX_PROFILES_PER_CALL principals; unknown ones are left out.
|
|
297
323
|
*/
|
|
298
|
-
'getProfiles' : ActorMethod<[ProfilesArgs],
|
|
324
|
+
'getProfiles' : ActorMethod<[ProfilesArgs], Result_14>,
|
|
299
325
|
/**
|
|
300
326
|
* / F-11: the driver wasms released so far, oldest first.
|
|
301
327
|
*/
|
|
@@ -307,11 +333,11 @@ export interface TigiCore {
|
|
|
307
333
|
/**
|
|
308
334
|
* / Admins: the coordinator, the workers confirmed so far, the mode.
|
|
309
335
|
*/
|
|
310
|
-
'getWiring' : ActorMethod<[],
|
|
336
|
+
'getWiring' : ActorMethod<[], Result_13>,
|
|
311
337
|
/**
|
|
312
338
|
* / Admins: how far the outbox to the workers is (C-6, C-7).
|
|
313
339
|
*/
|
|
314
|
-
'getWorkerOutbox' : ActorMethod<[],
|
|
340
|
+
'getWorkerOutbox' : ActorMethod<[], Result_12>,
|
|
315
341
|
/**
|
|
316
342
|
* / Workers of the group: the core asks the coordinator once and remembers the worker,
|
|
317
343
|
* / which then gets the network state through the outbox. A worker calls it once after
|
|
@@ -323,7 +349,7 @@ export interface TigiCore {
|
|
|
323
349
|
* / Idempotent: a known requestId and a counted rating count once. Invalid entries are
|
|
324
350
|
* / rejected and logged; the worker drops the whole batch after an ok.
|
|
325
351
|
*/
|
|
326
|
-
'ingestRideBatch' : ActorMethod<[RideBatch],
|
|
352
|
+
'ingestRideBatch' : ActorMethod<[RideBatch], Result_11>,
|
|
327
353
|
/**
|
|
328
354
|
* / C-14: the accounts gate of the chat (U-43). The chat core asks this group's
|
|
329
355
|
* / coordinator WHERE (`accountsCanisterFor` → this core) and asks here: true = an
|
|
@@ -331,15 +357,21 @@ export interface TigiCore {
|
|
|
331
357
|
*/
|
|
332
358
|
'isUser' : ActorMethod<[Principal], boolean>,
|
|
333
359
|
/**
|
|
334
|
-
* / F-5 … F-7: a demo canister for 15 min (outside prod).
|
|
360
|
+
* / F-5 … F-7: a demo canister for 15 min (outside prod). A fresh lease comes with a
|
|
361
|
+
* / one-time claim code (F-20, U-45).
|
|
335
362
|
*/
|
|
336
|
-
'leaseDemoDriverCanister' : ActorMethod<[],
|
|
337
|
-
'listBlocks' : ActorMethod<[PageArgs],
|
|
338
|
-
'listDriverCanisters' : ActorMethod<[PageArgs],
|
|
363
|
+
'leaseDemoDriverCanister' : ActorMethod<[], Result_10>,
|
|
364
|
+
'listBlocks' : ActorMethod<[PageArgs], Result_9>,
|
|
365
|
+
'listDriverCanisters' : ActorMethod<[PageArgs], Result_8>,
|
|
339
366
|
/**
|
|
340
367
|
* / Admins: the driver rooms as the core wants them, 100 a page at most.
|
|
341
368
|
*/
|
|
342
|
-
'listDriverRooms' : ActorMethod<[PageArgs],
|
|
369
|
+
'listDriverRooms' : ActorMethod<[PageArgs], Result_7>,
|
|
370
|
+
/**
|
|
371
|
+
* / F-20: a fresh claim code for the caller's running demo lease; the old one stops
|
|
372
|
+
* / working.
|
|
373
|
+
*/
|
|
374
|
+
'newClaimCode' : ActorMethod<[], Result_6>,
|
|
343
375
|
'removeAdmin' : ActorMethod<[PrincipalArgs], Result_2>,
|
|
344
376
|
'resumeDriverRollout' : ActorMethod<[], Result_3>,
|
|
345
377
|
/**
|
|
@@ -348,6 +380,11 @@ export interface TigiCore {
|
|
|
348
380
|
* / driver room again (a new project, a chat group set up again).
|
|
349
381
|
*/
|
|
350
382
|
'setChatConfig' : ActorMethod<[ChatConfig], Result_5>,
|
|
383
|
+
/**
|
|
384
|
+
* / Admins, localTest only: new claim codes live this long (the local check of an
|
|
385
|
+
* / expired code). Heap only: an upgrade brings back 15 min.
|
|
386
|
+
*/
|
|
387
|
+
'setClaimCodeTtl' : ActorMethod<[ClaimTtlArgs], Result>,
|
|
351
388
|
'setLoggingEnabled' : ActorMethod<[boolean], Result_2>,
|
|
352
389
|
/**
|
|
353
390
|
* / The coordinator only: the balance below which the core asks for cycles.
|
|
@@ -61,7 +61,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
61
61
|
'installedAtNs' : IDL.Opt(IDL.Int),
|
|
62
62
|
'leaseUntilNs' : IDL.Opt(IDL.Int),
|
|
63
63
|
});
|
|
64
|
-
const
|
|
64
|
+
const Result_17 = IDL.Variant({ 'ok' : DriverCanister, 'err' : Error });
|
|
65
65
|
const BlockDriverArgs = IDL.Record({
|
|
66
66
|
'driverKey' : IDL.Opt(IDL.Text),
|
|
67
67
|
'canister' : IDL.Principal,
|
|
@@ -71,6 +71,10 @@ export const idlFactory = ({ IDL }) => {
|
|
|
71
71
|
'rider' : IDL.Principal,
|
|
72
72
|
'reason' : IDL.Text,
|
|
73
73
|
});
|
|
74
|
+
const ClaimArgs = IDL.Record({
|
|
75
|
+
'code' : IDL.Text,
|
|
76
|
+
'canister' : IDL.Principal,
|
|
77
|
+
});
|
|
74
78
|
const WasmKind = IDL.Variant({ 'simulator' : IDL.Null, 'driver' : IDL.Null });
|
|
75
79
|
const WasmCommitArgs = IDL.Record({
|
|
76
80
|
'sha256' : IDL.Vec(IDL.Nat8),
|
|
@@ -83,9 +87,9 @@ export const idlFactory = ({ IDL }) => {
|
|
|
83
87
|
'size' : IDL.Nat,
|
|
84
88
|
'committedAtNs' : IDL.Int,
|
|
85
89
|
});
|
|
86
|
-
const
|
|
87
|
-
const
|
|
88
|
-
const
|
|
90
|
+
const Result_23 = IDL.Variant({ 'ok' : WasmInfo, 'err' : Error });
|
|
91
|
+
const Result_22 = IDL.Variant({ 'ok' : IDL.Principal, 'err' : Error });
|
|
92
|
+
const Result_21 = IDL.Variant({
|
|
89
93
|
'ok' : IDL.Vec(IDL.Principal),
|
|
90
94
|
'err' : Error,
|
|
91
95
|
});
|
|
@@ -101,13 +105,13 @@ export const idlFactory = ({ IDL }) => {
|
|
|
101
105
|
'pendingSinceNs' : IDL.Opt(IDL.Int),
|
|
102
106
|
'rooms' : IDL.Nat,
|
|
103
107
|
});
|
|
104
|
-
const
|
|
108
|
+
const Result_20 = IDL.Variant({ 'ok' : ChatRoomsStatus, 'err' : Error });
|
|
105
109
|
const DriverCanisterStatus = IDL.Record({
|
|
106
110
|
'moduleHash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
107
111
|
'blocked' : IDL.Bool,
|
|
108
112
|
'registered' : IDL.Bool,
|
|
109
113
|
});
|
|
110
|
-
const
|
|
114
|
+
const Result_19 = IDL.Variant({ 'ok' : IDL.Opt(RolloutView), 'err' : Error });
|
|
111
115
|
const FactoryStatus = IDL.Record({
|
|
112
116
|
'simulator' : IDL.Opt(IDL.Principal),
|
|
113
117
|
'mode' : Mode,
|
|
@@ -119,7 +123,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
119
123
|
'driverWasm' : IDL.Opt(WasmInfo),
|
|
120
124
|
'registered' : IDL.Nat,
|
|
121
125
|
});
|
|
122
|
-
const
|
|
126
|
+
const Result_18 = IDL.Variant({ 'ok' : FactoryStatus, 'err' : Error });
|
|
123
127
|
const Profile = IDL.Record({
|
|
124
128
|
'updatedAtNs' : IDL.Int,
|
|
125
129
|
'name' : IDL.Text,
|
|
@@ -127,7 +131,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
127
131
|
});
|
|
128
132
|
const Result_4 = IDL.Variant({ 'ok' : Profile, 'err' : Error });
|
|
129
133
|
const Rating = IDL.Record({ 'sum' : IDL.Nat, 'count' : IDL.Nat });
|
|
130
|
-
const
|
|
134
|
+
const Result_16 = IDL.Variant({ 'ok' : IDL.Opt(Rating), 'err' : Error });
|
|
131
135
|
const RidesPageArgs = IDL.Record({
|
|
132
136
|
'beforeIndex' : IDL.Opt(IDL.Nat),
|
|
133
137
|
'limit' : IDL.Nat,
|
|
@@ -151,13 +155,13 @@ export const idlFactory = ({ IDL }) => {
|
|
|
151
155
|
'nextBeforeIndex' : IDL.Opt(IDL.Nat),
|
|
152
156
|
'rides' : IDL.Vec(RideEntry),
|
|
153
157
|
});
|
|
154
|
-
const
|
|
158
|
+
const Result_15 = IDL.Variant({ 'ok' : RidesPage, 'err' : Error });
|
|
155
159
|
const ProfilesArgs = IDL.Record({ 'principals' : IDL.Vec(IDL.Principal) });
|
|
156
160
|
const ProfileEntry = IDL.Record({
|
|
157
161
|
'principal' : IDL.Principal,
|
|
158
162
|
'name' : IDL.Text,
|
|
159
163
|
});
|
|
160
|
-
const
|
|
164
|
+
const Result_14 = IDL.Variant({
|
|
161
165
|
'ok' : IDL.Vec(ProfileEntry),
|
|
162
166
|
'err' : Error,
|
|
163
167
|
});
|
|
@@ -171,8 +175,8 @@ export const idlFactory = ({ IDL }) => {
|
|
|
171
175
|
'knownWorkers' : IDL.Vec(IDL.Principal),
|
|
172
176
|
'coordinator' : IDL.Opt(IDL.Principal),
|
|
173
177
|
});
|
|
174
|
-
const
|
|
175
|
-
const
|
|
178
|
+
const Result_13 = IDL.Variant({ 'ok' : Wiring, 'err' : Error });
|
|
179
|
+
const Result_12 = IDL.Variant({
|
|
176
180
|
'ok' : IDL.Record({
|
|
177
181
|
'subjects' : IDL.Nat,
|
|
178
182
|
'headSeq' : IDL.Nat64,
|
|
@@ -203,12 +207,28 @@ export const idlFactory = ({ IDL }) => {
|
|
|
203
207
|
'rejected' : IDL.Nat,
|
|
204
208
|
'ratingsCounted' : IDL.Nat,
|
|
205
209
|
});
|
|
206
|
-
const
|
|
210
|
+
const Result_11 = IDL.Variant({ 'ok' : RideBatchResult, 'err' : Error });
|
|
211
|
+
const ClaimCode = IDL.Record({
|
|
212
|
+
'expiresAtNs' : IDL.Int,
|
|
213
|
+
'code' : IDL.Text,
|
|
214
|
+
'canister' : IDL.Principal,
|
|
215
|
+
});
|
|
216
|
+
const LeasedCanister = IDL.Record({
|
|
217
|
+
'moduleHash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
218
|
+
'owner' : IDL.Principal,
|
|
219
|
+
'blocked' : IDL.Bool,
|
|
220
|
+
'kind' : DriverCanisterKind,
|
|
221
|
+
'claim' : IDL.Opt(ClaimCode),
|
|
222
|
+
'createdAtNs' : IDL.Int,
|
|
223
|
+
'canister' : IDL.Principal,
|
|
224
|
+
'installedAtNs' : IDL.Opt(IDL.Int),
|
|
225
|
+
'leaseUntilNs' : IDL.Opt(IDL.Int),
|
|
226
|
+
});
|
|
207
227
|
const LeaseAnswer = IDL.Variant({
|
|
208
228
|
'busy' : IDL.Record({ 'untilNs' : IDL.Int }),
|
|
209
|
-
'leased' :
|
|
229
|
+
'leased' : LeasedCanister,
|
|
210
230
|
});
|
|
211
|
-
const
|
|
231
|
+
const Result_10 = IDL.Variant({ 'ok' : LeaseAnswer, 'err' : Error });
|
|
212
232
|
const PageArgs = IDL.Record({ 'offset' : IDL.Nat, 'limit' : IDL.Nat });
|
|
213
233
|
const BlockTarget = IDL.Variant({
|
|
214
234
|
'driverCanister' : IDL.Principal,
|
|
@@ -224,12 +244,12 @@ export const idlFactory = ({ IDL }) => {
|
|
|
224
244
|
'target' : BlockTarget,
|
|
225
245
|
'reason' : IDL.Text,
|
|
226
246
|
});
|
|
227
|
-
const
|
|
247
|
+
const Result_9 = IDL.Variant({ 'ok' : IDL.Vec(Block), 'err' : Error });
|
|
228
248
|
const DriverCanistersPage = IDL.Record({
|
|
229
249
|
'total' : IDL.Nat,
|
|
230
250
|
'canisters' : IDL.Vec(DriverCanister),
|
|
231
251
|
});
|
|
232
|
-
const
|
|
252
|
+
const Result_8 = IDL.Variant({ 'ok' : DriverCanistersPage, 'err' : Error });
|
|
233
253
|
const DriverRoomView = IDL.Record({
|
|
234
254
|
'recipient' : IDL.Principal,
|
|
235
255
|
'driverKey' : IDL.Text,
|
|
@@ -238,11 +258,14 @@ export const idlFactory = ({ IDL }) => {
|
|
|
238
258
|
'roomId' : IDL.Text,
|
|
239
259
|
'synced' : IDL.Bool,
|
|
240
260
|
});
|
|
241
|
-
const
|
|
261
|
+
const Result_7 = IDL.Variant({
|
|
242
262
|
'ok' : IDL.Vec(DriverRoomView),
|
|
243
263
|
'err' : Error,
|
|
244
264
|
});
|
|
265
|
+
const Result_6 = IDL.Variant({ 'ok' : ClaimCode, 'err' : Error });
|
|
245
266
|
const Result_5 = IDL.Variant({ 'ok' : ChatConfig, 'err' : Error });
|
|
267
|
+
const ClaimTtlArgs = IDL.Record({ 'seconds' : IDL.Nat });
|
|
268
|
+
const Result = IDL.Variant({ 'ok' : IDL.Nat, 'err' : Error });
|
|
246
269
|
const SetProfileArgs = IDL.Record({ 'name' : IDL.Text });
|
|
247
270
|
const UnblockDriverArgs = IDL.Record({
|
|
248
271
|
'driverKey' : IDL.Opt(IDL.Text),
|
|
@@ -255,49 +278,51 @@ export const idlFactory = ({ IDL }) => {
|
|
|
255
278
|
'bytes' : IDL.Vec(IDL.Nat8),
|
|
256
279
|
'index' : IDL.Nat32,
|
|
257
280
|
});
|
|
258
|
-
const Result = IDL.Variant({ 'ok' : IDL.Nat, 'err' : Error });
|
|
259
281
|
const TigiCore = IDL.Service({
|
|
260
282
|
'abortDriverRollout' : IDL.Func([], [Result_3], []),
|
|
261
283
|
'addAdmin' : IDL.Func([PrincipalArgs], [Result_2], []),
|
|
262
|
-
'addPoolCanister' : IDL.Func([CanisterArgs], [
|
|
284
|
+
'addPoolCanister' : IDL.Func([CanisterArgs], [Result_17], []),
|
|
263
285
|
'blockDriver' : IDL.Func([BlockDriverArgs], [Result_2], []),
|
|
264
286
|
'blockRider' : IDL.Func([BlockRiderArgs], [Result_2], []),
|
|
287
|
+
'claimDriverCanister' : IDL.Func([ClaimArgs], [Result_17], []),
|
|
265
288
|
'clearLogs' : IDL.Func([], [], []),
|
|
266
|
-
'commitDriverWasm' : IDL.Func([WasmCommitArgs], [
|
|
267
|
-
'createLocalPoolCanister' : IDL.Func([], [
|
|
268
|
-
'createMyDriverCanister' : IDL.Func([], [
|
|
269
|
-
'ensureSimulator' : IDL.Func([], [
|
|
270
|
-
'extendDemoLease' : IDL.Func([], [
|
|
271
|
-
'getAdmins' : IDL.Func([], [
|
|
289
|
+
'commitDriverWasm' : IDL.Func([WasmCommitArgs], [Result_23], []),
|
|
290
|
+
'createLocalPoolCanister' : IDL.Func([], [Result_17], []),
|
|
291
|
+
'createMyDriverCanister' : IDL.Func([], [Result_17], []),
|
|
292
|
+
'ensureSimulator' : IDL.Func([], [Result_22], []),
|
|
293
|
+
'extendDemoLease' : IDL.Func([], [Result_17], []),
|
|
294
|
+
'getAdmins' : IDL.Func([], [Result_21], ['query']),
|
|
272
295
|
'getChatConfig' : IDL.Func([], [IDL.Opt(ChatConfig)], ['query']),
|
|
273
|
-
'getChatRoomsStatus' : IDL.Func([], [
|
|
296
|
+
'getChatRoomsStatus' : IDL.Func([], [Result_20], ['query']),
|
|
274
297
|
'getDriverCanisterStatus' : IDL.Func(
|
|
275
298
|
[CanisterArgs],
|
|
276
299
|
[DriverCanisterStatus],
|
|
277
300
|
['query'],
|
|
278
301
|
),
|
|
279
|
-
'getDriverRollout' : IDL.Func([], [
|
|
280
|
-
'getFactoryStatus' : IDL.Func([], [
|
|
302
|
+
'getDriverRollout' : IDL.Func([], [Result_19], ['query']),
|
|
303
|
+
'getFactoryStatus' : IDL.Func([], [Result_18], ['query']),
|
|
281
304
|
'getLogs' : IDL.Func([], [IDL.Text], ['query']),
|
|
282
|
-
'getMyDriverCanister' : IDL.Func([], [
|
|
305
|
+
'getMyDriverCanister' : IDL.Func([], [Result_17], ['query']),
|
|
283
306
|
'getMyProfile' : IDL.Func([], [Result_4], ['query']),
|
|
284
|
-
'getMyRating' : IDL.Func([], [
|
|
285
|
-
'getMyRides' : IDL.Func([RidesPageArgs], [
|
|
286
|
-
'getProfiles' : IDL.Func([ProfilesArgs], [
|
|
307
|
+
'getMyRating' : IDL.Func([], [Result_16], ['query']),
|
|
308
|
+
'getMyRides' : IDL.Func([RidesPageArgs], [Result_15], ['query']),
|
|
309
|
+
'getProfiles' : IDL.Func([ProfilesArgs], [Result_14], ['query']),
|
|
287
310
|
'getReleasedDriverWasms' : IDL.Func([], [IDL.Vec(ReleasedWasm)], ['query']),
|
|
288
311
|
'getSimulator' : IDL.Func([], [IDL.Opt(IDL.Principal)], ['query']),
|
|
289
|
-
'getWiring' : IDL.Func([], [
|
|
290
|
-
'getWorkerOutbox' : IDL.Func([], [
|
|
312
|
+
'getWiring' : IDL.Func([], [Result_13], ['query']),
|
|
313
|
+
'getWorkerOutbox' : IDL.Func([], [Result_12], ['query']),
|
|
291
314
|
'helloFromWorker' : IDL.Func([], [Result_2], []),
|
|
292
|
-
'ingestRideBatch' : IDL.Func([RideBatch], [
|
|
315
|
+
'ingestRideBatch' : IDL.Func([RideBatch], [Result_11], []),
|
|
293
316
|
'isUser' : IDL.Func([IDL.Principal], [IDL.Bool], ['query']),
|
|
294
|
-
'leaseDemoDriverCanister' : IDL.Func([], [
|
|
295
|
-
'listBlocks' : IDL.Func([PageArgs], [
|
|
296
|
-
'listDriverCanisters' : IDL.Func([PageArgs], [
|
|
297
|
-
'listDriverRooms' : IDL.Func([PageArgs], [
|
|
317
|
+
'leaseDemoDriverCanister' : IDL.Func([], [Result_10], []),
|
|
318
|
+
'listBlocks' : IDL.Func([PageArgs], [Result_9], ['query']),
|
|
319
|
+
'listDriverCanisters' : IDL.Func([PageArgs], [Result_8], ['query']),
|
|
320
|
+
'listDriverRooms' : IDL.Func([PageArgs], [Result_7], ['query']),
|
|
321
|
+
'newClaimCode' : IDL.Func([], [Result_6], []),
|
|
298
322
|
'removeAdmin' : IDL.Func([PrincipalArgs], [Result_2], []),
|
|
299
323
|
'resumeDriverRollout' : IDL.Func([], [Result_3], []),
|
|
300
324
|
'setChatConfig' : IDL.Func([ChatConfig], [Result_5], []),
|
|
325
|
+
'setClaimCodeTtl' : IDL.Func([ClaimTtlArgs], [Result], []),
|
|
301
326
|
'setLoggingEnabled' : IDL.Func([IDL.Bool], [Result_2], []),
|
|
302
327
|
'setLowCyclesBelow' : IDL.Func([IDL.Nat], [Result_2], []),
|
|
303
328
|
'setMyProfile' : IDL.Func([SetProfileArgs], [Result_4], []),
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Identity } from "@icp-sdk/core/agent";
|
|
2
|
+
import type { ClaimCode as CandidClaimCode, DriverCanister as CandidDriverCanister } from "../../declarations/core/core.did.js";
|
|
3
|
+
import { type GroupOptions } from "../group/canister-actor.js";
|
|
4
|
+
import type { ClaimCodeView, DemoLeaseView, DriverCanisterView } from "../interfaces.js";
|
|
5
|
+
/** The fragment key of a claim link: `https://<canister>.icp0.io/#claim=<code>`. */
|
|
6
|
+
export declare const CLAIM_FRAGMENT_KEY = "claim";
|
|
7
|
+
/** F-20a: a code is 32 characters of base64url; the core refuses more than this. */
|
|
8
|
+
export declare const MAX_CLAIM_CODE_CHARS = 64;
|
|
9
|
+
/**
|
|
10
|
+
* F-20: the link the rider's site shows after a lease ("Otwórz swój kanister"). The code
|
|
11
|
+
* rides in the fragment, which the browser never sends to a server.
|
|
12
|
+
* @param frontOrigin the origin of the driver canister's front; default `https://<canister>.icp0.io`
|
|
13
|
+
*/
|
|
14
|
+
export declare function claimLinkOf(canisterId: string, code: string, frontOrigin?: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* F-20: the claim code in a location hash (`#claim=<code>`, also among other `&` parts), or
|
|
17
|
+
* undefined. The driver's front clears the fragment after the claim.
|
|
18
|
+
*/
|
|
19
|
+
export declare function claimCodeOfHash(hash: string): string | undefined;
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare function driverCanisterOf(record: Pick<CandidDriverCanister, "canister" | "owner" | "kind" | "leaseUntilNs" | "blocked">): DriverCanisterView;
|
|
22
|
+
/** @internal */
|
|
23
|
+
export declare function claimCodeOf(claim: CandidClaimCode): ClaimCodeView;
|
|
24
|
+
export declare class DriverCanistersActor {
|
|
25
|
+
private readonly group;
|
|
26
|
+
constructor(coordinatorId: string, identity: Identity, options?: GroupOptions);
|
|
27
|
+
/**
|
|
28
|
+
* F-5 … F-7, F-20a: a demo canister for 15 minutes, reinstalled with the caller as its
|
|
29
|
+
* owner — or the caller's lease already (no reinstall, no code: `newClaimCodeAsyncUnsafe`).
|
|
30
|
+
* @returns `leased` with `claim` after a fresh lease (undefined when the core could make
|
|
31
|
+
* no code — ask `newClaimCodeAsyncUnsafe`); `busy` with the time the pool frees up
|
|
32
|
+
* @throws Error with message `CanisterError` — `NotAuthorized` (prod), `NotFound` (no pool),
|
|
33
|
+
* `InvalidData` (no driver wasm), `RemoteCanisterError` (the install failed)
|
|
34
|
+
* @throws Error with message `CallRefusedAtInspectionStage` — anonymous, or the daily limit (30)
|
|
35
|
+
* @throws Error with message `CriticalCanisterError` — the core could not be reached
|
|
36
|
+
*/
|
|
37
|
+
leaseDemoAsyncUnsafe(): Promise<DemoLeaseView>;
|
|
38
|
+
/**
|
|
39
|
+
* F-8: 15 minutes more for the holder of the demo canister (at most 30 ahead), also after
|
|
40
|
+
* the end while nobody took it over. The owner stays (F-20f).
|
|
41
|
+
* @throws Error with message `CanisterError` — `NotFound` (no lease of the caller), `InvalidData` (being installed)
|
|
42
|
+
* @throws Error with message `CallRefusedAtInspectionStage` — anonymous, or the daily limit (30)
|
|
43
|
+
* @throws Error with message `CriticalCanisterError` — the core could not be reached
|
|
44
|
+
*/
|
|
45
|
+
extendDemoAsyncUnsafe(): Promise<DriverCanisterView>;
|
|
46
|
+
/**
|
|
47
|
+
* The caller's own driver canister, or the demo canister the caller holds now (as the
|
|
48
|
+
* lease holder — after a claim the canister's owner is the driver, `ownerPrincipal`).
|
|
49
|
+
* @returns undefined when the caller has none
|
|
50
|
+
* @throws Error with message `CanisterError` — `NotAuthorized` (anonymous)
|
|
51
|
+
* @throws Error with message `CriticalCanisterError` — the core could not be reached
|
|
52
|
+
*/
|
|
53
|
+
getMineAsyncUnsafe(): Promise<DriverCanisterView | undefined>;
|
|
54
|
+
/**
|
|
55
|
+
* F-20c: a new claim code for the caller's running demo lease ("Nowy link"); the code
|
|
56
|
+
* before it stops working. Good for 15 minutes, once.
|
|
57
|
+
* @throws Error with message `CanisterError` — `NotFound` (no running lease of the caller),
|
|
58
|
+
* `InvalidData` (being installed), `RemoteCanisterError` (no randomness — try again)
|
|
59
|
+
* @throws Error with message `CallRefusedAtInspectionStage` — anonymous, or the daily limit (30)
|
|
60
|
+
* @throws Error with message `CriticalCanisterError` — the core could not be reached
|
|
61
|
+
*/
|
|
62
|
+
newClaimCodeAsyncUnsafe(): Promise<ClaimCodeView>;
|
|
63
|
+
/**
|
|
64
|
+
* F-20d, F-20e: the caller — the driver signed in on the canister's own front — takes
|
|
65
|
+
* over the demo canister with the code of the link. The canister's owner becomes the
|
|
66
|
+
* caller, and so does the recipient of its chat room; the lease stays with its holder.
|
|
67
|
+
* @returns the canister with the caller as `ownerPrincipal`
|
|
68
|
+
* @throws Error with message `CanisterError` — `NotAuthorized` (the code is wrong, expired,
|
|
69
|
+
* used, or not for this canister — one answer for all), `InvalidData` (the canister
|
|
70
|
+
* is busy — try again), `RemoteCanisterError` (the driver canister did not take it;
|
|
71
|
+
* the code stays good)
|
|
72
|
+
* @throws Error with message `CallRefusedAtInspectionStage` — anonymous, or the daily limit (30)
|
|
73
|
+
* @throws Error with message `CriticalCanisterError` — the core could not be reached
|
|
74
|
+
*/
|
|
75
|
+
claimAsyncUnsafe(canisterId: string, code: string): Promise<DriverCanisterView>;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=driver-canisters-actor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driver-canisters-actor.d.ts","sourceR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AC,kBAAkB,GAAG,SAAS,CAAC;IAS1E;;;;;;;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;CAU/F"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// The driver canister of the signed-in person in the core's factory (fabryka.md F-5 … F-8,
|
|
2
|
+
// F-20; U-45): the demo lease, its extension, "mine", and the one-time claim code that hands
|
|
3
|
+
// a demo canister over to the driver's principal on the canister's own front.
|
|
4
|
+
//
|
|
5
|
+
// Internet Identity gives one person a different principal on every origin: the lease is
|
|
6
|
+
// taken on the rider's site, the driver signs in on `https://<canister>.icp0.io`. The
|
|
7
|
+
// rider's site shows the link `claimLinkOf(canisterId, code)`; the driver's front reads the
|
|
8
|
+
// code with `claimCodeOfHash(location.hash)` and calls `claimAsyncUnsafe` as the driver.
|
|
9
|
+
//
|
|
10
|
+
// The driver canister's id is the driver's own address (the link of his front), so these
|
|
11
|
+
// views carry it — unlike the rider's views of other drivers (U-14).
|
|
12
|
+
import { Principal } from "@icp-sdk/core/principal";
|
|
13
|
+
import { errorKeyOf, executeAsyncUnsafe } from "../group/canister-actor.js";
|
|
14
|
+
import { TigiGroup } from "../group/group.js";
|
|
15
|
+
import { msOf } from "../mappers.js";
|
|
16
|
+
/** The fragment key of a claim link: `https://<canister>.icp0.io/#claim=<code>`. */
|
|
17
|
+
export const CLAIM_FRAGMENT_KEY = "claim";
|
|
18
|
+
/** F-20a: a code is 32 characters of base64url; the core refuses more than this. */
|
|
19
|
+
export const MAX_CLAIM_CODE_CHARS = 64;
|
|
20
|
+
/**
|
|
21
|
+
* F-20: the link the rider's site shows after a lease ("Otwórz swój kanister"). The code
|
|
22
|
+
* rides in the fragment, which the browser never sends to a server.
|
|
23
|
+
* @param frontOrigin the origin of the driver canister's front; default `https://<canister>.icp0.io`
|
|
24
|
+
*/
|
|
25
|
+
export function claimLinkOf(canisterId, code, frontOrigin = `https://${canisterId}.icp0.io`) {
|
|
26
|
+
return `${frontOrigin}/#${CLAIM_FRAGMENT_KEY}=${encodeURIComponent(code)}`;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* F-20: the claim code in a location hash (`#claim=<code>`, also among other `&` parts), or
|
|
30
|
+
* undefined. The driver's front clears the fragment after the claim.
|
|
31
|
+
*/
|
|
32
|
+
export function claimCodeOfHash(hash) {
|
|
33
|
+
const text = hash.startsWith("#") ? hash.slice(1) : hash;
|
|
34
|
+
for (const part of text.split("&")) {
|
|
35
|
+
const [key, ...rest] = part.split("=");
|
|
36
|
+
if (key !== CLAIM_FRAGMENT_KEY)
|
|
37
|
+
continue;
|
|
38
|
+
let code;
|
|
39
|
+
try {
|
|
40
|
+
code = decodeURIComponent(rest.join("="));
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
return code.length > 0 && code.length <= MAX_CLAIM_CODE_CHARS && /^[A-Za-z0-9_-]+$/.test(code) ? code : undefined;
|
|
46
|
+
}
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
/** @internal */
|
|
50
|
+
export function driverCanisterOf(record) {
|
|
51
|
+
const until = record.leaseUntilNs[0];
|
|
52
|
+
return {
|
|
53
|
+
canisterId: record.canister.toText(),
|
|
54
|
+
kind: "pool" in record.kind ? "pool" : "own",
|
|
55
|
+
ownerPrincipal: record.owner.toText(),
|
|
56
|
+
leaseUntilMs: until === undefined ? undefined : msOf(BigInt(until)),
|
|
57
|
+
blocked: record.blocked,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/** @internal */
|
|
61
|
+
export function claimCodeOf(claim) {
|
|
62
|
+
return { canisterId: claim.canister.toText(), code: claim.code, expiresAtMs: msOf(BigInt(claim.expiresAtNs)) };
|
|
63
|
+
}
|
|
64
|
+
export class DriverCanistersActor {
|
|
65
|
+
group;
|
|
66
|
+
constructor(coordinatorId, identity, options = {}) {
|
|
67
|
+
this.group = TigiGroup.of(coordinatorId, identity, options);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* F-5 … F-7, F-20a: a demo canister for 15 minutes, reinstalled with the caller as its
|
|
71
|
+
* owner — or the caller's lease already (no reinstall, no code: `newClaimCodeAsyncUnsafe`).
|
|
72
|
+
* @returns `leased` with `claim` after a fresh lease (undefined when the core could make
|
|
73
|
+
* no code — ask `newClaimCodeAsyncUnsafe`); `busy` with the time the pool frees up
|
|
74
|
+
* @throws Error with message `CanisterError` — `NotAuthorized` (prod), `NotFound` (no pool),
|
|
75
|
+
* `InvalidData` (no driver wasm), `RemoteCanisterError` (the install failed)
|
|
76
|
+
* @throws Error with message `CallRefusedAtInspectionStage` — anonymous, or the daily limit (30)
|
|
77
|
+
* @throws Error with message `CriticalCanisterError` — the core could not be reached
|
|
78
|
+
*/
|
|
79
|
+
async leaseDemoAsyncUnsafe() {
|
|
80
|
+
const answer = await executeAsyncUnsafe(async () => (await this.group.coreAsync()).leaseDemoDriverCanister());
|
|
81
|
+
if ("busy" in answer)
|
|
82
|
+
return { kind: "busy", untilMs: msOf(BigInt(answer.busy.untilNs)) };
|
|
83
|
+
const leased = answer.leased;
|
|
84
|
+
const claim = leased.claim[0];
|
|
85
|
+
return { kind: "leased", canister: driverCanisterOf(leased), claim: claim === undefined ? undefined : claimCodeOf(claim) };
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* F-8: 15 minutes more for the holder of the demo canister (at most 30 ahead), also after
|
|
89
|
+
* the end while nobody took it over. The owner stays (F-20f).
|
|
90
|
+
* @throws Error with message `CanisterError` — `NotFound` (no lease of the caller), `InvalidData` (being installed)
|
|
91
|
+
* @throws Error with message `CallRefusedAtInspectionStage` — anonymous, or the daily limit (30)
|
|
92
|
+
* @throws Error with message `CriticalCanisterError` — the core could not be reached
|
|
93
|
+
*/
|
|
94
|
+
async extendDemoAsyncUnsafe() {
|
|
95
|
+
return driverCanisterOf(await executeAsyncUnsafe(async () => (await this.group.coreAsync()).extendDemoLease()));
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The caller's own driver canister, or the demo canister the caller holds now (as the
|
|
99
|
+
* lease holder — after a claim the canister's owner is the driver, `ownerPrincipal`).
|
|
100
|
+
* @returns undefined when the caller has none
|
|
101
|
+
* @throws Error with message `CanisterError` — `NotAuthorized` (anonymous)
|
|
102
|
+
* @throws Error with message `CriticalCanisterError` — the core could not be reached
|
|
103
|
+
*/
|
|
104
|
+
async getMineAsyncUnsafe() {
|
|
105
|
+
try {
|
|
106
|
+
return driverCanisterOf(await executeAsyncUnsafe(async () => (await this.group.coreAsync()).getMyDriverCanister()));
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
if (errorKeyOf(err) === "NotFound")
|
|
110
|
+
return undefined;
|
|
111
|
+
throw err;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* F-20c: a new claim code for the caller's running demo lease ("Nowy link"); the code
|
|
116
|
+
* before it stops working. Good for 15 minutes, once.
|
|
117
|
+
* @throws Error with message `CanisterError` — `NotFound` (no running lease of the caller),
|
|
118
|
+
* `InvalidData` (being installed), `RemoteCanisterError` (no randomness — try again)
|
|
119
|
+
* @throws Error with message `CallRefusedAtInspectionStage` — anonymous, or the daily limit (30)
|
|
120
|
+
* @throws Error with message `CriticalCanisterError` — the core could not be reached
|
|
121
|
+
*/
|
|
122
|
+
async newClaimCodeAsyncUnsafe() {
|
|
123
|
+
return claimCodeOf(await executeAsyncUnsafe(async () => (await this.group.coreAsync()).newClaimCode()));
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* F-20d, F-20e: the caller — the driver signed in on the canister's own front — takes
|
|
127
|
+
* over the demo canister with the code of the link. The canister's owner becomes the
|
|
128
|
+
* caller, and so does the recipient of its chat room; the lease stays with its holder.
|
|
129
|
+
* @returns the canister with the caller as `ownerPrincipal`
|
|
130
|
+
* @throws Error with message `CanisterError` — `NotAuthorized` (the code is wrong, expired,
|
|
131
|
+
* used, or not for this canister — one answer for all), `InvalidData` (the canister
|
|
132
|
+
* is busy — try again), `RemoteCanisterError` (the driver canister did not take it;
|
|
133
|
+
* the code stays good)
|
|
134
|
+
* @throws Error with message `CallRefusedAtInspectionStage` — anonymous, or the daily limit (30)
|
|
135
|
+
* @throws Error with message `CriticalCanisterError` — the core could not be reached
|
|
136
|
+
*/
|
|
137
|
+
async claimAsyncUnsafe(canisterId, code) {
|
|
138
|
+
let canister;
|
|
139
|
+
try {
|
|
140
|
+
canister = Principal.fromText(canisterId);
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
throw new Error("CanisterError", { cause: { errorKey: "InvalidData", errorMessage: "not a canister id", logs: [] } });
|
|
144
|
+
}
|
|
145
|
+
return driverCanisterOf(await executeAsyncUnsafe(async () => (await this.group.coreAsync()).claimDriverCanister({ canister, code })));
|
|
146
|
+
}
|
|
147
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { MAINNET_HOST, STOPPED_RETRY_ATTEMPTS, canisterError, errorKeyOf, isCani
|
|
|
2
2
|
export { RidesActor, RideRequest, refusalKeyOf, REFRESH_WAIT_MS, REQUEST_POLL_MS, RIDE_POLL_MS, RIDE_POLL_NEAR_MS, SEARCH_RADIUS_METERS, WIDE_RADIUS_METERS, WIDEN_AFTER_MS, type RequestRideArgs, } from "./actors/rides-actor.js";
|
|
3
3
|
export { ProfilesActor, RIDES_PAGE } from "./actors/profiles-actor.js";
|
|
4
4
|
export { TestManagerActor, SIMULATED_DRIVERS } from "./actors/test-manager-actor.js";
|
|
5
|
+
export { DriverCanistersActor, CLAIM_FRAGMENT_KEY, MAX_CLAIM_CODE_CHARS, claimCodeOfHash, claimLinkOf } from "./actors/driver-canisters-actor.js";
|
|
5
6
|
export { ChatPlacesActor, CHAT_CONFIG_TTL_MS, DRIVER_ROOM_PREFIX, MAX_ROOM_ID_CHARS, driverRoomId } from "./chat.js";
|
|
6
7
|
export { cellsWithin, decodeGeohashCenter, distanceMeters, encodeGeohash } from "./geo.js";
|
|
7
8
|
export type * from "./interfaces.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACH,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,UAAU,EACV,sBAAsB,EACtB,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,QAAQ,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,UAAU,EACV,WAAW,EACX,YAAY,EACZ,eAAe,EACf,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,KAAK,eAAe,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAClJ,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACrH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC3F,mBAAmB,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,9 +7,12 @@
|
|
|
7
7
|
// account, the rating and the history in the core), `TestManagerActor` (simulated drivers,
|
|
8
8
|
// ×10). The chat (U-43): `ChatPlacesActor` and `RideRequest.getChatPlaceAsyncUnsafe` say
|
|
9
9
|
// WHERE a driver's room is; the fronts use `@jsm-mit/chat-sharded-package` for the messages.
|
|
10
|
+
// The driver's own canister (U-45): `DriverCanistersActor` (the demo lease, its extension,
|
|
11
|
+
// "mine", the one-time claim code and the claim from the canister's own front).
|
|
10
12
|
export { MAINNET_HOST, STOPPED_RETRY_ATTEMPTS, canisterError, errorKeyOf, isCanisterStoppedError, retrySettings, } from "./group/canister-actor.js";
|
|
11
13
|
export { RidesActor, RideRequest, refusalKeyOf, REFRESH_WAIT_MS, REQUEST_POLL_MS, RIDE_POLL_MS, RIDE_POLL_NEAR_MS, SEARCH_RADIUS_METERS, WIDE_RADIUS_METERS, WIDEN_AFTER_MS, } from "./actors/rides-actor.js";
|
|
12
14
|
export { ProfilesActor, RIDES_PAGE } from "./actors/profiles-actor.js";
|
|
13
15
|
export { TestManagerActor, SIMULATED_DRIVERS } from "./actors/test-manager-actor.js";
|
|
16
|
+
export { DriverCanistersActor, CLAIM_FRAGMENT_KEY, MAX_CLAIM_CODE_CHARS, claimCodeOfHash, claimLinkOf } from "./actors/driver-canisters-actor.js";
|
|
14
17
|
export { ChatPlacesActor, CHAT_CONFIG_TTL_MS, DRIVER_ROOM_PREFIX, MAX_ROOM_ID_CHARS, driverRoomId } from "./chat.js";
|
|
15
18
|
export { cellsWithin, decodeGeohashCenter, distanceMeters, encodeGeohash } from "./geo.js";
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -165,4 +165,32 @@ export interface ChatPlace {
|
|
|
165
165
|
projectId: string;
|
|
166
166
|
roomId: string;
|
|
167
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* A driver canister of the signed-in person: their own (`own`) or a demo canister they
|
|
170
|
+
* hold (`pool`). Its id is the driver's own address (`https://<canisterId>.icp0.io`).
|
|
171
|
+
*/
|
|
172
|
+
export interface DriverCanisterView {
|
|
173
|
+
canisterId: string;
|
|
174
|
+
kind: "own" | "pool";
|
|
175
|
+
/** The admin of the canister: after a claim (F-20) the driver, not the lease holder. */
|
|
176
|
+
ownerPrincipal: string;
|
|
177
|
+
/** A demo lease ends then (pool canisters). */
|
|
178
|
+
leaseUntilMs?: number;
|
|
179
|
+
blocked: boolean;
|
|
180
|
+
}
|
|
181
|
+
/** F-20: a one-time code that hands the demo canister to whoever claims it, until `expiresAtMs`. */
|
|
182
|
+
export interface ClaimCodeView {
|
|
183
|
+
canisterId: string;
|
|
184
|
+
code: string;
|
|
185
|
+
expiresAtMs: number;
|
|
186
|
+
}
|
|
187
|
+
/** F-6, F-20a: a lease (with a claim code after a fresh one), or busy until then. */
|
|
188
|
+
export type DemoLeaseView = {
|
|
189
|
+
kind: "leased";
|
|
190
|
+
canister: DriverCanisterView;
|
|
191
|
+
claim?: ClaimCodeView;
|
|
192
|
+
} | {
|
|
193
|
+
kind: "busy";
|
|
194
|
+
untilMs: number;
|
|
195
|
+
};
|
|
168
196
|
//# sourceMappingURL=interfaces.d.ts.map
|
package/dist/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,wEAAwE;AACxE,MAAM,WAAW,KAAK;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,MAAM,GAAG,aAAa,GAAG,OAAO,CAAC;AAE7E,iFAAiF;AACjF,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,WAAW,CAAC;IACzB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,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O,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACtB,kDAAkD;IAClD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAClB;AAID;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;IACrB,wFAAwF;IACxF,cAAc,EAAE,MAAM,CAAC;IACvB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,oGAAoG;AACpG,MAAM,WAAW,aAAa;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,qFAAqF;AACrF,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,kBAAkB,CAAC;IAAC,KAAK,CAAC,EAAE,aAAa,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsm-mit/tigi-sharded-package",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.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": {
|
|
@@ -38,7 +38,9 @@
|
|
|
38
38
|
"test-simulator": "bash scripts/run-tests-local.sh tests/test-simulator.ts",
|
|
39
39
|
"test-drivers": "bash scripts/run-tests-local.sh tests/test-drivers.ts",
|
|
40
40
|
"test-split": "bash scripts/run-tests-local.sh tests/test-split.ts",
|
|
41
|
-
"test-
|
|
41
|
+
"test-claim": "bash scripts/run-tests-local.sh tests/test-claim.ts",
|
|
42
|
+
"load-local": "bash scripts/run-load-local.sh",
|
|
43
|
+
"test-e2e": "npm run test-drivers && npm run test-simulator && npm run test-split && npm run test-claim"
|
|
42
44
|
},
|
|
43
45
|
"dependencies": {
|
|
44
46
|
"@icp-sdk/core": "^6.1.0"
|
|
@@ -54,11 +56,11 @@
|
|
|
54
56
|
"tigiSharded": {
|
|
55
57
|
"repo": "tigi-sharded",
|
|
56
58
|
"repoUrl": "https://github.com/JSM-Tigi/tigi-sharded",
|
|
57
|
-
"commit": "
|
|
59
|
+
"commit": "8b9fac7d28569db8ee2633e5e40364528bd5aaa1"
|
|
58
60
|
},
|
|
59
61
|
"tigiDriverRust": {
|
|
60
62
|
"repo": "tigi-driver-rust",
|
|
61
63
|
"repoUrl": "https://github.com/JSM-Tigi/tigi-driver-rust",
|
|
62
|
-
"commit": "
|
|
64
|
+
"commit": "6870f40829f8532baa7209832e1c553d2c270f94"
|
|
63
65
|
}
|
|
64
66
|
}
|