@minca/core 0.1.14 → 0.1.15
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 +2 -2
- package/dist/files/space-files.d.ts +15 -3
- package/dist/files/space-files.d.ts.map +1 -1
- package/dist/files/space-files.js +225 -37
- package/dist/files/space-files.js.map +1 -1
- package/dist/network/relay-minca.d.ts +12 -1
- package/dist/network/relay-minca.d.ts.map +1 -1
- package/dist/network/relay-minca.js +14 -6
- package/dist/network/relay-minca.js.map +1 -1
- package/dist/network/relay-nostr.d.ts +14 -3
- package/dist/network/relay-nostr.d.ts.map +1 -1
- package/dist/network/relay-nostr.js +11 -9
- package/dist/network/relay-nostr.js.map +1 -1
- package/dist/network/relays.d.ts +26 -17
- package/dist/network/relays.d.ts.map +1 -1
- package/dist/network/relays.js +21 -28
- package/dist/network/relays.js.map +1 -1
- package/dist/network/rendezvous.d.ts +1 -1
- package/dist/network/rendezvous.d.ts.map +1 -1
- package/dist/network/rendezvous.js +2 -2
- package/dist/network/rendezvous.js.map +1 -1
- package/dist/node/actions.d.ts.map +1 -1
- package/dist/node/actions.js +6 -1
- package/dist/node/actions.js.map +1 -1
- package/dist/node/node.d.ts.map +1 -1
- package/dist/node/node.js +7 -7
- package/dist/node/node.js.map +1 -1
- package/dist/node/space-runtime.d.ts +1 -1
- package/dist/node/space-runtime.d.ts.map +1 -1
- package/dist/node/space-runtime.js +17 -5
- package/dist/node/space-runtime.js.map +1 -1
- package/dist/node/types.d.ts +4 -3
- package/dist/node/types.d.ts.map +1 -1
- package/dist/schema/collection-def.d.ts.map +1 -1
- package/dist/schema/collection-def.js +16 -5
- package/dist/schema/collection-def.js.map +1 -1
- package/dist/schemas/automations.d.ts +8 -0
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/connectors.d.ts +12 -0
- package/dist/schemas/connectors.d.ts.map +1 -1
- package/dist/schemas/fragments.d.ts +22 -2
- package/dist/schemas/fragments.d.ts.map +1 -1
- package/dist/schemas/fragments.js +20 -12
- package/dist/schemas/fragments.js.map +1 -1
- package/dist/schemas/library/annotations.d.ts +30 -0
- package/dist/schemas/library/annotations.d.ts.map +1 -1
- package/dist/schemas/library/annotations.js +1 -0
- package/dist/schemas/library/annotations.js.map +1 -1
- package/dist/schemas/library/community.d.ts +28 -0
- package/dist/schemas/library/community.d.ts.map +1 -1
- package/dist/schemas/library/life.d.ts +62 -2
- package/dist/schemas/library/life.d.ts.map +1 -1
- package/dist/schemas/library/media.d.ts +36 -0
- package/dist/schemas/library/media.d.ts.map +1 -1
- package/dist/schemas/library/money.d.ts +74 -2
- package/dist/schemas/library/money.d.ts.map +1 -1
- package/dist/schemas/library/planning.d.ts +56 -0
- package/dist/schemas/library/planning.d.ts.map +1 -1
- package/dist/schemas/library/publishing.d.ts +80 -4
- package/dist/schemas/library/publishing.d.ts.map +1 -1
- package/dist/schemas/library/social.d.ts +44 -0
- package/dist/schemas/library/social.d.ts.map +1 -1
- package/docs/README.md +2 -2
- package/docs/actions.md +47 -20
- package/docs/blueprints-and-guides.md +41 -13
- package/docs/building-an-app.md +4 -4
- package/docs/collections.md +31 -3
- package/docs/node.md +14 -12
- package/docs/standard-library.md +26 -25
- package/docs/storage.md +33 -10
- package/package.json +2 -21
- package/dist/calls/calls.d.ts +0 -140
- package/dist/calls/calls.d.ts.map +0 -1
- package/dist/calls/calls.js +0 -861
- package/dist/calls/calls.js.map +0 -1
- package/dist/calls/index.d.ts +0 -4
- package/dist/calls/index.d.ts.map +0 -1
- package/dist/calls/index.js +0 -3
- package/dist/calls/index.js.map +0 -1
- package/dist/react/context.d.ts +0 -81
- package/dist/react/context.d.ts.map +0 -1
- package/dist/react/context.js +0 -97
- package/dist/react/context.js.map +0 -1
- package/dist/react/follow.d.ts +0 -11
- package/dist/react/follow.d.ts.map +0 -1
- package/dist/react/follow.js +0 -7
- package/dist/react/follow.js.map +0 -1
- package/dist/react/index.d.ts +0 -44
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/index.js +0 -40
- package/dist/react/index.js.map +0 -1
- package/dist/react/minca-auth.d.ts +0 -19
- package/dist/react/minca-auth.d.ts.map +0 -1
- package/dist/react/minca-auth.js +0 -36
- package/dist/react/minca-auth.js.map +0 -1
- package/dist/react/use-calls.d.ts +0 -21
- package/dist/react/use-calls.d.ts.map +0 -1
- package/dist/react/use-calls.js +0 -39
- package/dist/react/use-calls.js.map +0 -1
- package/dist/react/use-invite-link.d.ts +0 -24
- package/dist/react/use-invite-link.d.ts.map +0 -1
- package/dist/react/use-invite-link.js +0 -62
- package/dist/react/use-invite-link.js.map +0 -1
- package/dist/react/use-live.d.ts +0 -16
- package/dist/react/use-live.d.ts.map +0 -1
- package/dist/react/use-live.js +0 -56
- package/dist/react/use-live.js.map +0 -1
- package/dist/react/use-my-name.d.ts +0 -12
- package/dist/react/use-my-name.d.ts.map +0 -1
- package/dist/react/use-my-name.js +0 -38
- package/dist/react/use-my-name.js.map +0 -1
- package/dist/react/use-names.d.ts +0 -7
- package/dist/react/use-names.d.ts.map +0 -1
- package/dist/react/use-names.js +0 -13
- package/dist/react/use-names.js.map +0 -1
- package/dist/react/use-network.d.ts +0 -9
- package/dist/react/use-network.d.ts.map +0 -1
- package/dist/react/use-network.js +0 -33
- package/dist/react/use-network.js.map +0 -1
- package/dist/react/use-query.d.ts +0 -14
- package/dist/react/use-query.d.ts.map +0 -1
- package/dist/react/use-query.js +0 -26
- package/dist/react/use-query.js.map +0 -1
- package/dist/react/use-space.d.ts +0 -29
- package/dist/react/use-space.d.ts.map +0 -1
- package/dist/react/use-space.js +0 -57
- package/dist/react/use-space.js.map +0 -1
- package/dist/react/use-spaces.d.ts +0 -29
- package/dist/react/use-spaces.d.ts.map +0 -1
- package/dist/react/use-spaces.js +0 -78
- package/dist/react/use-spaces.js.map +0 -1
- package/docs/calls.md +0 -189
|
@@ -58,6 +58,8 @@ export declare const profile: {
|
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
60
|
required: readonly ["hash", "size", "mime"];
|
|
61
|
+
} & {
|
|
62
|
+
readonly 'x-kind': "file";
|
|
61
63
|
};
|
|
62
64
|
readonly banner: {
|
|
63
65
|
type: 'object';
|
|
@@ -93,6 +95,8 @@ export declare const profile: {
|
|
|
93
95
|
};
|
|
94
96
|
};
|
|
95
97
|
required: readonly ["hash", "size", "mime"];
|
|
98
|
+
} & {
|
|
99
|
+
readonly 'x-kind': "file";
|
|
96
100
|
};
|
|
97
101
|
readonly pronouns: {
|
|
98
102
|
type: 'string';
|
|
@@ -114,6 +118,8 @@ export declare const profile: {
|
|
|
114
118
|
type: 'string';
|
|
115
119
|
minLength?: number | undefined;
|
|
116
120
|
maxLength: number;
|
|
121
|
+
} & {
|
|
122
|
+
readonly 'x-kind': "url";
|
|
117
123
|
};
|
|
118
124
|
};
|
|
119
125
|
readonly required: readonly ["url"];
|
|
@@ -288,6 +294,8 @@ export declare const card: {
|
|
|
288
294
|
type: 'string';
|
|
289
295
|
minLength: number;
|
|
290
296
|
maxLength: number;
|
|
297
|
+
} & {
|
|
298
|
+
readonly 'x-kind': "day";
|
|
291
299
|
};
|
|
292
300
|
readonly photo: {
|
|
293
301
|
type: 'object';
|
|
@@ -323,6 +331,8 @@ export declare const card: {
|
|
|
323
331
|
};
|
|
324
332
|
};
|
|
325
333
|
required: readonly ["hash", "size", "mime"];
|
|
334
|
+
} & {
|
|
335
|
+
readonly 'x-kind': "file";
|
|
326
336
|
};
|
|
327
337
|
readonly urls: {
|
|
328
338
|
readonly type: "array";
|
|
@@ -331,6 +341,8 @@ export declare const card: {
|
|
|
331
341
|
type: 'string';
|
|
332
342
|
minLength?: number | undefined;
|
|
333
343
|
maxLength: number;
|
|
344
|
+
} & {
|
|
345
|
+
readonly 'x-kind': "url";
|
|
334
346
|
};
|
|
335
347
|
};
|
|
336
348
|
readonly note: {
|
|
@@ -391,6 +403,8 @@ export declare const follow: {
|
|
|
391
403
|
type: 'string';
|
|
392
404
|
minLength?: number | undefined;
|
|
393
405
|
maxLength: number;
|
|
406
|
+
} & {
|
|
407
|
+
readonly 'x-kind': "did";
|
|
394
408
|
};
|
|
395
409
|
space: {
|
|
396
410
|
type: 'string';
|
|
@@ -422,11 +436,15 @@ export declare const block: {
|
|
|
422
436
|
type: 'string';
|
|
423
437
|
minLength?: number | undefined;
|
|
424
438
|
maxLength: number;
|
|
439
|
+
} & {
|
|
440
|
+
readonly 'x-kind': "did";
|
|
425
441
|
};
|
|
426
442
|
until: {
|
|
427
443
|
type: 'string';
|
|
428
444
|
minLength?: number | undefined;
|
|
429
445
|
maxLength: number;
|
|
446
|
+
} & {
|
|
447
|
+
readonly 'x-kind': "when";
|
|
430
448
|
};
|
|
431
449
|
};
|
|
432
450
|
readonly required: readonly ["did"];
|
|
@@ -450,11 +468,15 @@ export declare const mute: {
|
|
|
450
468
|
type: 'string';
|
|
451
469
|
minLength?: number | undefined;
|
|
452
470
|
maxLength: number;
|
|
471
|
+
} & {
|
|
472
|
+
readonly 'x-kind': "did";
|
|
453
473
|
};
|
|
454
474
|
until: {
|
|
455
475
|
type: 'string';
|
|
456
476
|
minLength?: number | undefined;
|
|
457
477
|
maxLength: number;
|
|
478
|
+
} & {
|
|
479
|
+
readonly 'x-kind': "when";
|
|
458
480
|
};
|
|
459
481
|
};
|
|
460
482
|
readonly required: readonly ["did"];
|
|
@@ -488,6 +510,8 @@ export declare const status: {
|
|
|
488
510
|
type: 'string';
|
|
489
511
|
minLength?: number | undefined;
|
|
490
512
|
maxLength: number;
|
|
513
|
+
} & {
|
|
514
|
+
readonly 'x-kind': "when";
|
|
491
515
|
};
|
|
492
516
|
};
|
|
493
517
|
};
|
|
@@ -553,6 +577,8 @@ export declare const socialGroups: {
|
|
|
553
577
|
};
|
|
554
578
|
};
|
|
555
579
|
required: readonly ["hash", "size", "mime"];
|
|
580
|
+
} & {
|
|
581
|
+
readonly 'x-kind': "file";
|
|
556
582
|
};
|
|
557
583
|
readonly banner: {
|
|
558
584
|
type: 'object';
|
|
@@ -588,6 +614,8 @@ export declare const socialGroups: {
|
|
|
588
614
|
};
|
|
589
615
|
};
|
|
590
616
|
required: readonly ["hash", "size", "mime"];
|
|
617
|
+
} & {
|
|
618
|
+
readonly 'x-kind': "file";
|
|
591
619
|
};
|
|
592
620
|
readonly pronouns: {
|
|
593
621
|
type: 'string';
|
|
@@ -609,6 +637,8 @@ export declare const socialGroups: {
|
|
|
609
637
|
type: 'string';
|
|
610
638
|
minLength?: number | undefined;
|
|
611
639
|
maxLength: number;
|
|
640
|
+
} & {
|
|
641
|
+
readonly 'x-kind': "url";
|
|
612
642
|
};
|
|
613
643
|
};
|
|
614
644
|
readonly required: readonly ["url"];
|
|
@@ -777,6 +807,8 @@ export declare const socialGroups: {
|
|
|
777
807
|
type: 'string';
|
|
778
808
|
minLength: number;
|
|
779
809
|
maxLength: number;
|
|
810
|
+
} & {
|
|
811
|
+
readonly 'x-kind': "day";
|
|
780
812
|
};
|
|
781
813
|
readonly photo: {
|
|
782
814
|
type: 'object';
|
|
@@ -812,6 +844,8 @@ export declare const socialGroups: {
|
|
|
812
844
|
};
|
|
813
845
|
};
|
|
814
846
|
required: readonly ["hash", "size", "mime"];
|
|
847
|
+
} & {
|
|
848
|
+
readonly 'x-kind': "file";
|
|
815
849
|
};
|
|
816
850
|
readonly urls: {
|
|
817
851
|
readonly type: "array";
|
|
@@ -820,6 +854,8 @@ export declare const socialGroups: {
|
|
|
820
854
|
type: 'string';
|
|
821
855
|
minLength?: number | undefined;
|
|
822
856
|
maxLength: number;
|
|
857
|
+
} & {
|
|
858
|
+
readonly 'x-kind': "url";
|
|
823
859
|
};
|
|
824
860
|
};
|
|
825
861
|
readonly note: {
|
|
@@ -877,6 +913,8 @@ export declare const socialGroups: {
|
|
|
877
913
|
type: 'string';
|
|
878
914
|
minLength?: number | undefined;
|
|
879
915
|
maxLength: number;
|
|
916
|
+
} & {
|
|
917
|
+
readonly 'x-kind': "did";
|
|
880
918
|
};
|
|
881
919
|
space: {
|
|
882
920
|
type: 'string';
|
|
@@ -904,11 +942,15 @@ export declare const socialGroups: {
|
|
|
904
942
|
type: 'string';
|
|
905
943
|
minLength?: number | undefined;
|
|
906
944
|
maxLength: number;
|
|
945
|
+
} & {
|
|
946
|
+
readonly 'x-kind': "did";
|
|
907
947
|
};
|
|
908
948
|
until: {
|
|
909
949
|
type: 'string';
|
|
910
950
|
minLength?: number | undefined;
|
|
911
951
|
maxLength: number;
|
|
952
|
+
} & {
|
|
953
|
+
readonly 'x-kind': "when";
|
|
912
954
|
};
|
|
913
955
|
};
|
|
914
956
|
readonly required: readonly ["did"];
|
|
@@ -940,6 +982,8 @@ export declare const socialGroups: {
|
|
|
940
982
|
type: 'string';
|
|
941
983
|
minLength?: number | undefined;
|
|
942
984
|
maxLength: number;
|
|
985
|
+
} & {
|
|
986
|
+
readonly 'x-kind': "when";
|
|
943
987
|
};
|
|
944
988
|
};
|
|
945
989
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../../../src/schemas/library/social.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../../../src/schemas/library/social.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiBI,KAAK;;;;;wBAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ3C,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,OAAO,CAAC,CAAC;AAY7C;;;GAGG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;oBAUK,IAAI;;;;;oBAAa,KAAK;;;;;oBAAa,MAAM;;;;;;;;sBAvBvD,OAAO;;;0BAGL,QAAQ;;;;;;;;;;;;;;;;;;sBAHV,OAAO;;;0BAGL,QAAQ;;;;;;;;;;;;;;;;;;sBAHV,OAAO;;;0BAGL,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiChB,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC;AAEvC,4EAA4E;AAC5E,eAAO,MAAM,MAAM;;;;;;;YAMD,GAAG;;;;;;;YAA6B,KAAK;;;;;;;;;;;;;;;EAKrD,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC;AAc3C,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,KAAK,CAAC,CAAC;AAEzC,sGAAsG;AACtG,eAAO,MAAM,KAAK;;;;;;;YARE,GAAG;;;;;;;YAAY,KAAK;;;;;;;;;;;;;;;;EAYvC,CAAC;AACF,iGAAiG;AACjG,eAAO,MAAM,IAAI;;;;;;;YAdG,GAAG;;;;;;;YAAY,KAAK;;;;;;;;;;;;;;;;EAcmE,CAAC;AAE5G,2EAA2E;AAC3E,eAAO,MAAM,MAAM;;;;;;;YAMD,IAAI;;;;;YAAa,KAAK;;;;;YAAY,KAAK;;;;;;;;;;;;;;;;EAGvD,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC;AAE3C,2CAA2C;AAC3C,eAAO,MAAM,YAAY;IACvB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAxGgB,KAAK;;;;;4BAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAmCvB,IAAI;;;;;wBAAa,KAAK;;;;;wBAAa,MAAM;;;;;;;;0BAvBvD,OAAO;;;8BAGL,QAAQ;;;;;;;;;;;;;;;;;;0BAHV,OAAO;;;8BAGL,QAAQ;;;;;;;;;;;;;;;;;;0BAHV,OAAO;;;8BAGL,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA2CA,GAAG;;;;;;;gBAA6B,KAAK;;;;;;;;;;;;;;;;;;;;;;gBAenC,GAAG;;;;;;;gBAAY,KAAK;;;;;;;;;;;;;;;;;;;;;;;gBAuBtB,IAAI;;;;;gBAAa,KAAK;;;;;gBAAY,KAAK;;;;;;;;;;;;;;;;;CASxD,CAAC"}
|
package/docs/README.md
CHANGED
|
@@ -67,7 +67,7 @@ the others wrote.
|
|
|
67
67
|
| [contracts.md](contracts.md) | `contract` (`check` and `line`): how the library runs contracts (spec 09), counts only versions that pass, and refuses its own failing ones |
|
|
68
68
|
| [automations.md](automations.md) | `std.automation`: when a query finds records, or at set times, do something: in an app, an agent or a bot; and the account's own, which notify it |
|
|
69
69
|
| [bots.md](bots.md) | Who may configure a bot, its instructions, connecting one to a service a host offers, writing a connector, and GitHub |
|
|
70
|
-
| [calls
|
|
70
|
+
| [calls](../../calls/README.md) | Voice and video calls in a space: the `call.*` messages, ringing, joining, leaving |
|
|
71
71
|
| [contacts.md](contacts.md) | `std.contact`: the list, asking in a shared space, `node.contacts` |
|
|
72
72
|
| [inbox.md](inbox.md) | The inbox kept as a record, and how a knock becomes a contact: `std.inbox`, `std.knock` |
|
|
73
73
|
| [spaces.md](spaces.md) | Constitution templates, invite defaults, key upkeep, profiles, the space manager |
|
|
@@ -77,7 +77,7 @@ the others wrote.
|
|
|
77
77
|
## Rules of thumb
|
|
78
78
|
|
|
79
79
|
- Import only from the package's entry points: `@minca/core`, and
|
|
80
|
-
`/react`, `/session`, `/schemas`, `/elements
|
|
80
|
+
`/react`, `/session`, `/schemas`, `/elements` for those parts.
|
|
81
81
|
- Name your collections reverse-DNS style, `app.<yours>.<thing>`. `sys.*` is
|
|
82
82
|
the protocol's own, and `std.*` is the shared library in `/schemas`.
|
|
83
83
|
- Check the standard library (`@minca/core/schemas`) before defining a
|
package/docs/actions.md
CHANGED
|
@@ -103,26 +103,53 @@ _Source: `packages/core/src/node/actions.ts` (`callAction`, `offeredActions`), `
|
|
|
103
103
|
|
|
104
104
|
## The agent on a computer
|
|
105
105
|
|
|
106
|
-
_Implementation detail of the CLI._
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
106
|
+
_Implementation detail of the CLI._ A key signs in one process at a time,
|
|
107
|
+
or its log forks (spec 02 §4.10). So each session running the agent at once,
|
|
108
|
+
a `minca mcp` per Claude window or a `minca agent`, has a key of its own, in a
|
|
109
|
+
numbered slot: `<home>/agent/<n>/` (1 to 16) holds `key.json`, the P-256 key
|
|
110
|
+
as JWK (mode 0600), the grant made out to it in `grant.json`, each written
|
|
111
|
+
whole, its lock, and `stores/`, what only that session keeps (its key's
|
|
112
|
+
places in its logs among them). The spaces are in one folder,
|
|
113
|
+
`<home>/agent/spaces/`, under a path per account, that every session reads
|
|
114
|
+
and writes at once the way clients share a data folder (spec 05 §14.5,
|
|
115
|
+
`folderStores`): what one session synced, the next starts from. It is a cache
|
|
116
|
+
of this CLI's, not a data folder another program opens.
|
|
117
|
+
|
|
118
|
+
Each session is a connection of its own at the account home, named "Agent on
|
|
119
|
+
<host>, session <n>", and is disconnected there on its own. A session whose
|
|
120
|
+
key is revoked forgets its slot's grant, so the next session there asks to be
|
|
121
|
+
allowed again, with a new key.
|
|
122
|
+
|
|
123
|
+
A session claims the first connected slot no other process holds, else the
|
|
124
|
+
first not connected yet. In that one, `minca mcp` offers only `agent_connect`:
|
|
125
|
+
the person allows this session at their account home and gives the model the
|
|
126
|
+
code it shows, once; the slot keeps its key and grant for later sessions.
|
|
127
|
+
`minca connect` at a terminal connects slot 1 and forgets the other slots'
|
|
128
|
+
grants, so each session after asks for its own again rather than run on a
|
|
129
|
+
note the person may have revoked; a session connected to another account
|
|
130
|
+
has every slot connected to the first forget its grant, so no later session
|
|
131
|
+
is handed one and writes as that account. Each connection is named for its
|
|
132
|
+
slot: "Agent on <host>", then ", session <n>" from slot 2. A slot's lock is
|
|
133
|
+
numbered files, `lock.<n>`, each linked into place whole: the highest is the
|
|
134
|
+
lock, taken over once its process is gone by linking the next number, and
|
|
135
|
+
let go of by writing `released` into it, so no number is used twice. Only one
|
|
136
|
+
session of an account runs its automations, under
|
|
137
|
+
`<home>/agent/automations-<account key>.lock`. A new key each time, since a key the
|
|
138
|
+
account home revoked stays revoked in every space, so a new note made out to
|
|
139
|
+
it would write nothing.
|
|
140
|
+
|
|
141
|
+
A session's node: signer `grantSigner(grant)`, session key = the slot's key,
|
|
142
|
+
the grant's keys when present and relays = the grant's ∪ `$MINCA_RELAYS`
|
|
143
|
+
(default `wss://minca.fly.dev`) (`nodeOptionsFromGrant`), WebRTC via
|
|
144
|
+
`node-datachannel`; it joins any granted spaces it lacks (`joinGranted`);
|
|
145
|
+
wraps the node with `asAgent`; holds every space; and serves MCP over stdio:
|
|
146
|
+
`offeredActions({ agent: true })`, without the `PERSON_ONLY` actions or
|
|
147
|
+
direct messages ([actions](#actions)).
|
|
148
|
+
|
|
149
|
+
A running session watches its slot's `grant.json`, and looks every 30 s as
|
|
150
|
+
well. When `minca connect` writes a new key and grant there that check out, it
|
|
151
|
+
closes its node and starts one under them, keeping the slot, so the session
|
|
125
152
|
needs no restart. When the node hears that its key was revoked in a space, a
|
|
126
153
|
tool that fails says so, and that connecting again fixes it.
|
|
127
154
|
|
|
128
|
-
_Source: `packages/cli/src/agent.ts` (`connectAgent`, `startAgentNode`, `reloadOnConnect`), `packages/cli/src/writer-keys.ts` (`holdLock`), `packages/cli/src/mcp.ts`, `packages/cli/src/main.ts` (`minca mcp`). Tests: `packages/core/tests/records-only.test.ts` ("an agent running a node of its own"), `packages/cli/tests/cli.test.ts` ("MCP"), `packages/cli/tests/agent-reconnect.test.ts` (all)._
|
|
155
|
+
_Source: `packages/cli/src/agent.ts` (`claimSlot`, `connectAgent`, `reconnectAgent`, `startAgentNode`, `reloadOnConnect`), `packages/cli/src/writer-keys.ts` (`holdLock`), `packages/cli/src/mcp.ts`, `packages/cli/src/main.ts` (`minca mcp`). Tests: `packages/core/tests/records-only.test.ts` ("an agent running a node of its own"), `packages/cli/tests/cli.test.ts` ("MCP"), `packages/cli/tests/agent-reconnect.test.ts` (all), `packages/cli/tests/agent-slot-lock.test.ts` (all), `packages/cli/tests/writer-keys.test.ts` ("a lock number is never used twice, so one taker that stalled can’t hold it beside another")._
|
|
@@ -168,7 +168,7 @@ its app's collections and the people in its space: it lists and writes
|
|
|
168
168
|
records as the person looking, asks what they may do (`can`), gets someone's
|
|
169
169
|
picture (`picture`), and asks the page to show a record or a person
|
|
170
170
|
(`open`), or the record one of its own links to (`open` with `link`: the
|
|
171
|
-
message a file was shared on)
|
|
171
|
+
message a file was shared on), which shows it to the person and tells the screen nothing. The bridge never follows one to the space's own records (`sys.*`, `launcher.app`), and opening one answers the same whether or not the record is there; but the page visibly opens a record that is there, for the person, who can see it anyway. What a sealed frame can't do, the page does for it when it asks,
|
|
172
172
|
after checking the request: it searches for places and asks where the person
|
|
173
173
|
is (`places`), opens http and https pages (`link`), saves text files
|
|
174
174
|
(`save`), keeps a few kilobytes per app on the device (`remember`, `recall`),
|
|
@@ -180,18 +180,46 @@ the screen.
|
|
|
180
180
|
`collections`, the ones it `shows`: the ones whose records it is the place
|
|
181
181
|
to open (`shows: ["std.message"]` for a chat). Whatever asks the example app
|
|
182
182
|
to open a record, a screen's `open` or a link beside a record, goes to the
|
|
183
|
-
app that shows that record's collection
|
|
183
|
+
app that shows that record's collection: the one open, if it does, else the
|
|
184
|
+
only one, else the one the person picks when asked, and that app's
|
|
184
185
|
screen is handed the record's key (`minca.shown`, `minca.onShow`, the kit's
|
|
185
186
|
`useShown`) to scroll to or open, but only of a collection it shows, which
|
|
186
187
|
it could list anyway. That app does learn which of those records the person
|
|
187
188
|
opens from elsewhere, which is why only someone who may define collections
|
|
188
|
-
adds an app. With no app that shows it,
|
|
189
|
-
|
|
189
|
+
adds an app. With no app that shows it, or when that app opens one of its
|
|
190
|
+
own (a poll's title in Polls, for its comments), the record opens beside
|
|
191
|
+
whatever is open. So the Files app opens a file's message in
|
|
190
192
|
the chat, and a chat's file in Files, without either knowing the other. An
|
|
191
193
|
app that names a collection in `shows` must do something with what it is
|
|
192
194
|
handed. The kit's `<Record>` draws any standard record as one line the same
|
|
193
195
|
way in every app, and opens it this way when clicked.
|
|
194
196
|
|
|
197
|
+
**Sharing a record into an app.** A screen can't list or read what its app
|
|
198
|
+
doesn't name, but a person can hand it one record, as a page gets only the
|
|
199
|
+
file a person picks for it. `minca.pick` asks the page to show a finder over
|
|
200
|
+
the whole space, and gives the screen the record the person chooses, or
|
|
201
|
+
null. The screen may then link one of its records to it with `shares`, like
|
|
202
|
+
a message, and anyone's screen reads it back through that link
|
|
203
|
+
(`minca.get(key, { link: 'shares' })`), read only. `shares` is the only role
|
|
204
|
+
a screen reads through: a file about a diary entry, or a reaction to it,
|
|
205
|
+
shares nothing, so a screen reads beyond its collections only records the
|
|
206
|
+
person picked, or that someone writing its collections shares (a member, an
|
|
207
|
+
agent, another app). That binds the screen, not its author: a member who
|
|
208
|
+
wrote a screen can share any record into its collections from their own
|
|
209
|
+
node, and the screen reads it. A shared record comes with its files' keys,
|
|
210
|
+
though not their bytes. A screen writes
|
|
211
|
+
a link only to a record of its own collections, one the person picked for
|
|
212
|
+
it, or one the record already has, refused alike whether or not the target
|
|
213
|
+
is here (so a link to a record that hasn't arrived yet waits until it has):
|
|
214
|
+
a screen never links out on its own, though like anything it reads, it can
|
|
215
|
+
copy what was shared into its own records. A screen may ask to pick as often
|
|
216
|
+
as it likes, and start the search from its own text; what it gets is still
|
|
217
|
+
only what the person chooses, in a space they can read anyway: Enter takes
|
|
218
|
+
the top match only once the person has typed. A chat
|
|
219
|
+
shares a poll without being able to read polls; `/` typed into an empty
|
|
220
|
+
message, or its `/` button, picks one; so does a comment box (the kit's
|
|
221
|
+
`useShare`).
|
|
222
|
+
|
|
195
223
|
A screen also sends live messages, kept nowhere, to the other devices that
|
|
196
224
|
have the same app open in the space (`live.send`, `live.on`): for cursors,
|
|
197
225
|
typing, who is here, or a game. Each goes as a live message of the space
|
|
@@ -223,7 +251,7 @@ defines its collections and writes a copy of it, naming where it came from
|
|
|
223
251
|
(`template: "kanban"`), and from then on the space changes its copy like any
|
|
224
252
|
other app.
|
|
225
253
|
|
|
226
|
-
_Source: `apps/example/src/components/apps/launcher.ts` (`addTemplate`), `apps/example/src/components/apps/screens.ts`, `apps/example/src/components/apps/ScreenFrame.tsx`, `apps/example/src/components/apps/templates/`, `apps/example/public/screen.html`, `packages/ui/src/frame/`, `packages/ui/src/guide.ts`. Tests: `apps/example/tests/launcher.test.ts` ("adding a ready-made app copies it into the space once, with its collections and first records"), `apps/example/tests/screens.test.ts` ("a screen checks, shows faces and opens things only within its app and its space", "what the page does for a screen, it does only as asked properly", "a screen hears the same app's screens on other devices, as who sent it, and no other app's")._
|
|
254
|
+
_Source: `apps/example/src/components/apps/launcher.ts` (`addTemplate`), `apps/example/src/components/apps/screens.ts`, `apps/example/src/components/apps/ScreenFrame.tsx`, `apps/example/src/components/apps/templates/`, `apps/example/public/screen.html`, `packages/ui/src/frame/`, `packages/ui/src/guide.ts`. Tests: `apps/example/tests/launcher.test.ts` ("adding a ready-made app copies it into the space once, with its collections and first records"), `apps/example/tests/screens.test.ts` ("a screen checks, shows faces and opens things only within its app and its space", "what the page does for a screen, it does only as asked properly", "a screen can’t point a link out of its app, so it can’t probe for keys or reach what no one shared", "a record someone shared is read through the link to it, and only through that", "a screen links out only to what the person picked for it, and is handed what they picked", "the space’s own records are never picked for a screen", "a screen hears the same app's screens on other devices, as who sent it, and no other app's")._
|
|
227
255
|
|
|
228
256
|
## Describing a collection
|
|
229
257
|
|
|
@@ -260,7 +288,7 @@ _Source: `packages/core/src/records/describe.ts`. Tests: `packages/core/tests/re
|
|
|
260
288
|
|
|
261
289
|
An app decides it can open a space by finding a collection with the right
|
|
262
290
|
**name**. Chat opens any `std.message`, whatever its fields and rules. And a space whose definition is a little older than the
|
|
263
|
-
app's (a `std.message` without the `shares` link) stays that way, because the
|
|
291
|
+
app's (a `std.message` or `std.comment` without the `shares` link) stays that way, because the
|
|
264
292
|
library skips a collection the space already has. Whether an app can use a
|
|
265
293
|
definition it did not write is a question for the app, not for peers: a peer
|
|
266
294
|
stores and judges every record the same way whatever the answer.
|
|
@@ -296,8 +324,8 @@ Anything the checker cannot decide is a break.
|
|
|
296
324
|
this is a walk of both schemas: `type` sets contained (`integer` inside
|
|
297
325
|
`number`); a field one side relies on is `required` on the other; numeric
|
|
298
326
|
and length ranges contained; `enum`, `const` and `oneOf` value sets
|
|
299
|
-
contained; recurse into `properties` and `items`. `title`, `description
|
|
300
|
-
|
|
327
|
+
contained; recurse into `properties` and `items`. `title`, `description`,
|
|
328
|
+
`x-choicesFrom` and every other `x-*` annotation are ignored. A field only one side mentions is ignored,
|
|
301
329
|
unless that side requires it or closes the schema
|
|
302
330
|
(`additionalProperties: false`).
|
|
303
331
|
- **Links.** A link role the app uses is declared in the space; where it may
|
|
@@ -385,15 +413,15 @@ which field is the title or that votes are shown as counts. The plan adds
|
|
|
385
413
|
optional hints to a definition:
|
|
386
414
|
|
|
387
415
|
- which field is the record's **title**;
|
|
388
|
-
- a field's **role** (a date, a person, an amount);
|
|
389
416
|
- **tallies**: "show as a count" of records linking here, the way
|
|
390
417
|
`x-choicesFrom` already makes vote-style counts possible;
|
|
391
418
|
- values **worked out on read**: "voting closes Friday", "who hasn't
|
|
392
419
|
answered". Each reader computes them from the records and its own clock, so
|
|
393
420
|
nothing has to run anywhere.
|
|
394
421
|
|
|
422
|
+
A field's kind (a person) is already its `x-kind` ([collections](collections.md#schemas)).
|
|
395
423
|
Like `x-choicesFrom`, hints are display only and never checked when
|
|
396
|
-
validating, and [`compare`](#compatible-definitions) ignores them.
|
|
397
|
-
|
|
398
|
-
top-level
|
|
399
|
-
|
|
424
|
+
validating, and [`compare`](#compatible-definitions) ignores them. A hint
|
|
425
|
+
about one field is an `x-*` keyword on it; one about the whole record goes
|
|
426
|
+
in a top-level definition member, which today's peers ignore when they
|
|
427
|
+
don't know it ([spec 02 §6.2](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md)). Added when a derived view falls short. _Open:_ the format.
|
package/docs/building-an-app.md
CHANGED
|
@@ -12,7 +12,7 @@ the app cannot write anywhere it was not given.
|
|
|
12
12
|
|
|
13
13
|
```tsx
|
|
14
14
|
import { createMincaConnection } from '@minca/core/session';
|
|
15
|
-
import { MincaProvider, useConnection } from '@minca/
|
|
15
|
+
import { MincaProvider, useConnection } from '@minca/react';
|
|
16
16
|
|
|
17
17
|
const connection = createMincaConnection({
|
|
18
18
|
home: 'https://home.minca.social/connect', // a suggestion: the person may use their own
|
|
@@ -67,7 +67,7 @@ element and as a React component.
|
|
|
67
67
|
|
|
68
68
|
```tsx
|
|
69
69
|
import { createMincaAuth } from '@minca/core/session';
|
|
70
|
-
import { MincaProvider, MincaAuth, useMinca } from '@minca/
|
|
70
|
+
import { MincaProvider, MincaAuth, useMinca } from '@minca/react';
|
|
71
71
|
|
|
72
72
|
const auth = createMincaAuth({ appName: 'Todo', network: { relays: ['wss://minca.fly.dev'] } });
|
|
73
73
|
|
|
@@ -135,7 +135,7 @@ await node.spaces.closeInvite(space.id, invite); // nobody else joins with it
|
|
|
135
135
|
|
|
136
136
|
## React hooks
|
|
137
137
|
|
|
138
|
-
All from `@minca/
|
|
138
|
+
All from `@minca/react`, below a `MincaProvider`:
|
|
139
139
|
|
|
140
140
|
| Hook | Gives |
|
|
141
141
|
| ------------------------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
@@ -177,7 +177,7 @@ takes the invite out of a pasted link, and `useInviteLink()` reads the one the
|
|
|
177
177
|
page was opened with:
|
|
178
178
|
|
|
179
179
|
```tsx
|
|
180
|
-
import { inviteLink, useInviteLink, useMyName, useNode } from '@minca/
|
|
180
|
+
import { inviteLink, useInviteLink, useMyName, useNode } from '@minca/react';
|
|
181
181
|
|
|
182
182
|
const link = inviteLink(await node.spaces.invite(space.id, { short: true })); // https://app.example/#invite=…
|
|
183
183
|
|
package/docs/collections.md
CHANGED
|
@@ -45,13 +45,39 @@ What gets stored is JSON Schema, in a small subset every app agrees on:
|
|
|
45
45
|
`maximum`, `minLength`, `maxLength`, `minItems`, `maxItems`,
|
|
46
46
|
`additionalProperties` (true or false), `title`, `description`
|
|
47
47
|
|
|
48
|
-
and
|
|
48
|
+
and three that say what a value means, so any app can show it well:
|
|
49
49
|
|
|
50
50
|
- `oneOf: [{ const, title }]`: fixed choices with labels.
|
|
51
51
|
- `x-choicesFrom: { rel, field }`: the value picks from a list in the record
|
|
52
52
|
this one links to as `rel`, in its field `field`. A number is a position in
|
|
53
53
|
that list; anything else is the option itself. A vote's `choice` picks from
|
|
54
54
|
its poll's `options`. It is a display hint, never checked when validating.
|
|
55
|
+
- `x-kind: "<name>"`: what kind of value a field holds. The names apps read:
|
|
56
|
+
|
|
57
|
+
| `x-kind` | The value | An app shows |
|
|
58
|
+
| ---------- | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------- |
|
|
59
|
+
| `did` | an account's DID, `did:key:z…` ([spec 01 §4](https://github.com/leifriksheim/minca/blob/main/spec/01-identity.md)) | who it is, and a list of people to pick from |
|
|
60
|
+
| `when` | a moment, RFC 3339, or a whole day, `YYYY-MM-DD` | the time in the reader's words, a date and time picker with "all day" |
|
|
61
|
+
| `day` | a day, `YYYY-MM-DD` | the day in the reader's words, a date picker |
|
|
62
|
+
| `url` | a web address | a link, opened only when it is `http` or `https` |
|
|
63
|
+
| `money` | `{ amount, currency }`, `amount` a decimal string | `€12.50` in the reader's format; an amount and a currency |
|
|
64
|
+
| `file` | a file, as `records.addFile` gives it | its name and size, a picture when it is one; a file picker |
|
|
65
|
+
| `image` | `{ blob, alt }`: a picture and what it shows | the picture; a picker and its description |
|
|
66
|
+
| `position` | a sort key (`positionBetween`) | nothing: it orders records, nobody reads it |
|
|
67
|
+
|
|
68
|
+
Each is what the fragment of the same name writes (`person` writes `did`,
|
|
69
|
+
`blob` writes `file`). An app shows a kind it doesn't know as the plain
|
|
70
|
+
value. A definition
|
|
71
|
+
already in a space keeps the labels it was written with: a space defined
|
|
72
|
+
before these labels shows those fields plainly until the collection is
|
|
73
|
+
redefined.
|
|
74
|
+
|
|
75
|
+
Any keyword starting `x-` is an annotation like these: any JSON, and it says
|
|
76
|
+
nothing about whether a body fits. A new one, or a new `x-kind`, is a row
|
|
77
|
+
here, never a change to the protocol. With Zod, add one with
|
|
78
|
+
`.meta({ 'x-kind': 'did' })`. Keep annotations to plain values: a validator
|
|
79
|
+
that can't build from a schema (an `$id` inside one is enough) checks
|
|
80
|
+
nothing against it, so the collection's shape goes unchecked.
|
|
55
81
|
|
|
56
82
|
Anything else, like `pattern` or `format`, is refused when you define the
|
|
57
83
|
collection, with the reason. A Zod `.regex()` or `.email()` fails for that
|
|
@@ -69,7 +95,9 @@ unknown keywords ignored, so a space written by a newer app that allows more
|
|
|
69
95
|
stays readable by an older one. Every failing leaf is reported, not only the
|
|
70
96
|
first, with a JSON Pointer to the value. The validator is
|
|
71
97
|
`@cfworker/json-schema`, which interprets rather than compiles, so it runs
|
|
72
|
-
under a strict CSP.
|
|
98
|
+
under a strict CSP. A schema it can't build a validator from (it follows
|
|
99
|
+
`$id`s into any key it doesn't know, so a bad one in an annotation is enough)
|
|
100
|
+
checks nothing, like an invalid definition; reading never fails on it.
|
|
73
101
|
|
|
74
102
|
A record that doesn't fit the schema is still kept and synced, and comes back
|
|
75
103
|
with `conforms: false` and the issues. Shape is checked when you write, not
|
|
@@ -77,7 +105,7 @@ enforced on arrival, because two peers may have seen different versions of a
|
|
|
77
105
|
definition ([spec 02 §9.6](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md)).
|
|
78
106
|
Rules, below, are enforced everywhere.
|
|
79
107
|
|
|
80
|
-
_Source: `packages/core/src/schema/collection-def.ts` (`validateJsonSchema`, `toJsonSchema`, `asStandardSchema`), `packages/core/src/node/space-runtime.ts` (`contentIssues`). Tests: `packages/core/tests/space-catalog.test.ts` ("validate and reject within the supported subset", "an unknown keyword is ignored when validating, so newer spaces stay readable", "choices can carry labels, or come from a linked record", "a record that does not fit is kept and flagged when it arrives, never rejected"), `packages/core/tests/schemas.test.ts` ("schemas from a validator you already use")._
|
|
108
|
+
_Source: `packages/core/src/schema/collection-def.ts` (`validateJsonSchema`, `toJsonSchema`, `asStandardSchema`), `packages/core/src/node/space-runtime.ts` (`contentIssues`). Tests: `packages/core/tests/space-catalog.test.ts` ("validate and reject within the supported subset", "an unknown keyword is ignored when validating, so newer spaces stay readable", "choices can carry labels, or come from a linked record", "an x-\* keyword is an annotation: any one publishes, and no value is checked against it", "a record that does not fit is kept and flagged when it arrives, never rejected"), `packages/core/tests/attacks.test.ts` ("a definition the validator can't use can't break reading the collection, or the space"), `packages/core/tests/schemas.test.ts` ("schemas from a validator you already use")._
|
|
81
109
|
|
|
82
110
|
## Links
|
|
83
111
|
|
package/docs/node.md
CHANGED
|
@@ -239,13 +239,13 @@ node makes a key for this run as it would without a source.
|
|
|
239
239
|
write fails until the page reloads, since signing on would fork the line
|
|
240
240
|
and withdraw what the key wrote. A slot whose connection the browser
|
|
241
241
|
closed opens again only while it still holds the key.
|
|
242
|
-
- The CLI keeps them outside its home, in `<local>/
|
|
242
|
+
- The CLI keeps them outside its home, in `<local>/writer-keys/slot-<n>/` (`localPath` in `packages/cli/src/home.ts`, [sync and storage](storage.md#data-folders)): the key as
|
|
243
243
|
JWK in an envelope (spec 01 §9.1) under the account's local key, with label
|
|
244
244
|
`minca/writer-key/v1` and bound `{ did: <account DID>, slot: <n> }`
|
|
245
245
|
(`key.sealed`, mode 600), so a copy of the files can't sign, and a key file
|
|
246
246
|
moved to another slot or account is refused rather than used; its places in
|
|
247
|
-
`heads/`; and
|
|
248
|
-
once that process is gone.
|
|
247
|
+
`heads/`; and numbered `lock.<n>` files naming the process that holds the
|
|
248
|
+
highest, taken over once that process is gone.
|
|
249
249
|
|
|
250
250
|
_Source: `packages/core/src/node/writer-keys.ts` (`browserWriterKeys`), `packages/core/src/node/writers.ts` (`createWriters`), `packages/core/src/node/node.ts` (`createNode`, `revokeSelf`), `packages/core/src/node/stores.ts` (`writerKeysFor`), `packages/core/src/node/worker.ts` (`withWriterKey`), `packages/cli/src/writer-keys.ts` (`fileWriterKeys`), `packages/cli/src/home.ts` (`unlock`, `nodeFor`). Tests: `packages/core/tests/writer-logs.test.ts` ("a writer key that outlives the node"), `packages/cli/tests/writer-keys.test.ts` ("a key file moved to another slot, or to another account, does not open")._
|
|
251
251
|
|
|
@@ -616,7 +616,7 @@ successors, mine, heads, key, relays, keepers, copies, forks, flagged }`
|
|
|
616
616
|
accepting also need whole-account access.
|
|
617
617
|
- `node.carriers`, `node.hosting`, `node.notifications` — [carriers and hosting](#carriers-hosting-and-notifications), [spec 06 §4](https://github.com/leifriksheim/minca/blob/main/spec/06-nodes-and-sessions.md).
|
|
618
618
|
- `node.iceServers()` — the configured ICE servers plus TURN servers a relay
|
|
619
|
-
offers ([the network](#the-network)); what [calls](calls.md#connections) use.
|
|
619
|
+
offers ([the network](#the-network)); what [calls](../../calls/README.md#connections) use.
|
|
620
620
|
- `node.network` — `status()`: each relay's state (open, or waiting to redial,
|
|
621
621
|
when and why), the connections open and those still being made, and whether
|
|
622
622
|
a relay offered TURN; `reconnect()` redials a waiting relay now
|
|
@@ -655,8 +655,9 @@ says hello back in a room at most once every 10 s; one due sooner waits
|
|
|
655
655
|
for the 10 s, once for everyone who said hello meanwhile. Each socket
|
|
656
656
|
sends at most 20 messages a second, in bursts of 40, and queues the rest. A
|
|
657
657
|
connection attempt that times out is retried on the peer's next hello. `requestIce`
|
|
658
|
-
asks every connected relay
|
|
659
|
-
ICE gathering to finish, or 2 s, and carries what it
|
|
658
|
+
asks every connected relay whose kind can hand out TURN passwords. Each WebRTC
|
|
659
|
+
offer or answer waits for ICE gathering to finish, or 2 s, and carries what it
|
|
660
|
+
found.
|
|
660
661
|
|
|
661
662
|
**Kinds of relay** (spec 04 §1.2). `network.relays` may mix kinds:
|
|
662
663
|
`['wss://minca.fly.dev', 'nostr+wss://relay.damus.io']`. A relay of a kind
|
|
@@ -695,8 +696,8 @@ configured servers plus the TURN servers relays offered, the latter only while
|
|
|
695
696
|
`expiresAt` is in the future. `node.iceServers()` returns the same list for
|
|
696
697
|
the application's own connections (a call's). Before answering it refreshes:
|
|
697
698
|
if any relay is connected and the TURN passwords held are missing or expire
|
|
698
|
-
within 10 minutes, and it has not asked in the last 10 minutes, it
|
|
699
|
-
|
|
699
|
+
within 10 minutes, and it has not asked in the last 10 minutes, it asks every
|
|
700
|
+
connected relay that can and waits up to 1.5 s for an answer (relays without
|
|
700
701
|
TURN never answer), then returns what it has. A node with no relays returns
|
|
701
702
|
the configured servers.
|
|
702
703
|
|
|
@@ -1036,7 +1037,7 @@ _Source: `packages/core/src/node/node.ts` (`keepSpaceHosts`, `askSpaceHost`, `ho
|
|
|
1036
1037
|
|
|
1037
1038
|
## Client conveniences
|
|
1038
1039
|
|
|
1039
|
-
These are not protocol; another client may draw sign-in and [calls](calls.md) however it
|
|
1040
|
+
These are not protocol; another client may draw sign-in and [calls](../../calls/README.md) however it
|
|
1040
1041
|
likes.
|
|
1041
1042
|
|
|
1042
1043
|
- **`<minca-auth>`** draws the flow of [sign-in](sign-in.md) into its own light DOM (so password
|
|
@@ -1046,11 +1047,12 @@ likes.
|
|
|
1046
1047
|
`element.auth = createMincaAuth(…)`. It sizes to its container, so it fits a
|
|
1047
1048
|
page, a modal or a side panel, and draws nothing once someone is in. Colours,
|
|
1048
1049
|
font and radius are custom properties (`--minca-accent`, `--minca-font`, …).
|
|
1049
|
-
- **React** (`@minca/
|
|
1050
|
+
- **React** (`@minca/react`): `MincaProvider`, `useMinca`,
|
|
1050
1051
|
`useAuth`, `useSession`, `useConnection`, `useAccount`, `useNode`,
|
|
1051
1052
|
`<MincaAuth>`, `useQuery`, `useLive`, `useSpaces`,
|
|
1052
1053
|
`useHoldSpace` (holds a space while mounted, releasing it a few seconds late),
|
|
1053
1054
|
`useRecord`, `useLinked`, `useCollections`, `useProfiles`, `useAccess`,
|
|
1054
|
-
`useSpaceStatus`, `useCan
|
|
1055
|
+
`useSpaceStatus`, `useCan`. Calls' `CallsProvider` and `useCalls` are in
|
|
1056
|
+
`@minca/calls/react`.
|
|
1055
1057
|
|
|
1056
|
-
_Source: `packages/core/src/elements/minca-auth.ts`, `packages/
|
|
1058
|
+
_Source: `packages/core/src/elements/minca-auth.ts`, `packages/react/src/`. Tests: none._
|