driggsby 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -123,4 +123,6 @@ signed in with an earlier version of the CLI, run
123
123
 
124
124
  ## License
125
125
 
126
- Apache-2.0
126
+ Apache-2.0. The bundled Inter font (`assets/Inter.woff2`), which
127
+ `driggsby dev` serves to the app it previews, is under the SIL Open Font
128
+ License 1.1; see `assets/Inter-LICENSE.txt`.
@@ -0,0 +1,92 @@
1
+ Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)
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
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
9
+ -----------------------------------------------------------
10
+
11
+ PREAMBLE
12
+ The goals of the Open Font License (OFL) are to stimulate worldwide
13
+ development of collaborative font projects, to support the font creation
14
+ efforts of academic and linguistic communities, and to provide a free and
15
+ open framework in which fonts may be shared and improved in partnership
16
+ with others.
17
+
18
+ The OFL allows the licensed fonts to be used, studied, modified and
19
+ redistributed freely as long as they are not sold by themselves. The
20
+ fonts, including any derivative works, can be bundled, embedded,
21
+ redistributed and/or sold with any software provided that any reserved
22
+ names are not used by derivative works. The fonts and derivatives,
23
+ however, cannot be released under any other type of license. The
24
+ requirement for fonts to remain under this license does not apply
25
+ to any document created using the fonts or their derivatives.
26
+
27
+ DEFINITIONS
28
+ "Font Software" refers to the set of files released by the Copyright
29
+ Holder(s) under this license and clearly marked as such. This may
30
+ include source files, build scripts and documentation.
31
+
32
+ "Reserved Font Name" refers to any names specified as such after the
33
+ copyright statement(s).
34
+
35
+ "Original Version" refers to the collection of Font Software components as
36
+ distributed by the Copyright Holder(s).
37
+
38
+ "Modified Version" refers to any derivative made by adding to, deleting,
39
+ or substituting -- in part or in whole -- any of the components of the
40
+ Original Version, by changing formats or by porting the Font Software to a
41
+ new environment.
42
+
43
+ "Author" refers to any designer, engineer, programmer, technical
44
+ writer or other person who contributed to the Font Software.
45
+
46
+ PERMISSION AND CONDITIONS
47
+ Permission is hereby granted, free of charge, to any person obtaining
48
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
49
+ redistribute, and sell modified and unmodified copies of the Font
50
+ Software, subject to the following conditions:
51
+
52
+ 1) Neither the Font Software nor any of its individual components,
53
+ in Original or Modified Versions, may be sold by itself.
54
+
55
+ 2) Original or Modified Versions of the Font Software may be bundled,
56
+ redistributed and/or sold with any software, provided that each copy
57
+ contains the above copyright notice and this license. These can be
58
+ included either as stand-alone text files, human-readable headers or
59
+ in the appropriate machine-readable metadata fields within text or
60
+ binary files as long as those fields can be easily viewed by the user.
61
+
62
+ 3) No Modified Version of the Font Software may use the Reserved Font
63
+ Name(s) unless explicit written permission is granted by the corresponding
64
+ Copyright Holder. This restriction only applies to the primary font name as
65
+ presented to the users.
66
+
67
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
68
+ Software shall not be used to promote, endorse or advertise any
69
+ Modified Version, except to acknowledge the contribution(s) of the
70
+ Copyright Holder(s) and the Author(s) or with their explicit written
71
+ permission.
72
+
73
+ 5) The Font Software, modified or unmodified, in part or in whole,
74
+ must be distributed entirely under this license, and must not be
75
+ distributed under any other license. The requirement for fonts to
76
+ remain under this license does not apply to any document created
77
+ using the Font Software.
78
+
79
+ TERMINATION
80
+ This license becomes null and void if any of the above conditions are
81
+ not met.
82
+
83
+ DISCLAIMER
84
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
85
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
86
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
87
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
88
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
89
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
90
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
91
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
92
+ OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file
@@ -0,0 +1,14 @@
1
+ // Inter, the face Driggsby apps set their text in. Driggsby serves it on
2
+ // every deployed app's own origin at DASHBOARD_FONT_PATH, and the scaffold
3
+ // loads it from there; dev serves the same bytes at the same path, from
4
+ // this package (assets/Inter.woff2, under the SIL Open Font License 1.1 in
5
+ // assets/Inter-LICENSE.txt). So the preview draws the letters the deployed
6
+ // page draws, and nothing reaches the internet for them.
7
+ import { readFile } from "node:fs/promises";
8
+ export const DASHBOARD_FONT_PATH = "/-/inter.woff2";
9
+ export const DASHBOARD_FONT_TYPE = "font/woff2";
10
+ // src/dev/ and dist/dev/ both sit two levels under the package root.
11
+ const FONT_FILE = new URL("../../assets/Inter.woff2", import.meta.url);
12
+ export async function loadDashboardFont() {
13
+ return await readFile(FONT_FILE);
14
+ }
@@ -13,6 +13,7 @@ import { defaultCredentialEnvironment, } from "../credentials/store.js";
13
13
  import { requireDeploySession } from "../deploy/api-session.js";
14
14
  import { tryOpenUrl } from "../login/open-url.js";
15
15
  import { wrapProse } from "../terminal-text.js";
16
+ import { loadDashboardFont } from "./dashboard-font.js";
16
17
  import { DEV_IDLE_MINUTES, DEV_START_COMMAND, DEV_STOP_COMMAND } from "./dev-commands.js";
17
18
  import { startDevServers } from "./dev-servers.js";
18
19
  import { pruneDevStatesForPorts, readDevStates, removeDevState, writeDevState } from "./dev-state.js";
@@ -63,6 +64,7 @@ export async function runDev(options = {}, environment = defaultCredentialEnviro
63
64
  const session = await requireDeploySession(environment);
64
65
  await refuseSecondPreview(environment.homeDirectory, projectDirectory);
65
66
  const sdkBundle = await loadSdkBundle();
67
+ const dashboardFont = await loadDashboardFont();
66
68
  // Retries like the production host, so the preview loads the way the
67
69
  // deployed app would.
68
70
  const broker = new McpBroker({ baseUrl: session.baseUrl, token: session.token, retries: true });
@@ -83,6 +85,7 @@ export async function runDev(options = {}, environment = defaultCredentialEnviro
83
85
  background: config.background,
84
86
  serveDirectory: config.serveDirectory,
85
87
  sdkBundle,
88
+ dashboardFont,
86
89
  runToolCall: async (tool, argumentsObject) => {
87
90
  const started = Date.now();
88
91
  const calledIn = documentGeneration;
@@ -1,11 +1,12 @@
1
1
  // The two local servers behind `driggsby dev`, mirroring production's
2
2
  // topology: the host origin (the page a person opens; serves the host page
3
3
  // and the CLI's tool-call endpoint) and the app origin (the app's own
4
- // files, plus the Driggsby SDK at /-/driggsby-sdk.js). Both bind loopback
5
- // only. The app token never appears here — the broker callback holds it in
6
- // the CLI process.
4
+ // files, plus the Driggsby SDK at /-/driggsby-sdk.js and the dashboard font
5
+ // at /-/inter.woff2). Both bind loopback only. The app token never appears
6
+ // here — the broker callback holds it in the CLI process.
7
7
  import { createServer } from "node:http";
8
8
  import { appResponseHeaders, INERT_SERVICE_WORKER } from "./app-policy.js";
9
+ import { DASHBOARD_FONT_PATH, DASHBOARD_FONT_TYPE } from "./dashboard-font.js";
9
10
  import { DEV_IDENTITY_PATH } from "./dev-state.js";
10
11
  import { hostPageHtml, HOST_PAGE_JS } from "./host-page.js";
11
12
  import { serveStaticFile } from "./static-files.js";
@@ -71,7 +72,7 @@ export async function startDevServers(options) {
71
72
  };
72
73
  }
73
74
  // ---------------------------------------------------------------------------
74
- // The app origin: the SDK path, then the project's own files.
75
+ // The app origin: the SDK and font paths, then the project's own files.
75
76
  // ---------------------------------------------------------------------------
76
77
  async function handleAppRequest(options, appPort, hostOrigin, request, response) {
77
78
  // Every response carries the deployed app's headers (app-policy.ts). Their
@@ -100,6 +101,15 @@ async function handleAppRequest(options, appPort, hostOrigin, request, response)
100
101
  sendText(response, 200, JAVASCRIPT, options.sdkBundle, appResponseHeaders(hostOrigin, JAVASCRIPT));
101
102
  return;
102
103
  }
104
+ if (path === DASHBOARD_FONT_PATH) {
105
+ response.writeHead(200, {
106
+ "Content-Type": DASHBOARD_FONT_TYPE,
107
+ "Cache-Control": "no-store",
108
+ ...appResponseHeaders(hostOrigin, DASHBOARD_FONT_TYPE),
109
+ });
110
+ response.end(options.dashboardFont);
111
+ return;
112
+ }
103
113
  const file = await serveStaticFile(options.serveDirectory, path);
104
114
  if (file === null) {
105
115
  sendText(response, 404, PLAIN_TEXT, "Not found.", plainTextHeaders);
@@ -5,9 +5,11 @@
5
5
  // console's stylesheet, so each gray is written as the console paints it
6
6
  // on its black page (the console's cards and fills are translucent over
7
7
  // that ground) and each hue verbatim. The :root block is the same one
8
- // Driggsby's own example dashboard carries. --bg-app must stay equal to
9
- // driggsby.json's "background" (init-command.test.ts pins the two
10
- // together): Driggsby paints that color while the app loads.
8
+ // Driggsby's own example dashboard carries, --font-sans leading with
9
+ // Inter, the face Driggsby serves every app (dev/dashboard-font.ts).
10
+ // --bg-app must stay equal to driggsby.json's "background"
11
+ // (init-command.test.ts pins the two together): Driggsby paints that color
12
+ // while the app loads.
11
13
  export const STYLES_CSS = `/* Driggsby's console palette, so this page reads as part of the app it
12
14
  opens inside. Change these together if you re-theme; keep --bg-app equal
13
15
  to the "background" in driggsby.json. The status tones are the
@@ -28,10 +30,27 @@ export const STYLES_CSS = `/* Driggsby's console palette, so this page reads as
28
30
  --text-error: oklch(0.8 0.13 25);
29
31
  --radius-card: 8px;
30
32
  --radius-bar: 4px;
31
- --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
33
+ --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
32
34
  --ease: cubic-bezier(0.2, 0, 0, 1);
33
35
  }
34
36
 
37
+ /* Inter, which Driggsby serves at /-/inter.woff2 on this app's own origin
38
+ (driggsby dev serves the same file there), so nothing loads from another
39
+ site. Keep the page's text set in it: the Dashboards page shows a
40
+ picture of this page, taken on a server with none of your fonts, and
41
+ only a font the page loads itself looks the same there. Fonts from other
42
+ sites are refused. To switch faces, put the font file in this folder,
43
+ point an @font-face at it, name it first in --font-sans, and change the
44
+ preload in index.html to match. Text waits for the font (font-display:
45
+ block, preloaded) rather than flash another face first. */
46
+ @font-face {
47
+ font-family: "Inter";
48
+ src: url("/-/inter.woff2") format("woff2");
49
+ font-weight: 100 900;
50
+ font-style: normal;
51
+ font-display: block;
52
+ }
53
+
35
54
  * {
36
55
  box-sizing: border-box;
37
56
  }
@@ -15,6 +15,7 @@ export function indexHtml(slug) {
15
15
  <meta charset="utf-8">
16
16
  <meta name="viewport" content="width=device-width, initial-scale=1">
17
17
  <title>${slug}</title>
18
+ <link rel="preload" href="/-/inter.woff2" as="font" type="font/woff2" crossorigin>
18
19
  <link rel="stylesheet" href="styles.css">
19
20
  </head>
20
21
  <body>
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "driggsby",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Set up and build on Driggsby, the MCP server for personal finance.",
5
- "license": "Apache-2.0",
5
+ "license": "Apache-2.0 AND OFL-1.1",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/driggsby/driggsby.git"
@@ -13,6 +13,8 @@
13
13
  "driggsby": "bin/driggsby.js"
14
14
  },
15
15
  "files": [
16
+ "assets/Inter.woff2",
17
+ "assets/Inter-LICENSE.txt",
16
18
  "bin",
17
19
  "dist",
18
20
  "LICENSE",
@@ -28,7 +30,7 @@
28
30
  "node": ">=18"
29
31
  },
30
32
  "dependencies": {
31
- "@driggsby/deploy": "0.7.1",
32
- "@driggsby/sdk": "0.7.1"
33
+ "@driggsby/deploy": "0.7.2",
34
+ "@driggsby/sdk": "0.7.2"
33
35
  }
34
36
  }