hafez 2.1.0 → 2.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 +72 -5
- package/dist/apply.d.ts +14 -1
- package/dist/apply.js +94 -32
- package/dist/batch-ops.d.ts +31 -27
- package/dist/batch-ops.js +83 -16
- package/dist/cli/block-hook.d.ts +6 -0
- package/dist/cli/block-hook.js +27 -12
- package/dist/cli/commands.d.ts +3 -1
- package/dist/cli/commands.js +183 -73
- package/dist/cli/format.d.ts +11 -3
- package/dist/cli/format.js +61 -4
- package/dist/cli/index.js +40 -19
- package/dist/cli/install.d.ts +9 -0
- package/dist/cli/install.js +36 -15
- package/dist/cli/onboard.js +30 -9
- package/dist/cli/upgrade.js +5 -4
- package/dist/contracts.d.ts +9 -0
- package/dist/contracts.js +9 -0
- package/dist/dates.d.ts +7 -0
- package/dist/dates.js +21 -1
- package/dist/db.d.ts +50 -10
- package/dist/db.js +251 -65
- package/dist/digest.js +14 -7
- package/dist/document.d.ts +2 -0
- package/dist/document.js +2 -2
- package/dist/git.d.ts +13 -2
- package/dist/git.js +121 -14
- package/dist/graph/activity.d.ts +5 -0
- package/dist/graph/activity.js +70 -0
- package/dist/graph/client.js +326 -0
- package/dist/graph/copy-fonts.d.ts +1 -0
- package/dist/graph/copy-fonts.js +13 -0
- package/dist/graph/fields.d.ts +8 -0
- package/dist/graph/fields.js +12 -0
- package/dist/graph/fonts/geist-OFL.txt +93 -0
- package/dist/graph/fonts/geist-mono-OFL.txt +93 -0
- package/dist/graph/fonts/geist-mono.woff2 +0 -0
- package/dist/graph/fonts/geist.woff2 +0 -0
- package/dist/graph/fonts/outfit-OFL.txt +93 -0
- package/dist/graph/fonts/outfit.woff2 +0 -0
- package/dist/graph/fonts.d.ts +14 -0
- package/dist/graph/fonts.js +17 -0
- package/dist/graph/live.d.ts +16 -0
- package/dist/graph/live.js +99 -0
- package/dist/graph/open.d.ts +1 -0
- package/dist/graph/open.js +20 -0
- package/dist/graph/server.d.ts +17 -0
- package/dist/graph/server.js +189 -0
- package/dist/health.d.ts +6 -0
- package/dist/health.js +310 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +66 -18
- package/dist/internal.d.ts +21 -0
- package/dist/internal.js +9 -0
- package/dist/knowledge-index.d.ts +1 -1
- package/dist/read-json.d.ts +26 -0
- package/dist/read-json.js +53 -0
- package/dist/schema.d.ts +2 -0
- package/dist/schema.js +11 -0
- package/dist/stale.d.ts +2 -2
- package/dist/stale.js +4 -9
- package/dist/surfaces/items.d.ts +100 -1
- package/dist/surfaces/items.js +148 -10
- package/dist/surfaces/surfaces.d.ts +8 -5
- package/dist/surfaces/surfaces.js +34 -17
- package/dist/templates.d.ts +2 -0
- package/dist/templates.js +6 -1
- package/dist/types.d.ts +239 -25
- package/dist/validate.js +44 -56
- package/dist/vault.d.ts +29 -9
- package/dist/vault.js +39 -8
- package/dist/workstream.d.ts +17 -0
- package/dist/workstream.js +78 -0
- package/package.json +10 -4
- package/skill/hafez/SKILL.md +16 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/graph/copy-fonts.ts
|
|
2
|
+
// Build step (#272), run as `node dist/graph/copy-fonts.js` after tsc: copy
|
|
3
|
+
// the page's fonts and their licences from the devDependencies into
|
|
4
|
+
// dist/graph/fonts/, where the server's `/fonts/` route reads them.
|
|
5
|
+
import { copyFileSync, mkdirSync } from 'fs';
|
|
6
|
+
import { dirname, join } from 'path';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
import { FONT_FILES } from './fonts.js';
|
|
9
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
10
|
+
const out = join(root, 'dist', 'graph', 'fonts');
|
|
11
|
+
mkdirSync(out, { recursive: true });
|
|
12
|
+
for (const [file, from] of FONT_FILES)
|
|
13
|
+
copyFileSync(join(root, 'node_modules', from), join(out, file));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The optional Graph node fields queryGraph copies from an index row when set. */
|
|
2
|
+
export declare const GRAPH_ROW_FIELDS: readonly ["type", "status", "subtype", "confidence", "last_touched", "description"];
|
|
3
|
+
/** The optional Graph node fields queryGraph derives (#271): an Entity's signals
|
|
4
|
+
* and an Unlinked note's mark and placing slug. */
|
|
5
|
+
export declare const GRAPH_SIGNAL_FIELDS: readonly ["open_actions", "stale", "stale_actions", "staleness_days", "unlinked", "best"];
|
|
6
|
+
/** Every optional Graph node field: what the page's merge drops from a node a
|
|
7
|
+
* refresh no longer gives it. */
|
|
8
|
+
export declare const GRAPH_NODE_FIELDS: readonly ["type", "status", "subtype", "confidence", "last_touched", "description", "open_actions", "stale", "stale_actions", "staleness_days", "unlinked", "best"];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/graph/fields.ts
|
|
2
|
+
// Plain data shared by the index (db.ts) and the graph page's bundle. Kept
|
|
3
|
+
// out of contracts.ts, whose contract objects esbuild cannot drop from the
|
|
4
|
+
// bundle once it imports anything there.
|
|
5
|
+
/** The optional Graph node fields queryGraph copies from an index row when set. */
|
|
6
|
+
export const GRAPH_ROW_FIELDS = ['type', 'status', 'subtype', 'confidence', 'last_touched', 'description'];
|
|
7
|
+
/** The optional Graph node fields queryGraph derives (#271): an Entity's signals
|
|
8
|
+
* and an Unlinked note's mark and placing slug. */
|
|
9
|
+
export const GRAPH_SIGNAL_FIELDS = ['open_actions', 'stale', 'stale_actions', 'staleness_days', 'unlinked', 'best'];
|
|
10
|
+
/** Every optional Graph node field: what the page's merge drops from a node a
|
|
11
|
+
* refresh no longer gives it. */
|
|
12
|
+
export const GRAPH_NODE_FIELDS = [...GRAPH_ROW_FIELDS, ...GRAPH_SIGNAL_FIELDS];
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font) Geist-Italic[wght].ttf: Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font.git) GeistMono-Italic[wght].ttf: Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font.git)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2021 The Outfit Project Authors (https://github.com/Outfitio/Outfit-Fonts)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Font {
|
|
2
|
+
/** The CSS family the token sheet's stacks name. */
|
|
3
|
+
family: string;
|
|
4
|
+
/** The served name under `/fonts/`; the licence is `<file stem>-OFL.txt`. */
|
|
5
|
+
file: string;
|
|
6
|
+
/** The devDependency it is copied from, and the woff2 inside it. */
|
|
7
|
+
pkg: string;
|
|
8
|
+
src: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const FONTS: readonly Font[];
|
|
11
|
+
/** The served name of a font's licence. */
|
|
12
|
+
export declare const licenceFile: (font: Font) => string;
|
|
13
|
+
/** Every file `/fonts/` serves, by served name: what the build copies, from where in node_modules. */
|
|
14
|
+
export declare const FONT_FILES: ReadonlyMap<string, string>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/graph/fonts.ts
|
|
2
|
+
// The page's bundled fonts (#272), plain data shared by the build, the
|
|
3
|
+
// server's `/fonts/` allowlist and the page's stylesheet. Each is a latin
|
|
4
|
+
// variable-weight woff2 from a devDependency, copied into dist/graph/fonts/ at
|
|
5
|
+
// build with its OFL licence beside it: the package gains no runtime dependency.
|
|
6
|
+
export const FONTS = [
|
|
7
|
+
{ family: 'Geist', file: 'geist.woff2', pkg: '@fontsource-variable/geist', src: 'files/geist-latin-wght-normal.woff2' },
|
|
8
|
+
{ family: 'Geist Mono', file: 'geist-mono.woff2', pkg: '@fontsource-variable/geist-mono', src: 'files/geist-mono-latin-wght-normal.woff2' },
|
|
9
|
+
{ family: 'Outfit', file: 'outfit.woff2', pkg: '@fontsource-variable/outfit', src: 'files/outfit-latin-wght-normal.woff2' },
|
|
10
|
+
];
|
|
11
|
+
/** The served name of a font's licence. */
|
|
12
|
+
export const licenceFile = (font) => font.file.replace(/\.woff2$/, '-OFL.txt');
|
|
13
|
+
/** Every file `/fonts/` serves, by served name: what the build copies, from where in node_modules. */
|
|
14
|
+
export const FONT_FILES = new Map(FONTS.flatMap(f => [
|
|
15
|
+
[f.file, `${f.pkg}/${f.src}`],
|
|
16
|
+
[licenceFile(f), `${f.pkg}/LICENSE`],
|
|
17
|
+
]));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from 'http';
|
|
2
|
+
import type { Hafez } from '../types.js';
|
|
3
|
+
/** How often the Vault's history is checked when no interval is given, in ms. */
|
|
4
|
+
export declare const DEFAULT_POLL_MS = 2000;
|
|
5
|
+
export interface Live {
|
|
6
|
+
/** Hold `res` open as an SSE stream until the client goes away; a
|
|
7
|
+
* `Last-Event-ID` on `req` is replayed the changes since it first. */
|
|
8
|
+
subscribe(req: IncomingMessage, res: ServerResponse): void;
|
|
9
|
+
/** Stop polling and wait out a poll in flight, so nothing touches the Hafez
|
|
10
|
+
* instance afterwards (its index is closed next). */
|
|
11
|
+
stop(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
/** Start following the Vault from its current cursor; `rebuild` refreshes the
|
|
14
|
+
* cached Graph before an event goes out, so a client refetching on the event
|
|
15
|
+
* reads the new one. */
|
|
16
|
+
export declare function startLive(os: Hafez, pollMs: number, rebuild: () => Promise<void>): Promise<Live>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/** How often the Vault's history is checked when no interval is given, in ms. */
|
|
2
|
+
export const DEFAULT_POLL_MS = 2000;
|
|
3
|
+
/** Start following the Vault from its current cursor; `rebuild` refreshes the
|
|
4
|
+
* cached Graph before an event goes out, so a client refetching on the event
|
|
5
|
+
* reads the new one. */
|
|
6
|
+
export async function startLive(os, pollMs, rebuild) {
|
|
7
|
+
const clients = new Set();
|
|
8
|
+
let cursor = (await os.changesSince()).cursor;
|
|
9
|
+
let stopped = false;
|
|
10
|
+
/** Polls and replays run one at a time, in order. */
|
|
11
|
+
let chain = Promise.resolve();
|
|
12
|
+
const serial = (task) => (chain = chain.then(task));
|
|
13
|
+
let timer;
|
|
14
|
+
async function poll() {
|
|
15
|
+
let found;
|
|
16
|
+
try {
|
|
17
|
+
found = await os.changesSince(cursor);
|
|
18
|
+
if (found.changes.length === 0) {
|
|
19
|
+
cursor = found.cursor;
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
// A cursor history no longer knows (rewritten), or a transient read
|
|
25
|
+
// failure. Follow from where history is now: what changed in between is
|
|
26
|
+
// unknown, so a moved cursor goes out as a commit naming no note, and
|
|
27
|
+
// the page refetches the Graph on it as on any commit.
|
|
28
|
+
try {
|
|
29
|
+
found = { ...await os.changesSince(), changes: [] };
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return; // the cursor stays: the next poll asks again
|
|
33
|
+
}
|
|
34
|
+
if (found.cursor === cursor)
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (stopped)
|
|
38
|
+
return;
|
|
39
|
+
try {
|
|
40
|
+
await rebuild();
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// The cursor stays where it was: the next poll finds these changes again.
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const frame = commitFrame(found);
|
|
47
|
+
for (const res of clients)
|
|
48
|
+
res.write(frame);
|
|
49
|
+
cursor = found.cursor;
|
|
50
|
+
}
|
|
51
|
+
/** What changed since `lastId`, to one stream. A cursor history no longer
|
|
52
|
+
* knows replays nothing: the page refetches the Graph on reconnect anyway.
|
|
53
|
+
* A change the next poll also finds reaches this stream twice, which the
|
|
54
|
+
* page takes as one more refetch. */
|
|
55
|
+
async function replay(res, lastId) {
|
|
56
|
+
let found;
|
|
57
|
+
try {
|
|
58
|
+
found = await os.changesSince(lastId);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
found = { cursor: cursor ?? '', changes: [] };
|
|
62
|
+
}
|
|
63
|
+
if (!res.writableEnded)
|
|
64
|
+
res.write(found.changes.length > 0 ? commitFrame(found) : idFrame(found.cursor));
|
|
65
|
+
}
|
|
66
|
+
function schedule() {
|
|
67
|
+
if (stopped)
|
|
68
|
+
return;
|
|
69
|
+
timer = setTimeout(() => { void serial(poll).finally(schedule); }, pollMs);
|
|
70
|
+
timer.unref();
|
|
71
|
+
}
|
|
72
|
+
schedule();
|
|
73
|
+
return {
|
|
74
|
+
subscribe(req, res) {
|
|
75
|
+
res.writeHead(200, { 'Content-Type': 'text/event-stream; charset=utf-8', 'Cache-Control': 'no-cache', Connection: 'keep-alive' });
|
|
76
|
+
res.write(': live\n\n');
|
|
77
|
+
const lastId = req.headers['last-event-id'];
|
|
78
|
+
if (typeof lastId === 'string' && lastId !== cursor && !stopped)
|
|
79
|
+
void serial(() => replay(res, lastId));
|
|
80
|
+
else
|
|
81
|
+
res.write(idFrame(cursor ?? ''));
|
|
82
|
+
clients.add(res);
|
|
83
|
+
res.on('close', () => clients.delete(res));
|
|
84
|
+
},
|
|
85
|
+
async stop() {
|
|
86
|
+
stopped = true;
|
|
87
|
+
clearTimeout(timer);
|
|
88
|
+
await chain;
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/** An event with an id and no data: it sets the browser's last event id and dispatches nothing. */
|
|
93
|
+
function idFrame(cursor) {
|
|
94
|
+
return `id: ${cursor}\n\n`;
|
|
95
|
+
}
|
|
96
|
+
function commitFrame({ cursor, changes }) {
|
|
97
|
+
const event = { type: 'commit', changes };
|
|
98
|
+
return `id: ${cursor}\ndata: ${JSON.stringify(event)}\n\n`;
|
|
99
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function openBrowser(url: string): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// src/graph/open.ts
|
|
2
|
+
// Open a URL in the user's browser, best-effort: any failure is silent,
|
|
3
|
+
// because the URL is printed either way.
|
|
4
|
+
import { spawn } from 'child_process';
|
|
5
|
+
import { release } from 'os';
|
|
6
|
+
export function openBrowser(url) {
|
|
7
|
+
const wsl = process.platform === 'linux' && release().toLowerCase().includes('microsoft');
|
|
8
|
+
const [cmd, args] = process.platform === 'darwin' ? ['open', [url]]
|
|
9
|
+
// cmd.exe splits a command at `&`: a focused URL (`?focus=…&depth=2`) needs it escaped.
|
|
10
|
+
: process.platform === 'win32' || wsl ? ['cmd.exe', ['/c', 'start', url.replace(/&/g, '^&')]]
|
|
11
|
+
: ['xdg-open', [url]];
|
|
12
|
+
try {
|
|
13
|
+
const child = spawn(cmd, args, { detached: true, stdio: 'ignore' });
|
|
14
|
+
child.on('error', () => { });
|
|
15
|
+
child.unref();
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
// No opener on this machine: the printed URL is the way in.
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { InternalHafez } from '../internal.js';
|
|
2
|
+
/** Where the port search starts when no port is asked for. */
|
|
3
|
+
export declare const DEFAULT_PORT = 4747;
|
|
4
|
+
export interface GraphServerOpts {
|
|
5
|
+
/** An instance from createInternalHafez (src/internal.ts): the server syncs its index itself. */
|
|
6
|
+
os: InternalHafez;
|
|
7
|
+
/** The port to bind; 0 lets the OS pick. Unset: the first free port from DEFAULT_PORT. */
|
|
8
|
+
port?: number;
|
|
9
|
+
/** How often to look for Vault changes, in ms (default DEFAULT_POLL_MS). */
|
|
10
|
+
pollMs?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface GraphServer {
|
|
13
|
+
url: string;
|
|
14
|
+
/** Stop the server, drop open connections and close the Hafez instance's index. */
|
|
15
|
+
close(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export declare function startGraphServer({ os, port, pollMs }: GraphServerOpts): Promise<GraphServer>;
|