@jskit-ai/agent-docs 0.1.386 → 0.1.388

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.
Files changed (40) hide show
  1. package/guide/agent/app-setup/authentication.md +46 -12
  2. package/guide/agent/framework/client-features.md +4 -0
  3. package/guide/agent/framework/crud-form-actions.md +4 -0
  4. package/guide/agent/framework/material-3.md +38 -11
  5. package/guide/agent/framework/typed-features.md +0 -20
  6. package/guide/agent/framework/ui-operations.md +23 -0
  7. package/package.json +1 -1
  8. package/patterns/minimal-foundation/example/AGENTS.md +5 -0
  9. package/patterns/minimal-foundation/example/package.json +2 -2
  10. package/patterns/shell-foundation/example/AGENTS.md +5 -0
  11. package/patterns/shell-foundation/example/package.json +3 -3
  12. package/reference/autogen/PATTERN_INDEX.md +37 -37
  13. package/reference/autogen/packages/auth-web.md +11 -0
  14. package/reference/autogen/packages/users-web.md +6 -0
  15. package/skills/jskit/references/client-features.md +4 -0
  16. package/skills/jskit/references/crud-form-actions.md +4 -0
  17. package/skills/jskit/references/material-3.md +38 -11
  18. package/skills/jskit/references/pattern-index.md +37 -37
  19. package/skills/jskit/references/patterns/app/minimal-foundation/example/AGENTS.md +5 -0
  20. package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +2 -2
  21. package/skills/jskit/references/patterns/app/shell-foundation/example/AGENTS.md +5 -0
  22. package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +3 -3
  23. package/skills/jskit/references/patterns/auth/accounts-hub/example/package.json +3 -3
  24. package/skills/jskit/references/patterns/auth/auth-surface/PATTERN.md +7 -4
  25. package/skills/jskit/references/patterns/auth/auth-surface/example/src/components/AppBrand.vue +58 -3
  26. package/skills/jskit/references/patterns/auth/oidc-sign-in/example/package.json +2 -2
  27. package/skills/jskit/references/patterns/connectors/calendar-cli/example/package.json +4 -4
  28. package/skills/jskit/references/patterns/crud/crud-feature-package/example/packages/books/package.json +1 -1
  29. package/skills/jskit/references/patterns/database/mysql-application/example/package.json +2 -2
  30. package/skills/jskit/references/patterns/database/postgres-application/example/package.json +2 -2
  31. package/skills/jskit/references/patterns/realtime/realtime-application/example/package.json +2 -2
  32. package/skills/jskit/references/patterns/users/account-settings/PATTERN.md +59 -10
  33. package/skills/jskit/references/patterns/users/account-settings/example/src/components/account/settings/AccountSettingsNotificationsSection.vue +25 -12
  34. package/skills/jskit/references/patterns/users/account-settings/example/src/components/account/settings/AccountSettingsPreferencesSection.vue +25 -19
  35. package/skills/jskit/references/patterns/users/account-settings/example/src/components/account/settings/AccountSettingsProfileSection.vue +74 -54
  36. package/skills/jskit/references/patterns/users/account-settings/example/src/components/account/settings/AccountSettingsSignInMethodsSection.vue +7 -2
  37. package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users/package.json +2 -2
  38. package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users-workspace/package.json +4 -4
  39. package/skills/jskit/references/typed-features.md +0 -20
  40. package/skills/jskit/references/ui-operations.md +23 -0
@@ -562,8 +562,8 @@ email, and the first account is admitted by its setup code. Those
562
562
  registrations sign in at once, with or without a sender, except an invitation
563
563
  whose resolver names no email, which confirms when a sender is installed. An
564
564
  app that refused the register routes itself, with a 404 hook,
565
- can drop the hook for this setting. The sign-in page then shows its Register
566
- tab only to an invited person (an `invitationToken` in its address) and, while
565
+ can drop the hook for this setting. The sign-in page then shows its Create
566
+ account tab only to an invited person (an `invitationToken` in its address) and, while
567
567
  the app has no account, to the first one: local auth reports
568
568
  `features.password.selfRegister: false` otherwise, and a provider that doesn't
569
569
  report it offers registering whenever it supports it.
@@ -1042,19 +1042,24 @@ the `auth_local_identities` and `auth_local_oauth_attempts` tables.
1042
1042
 
1043
1043
  `@jskit-ai/auth-web` owns the normal auth views, guard runtime, sign-out flow,
1044
1044
  and auth-aware HTTP integration. `DefaultLoginView`, `DefaultResetPasswordView`,
1045
- `DefaultEmailChangeView` and `DefaultSignOutView` fill the window themselves: a card on
1046
- `surface-container` on wide windows, the whole screen on phones, and each
1047
- screen's one `h1` ("Sign in", "Create your account", "Reset password", ...).
1045
+ `DefaultEmailChangeView` and `DefaultSignOutView` fill the window themselves: a
1046
+ 520px card in `surface-container-low` on the `surface`, centred and with its top
1047
+ fixed so it stays put as the view changes mode, from 600px wide; the whole
1048
+ screen on phones; and each screen's one `h1` ("Sign in", "Create your account",
1049
+ "Choose a new password", ...).
1048
1050
  Every app shows its identity there, so a person always sees which app they are
1049
1051
  signing in to. It goes in their `brand` slot, which JSKIT lays out: a pane
1050
- beside the card on wide windows (`primary-container`, its children from top to
1051
- bottom) and a compact row above the card on phones. The slot gets `{ compact }`
1052
+ beside the card on wide windows (`surface-container`, so the screen's one
1053
+ focal point in colour stays its main action; its children from top to bottom,
1054
+ the card's top lined up with the pane's first)
1055
+ and a compact row above the card, lined up with it, below 960px. The slot gets `{ compact }`
1052
1056
  to choose what to show, and holds no heading. The `auth/auth-surface` pattern
1053
1057
  does this already: its pages render the app's view wrappers
1054
1058
  (`src/views/auth/LoginView.vue`, `ResetPasswordView.vue`, `EmailChangeView.vue`,
1055
1059
  `SignOutView.vue`),
1056
- and each fills the slot with `src/components/AppBrand.vue`, the app's name as
1057
- `index.html`'s `<title>` spells it. Renaming the app renames both:
1060
+ and each fills the slot with `src/components/AppBrand.vue`: the app's mark, its
1061
+ name as `index.html`'s `<title>` spells it, and on the pane one line about the
1062
+ app. Renaming the app renames both:
1058
1063
 
1059
1064
  ```vue
1060
1065
  <template>
@@ -1066,8 +1071,37 @@ and each fills the slot with `src/components/AppBrand.vue`, the app's name as
1066
1071
  </template>
1067
1072
  ```
1068
1073
 
1069
- An app with a logo or a line about the product puts them in `AppBrand.vue`
1070
- too, keeping the name.
1074
+ An app with a logo puts it in `AppBrand.vue` in place of the mark's initial,
1075
+ keeping the name, and its own line about the product in `APP_TAGLINE`.
1076
+
1077
+ Each field has a leading icon: the mail glyph for the email address, the lock
1078
+ for a password and the key for a code. A new password's field states its rule
1079
+ ("Use at least 8 characters.") before anything is typed. The form's submit
1080
+ follows its fields, and the other ways in come after it, set apart by an "or":
1081
+ the providers, Google's button with Google's own four-colour mark, and on sign
1082
+ in **Email me a sign-in code**. Creating an account is "Create account" on its
1083
+ tab and its submit. A way back to sign-in is named "Sign in", with the sign-in
1084
+ icon (`$login`), beside the question it answers, and every text button's label is in `primary`. Buttons
1085
+ are Material 3's 40dp and fields its 56dp outlined fields; on a phone the card's
1086
+ content and the brand row keep the 16px compact margin. The remember checkbox
1087
+ says what it keeps: "Shows your account here next time. It doesn't keep you
1088
+ signed in." Each screen's title starts at the same place in its card. `DefaultLoginView` and
1089
+ `DefaultResetPasswordView` take `fieldIcons`, naming the fields whose icon the
1090
+ app changes (`email`, `password`, `confirmPassword`, `otpCode`,
1091
+ `confirmationCode`, `setupCode`) as an icon alias, or `""` for none; the others
1092
+ keep JSKIT's (`<DefaultLoginView :field-icons="{ email: '$person' }">`, in
1093
+ the app's `LoginView.vue` wrapper).
1094
+
1095
+ A failed sign-out is titled "Sign-out didn't finish" and is one tonal error
1096
+ alert, `DefaultSignOutView`'s own: "This device may still be signed in" is its
1097
+ title, and the reason and "Try again before you leave this device." its text.
1098
+ Below it are **Retry sign out** and **Go to the app**, with the home icon
1099
+ (`goToLogin`, which takes a device still signed in back to its page);
1100
+ `useSignOutView()` gives the shell's error runtime nothing, so an own sign-out
1101
+ view shows its `errorMessage` there too.
1102
+ The new password page offers **Update password** always: pressed too early, it
1103
+ names what is missing beside each field and sends nothing. An expired link
1104
+ offers **Send a new link**.
1071
1105
 
1072
1106
  A sign-in lands on the page its `returnTo` names. Without one, or with one
1073
1107
  refused as on another origin or as a sign-in or sign-out page, it lands on
@@ -1236,7 +1270,7 @@ Cancel and then Confirm, in its `actions` slot. A native `<dialog>` opened with
1236
1270
  `text-title-small`, `text-body-large`, `text-body-medium` and
1237
1271
  `text-body-small`.
1238
1272
 
1239
- The fields, the Sign in and Register switch, the remember-me checkbox, the
1273
+ The fields, the Sign in and Create account switch, the remember-me checkbox, the
1240
1274
  screen's card and its alerts stay Vuetify components drawn by the app's
1241
1275
  Vuetify theme, so this app still runs Vuetify; an app with no Vuetify writes
1242
1276
  its own screens on the composables above.
@@ -583,6 +583,10 @@ editable while the record is read again, and it shows its `conflicts`, the
583
583
  fields whose server value changed under the person's change, with
584
584
  `EditConflictNotice` after its fields.**
585
585
 
586
+ Its `hasUnsavedEdits` (`useAddEdit()`'s too) is true while a field differs from
587
+ what the form last took, so Save can wait for a change and leaving can ask
588
+ first; `discard()` (`useAddEdit()`'s `discardEdits()`) gives those values back.
589
+
586
590
  Why: a record is read again on a realtime event, when the window regains focus
587
591
  and on Retry; a write straight into the form replaced what the person had typed
588
592
  and not saved, without a word, and a field locked during the read dropped what
@@ -51,6 +51,10 @@ submissions remain blocked during both.
51
51
  - `applyLoaded(payload)`: gives the form a record another read loaded, as the
52
52
  account settings' one read of all its forms does, keeping unsaved edits the
53
53
  same way.
54
+ - `hasUnsavedEdits`: true while a field differs from what the form last took
55
+ from the server (a read, or a save's answer), so a form's Save can wait for a
56
+ change and leaving can ask first; `discardEdits()` gives the form those
57
+ values back and ends its conflicts.
54
58
 
55
59
  For guidance beside a custom button, set `addEditOptions.validationFeedback`
56
60
  to `false` on `useCrudAddEditScreen()` or `useCrudAddEdit()`. With `useAddEdit()`,
@@ -200,8 +200,9 @@ never "Back" or a back arrow.
200
200
  `@jskit-ai/material-web/client/material.css`. JSKIT generates the light and
201
201
  dark schemes from the seed (every role in kebab-case such as
202
202
  `surface-container-low`, plus success, warning and info with their
203
- containers) once per seed and colours, which a browser keeps for its next
204
- start, with `defaultTheme: "system"` so the person's light, dark or system preference
203
+ containers) once per seed and app colours: a browser stores them for its
204
+ next start, and a changed seed or colour generates them again. It sets
205
+ `defaultTheme: "system"` so the person's light, dark or system preference
205
206
  applies. The `md3` blueprint and JSKIT's Material 3 Vuetify defaults live in
206
207
  material-web; an app keeps no defaults file and never hand-picks a colour. The
207
208
  seed is the only hex value.
@@ -269,7 +270,8 @@ dialog, chip or FAB.
269
270
  own pieces, from `@jskit-ai/shell-web/client`. It calls `useShellAppBar()`
270
271
  once, so its pages enter the trail and their `ShellPageActions` show in its
271
272
  bar, and renders `ShellUpButton` first, then `ShellPageTitle` (the page's one
272
- `h1`) and `ShellPageActionsTarget`. A title that is also a switcher, such as a
273
+ `h1`, with the place right after it where a page's `ShellPageTitleTrailing`
274
+ shows) and `ShellPageActionsTarget`. A title that is also a switcher, such as a
273
275
  project menu, goes in `ShellPageTitle`'s default slot (given `{ title }`) as
274
276
  the menu's activator, so it stays the one `h1`. `jskit check` counts it as a
275
277
  shell layout, so its inner pages need parents.
@@ -279,14 +281,30 @@ dialog, chip or FAB.
279
281
  tooltip), and `primary`, `close` (a page's way out with no Up arrow), `to`,
280
282
  `replace`, `href` (with `download` for a file, such as a CSV export),
281
283
  `disabled`, `pending`, `loading` or `color` (`error` for a destructive one);
282
- attributes such as `target` reach its button. Bars show the single `primary`
283
- (a form's Save) and `close`; compact ones put the rest in "More actions",
284
- where `overflow` actions always are; medium bars keep those that fit beside
285
- the whole title, wider bars beside 200px of it (a longer title truncates);
286
- the rest go there, last first, then top-right items that don't fit, after
287
- wider bars hide the account's name. Put the most used first.
288
- - **After the title:** status chips go in `ShellPageTitleTrailing` on large
289
- windows, else in the content.
284
+ attributes such as `target` reach its button. Every bar shows the single
285
+ `primary` action (a form's Save) and the `close` action, which never fold.
286
+ On compact widths the bar puts the other actions in its "More actions" menu,
287
+ where `overflow` actions always are; medium bars show the actions that fit
288
+ beside the whole title, and expanded and large bars, which have room for
289
+ them, truncate the title first and show the actions that fit beside 200px of
290
+ it (or the whole title when narrower). Both put the rest in that menu, the
291
+ last first, so the menu button and the top-right items stay on screen.
292
+ Expanded and large bars hide their items' labels, such as the account's
293
+ name, before any action folds; top-right items that don't fit beside the
294
+ title follow the actions into the menu, farthest from the corner first, only
295
+ once the page actions have folded. Put a screen's most used actions first.
296
+ - **After the title:** a few small status chips that describe the page, such
297
+ as a record's status, may sit on the title's line right after it, inside
298
+ `ShellPageTitleTrailing`
299
+ (`@jskit-ai/shell-web/client/components/ShellPageTitleTrailing`). They stay
300
+ outside the `h1`, so they are not part of the page's name. The page decides
301
+ when they show there, from `useShellWindowSizeClass()` (on large windows,
302
+ `isLarge`), and shows them in a row of its own in the content otherwise. The
303
+ title truncates first; the bar folds page actions and moves its own items
304
+ into "More actions" to keep the chips whole, and clips them at its end only
305
+ when an empty title leaves them too little room. Actions stay in
306
+ `ShellPageActions`. Outside a layout that owns the bar, the chips render
307
+ where they are written.
290
308
  - **Window size classes:** compact under 600 (navigation bar), medium 600–839
291
309
  (navigation rail), expanded 840–1199 and large from 1200 (drawer), read from
292
310
  `useShellWindowSizeClass()`
@@ -301,6 +319,15 @@ dialog, chip or FAB.
301
319
  `outline-variant` bottom border. `ShellTabLinkItem` is the navigation bar's
302
320
  destination; placed in a page it draws a section tab. material.css draws an
303
321
  app's own `v-bottom-navigation` the same way, keeping its colour props.
322
+ - **Navigation bar labels:** a phone's bar gives each destination about 68px
323
+ (390px, five destinations), so its label is short. A destination whose
324
+ `label` runs wider (such as "Metal servers") gives its placement a
325
+ `shortLabel` for the bar ("Servers"); menus, the rail and the drawer keep
326
+ `label`. A bar label wider than its slot ends in an ellipsis, never cut at
327
+ both ends, but that is a fallback: `runAdaptiveShellSmoke` and
328
+ `expectWholeNavigationBarLabels`
329
+ (`@jskit-ai/shell-web/test/adaptiveShellSmoke`) fail on any bar label that is
330
+ cut or ends in an ellipsis, naming it.
304
331
 
305
332
  ## Colour
306
333
 
@@ -1167,26 +1167,6 @@ the last run's largest app server reached.**
1167
1167
  each test signing in. `jskit check` fails a webServer that runs the development server
1168
1168
  (`npm run develop`, `vite`), one webServer shared by every worker, and a
1169
1169
  config without a `globalTimeout`.
1170
- - Every test of a worker reaches its server from 127.0.0.1, as a different
1171
- person each time, so the servers `jskit browser tests` starts count no
1172
- per-address rate limit: a route's `rateLimit`, auth's sign-in limits and the
1173
- accounts hub's per-address counters. The launcher sets
1174
- `JSKIT_BROWSER_TEST_SERVER=1`, and a server with it whose `APP_ENV` is not
1175
- `test` refuses to start. Prove a limit with a Node test against an ordinary
1176
- server.
1177
- - A failed test keeps its trace with DOM snapshots. To take them, Playwright
1178
- runs a script in every frame, and Chromium logs `Blocked script execution in
1179
- 'about:srcdoc' because the document's frame is sandboxed and the
1180
- 'allow-scripts' permission is not set.` for each frame sandboxed without
1181
- `allow-scripts`, such as an email preview: the sandbox at work, not the app.
1182
- A test that fails on console errors leaves out that line, and only that line.
1183
- - JSKIT's realtime connects by WebSocket only, which `page.route()` and
1184
- `context.route()` never see, so an HTTP route that aborts `/socket.io`
1185
- changes nothing. A test that must run without live updates closes the socket
1186
- with `context.routeWebSocket(/\/socket\.io\//, (socket) => socket.close())`
1187
- before its page opens. Any HTTP route also turns the browser's cache off for
1188
- its page or context, so a guard that only watches requests listens to
1189
- `page.on("request")` instead.
1190
1170
  - A file that truly cannot run beside others, because it holds a resource of
1191
1171
  the whole machine, says why on its first line,
1192
1172
  `// jskit-test: alone - <reason>`. `jskit test` runs it after the others,
@@ -123,6 +123,13 @@ without it adds:
123
123
  - Ready when: `GET` `/api/health` returns `200`
124
124
  ```
125
125
 
126
+ Every test of a worker reaches its server from one address, 127.0.0.1, as a
127
+ different person each time, so a browser test server counts no per-address
128
+ rate limit: a route's `rateLimit`, auth's sign-in limits and the accounts hub's
129
+ per-address counters. The servers' launcher sets `JSKIT_BROWSER_TEST_SERVER=1`,
130
+ and a server with it whose `APP_ENV` is not `test` refuses to start. Prove a
131
+ limit with a Node test against an ordinary server.
132
+
126
133
  The build and the snapshot are reused while their sources are unchanged, so a
127
134
  focused check never rebuilds them. After a change to the browser-test setup,
128
135
  run the suite twice: the second run says `Frontend build unchanged, reused` and
@@ -139,3 +146,19 @@ directly:
139
146
  ```bash
140
147
  npx playwright test <test-file> -g "<changed behavior>"
141
148
  ```
149
+
150
+ A test that must run without live updates closes the realtime socket with
151
+ `context.routeWebSocket(/\/socket\.io\//, (socket) => socket.close())` before
152
+ its page opens. JSKIT's realtime connects by WebSocket only, which
153
+ `page.route()` and `context.route()` never see, so an HTTP route that aborts
154
+ `/socket.io` changes nothing. Any HTTP route also turns the browser's cache off
155
+ for its page or context, so a guard that only watches requests listens to
156
+ `page.on("request")` instead.
157
+
158
+ `browserTestConfig()` keeps a failed test's trace with DOM snapshots. To take
159
+ them, Playwright runs a script in every frame, and Chromium logs `Blocked script
160
+ execution in 'about:srcdoc' because the document's frame is sandboxed and the
161
+ 'allow-scripts' permission is not set.` for each frame sandboxed without
162
+ `allow-scripts`, such as an email preview. That is the sandbox doing its job,
163
+ not the app failing: a test that fails on console errors leaves out that line,
164
+ and only that line.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/agent-docs",
3
- "version": "0.1.386",
3
+ "version": "0.1.388",
4
4
  "description": "Distributed JSKIT agent references, prompts, guides, and generated reference maps.",
5
5
  "type": "module",
6
6
  "files": [
@@ -44,6 +44,11 @@ suite does: then follow them. Each finding links the guide section that
44
44
  explains it: fix it in the code, and excuse one only with the guide's
45
45
  `readable-check: allow` comment and reason prefix.
46
46
 
47
+ To fix a slow or failing suite, first run it whole, keeping each file's and
48
+ test's time, and read that run, as the test pass guide above says, unless this
49
+ project's own rules say when the whole suite runs: then follow them. A check
50
+ that passed on the exact tree is never run again.
51
+
47
52
  Where the host provides a managed browser runner, such as Vibe64's, every
48
53
  Playwright suite runs through it from the first run, on a declared test target:
49
54
  give the runner the package script (on Vibe64,
@@ -35,7 +35,7 @@
35
35
  "@local/main": "0.1.0",
36
36
  "@fastify/static": "^10.1.3",
37
37
  "@jskit-ai/kernel": "0.2.38",
38
- "@jskit-ai/material-web": "0.1.17",
38
+ "@jskit-ai/material-web": "0.1.19",
39
39
  "@tanstack/vue-query": "^5.101.0",
40
40
  "fastify": "^5.12.7",
41
41
  "pino": "^10.3.1",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@jskit-ai/config-eslint": "0.1.256",
53
- "@jskit-ai/jskit-catalog": "0.2.138",
53
+ "@jskit-ai/jskit-catalog": "0.2.140",
54
54
  "@playwright/test": "1.61.1",
55
55
  "@vitejs/plugin-vue": "^6.0.7",
56
56
  "eslint": "^10.8.0",
@@ -44,6 +44,11 @@ suite does: then follow them. Each finding links the guide section that
44
44
  explains it: fix it in the code, and excuse one only with the guide's
45
45
  `readable-check: allow` comment and reason prefix.
46
46
 
47
+ To fix a slow or failing suite, first run it whole, keeping each file's and
48
+ test's time, and read that run, as the test pass guide above says, unless this
49
+ project's own rules say when the whole suite runs: then follow them. A check
50
+ that passed on the exact tree is never run again.
51
+
47
52
  Where the host provides a managed browser runner, such as Vibe64's, every
48
53
  Playwright suite runs through it from the first run, on a declared test target:
49
54
  give the runner the package script (on Vibe64,
@@ -35,7 +35,7 @@
35
35
  "@local/main": "0.1.0",
36
36
  "@fastify/static": "^10.1.3",
37
37
  "@jskit-ai/kernel": "0.2.38",
38
- "@jskit-ai/material-web": "0.1.17",
38
+ "@jskit-ai/material-web": "0.1.19",
39
39
  "@tanstack/vue-query": "^5.101.0",
40
40
  "fastify": "^5.12.7",
41
41
  "pino": "^10.3.1",
@@ -45,13 +45,13 @@
45
45
  "vue-router": "^5.3.1",
46
46
  "vuetify": "^4.3.0",
47
47
  "@jskit-ai/http-runtime": "0.2.39",
48
- "@jskit-ai/shell-web": "0.2.67",
48
+ "@jskit-ai/shell-web": "0.2.69",
49
49
  "@fastify/fast-json-stringify-compiler": "^5.1.0",
50
50
  "@vue/devtools-api": "^8.2.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@jskit-ai/config-eslint": "0.1.256",
54
- "@jskit-ai/jskit-catalog": "0.2.138",
54
+ "@jskit-ai/jskit-catalog": "0.2.140",
55
55
  "@playwright/test": "1.61.1",
56
56
  "@vitejs/plugin-vue": "^6.0.7",
57
57
  "eslint": "^10.8.0",