@jskit-ai/agent-docs 0.1.351 → 0.1.352
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/guide/agent/app-extras/assistant-conversation.md +63 -5
- package/guide/agent/app-extras/assistant-voice.md +38 -21
- package/guide/agent/app-setup/database-layer.md +26 -0
- package/guide/agent/app-setup/upgrading-jskit.md +15 -3
- package/guide/agent/framework/data-access.md +19 -5
- package/guide/agent/framework/material-3.md +3 -3
- package/guide/agent/framework/ui-operations.md +8 -5
- package/package.json +1 -1
- package/patterns/minimal-foundation/example/AGENTS.md +4 -0
- package/patterns/minimal-foundation/example/package.json +3 -3
- package/patterns/shell-foundation/example/AGENTS.md +4 -0
- package/patterns/shell-foundation/example/package.json +4 -4
- package/reference/autogen/PATTERN_INDEX.md +35 -35
- package/reference/autogen/packages/assistant-core.md +12 -3
- package/reference/autogen/packages/assistant-voice-sherpa.md +34 -5
- package/reference/autogen/packages/assistant-voice.md +61 -16
- package/reference/autogen/packages/database-runtime.md +25 -1
- package/reference/autogen/packages/http-runtime.md +2 -0
- package/reference/autogen/packages/http-web.md +6 -5
- package/reference/autogen/packages/material-web.md +10 -4
- package/reference/autogen/packages/resource-runtime.md +1 -0
- package/reference/autogen/packages/shell-web.md +1 -1
- package/reference/autogen/tooling/jskit-catalog.md +6 -0
- package/skills/jskit/SKILL.md +4 -1
- package/skills/jskit/references/data-access.md +19 -5
- package/skills/jskit/references/database-layer.md +26 -0
- package/skills/jskit/references/heuristics/INDEX.md +1 -1
- package/skills/jskit/references/heuristics/client-requests.md +3 -2
- package/skills/jskit/references/heuristics/ui-testing.md +15 -15
- package/skills/jskit/references/material-3.md +3 -3
- package/skills/jskit/references/pattern-index.md +35 -35
- package/skills/jskit/references/patterns/app/minimal-foundation/example/AGENTS.md +4 -0
- package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +3 -3
- package/skills/jskit/references/patterns/app/shell-foundation/example/AGENTS.md +4 -0
- package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +4 -4
- package/skills/jskit/references/patterns/auth/accounts-hub/example/package.json +3 -3
- package/skills/jskit/references/patterns/auth/oidc-sign-in/example/package.json +2 -2
- package/skills/jskit/references/patterns/connectors/calendar-cli/example/package.json +4 -4
- package/skills/jskit/references/patterns/crud/crud-feature-package/example/packages/books/package.json +1 -1
- package/skills/jskit/references/patterns/crud/crud-screen-set/example/books/BookEditPage.vue +0 -1
- package/skills/jskit/references/patterns/crud/crud-screen-set/example/books/BookListPage.vue +0 -1
- package/skills/jskit/references/patterns/crud/crud-screen-set/example/books/BookViewPage.vue +0 -1
- package/skills/jskit/references/patterns/database/mysql-application/PATTERN.md +4 -2
- package/skills/jskit/references/patterns/database/mysql-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/database/postgres-application/PATTERN.md +3 -1
- package/skills/jskit/references/patterns/database/postgres-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/realtime/realtime-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/shell/application-shell/PATTERN.md +5 -3
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users/package.json +2 -2
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users-workspace/package.json +4 -4
- package/skills/jskit/references/ui-operations.md +8 -5
|
@@ -221,7 +221,7 @@ Local functions
|
|
|
221
221
|
|
|
222
222
|
### `src/client/composables/records/useAddEdit.js`
|
|
223
223
|
Exports
|
|
224
|
-
- `useAddEdit({ ownershipFilter = ROUTE_VISIBILITY_WORKSPACE, surfaceId = "", access = "auto", resource = null, apiSuffix = "", queryKeyFactory, viewPermissions = [], savePermissions = [], readMethod = "GET", readEnabled = true, writeMethod = "PATCH", client, transport, requestRecovery, requestRecoveryLabel
|
|
224
|
+
- `useAddEdit({ ownershipFilter = ROUTE_VISIBILITY_WORKSPACE, surfaceId = "", access = "auto", resource = null, apiSuffix = "", queryKeyFactory, viewPermissions = [], savePermissions = [], readMethod = "GET", readEnabled = true, writeMethod = "PATCH", client, transport, requestRecovery, requestRecoveryLabel, placementSource = "http-web.add-edit", fallbackLoadError = t("jskit.http.resource.loadFailed"), fallbackSaveError = "", fieldErrorKeys, clearOnRouteChange = true, model, input, mapLoadedToModel, buildRawPayload, buildSavePayload, onSaveSuccess, validationFeedback = true, requestQueryParams, recordIdParam = "recordId", routeParams = null, routeRecordId, apiUrlTemplate = "", viewUrlTemplate = "", listUrlTemplate = "", saveRecordIdSelector, messages = {}, realtime })`
|
|
225
225
|
|
|
226
226
|
### `src/client/composables/records/useCrudAddEdit.js`
|
|
227
227
|
Exports
|
|
@@ -244,11 +244,11 @@ Exports
|
|
|
244
244
|
|
|
245
245
|
### `src/client/composables/records/useList.js`
|
|
246
246
|
Exports
|
|
247
|
-
- `useList({ ownershipFilter = ROUTE_VISIBILITY_WORKSPACE, surfaceId = "", access = "auto", apiSuffix = "", queryKeyFactory, viewPermissions = [], readEnabled = true, placementSource = "http-web.list", fallbackLoadError = t("jskit.http.list.loadFailed"), initialPageParam, getNextPageParam, selectItems, client, transport, requestOptions, queryOptions, requestRecovery, requestRecoveryLabel
|
|
247
|
+
- `useList({ ownershipFilter = ROUTE_VISIBILITY_WORKSPACE, surfaceId = "", access = "auto", apiSuffix = "", queryKeyFactory, viewPermissions = [], readEnabled = true, placementSource = "http-web.list", fallbackLoadError = t("jskit.http.list.loadFailed"), initialPageParam, getNextPageParam, selectItems, client, transport, requestOptions, queryOptions, requestRecovery, requestRecoveryLabel, realtime, recordIdParam = "recordId", recordIdSelector, viewUrlTemplate = "", editUrlTemplate = "", search = null, queryParams = null, routeQueryValueResolvers = null, requestQueryParams, requestFieldsets, syncToRoute = false })`
|
|
248
248
|
|
|
249
249
|
### `src/client/composables/records/useView.js`
|
|
250
250
|
Exports
|
|
251
|
-
- `useView({ resource, ownershipFilter = ROUTE_VISIBILITY_WORKSPACE, surfaceId = "", access = "auto", apiSuffix = "", queryKeyFactory, viewPermissions = [], readMethod = "GET", readEnabled = true, client, transport, requestRecovery, requestRecoveryLabel
|
|
251
|
+
- `useView({ resource, ownershipFilter = ROUTE_VISIBILITY_WORKSPACE, surfaceId = "", access = "auto", apiSuffix = "", queryKeyFactory, viewPermissions = [], readMethod = "GET", readEnabled = true, client, transport, requestRecovery, requestRecoveryLabel, placementSource = "http-web.view", fallbackLoadError = t("jskit.http.resource.loadFailed"), notFoundStatuses = [404], notFoundMessage = t("jskit.http.crud.recordNotFound"), model, mapLoadedToModel, requestQueryParams, requestFieldsets, recordIdParam = "recordId", routeParams = null, routeRecordId, apiUrlTemplate = "", listUrlTemplate = "", editUrlTemplate = "", includeRecordIdInQueryKey = false, realtime })`
|
|
252
252
|
|
|
253
253
|
### `src/client/composables/runtime/addEditUiRuntime.js`
|
|
254
254
|
Exports
|
|
@@ -394,6 +394,7 @@ Exports
|
|
|
394
394
|
- `mergeQueryMeta(queryOptions = null, meta = {})`
|
|
395
395
|
- `mergeRequestRecoveryQueryMeta(queryOptions = null, requestRecovery = null, defaults = {})`
|
|
396
396
|
- `resolveLoadErrorStatus(error)`
|
|
397
|
+
- `resolveScreenReadRequestRecovery(requestRecovery = null, { caller, requestRecoveryLabel } = {})`
|
|
397
398
|
Local functions
|
|
398
399
|
- `normalizeRequestRecoveryInput(requestRecovery = null)`
|
|
399
400
|
- `normalizeRequestRecoveryValue(name, value)`
|
|
@@ -500,7 +501,7 @@ Local functions
|
|
|
500
501
|
### `src/client/composables/useCrudListScreen.js`
|
|
501
502
|
Exports
|
|
502
503
|
- `__testables`
|
|
503
|
-
- `useCrudListScreen({ client, resource, resourceNamespace = "resource", apiSuffix = "", recordIdParam = "recordId", recordIdSelector, titleFallbackFieldKey = "", viewUrlTemplate = "", editUrlTemplate = "", newUrlTemplate = "", recordChangedEvents = [], listFilters = NO_LIST_FILTERS, listBulkActions, listRowActions = NO_LIST_ACTIONS, syntheticRows = null, routeQueryBlacklist = Object.freeze(["include", "cursor", "limit"]), requestQueryParams, requestFieldsets, readEnabled = true, requestRecoveryLabel
|
|
504
|
+
- `useCrudListScreen({ client, resource, resourceNamespace = "resource", apiSuffix = "", recordIdParam = "recordId", recordIdSelector, titleFallbackFieldKey = "", viewUrlTemplate = "", editUrlTemplate = "", newUrlTemplate = "", recordChangedEvents = [], listFilters = NO_LIST_FILTERS, listBulkActions, listRowActions = NO_LIST_ACTIONS, syntheticRows = null, routeQueryBlacklist = Object.freeze(["include", "cursor", "limit"]), requestQueryParams, requestFieldsets, readEnabled = true, requestRecoveryLabel, fallbackLoadError = t("jskit.http.crud.list.loadFailed") })`
|
|
504
505
|
Local functions
|
|
505
506
|
- `buildCrudListActionContext(records, client)`
|
|
506
507
|
- `formatCrudListCardValue(value)`
|
|
@@ -513,7 +514,7 @@ Local functions
|
|
|
513
514
|
|
|
514
515
|
### `src/client/composables/useCrudViewScreen.js`
|
|
515
516
|
Exports
|
|
516
|
-
- `useCrudViewScreen({ resource, resourceNamespace = "resource", apiUrlTemplate = "", recordIdParam = "recordId", titleFallbackFieldKey = "", listUrlTemplate = "", editUrlTemplate = "", recordChangedEvent = "", requestQueryParams, requestFieldsets, readEnabled = true, queryKeyFactory = null, requestRecoveryLabel
|
|
517
|
+
- `useCrudViewScreen({ resource, resourceNamespace = "resource", apiUrlTemplate = "", recordIdParam = "recordId", titleFallbackFieldKey = "", listUrlTemplate = "", editUrlTemplate = "", recordChangedEvent = "", requestQueryParams, requestFieldsets, readEnabled = true, queryKeyFactory = null, requestRecoveryLabel, fallbackLoadError = t("jskit.http.crud.view.loadFailed"), notFoundMessage = t("jskit.http.crud.recordNotFound") })`
|
|
517
518
|
|
|
518
519
|
### `src/client/composables/usePagedCollection.js`
|
|
519
520
|
Exports
|
|
@@ -21,10 +21,16 @@ Local functions
|
|
|
21
21
|
- `kebabCase(name)`
|
|
22
22
|
- `channels(argb)`
|
|
23
23
|
- `customColorRoleNames(name)`
|
|
24
|
-
- `addCustomColorRoles(
|
|
25
|
-
- `
|
|
26
|
-
- `
|
|
27
|
-
- `
|
|
24
|
+
- `addCustomColorRoles(schemes, seedArgb, name, argb, blend = true)`
|
|
25
|
+
- `materialRoles(seedArgb, dark)`
|
|
26
|
+
- `computeSchemeColors(seedArgb, appColors)`
|
|
27
|
+
- `storedColorsAreUsable(colors)`
|
|
28
|
+
- `browserStorage()`
|
|
29
|
+
- `storedSchemeColors(storage)`
|
|
30
|
+
- `remember(input, colors)`
|
|
31
|
+
- `schemeColors(input, seedArgb, appColors)`
|
|
32
|
+
- `vuetifyTheme(schemeColorsByRole, dark)`
|
|
33
|
+
- `normalizeAppColors(colors)`
|
|
28
34
|
|
|
29
35
|
### `src/client/defaults.js`
|
|
30
36
|
Exports
|
|
@@ -235,6 +235,7 @@ Local functions
|
|
|
235
235
|
- `workspaceScopeOwnerId(visibilityContext)`
|
|
236
236
|
- `isJsonRestResourceMissingError(error = null)`
|
|
237
237
|
- `isJsonRestSparseFieldError(error = null)`
|
|
238
|
+
- `jsonRestApiLogger(logger)`
|
|
238
239
|
|
|
239
240
|
### `src/server/resourceRuntime.js`
|
|
240
241
|
Exports
|
|
@@ -292,7 +292,7 @@ Exports
|
|
|
292
292
|
### `src/client/error/presentation.js`
|
|
293
293
|
Exports
|
|
294
294
|
- `actionsFor(entry)`
|
|
295
|
-
- `resolveBannerPlacement(
|
|
295
|
+
- `resolveBannerPlacement(top = 0)`
|
|
296
296
|
- `resolveSeverityColor(severity = "error")`
|
|
297
297
|
- `resolveSeverityIcon(severity = "error")`
|
|
298
298
|
- `resolveTimeout(entry)`
|
|
@@ -27,6 +27,10 @@ Local functions
|
|
|
27
27
|
- `lockBuild(appRoot)`
|
|
28
28
|
- `isCurrent(appRoot, inputs)`
|
|
29
29
|
|
|
30
|
+
### `scripts/browser-test-server.mjs`
|
|
31
|
+
Exports
|
|
32
|
+
- `serveBrowserTestTarget(args = [], environment = process.env, appRoot = process.cwd())`
|
|
33
|
+
|
|
30
34
|
### `scripts/browser-test-servers.mjs`
|
|
31
35
|
Exports
|
|
32
36
|
- None
|
|
@@ -39,7 +43,9 @@ Local functions
|
|
|
39
43
|
- `refuseBusyPorts(host, ports)`
|
|
40
44
|
- `waitUntilReady(url, server, name)`
|
|
41
45
|
- `running(server)`
|
|
46
|
+
- `delay(ms)`
|
|
42
47
|
- `stopServers()`
|
|
48
|
+
- `dropPreparedCopies(exited)`
|
|
43
49
|
- `stopAndExit(code)`
|
|
44
50
|
|
|
45
51
|
### `scripts/browser-test-times.mjs`
|
package/skills/jskit/SKILL.md
CHANGED
|
@@ -135,7 +135,10 @@ severity and file.
|
|
|
135
135
|
|
|
136
136
|
Run focused tests for a slice and the application's `npm run verify` for a
|
|
137
137
|
whole changeset. Use the current-state owners in application operations and
|
|
138
|
-
Playwright for affected UI.
|
|
138
|
+
Playwright for affected UI. Where the host provides a managed browser runner,
|
|
139
|
+
every Playwright suite runs through it from the first run, never through
|
|
140
|
+
`npx playwright test`, `playwright test` or a package script such as
|
|
141
|
+
`npm run test:e2e`. There is no current JSKIT Doctor command; ignore
|
|
139
142
|
old CLI authoring-history diagnoses. Never expose environment values.
|
|
140
143
|
|
|
141
144
|
Tests and requests take the time their work needs, no more: count a list's or
|
|
@@ -1978,11 +1978,25 @@ nothing never passes: "The path sent no statement at any size" means pass
|
|
|
1978
1978
|
|
|
1979
1979
|
A package's own data test that creates its tables in the test takes its Knex
|
|
1980
1980
|
from `createPackageTestKnex(t, { environment: process.env })` (from
|
|
1981
|
-
`@jskit-ai/resource-runtime/test`)
|
|
1982
|
-
`
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1981
|
+
`@jskit-ai/resource-runtime/test`), on the run's `DB_CLIENT`: an in-memory
|
|
1982
|
+
SQLite database when it is neither `pg` nor `mysql2`; on `pg` a schema of the
|
|
1983
|
+
test's own in `TEST_DB_NAME`; on `mysql2` one of `TEST_DB_NAME`'s 26 lettered
|
|
1984
|
+
copies, `<TEST_DB_NAME>_a` to `_z`, the first no other test holds, recreated
|
|
1985
|
+
empty. A test holds its copy with a lock on the database server named after
|
|
1986
|
+
it, so tests at once, in this run or another tree's, never share one, and a
|
|
1987
|
+
test whose process dies gives its copy up; in a file `jskit test --databases`
|
|
1988
|
+
gave a numbered copy, the lettered copies are the run's designated database's.
|
|
1989
|
+
Either is dropped after the test, so files run at once, on MySQL and MariaDB as
|
|
1990
|
+
on SQLite, and an application on MySQL or MariaDB needs no SQLite driver. There
|
|
1991
|
+
the database user needs all privileges on the 26 lettered copies, by name or at
|
|
1992
|
+
once (`` `<TEST_DB_NAME>\__`.* ``), beside the numbered copies a
|
|
1993
|
+
`jskit test --databases` run makes; with all 26 held a test waits up to a
|
|
1994
|
+
minute for one, then fails, as a refused copy does, naming the grant. An
|
|
1995
|
+
application's own test fixture that uses these copies too claims one the same
|
|
1996
|
+
way, `GET_LOCK('<copy>', 0)` on a session it keeps while it uses the copy, so
|
|
1997
|
+
the two never share one. The same file then proves its locks, many-row writes and
|
|
1998
|
+
upserts on PostgreSQL, MySQL and MariaDB too; compare counts with `Number()`
|
|
1999
|
+
(PostgreSQL answers them as strings) and ids with `String()`.
|
|
1986
2000
|
|
|
1987
2001
|
`createTestResourceRuntime({ knex })` gives a test the resource runtime its
|
|
1988
2002
|
features own their tables through: `runtime.own(featureId, [resource])`
|
|
@@ -383,6 +383,14 @@ the application's `knexfile.js`:
|
|
|
383
383
|
Every file starts from the snapshot, rows included: a copy an earlier file of
|
|
384
384
|
the run used is restored before the next file takes it, so no file sees what
|
|
385
385
|
another wrote.
|
|
386
|
+
- When the run ends, whether its test files passed, failed or were stopped
|
|
387
|
+
(Ctrl-C, `SIGTERM`), or its foreign key check failed before the first file,
|
|
388
|
+
it drops the numbered copies it made and says so
|
|
389
|
+
(`jskit test: dropped the run's 3 numbered test database(s).`); the next run
|
|
390
|
+
makes them afresh from the snapshot. `TEST_DB_NAME` and the snapshot stay, so
|
|
391
|
+
a later run in the same tree restores them instead of replaying the
|
|
392
|
+
migrations. Only the copies the run made are dropped, and none a session is
|
|
393
|
+
connected to, such as another run's: the run names each copy it kept and why.
|
|
386
394
|
- The snapshot holds the schema as the engine reports it and the rows the
|
|
387
395
|
migrations wrote, including the migration ledger. On MySQL and MariaDB it is
|
|
388
396
|
each table's `SHOW CREATE TABLE` and rows, in
|
|
@@ -446,6 +454,13 @@ the app's `knexfile.js`) reaches that worker's copy. The copies (`<name>`, `<nam
|
|
|
446
454
|
transaction each, so stale rows never survive a run and the migrations are
|
|
447
455
|
replayed only when one changes. It refuses the application's database,
|
|
448
456
|
`STAGING_DB_NAME`, `PRODUCTION_DB_NAME`, `TEST_DB_NAME` and their copies.
|
|
457
|
+
When the run stops (Playwright's `SIGTERM`, Ctrl-C, or a start that failed), the
|
|
458
|
+
launcher stops its servers, whose sessions keep their copies, then drops the
|
|
459
|
+
numbered copies the `prepare` module made and says so
|
|
460
|
+
(`[browser-tests] dropped the run's 3 numbered test database(s).`), all within
|
|
461
|
+
the 10 s Playwright gives its webServer; `BROWSER_TEST_DB_NAME` and the snapshot
|
|
462
|
+
stay. `prepareTestDatabases()` itself drops the copies it made when it throws,
|
|
463
|
+
for a Node or a browser run alike.
|
|
449
464
|
|
|
450
465
|
Give disposable integration and migration tests their own `TEST_DB_NAME`;
|
|
451
466
|
the two names, and their copies, must differ, and the application account
|
|
@@ -462,3 +477,14 @@ host serves it, starts no second server, and restores normal Preview after the
|
|
|
462
477
|
batch. Database isolation alone does not
|
|
463
478
|
disable email, payments or other external effects: configure those test controls
|
|
464
479
|
and verify the actual server identity before destructive requests.
|
|
480
|
+
|
|
481
|
+
A host's browser test target, such as a Vibe64 Outputs target with
|
|
482
|
+
``- Data: `test` ``, runs `jskit browser-test-server <host> <port>`: one worker's
|
|
483
|
+
server of the app's own `browserTestConfig()`, on the production build, with the
|
|
484
|
+
database its `prepare` module gives that worker (`BROWSER_TEST_DB_NAME` itself in
|
|
485
|
+
the database patterns), its test-only `env` and `APP_ENV=test`, on the host's
|
|
486
|
+
address. The JSKIT Stack piece declares that target as `test-app`, so
|
|
487
|
+
`vibe64-helper playwright --target test-app npm-run test:e2e` runs the app's
|
|
488
|
+
suite against its own test database from the first commit. The target signs
|
|
489
|
+
nothing in; the host supplies the suite's login state through the target's
|
|
490
|
+
Preview identity, the same command as the normal target's.
|
|
@@ -32,7 +32,7 @@ How to use it:
|
|
|
32
32
|
- [live-actions.md](./live-actions.md)
|
|
33
33
|
- ajax, fetch, API call, request, endpoint, HTTP client, `useCrudListScreen()`, `useCrudViewScreen()`, `useCrudAddEditScreen()`, `useList()`, `useView()`, `useAddEdit()`, `useEndpointResource()`, `httpWebClient`
|
|
34
34
|
- [client-requests.md](./client-requests.md)
|
|
35
|
-
- playwright, browser test, e2e, ui verification, baseline test, authenticated ui test, test auth, dev login as, dev auth bypass, `getByLabel`, strict mode violation
|
|
35
|
+
- playwright, browser test, e2e, ui verification, baseline test, authenticated ui test, test auth, dev login as, dev auth bypass, `getByLabel`, strict mode violation, managed browser runner, `npx playwright test`, `playwright test`, `npm run test:e2e`
|
|
36
36
|
- [ui-testing.md](./ui-testing.md)
|
|
37
37
|
- UI contract, design contract, navigation roles, Up arrow, Back button, declared parent, jskit.parent, in-app trail, history.back, hand-built links, jskit check, Deslop, density, placeholder copy, card shells, shared CRUD screens, row actions, synthetic rows, detail slots
|
|
38
38
|
- [ui-contract.md](./ui-contract.md)
|
|
@@ -96,11 +96,12 @@ Error presentation rules:
|
|
|
96
96
|
|
|
97
97
|
- Resource load failures should stay local to the screen with the runtime's `loadError` state and a retry action when trying again can help. The load notices of `useList()`, `useView()` and `useAddEdit()`, and the Retry buttons of `CrudListScreen`, `CrudViewScreen` and `CrudAddEditScreen`, offer Retry only after a network failure (no status), 408, 429 or a 5xx; a refusal (401, 403, 404, 422 and other 4xx) gets none. The three runtimes expose the status as `errorStatus` (0 for a network failure), so a custom screen can tell a refusal from a network failure and hide its own Retry the same way. After a refusal a screen says why rather than suggesting the connection: the runtimes' `loadRefusalMessage` is the server's own message when the error carries one, otherwise a neutral text for the kind of refusal (401, 403, 404, another 4xx), and empty when trying again can help; the three CRUD screens show it.
|
|
98
98
|
- Do not force global banners for ordinary list/view/add-edit load failures; the shell error policy treats `resource-load` as `silent` by default.
|
|
99
|
-
- Transport/connectivity failures are different from ordinary resource-load errors. `shell-web` observes the app QueryClient and reports active safe-read query failures such as `Network request failed.` or `Failed to fetch` through request recovery with a `Retry` action that calls `query.refetch()`.
|
|
99
|
+
- Transport/connectivity failures are different from ordinary resource-load errors. `shell-web` observes the app QueryClient and reports active safe-read query failures such as `Network request failed.` or `Failed to fetch` through request recovery: a banner below the app bar (it takes its own room, so it never covers the page) with a `Retry` action that calls `query.refetch()`.
|
|
100
|
+
- A failure shows once. `useList()`, `useView()` and `useAddEdit()`, and the CRUD runtimes and screens built on them, show their read's failure where it happened (`loadError`, with Retry when trying again can help) and report it once as `resource-load`, so request recovery leaves their queries out: a network failure of a list shows the list's own error and Retry, not a banner too. A read whose screen shows no load error (a lookup's options, a section that hides its read) passes `requestRecovery: true` (or a label) to get the banner; JSKIT's lookup fields and filters already do. A hand-written TanStack Query read whose component shows its own load error with Retry (an app's list-state component) sets `meta: { jskit: { requestRecovery: false } }`.
|
|
100
101
|
- User-visible reads should be TanStack Query-backed through `useEndpointResource()`, `useList()`, `useView()`, `useAddEdit()`, or CRUD screen composables. Do not load panel data with raw `fetch(...)` plus manual request recovery reporting.
|
|
101
102
|
- Automatic shell request recovery is for `GET` and `HEAD` read refetches. Do not use it to replay `POST`, `PATCH`, `PUT`, or `DELETE`; saving and command screens own their mutation state and feedback.
|
|
102
103
|
- JSKIT read composables mark their Query entries with `jskit.requestRecoveryMethod`. For hand-written TanStack Query reads outside those composables, set `meta.jskit.requestRecoveryMethod` to `GET` or `HEAD`.
|
|
103
|
-
- Use `requestRecoveryLabel` on JSKIT read composables, or query meta `jskit.requestRecoveryLabel`, when the recovery banner needs a better label. Use `jskit.requestRecovery = false`
|
|
104
|
+
- Use `requestRecoveryLabel` on JSKIT read composables, or query meta `jskit.requestRecoveryLabel`, when the recovery banner needs a better label. On `useList()`, `useView()` and `useAddEdit()`, and the CRUD runtimes and screens built on them, it goes with `requestRecovery: true`: given alone it is refused (a `TypeError` naming the fix), since their screen shows the failure as `loadError` and the banner stays out. Use `jskit.requestRecovery = false` when a query owns its full connectivity recovery UI.
|
|
104
105
|
- Use `useUiFeedback()` or `useCommand()` for user-triggered action feedback. Those flows report `action-feedback`, and the app-owned shell error policy decides the channel. An action that did its work with a catch the person must act on (an invitation created but not emailed) reports through `useUiFeedback().warning()`, not `success()`.
|
|
105
106
|
- Use explicit shell error intents only for exceptional app-level cases: `app-recoverable` for recoverable shell/runtime failures and `blocking` for failures that require user attention.
|
|
106
107
|
|
|
@@ -11,6 +11,7 @@ Use when:
|
|
|
11
11
|
|
|
12
12
|
Rules:
|
|
13
13
|
|
|
14
|
+
- Where the host provides a managed browser runner, every Playwright suite runs through it from the first run, never through `npx playwright test`, `playwright test` or a package script such as `npm run test:e2e`. Do not try a direct start first to see whether it is allowed, and do not install a browser. See Run verification below.
|
|
14
15
|
- Any chunk that adds or changes user-facing UI proves the changed behavior with an automated test before the chunk is done, at the cheapest level that can: a component's content, states and conditional display in a client component test (Vitest); only what needs a real browser (navigation, a flow across screens, layout at the standard widths, focus, the real sign-in) in Playwright.
|
|
15
16
|
- Put a new browser check in the existing spec that already reaches that screen with the data it needs. Add a new spec only for a new flow, using the app's shared server, sign-in and fixture setup. A browser test that pays its own server start, sign-in or seeding to check one card, label or state is not acceptable: every run pays for it for as long as it exists. Move that check to a component test or an existing spec, and report the spec's time and the suite's time before and after.
|
|
16
17
|
- Never wait out the app's own delays (request retries, debounce, polling) in real time, and never change the scenario to skip them: install Playwright's `page.clock` before the page loads and advance it with `page.clock.runFor(...)`, or use Vitest's fake timers in a component test. Change the scenario only when another test already proves the skipped path.
|
|
@@ -37,7 +38,6 @@ Rules:
|
|
|
37
38
|
- A managed runner supplies `PLAYWRIGHT_BASE_URL`. When it is set, JSKIT does not start another app server.
|
|
38
39
|
- Otherwise the config starts the app on `PLAYWRIGHT_PORT`, 4173 by default. A runner that shares a machine between runs sets a free port for each run; with one fixed port, a second run would wait for it or reuse another run's server.
|
|
39
40
|
- A managed runner may supply an authenticated context through `PLAYWRIGHT_STORAGE_STATE`. Treat that file as a temporary secret: do not commit it, print it, or retain it after the run.
|
|
40
|
-
- Do not install a browser when the environment provides a managed browser runner.
|
|
41
41
|
- Shared CRUD lists retain both card and table markup and hide the inactive
|
|
42
42
|
layout with CSS. Select visible record text with
|
|
43
43
|
`page.getByText(title, { exact: true }).filter({ visible: true })`; asserting on
|
|
@@ -150,13 +150,7 @@ The route only selects an existing user. Seed a stable user or fixture before th
|
|
|
150
150
|
|
|
151
151
|
## Managed-host authentication
|
|
152
152
|
|
|
153
|
-
A managed preview must not expose `AUTH_DEV_BYPASS_SECRET` to project code or forward an ordinary browser request to the private login exchange. The host performs its trusted identity exchange outside the application browser context
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
PLAYWRIGHT_BASE_URL=https://managed-preview.example.test \
|
|
157
|
-
PLAYWRIGHT_STORAGE_STATE=/secure/temp/playwright-state.json \
|
|
158
|
-
playwright test tests/e2e/contacts.spec.ts
|
|
159
|
-
```
|
|
153
|
+
A managed preview must not expose `AUTH_DEV_BYPASS_SECRET` to project code or forward an ordinary browser request to the private login exchange. The host performs its trusted identity exchange outside the application browser context and writes a temporary Playwright storage-state file. Its managed runner then starts Playwright itself, with `PLAYWRIGHT_BASE_URL` set to the target it serves and `PLAYWRIGHT_STORAGE_STATE` set to that file. Run the suite through the runner; never set these variables and start Playwright yourself.
|
|
160
154
|
|
|
161
155
|
The app-owned config applies that state to Playwright contexts and omits its local `webServer`. Tests then navigate with relative paths and begin with the runner-provided identity already authenticated.
|
|
162
156
|
|
|
@@ -164,17 +158,23 @@ Do not call `loginAsExistingUser()` against a managed preview. It is deliberatel
|
|
|
164
158
|
|
|
165
159
|
## Run verification
|
|
166
160
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
test
|
|
161
|
+
Where the host provides a managed browser runner, every Playwright suite runs
|
|
162
|
+
through it from the first run, never through `npx playwright test`,
|
|
163
|
+
`playwright test` or a package script such as `npm run test:e2e`. The host's
|
|
164
|
+
own instructions name its command. Give it the declared test target and the
|
|
165
|
+
file and case selection; when the suite runs through a package script, give the
|
|
166
|
+
runner that script instead of running it.
|
|
167
|
+
|
|
168
|
+
Only a machine with no managed browser runner runs Playwright directly, for
|
|
169
|
+
example:
|
|
170
170
|
|
|
171
171
|
```bash
|
|
172
172
|
npx playwright test tests/e2e/contacts.spec.ts -g filters --reporter=dot > /tmp/contacts-test.log 2>&1
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
175
|
+
Either way, keep the complete output in a local artifact and preserve its exit
|
|
176
|
+
status; a pipe through `tail` must not turn a failed test into a successful
|
|
177
|
+
command.
|
|
178
178
|
|
|
179
179
|
Read a compact summary first: exit status, passed/failed/skipped counts,
|
|
180
180
|
duration and artifact paths. On failure, extract the affected case and its
|
|
@@ -196,5 +196,5 @@ Do not mark the chunk done if:
|
|
|
196
196
|
- the feature changed user-facing UI but no test at the right level proves it
|
|
197
197
|
- the test skipped the changed behavior itself
|
|
198
198
|
- a new browser test pays its own setup to check what a component test or an existing spec could
|
|
199
|
-
- a managed environment was bypassed by installing another browser
|
|
199
|
+
- a managed environment was bypassed by installing another browser or by starting Playwright directly
|
|
200
200
|
- an authenticated flow was left untested without clearly reporting the missing session-bootstrap seam
|
|
@@ -193,10 +193,10 @@ never "Back" or a back arrow.
|
|
|
193
193
|
`createVuetify(createMaterialVuetifyOptions(theme))` with
|
|
194
194
|
`createMaterialVuetifyOptions` from `@jskit-ai/material-web/client`, importing
|
|
195
195
|
`@jskit-ai/material-web/client/material.css`. JSKIT generates the light and
|
|
196
|
-
dark schemes from the seed
|
|
196
|
+
dark schemes from the seed (every role in kebab-case such as
|
|
197
197
|
`surface-container-low`, plus success, warning and info with their
|
|
198
|
-
containers),
|
|
199
|
-
`defaultTheme: "system"` so the person's light, dark or system preference
|
|
198
|
+
containers) once per seed and colours, which a browser keeps for its next
|
|
199
|
+
start, with `defaultTheme: "system"` so the person's light, dark or system preference
|
|
200
200
|
applies. The `md3` blueprint and JSKIT's Material 3 Vuetify defaults live in
|
|
201
201
|
material-web; an app keeps no defaults file and never hand-picks a colour. The
|
|
202
202
|
seed is the only hex value.
|