@jskit-ai/agent-docs 0.1.331 → 0.1.333

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 (92) hide show
  1. package/guide/agent/app-extras/realtime.md +11 -3
  2. package/guide/agent/app-setup/authentication.md +135 -32
  3. package/guide/agent/app-setup/initial-scaffolding.md +10 -9
  4. package/guide/agent/app-setup/more-than-one-server.md +111 -0
  5. package/guide/agent/app-setup/multi-homing.md +2 -2
  6. package/guide/agent/app-setup/package-with-nix.md +60 -15
  7. package/guide/agent/app-setup/upgrading-jskit.md +36 -1
  8. package/guide/agent/framework/crud-form-actions.md +18 -7
  9. package/guide/agent/framework/environments.md +174 -0
  10. package/guide/agent/framework/material-3.md +9 -3
  11. package/guide/agent/framework/quality-pass.md +8 -2
  12. package/guide/agent/framework/sanity-checks.md +3 -3
  13. package/guide/agent/framework/security-pass.md +7 -5
  14. package/guide/agent/index.md +6 -2
  15. package/package.json +1 -1
  16. package/patterns/feature-package/example/booking-engine/package.json +1 -1
  17. package/patterns/minimal-foundation/example/.env.example +8 -0
  18. package/patterns/minimal-foundation/example/AGENTS.md +7 -5
  19. package/patterns/minimal-foundation/example/bin/develop.js +2 -0
  20. package/patterns/minimal-foundation/example/package.json +7 -7
  21. package/patterns/shell-foundation/example/.env.example +8 -0
  22. package/patterns/shell-foundation/example/AGENTS.md +7 -5
  23. package/patterns/shell-foundation/example/bin/develop.js +2 -0
  24. package/patterns/shell-foundation/example/package.json +8 -8
  25. package/patterns/shell-foundation/example/packages/main/package.json +1 -1
  26. package/reference/autogen/KERNEL_MAP.md +10 -11
  27. package/reference/autogen/PATTERN_INDEX.md +38 -38
  28. package/reference/autogen/packages/auth-core.md +15 -2
  29. package/reference/autogen/packages/auth-provider-local-core.md +48 -13
  30. package/reference/autogen/packages/auth-provider-local-db-core.md +15 -0
  31. package/reference/autogen/packages/auth-provider-oidc-core.md +1 -1
  32. package/reference/autogen/packages/auth-provider-supabase-core.md +2 -2
  33. package/reference/autogen/packages/auth-web.md +26 -0
  34. package/reference/autogen/packages/connectors-core.md +2 -2
  35. package/reference/autogen/packages/http-web.md +2 -0
  36. package/reference/autogen/packages/kernel.md +32 -27
  37. package/reference/autogen/packages/oidc-issuer-core.md +4 -4
  38. package/reference/autogen/packages/payments-core.md +1 -1
  39. package/reference/autogen/packages/shell-web.md +40 -13
  40. package/reference/autogen/packages/storage-runtime.md +6 -0
  41. package/reference/autogen/packages/workspaces-core.md +4 -4
  42. package/reference/autogen/tooling/jskit-catalog.md +6 -1
  43. package/skills/jskit/SKILL.md +2 -1
  44. package/skills/jskit/references/crud-form-actions.md +18 -7
  45. package/skills/jskit/references/environments.md +169 -0
  46. package/skills/jskit/references/heuristics/INDEX.md +1 -1
  47. package/skills/jskit/references/heuristics/client-requests.md +1 -1
  48. package/skills/jskit/references/heuristics/crud-authoring.md +3 -2
  49. package/skills/jskit/references/heuristics/live-actions.md +4 -1
  50. package/skills/jskit/references/heuristics/ui-contract.md +9 -1
  51. package/skills/jskit/references/material-3.md +9 -3
  52. package/skills/jskit/references/multi-homing.md +2 -2
  53. package/skills/jskit/references/package-with-nix.md +60 -15
  54. package/skills/jskit/references/pattern-index.md +38 -38
  55. package/skills/jskit/references/patterns/app/minimal-foundation/example/.env.example +8 -0
  56. package/skills/jskit/references/patterns/app/minimal-foundation/example/AGENTS.md +7 -5
  57. package/skills/jskit/references/patterns/app/minimal-foundation/example/bin/develop.js +2 -0
  58. package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +7 -7
  59. package/skills/jskit/references/patterns/app/shell-foundation/example/.env.example +8 -0
  60. package/skills/jskit/references/patterns/app/shell-foundation/example/AGENTS.md +7 -5
  61. package/skills/jskit/references/patterns/app/shell-foundation/example/bin/develop.js +2 -0
  62. package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +8 -8
  63. package/skills/jskit/references/patterns/app/shell-foundation/example/packages/main/package.json +1 -1
  64. package/skills/jskit/references/patterns/auth/accounts-hub/example/package.json +3 -3
  65. package/skills/jskit/references/patterns/auth/auth-surface/PATTERN.md +10 -8
  66. package/skills/jskit/references/patterns/auth/auth-surface/example/src/pages/auth/email-change.vue +17 -0
  67. package/skills/jskit/references/patterns/auth/auth-surface/example/src/views/auth/EmailChangeView.vue +12 -0
  68. package/skills/jskit/references/patterns/auth/oidc-sign-in/example/package.json +2 -2
  69. package/skills/jskit/references/patterns/auth/supabase-auth/example/package.json +1 -1
  70. package/skills/jskit/references/patterns/connectors/api-key-connection/PATTERN.md +4 -1
  71. package/skills/jskit/references/patterns/connectors/api-key-connection/example/connections.js +3 -3
  72. package/skills/jskit/references/patterns/connectors/calendar-cli/example/.env.example +1 -0
  73. package/skills/jskit/references/patterns/connectors/calendar-cli/example/package.json +5 -4
  74. package/skills/jskit/references/patterns/connectors/calendar-cli/example/scripts/calendar.js +3 -1
  75. package/skills/jskit/references/patterns/connectors/firebase-messaging/example/server/notifications.js +3 -3
  76. package/skills/jskit/references/patterns/connectors/oauth-connection/PATTERN.md +3 -1
  77. package/skills/jskit/references/patterns/crud/crud-feature-package/example/packages/books/package.json +3 -3
  78. package/skills/jskit/references/patterns/database/mysql-application/example/package.json +2 -2
  79. package/skills/jskit/references/patterns/database/postgres-application/example/package.json +2 -2
  80. package/skills/jskit/references/patterns/realtime/realtime-application/example/.env.example +1 -0
  81. package/skills/jskit/references/patterns/realtime/realtime-application/example/package.json +2 -2
  82. package/skills/jskit/references/patterns/server/feature-package/example/booking-engine/package.json +1 -1
  83. package/skills/jskit/references/patterns/users/account-settings/example/src/components/account/settings/AccountSettingsNotificationsSection.vue +3 -1
  84. package/skills/jskit/references/patterns/users/account-settings/example/src/components/account/settings/AccountSettingsPreferencesSection.vue +3 -1
  85. package/skills/jskit/references/patterns/users/account-settings/example/src/components/account/settings/AccountSettingsProfileSection.vue +4 -1
  86. package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users/package.json +3 -3
  87. package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users-workspace/package.json +6 -6
  88. package/skills/jskit/references/quality-pass.md +8 -2
  89. package/skills/jskit/references/sanity-checks.md +3 -3
  90. package/skills/jskit/references/security-pass.md +7 -5
  91. package/guide/agent/framework/side-effects.md +0 -77
  92. package/skills/jskit/references/side-effects.md +0 -72
@@ -104,6 +104,10 @@ Exports
104
104
  Exports
105
105
  - `useSecondFactorStepUp()`
106
106
 
107
+ ### `src/client/composables/useDefaultEmailChangeView.js`
108
+ Exports
109
+ - `useDefaultEmailChangeView()`
110
+
107
111
  ### `src/client/composables/useDefaultResetPasswordView.js`
108
112
  Exports
109
113
  - `useDefaultResetPasswordView()`
@@ -125,6 +129,7 @@ Exports
125
129
  - `DefaultLoginView`
126
130
  - `DefaultSignOutView`
127
131
  - `DefaultResetPasswordView`
132
+ - `DefaultEmailChangeView`
128
133
  - `AuthProfileWidget`
129
134
  - `AuthProfileMenuLinkItem`
130
135
  - `useSecondFactorStepUp`
@@ -207,6 +212,11 @@ Exports
207
212
  - `authHttpRequest(url, options = {}, state = undefined)`
208
213
  - `clearAuthCsrfTokenCache()`
209
214
 
215
+ ### `src/client/runtime/emailChangeLink.js`
216
+ Exports
217
+ - `confirmEmailChangeLink(href, request = authHttpRequest)`
218
+ - `readEmailChangeToken(href)`
219
+
210
220
  ### `src/client/runtime/inactiveSessionMessage.js`
211
221
  Exports
212
222
  - `inactiveSessionMessage(session)`
@@ -323,6 +333,10 @@ Exports
323
333
  Exports
324
334
  - None
325
335
 
336
+ ### `src/client/views/DefaultEmailChangeView.vue`
337
+ Exports
338
+ - None
339
+
326
340
  ### `src/client/views/DefaultLoginView.vue`
327
341
  Exports
328
342
  - None
@@ -411,6 +425,10 @@ Local functions
411
425
  Exports
412
426
  - `buildRoutes(controller, { includeDevLoginAs = false, rateLimits = DEFAULT_AUTH_RATE_LIMITS } = {})`
413
427
 
428
+ ### `src/server/routes/emailChangeRoutes.js`
429
+ Exports
430
+ - `registerEmailChangeRoutes(router, { rateLimits })`
431
+
414
432
  ### `src/server/routes/passSignInRoutes.js`
415
433
  Exports
416
434
  - `registerPassSignInRoutes(fastify, { service, rateLimit })`
@@ -448,6 +466,10 @@ Exports
448
466
  Exports
449
467
  - None
450
468
 
469
+ ### `patterns/auth-surface/example/src/pages/auth/email-change.vue`
470
+ Exports
471
+ - None
472
+
451
473
  ### `patterns/auth-surface/example/src/pages/auth/login.vue`
452
474
  Exports
453
475
  - None
@@ -479,6 +501,10 @@ Exports
479
501
  - `createSignOutAction`
480
502
  - `performSignOutRequest`
481
503
 
504
+ ### `patterns/auth-surface/example/src/views/auth/EmailChangeView.vue`
505
+ Exports
506
+ - None
507
+
482
508
  ### `patterns/auth-surface/example/src/views/auth/LoginView.vue`
483
509
  Exports
484
510
  - None
@@ -22,7 +22,7 @@ Local functions
22
22
 
23
23
  ### `src/server/connectionService.js`
24
24
  Exports
25
- - `createConnectionService({ configuration, providers, resolveReference, store, authorize, executionMode = "application", fetchImpl = globalThis.fetch, now = Date.now, sideEffects = "simulate", logger = console })`
25
+ - `createConnectionService({ configuration, providers, resolveReference, store, authorize, executionMode = "application", fetchImpl = globalThis.fetch, now = Date.now, appEnv, logger = console })`
26
26
  Local functions
27
27
  - `publicConnection(connection)`
28
28
  - `connectionMatches(connection, integration, providerId, registration)`
@@ -94,7 +94,7 @@ Exports
94
94
  Exports
95
95
  - `SIMULATED_RESULT`
96
96
  - `connectionProvider(definition, integration)`
97
- - `createProviderRequests({ fetchImpl, now, resolveReference, sideEffects = "simulate", logger = console })`
97
+ - `createProviderRequests({ fetchImpl, now, resolveReference, appEnv, logger = console })`
98
98
  - `operationRequest(operation, input, settings, providerData)`
99
99
  - `requireOperationScope(operation, scopes, message, { messageCode })`
100
100
  - `tokenResponse(provider, response, details)`
@@ -94,6 +94,8 @@ Local functions
94
94
  - `resolveEditLocation(record)`
95
95
  - `resolveOpenLocation(row)`
96
96
  - `openRow(row, event)`
97
+ - `loadMore()`
98
+ - `focusRow(index)`
97
99
  - `hasRowActionsFor(record, index)`
98
100
  - `isBulkRowSelected(row)`
99
101
  - `setBulkRowSelected(row, selected = true)`
@@ -64,6 +64,16 @@ Exports
64
64
  - `resolveLinkPath`
65
65
  - `normalizePathname`
66
66
 
67
+ ### `shared/support/appEnvironment.js`
68
+ Exports
69
+ - `APP_ENV_KEY`
70
+ - `APP_ENVIRONMENTS`
71
+ - `APP_ENVIRONMENT_META_NAME`
72
+ - `appEnvironment(env)`
73
+ - `isDeployed(env)`
74
+ - `pageAppEnvironment(documentObject = globalThis.document)`
75
+ - `withAppEnvironmentMeta(html, environment)`
76
+
67
77
  ### `shared/support/clientBuild.js`
68
78
  Exports
69
79
  - `CLIENT_BUILD_META_NAME`
@@ -215,17 +225,6 @@ Exports
215
225
  Local functions
216
226
  - `normalizePlacementRenderers(value = {})`
217
227
 
218
- ### `shared/support/sideEffects.js`
219
- Exports
220
- - `SIDE_EFFECTS_ENV_KEY`
221
- - `SIDE_EFFECTS_LIVE`
222
- - `SIDE_EFFECTS_META_NAME`
223
- - `SIDE_EFFECTS_SIMULATE`
224
- - `pageSideEffectsMode(documentObject = globalThis.document)`
225
- - `resolveSideEffectsMode(env)`
226
- - `sideEffectsAreLive(env)`
227
- - `withSideEffectsMeta(html, mode)`
228
-
229
228
  ### `shared/support/silentLogger.js`
230
229
  Exports
231
230
  - `silentLogger`
@@ -780,6 +779,12 @@ Exports
780
779
  Exports
781
780
  - `compileRouteValidator`
782
781
 
782
+ ### `server/http/appEnvironmentPage.js`
783
+ Exports
784
+ - `registerAppEnvironmentPage(fastify, { env })`
785
+ - `type RuntimeEnv`
786
+ - `type RuntimeFastify`
787
+
783
788
  ### `server/http/capabilityHttpRuntime.js`
784
789
  Exports
785
790
  - `createCapabilityHttpRuntime({ fastify, actions })`
@@ -947,12 +952,6 @@ Local functions
947
952
  - `resolveContentSecurityPolicyHeaders(settings)`
948
953
  - `resolveSecurityHeaders({ config, env })`
949
954
 
950
- ### `server/http/sideEffectsPage.js`
951
- Exports
952
- - `registerSideEffectsPage(fastify, { env })`
953
- - `type RuntimeEnv`
954
- - `type RuntimeFastify`
955
-
956
955
  ### `server/http/trustedProxies.js`
957
956
  Exports
958
957
  - `DEFAULT_TRUSTED_PROXIES`
@@ -1029,6 +1028,22 @@ Exports
1029
1028
  Local functions
1030
1029
  - `matchesGlobalUiPath(pathname, globalUiPaths)`
1031
1030
 
1031
+ ### `server/runtime/appEnvironment.js`
1032
+ Exports
1033
+ - `STAGING_ORIGINAL_TO_HEADER`
1034
+ - `assertAppEnvironment(env)`
1035
+ - `assertDevelopmentOnlySettings(env, names)`
1036
+ - `deliverMessage({ env, logger, channel, to, summary, details = {}, send })`
1037
+ - `logAppEnvironment(logger, env)`
1038
+ - `logSideEffect(logger, environment, { kind, summary, details = {}, reason = "" })`
1039
+ - `markStagingEmail(email, originalTo)`
1040
+ - `type RuntimeEnv`
1041
+ - `type RuntimeLogger`
1042
+ - `type AppEnvironment`
1043
+ Local functions
1044
+ - `stagingAddress(env, kind)`
1045
+ - `escapeHtml(value)`
1046
+
1032
1047
  ### `server/runtime/BootstrapProvider.js`
1033
1048
  Exports
1034
1049
  - `BootstrapProvider`
@@ -1097,11 +1112,6 @@ Exports
1097
1112
  - `safePathnameFromRequest(request)`
1098
1113
  - `resolveClientIpAddress(request)`
1099
1114
 
1100
- ### `server/runtime/runtimeMode.js`
1101
- Exports
1102
- - `assertDevelopmentOnlySettings(env, names)`
1103
- - `isProductionEnv(env)`
1104
-
1105
1115
  ### `server/runtime/serviceAuthorization.js`
1106
1116
  Exports
1107
1117
  - `requireAuth(source = {}, options = {})`
@@ -1111,11 +1121,6 @@ Local functions
1111
1121
  - `normalizeRequireAuthOptions(options = {})`
1112
1122
  - `requireAuthenticatedActor(context = {}, options = {})`
1113
1123
 
1114
- ### `server/runtime/sideEffects.js`
1115
- Exports
1116
- - `logSideEffectsMode(logger, env)`
1117
- - `logSimulatedSideEffect(logger, { kind, summary, details = {} })`
1118
-
1119
1124
  ### `server/support/appConfig.js`
1120
1125
  Exports
1121
1126
  - `resolveMobileConfig(appConfig)`
@@ -68,11 +68,11 @@ Exports
68
68
  - `resolveHubDevAuth(env)`
69
69
  Local functions
70
70
  - `text(value)`
71
- - `resolveIssuer(env, isProduction)`
71
+ - `resolveIssuer(env, deployed)`
72
72
  - `readOrCreateDevSecret(appRoot)`
73
- - `resolveSecret(env, { isProduction, appRoot })`
73
+ - `resolveSecret(env, { deployed, appRoot })`
74
74
  - `parseDevOriginPatterns(value)`
75
- - `resolveMail(env, { isProduction })`
75
+ - `resolveMail(env, { deployed })`
76
76
  - `resolveGoogle(env)`
77
77
 
78
78
  ### `src/server/crypto.js`
@@ -181,7 +181,7 @@ Local functions
181
181
  ### `src/server/mailer.js`
182
182
  Exports
183
183
  - `composeMessage({ heading, body, actionLabel, actionUrl, footer })`
184
- - `createMailer({ mail, logger, isProduction, fetchImpl })`
184
+ - `createMailer({ mail, env, logger, fetchImpl })`
185
185
 
186
186
  ### `src/server/oidcProvider.js`
187
187
  Exports
@@ -23,7 +23,7 @@ Local functions
23
23
 
24
24
  ### `src/server/checkout.js`
25
25
  Exports
26
- - `createPaymentCheckoutService({ adapter, store, payments, merchantScope, returnUrl, authorize, sideEffects = "simulate" })`
26
+ - `createPaymentCheckoutService({ adapter, store, payments, merchantScope, returnUrl, authorize, appEnv })`
27
27
 
28
28
  ### `src/server/errors.js`
29
29
  Exports
@@ -22,6 +22,14 @@ Exports
22
22
  Exports
23
23
  - `inspectVueArchitecture`
24
24
 
25
+ ### `src/client/appEnvironment/appEnvironmentBanner.js`
26
+ Exports
27
+ - `APP_ENVIRONMENT_BANNER_ID`
28
+ - `createAppEnvironmentBannerRuntime(options)`
29
+ - `installAppEnvironmentBanner({ documentObject = pageDocument(), environment = pageAppEnvironment(documentObject) } = {})`
30
+ Local functions
31
+ - `removeNothing()`
32
+
25
33
  ### `src/client/asyncModuleRecovery/index.js`
26
34
  Exports
27
35
  - `NO_SHELL_ASYNC_MODULE_RECOVERY_RUNTIME`
@@ -96,6 +104,8 @@ Exports
96
104
  ### `src/client/components/ShellNavigationItem.vue`
97
105
  Exports
98
106
  - None
107
+ Local functions
108
+ - `Unwrapped(_props, { slots })`
99
109
 
100
110
  ### `src/client/components/ShellNavigationScope.vue`
101
111
  Exports
@@ -227,6 +237,16 @@ Local functions
227
237
  Exports
228
238
  - `useShellWindowSizeClass()`
229
239
 
240
+ ### `src/client/directives/vPending.js`
241
+ Exports
242
+ - `vPending`
243
+ Local functions
244
+ - `controlOf(element)`
245
+ - `ignoreWhilePending(event)`
246
+ - `firstMarkedField(control)`
247
+ - `mark(element, pending)`
248
+ - `settle(element)`
249
+
230
250
  ### `src/client/error/index.js`
231
251
  Exports
232
252
  - `createDefaultErrorPolicy`
@@ -332,6 +352,7 @@ Exports
332
352
  - `useShellPageTitle`
333
353
  - `useShellPageClose`
334
354
  - `useShellWindowSizeClass`
355
+ - `vPending`
335
356
  - `useShellNavigation`
336
357
  - `leaveApp`
337
358
  - `reloadAppPage`
@@ -566,14 +587,6 @@ Exports
566
587
  Local functions
567
588
  - `isPullRefreshQuery(query)`
568
589
 
569
- ### `src/client/sideEffects/testCopyBanner.js`
570
- Exports
571
- - `TEST_COPY_BANNER_ID`
572
- - `createTestCopyBannerRuntime(options)`
573
- - `installTestCopyBanner({ documentObject = pageDocument(), mode = pageSideEffectsMode(documentObject) } = {})`
574
- Local functions
575
- - `removeNothing()`
576
-
577
590
  ### `src/client/stores/useShellErrorPresentationStore.js`
578
591
  Exports
579
592
  - `useShellErrorPresentationStore`
@@ -637,10 +650,12 @@ Exports
637
650
  - `NO_SHELL_NAVIGATION_PRESENTATION`
638
651
  - `NO_SHELL_PAGE_ACTIONS_TARGET`
639
652
  - `NO_VUETIFY_ICONS`
653
+ - `NO_VUETIFY_LIST`
640
654
  - `SHELL_NAVIGATION_PRESENTATION_KEY`
641
655
  - `SHELL_PAGE_ACTIONS_ID`
642
656
  - `SHELL_PAGE_ACTIONS_TARGET_KEY`
643
657
  - `VUETIFY_ICONS_KEY`
658
+ - `VUETIFY_LIST_KEY`
644
659
  - `filledIconAlias(icon, aliases)`
645
660
 
646
661
  ### `src/client/support/pageActions.js`
@@ -759,6 +774,18 @@ Local functions
759
774
  Exports
760
775
  - None
761
776
 
777
+ ### `fixtures/adaptive-shell/src/PendingActionsPage.vue`
778
+ Exports
779
+ - None
780
+ Local functions
781
+ - `start(name)`
782
+
783
+ ### `fixtures/adaptive-shell/src/PendingDialogPage.vue`
784
+ Exports
785
+ - None
786
+ Local functions
787
+ - `invite()`
788
+
762
789
  ### `fixtures/adaptive-shell/src/RecordListPage.vue`
763
790
  Exports
764
791
  - None
@@ -806,23 +833,23 @@ Exports
806
833
  Exports
807
834
  - None
808
835
 
809
- ### `fixtures/production-build/src/App.vue`
836
+ ### `fixtures/app-environment-banner/src/main.js`
810
837
  Exports
811
838
  - None
812
839
 
813
- ### `fixtures/production-build/src/main.js`
840
+ ### `fixtures/app-environment-banner/vite.config.mjs`
814
841
  Exports
815
842
  - None
816
843
 
817
- ### `fixtures/production-build/vite.config.mjs`
844
+ ### `fixtures/production-build/src/App.vue`
818
845
  Exports
819
846
  - None
820
847
 
821
- ### `fixtures/test-copy-banner/src/main.js`
848
+ ### `fixtures/production-build/src/main.js`
822
849
  Exports
823
850
  - None
824
851
 
825
- ### `fixtures/test-copy-banner/vite.config.mjs`
852
+ ### `fixtures/production-build/vite.config.mjs`
826
853
  Exports
827
854
  - None
828
855
 
@@ -26,11 +26,17 @@ Exports
26
26
  Exports
27
27
  - `STORAGE_DRIVER_ENV_KEY`
28
28
  - `STORAGE_FS_BASE_PATH_ENV_KEY`
29
+ - `STORAGE_S3_ACCESS_KEY_ID_ENV_KEY`
30
+ - `STORAGE_S3_BUCKET_ENV_KEY`
31
+ - `STORAGE_S3_ENDPOINT_ENV_KEY`
32
+ - `STORAGE_S3_REGION_ENV_KEY`
33
+ - `STORAGE_S3_SECRET_ACCESS_KEY_ENV_KEY`
29
34
  - `DEFAULT_STORAGE_DRIVER`
30
35
  - `normalizeStorageDriver(value)`
31
36
  - `createStorageBinding({ env, appRoot })`
32
37
  Local functions
33
38
  - `resolveFsBasePath(fsBasePath, appRoot)`
39
+ - `createS3Driver(env)`
34
40
 
35
41
  ### `src/server/types.js`
36
42
  Exports
@@ -204,6 +204,10 @@ Local functions
204
204
  Exports
205
205
  - `registerWorkspaceDirectoryRoutes(router, { config, workspaceSelfCreateEnabled })`
206
206
 
207
+ ### `src/server/workspaceMembers/appEnvironmentInviteMailer.js`
208
+ Exports
209
+ - `createAppEnvironmentInviteMailer({ env, logger, mailer })`
210
+
207
211
  ### `src/server/workspaceMembers/defaultWorkspaceInviteEmail.js`
208
212
  Exports
209
213
  - `formatInviteExpiry(expiresAt, locale, timeZone)`
@@ -211,10 +215,6 @@ Exports
211
215
  Local functions
212
216
  - `escapeHtml(value)`
213
217
 
214
- ### `src/server/workspaceMembers/simulatedWorkspaceInviteMailer.js`
215
- Exports
216
- - `createSimulatedWorkspaceInviteMailer(logger)`
217
-
218
218
  ### `src/server/workspaceMembers/unconfiguredWorkspaceInviteMailer.js`
219
219
  Exports
220
220
  - `buildMailerUnconfiguredDelivery()`
@@ -294,9 +294,10 @@ Exports
294
294
  Local functions
295
295
  - `isObject(value)`
296
296
  - `scriptEnvironment({ app, envFile })`
297
- - `scriptOf(app, name)`
297
+ - `scriptOf(app, name, { optional = false } = {})`
298
298
  - `replaceWithScript({ app, shell, envFile, name, first })`
299
299
  - `check({ envFile, wait })`
300
+ - `chownTo(user, file)`
300
301
  - `prepare({ settings, envFile, user })`
301
302
  - `npmCache(list, cache)`
302
303
  - `isCliEntrypoint(argvPath = process.argv[1])`
@@ -417,6 +418,10 @@ Local functions
417
418
  - `exportedTableResources(namespace, isTableResource)`
418
419
  - `keyText({ tableName, columns, referencedTableName, referencedColumns })`
419
420
 
421
+ ### `scripts/test-environment.mjs`
422
+ Exports
423
+ - `useTestAppEnvironment(env, command)`
424
+
420
425
  ### `scripts/test-file-stop.mjs`
421
426
  Exports
422
427
  - `STOPPED_PREFIX`
@@ -50,7 +50,8 @@ manifests, migrations, tests, and runtime behaviour are the evidence.
50
50
  - [multi-homing](references/multi-homing.md) for workspaces or invitations.
51
51
  - [translation](references/translation.md) for languages, translated texts
52
52
  or error codes.
53
- - [side effects](references/side-effects.md) before sending email, messages or payments.
53
+ - [environments](references/environments.md) before code that sends email, messages or payments, or that
54
+ depends on where the app runs (APP_ENV).
54
55
  - [Nix packaging](references/package-with-nix.md) to package an app for a host
55
56
  that runs apps only as Nix packages, built with no network access.
56
57
  - For creation, foundation patterns, or package selection, read
@@ -6,9 +6,15 @@
6
6
  its default content. The slot exposes `screen`, `mode`, `formRuntime`,
7
7
  `formState`, `addEdit`, `saveLabel`, the resolved
8
8
  `cancelTo` route target, and `submit`. Custom actions call `submit()` and bind
9
- their disabled state to `addEdit.isSubmitDisabled`. Keyboard submission uses
10
- the same runtime. `addEdit.isSaving` stays true through the request and
11
- asynchronous `onSaveSuccess` callback; duplicate
9
+ their disabled state to `addEdit.isSubmitDisabled` and their pending state to
10
+ `addEdit.isSubmitPending` (the save, or the record's reload after it, is
11
+ running). `ShellPageAction` takes both and keeps keyboard focus while it is
12
+ pending; a plain button, when possible, takes
13
+ `v-pending="addEdit.isSubmitPending"` and
14
+ `:disabled="addEdit.isSubmitDisabled && !addEdit.isSubmitPending"`, since a
15
+ focused button that becomes disabled drops focus to the page body. Keyboard
16
+ submission uses the same runtime. `addEdit.isSaving` stays true through the
17
+ request and asynchronous `onSaveSuccess` callback; duplicate
12
18
  submissions remain blocked during both.
13
19
 
14
20
  `useAddEdit()` and the `addEdit` runtime exposed by `useCrudAddEdit()` and
@@ -37,9 +43,13 @@ Inside `CrudAddEditScreen`, alongside the existing `fields` slot:
37
43
  <template #actions="{ addEdit, submit, saveLabel, cancelTo }">
38
44
  <v-btn v-if="cancelTo" variant="outlined" :to="cancelTo">Cancel</v-btn>
39
45
  <div>
40
- <v-btn :disabled="addEdit.isSubmitDisabled" @click="submit">
41
- {{ addEdit.isSaving ? "Saving…" : saveLabel }}
42
- </v-btn>
46
+ <ShellPageAction
47
+ primary
48
+ :label="addEdit.isSaving ? 'Saving…' : saveLabel"
49
+ :disabled="addEdit.isSubmitDisabled"
50
+ :pending="addEdit.isSubmitPending"
51
+ @click="submit"
52
+ />
43
53
  <p v-if="addEdit.validationAttempted" aria-live="polite">
44
54
  {{ Object.values(addEdit.validationErrors).join(" ") }}
45
55
  </p>
@@ -53,7 +63,8 @@ to clear the successfully saved model, call `screen.addEdit.resetValidation()`,
53
63
  and prepare the next entry. This callback replaces default success navigation
54
64
  and invalidation; perform those there when needed. Clear the model only in
55
65
  `onSaveSuccess`: `submit()` also resolves after invalid or failed submissions.
56
- Guard action selection with `isSubmitDisabled` and restore the default action
66
+ Guard action selection with `isSubmitDisabled` (true while pending too) and
67
+ restore the default action
57
68
  after each attempt so keyboard submission uses normal Save. Track the clicked
58
69
  button separately to keep guidance beside it while fields are corrected.
59
70
 
@@ -0,0 +1,169 @@
1
+ <!-- Generated from `packages/agent-docs/site/guide/framework/environments.md`. -->
2
+
3
+ # Environments
4
+
5
+ Where an application runs is one environment variable, `APP_ENV`, with four
6
+ values. Everything JSKIT does differently by place reads it: what the
7
+ application sends, the development shortcuts, the security headers and the
8
+ banner on each page. `NODE_ENV` decides nothing else: it only picks optimised
9
+ builds, and staging and production set it to `production`.
10
+
11
+ | `APP_ENV` | Where | Email and SMS | Push, webhooks, connector writes | Payments | Development shortcuts | Banner |
12
+ | --- | --- | --- | --- | --- | --- | --- |
13
+ | `development` | a developer's machine, a session, a preview | logged | logged | sandbox only | allowed | "Development" |
14
+ | `test` | automated test runs | logged | logged | sandbox only | allowed | "Test" |
15
+ | `staging` | a deployed copy for checking the application | only to `STAGING_EMAIL_TO` and `STAGING_SMS_TO`; logged when unset | logged | sandbox only | refused | "Staging" |
16
+ | `production` | the application serving real people | sent | sent | live | refused | none |
17
+
18
+ The development shortcuts are dev sign-in (`AUTH_DEV_BYPASS_ENABLED`), cookies
19
+ without `Secure`, links in answers (`AUTH_LOCAL_RECOVERY_DEV_OUTPUT`), a first
20
+ account without a setup code, test databases, and a server that refuses to
21
+ start over a role grant no action requires (staging and production log it
22
+ instead). Staging and production add HSTS and the content security policy, and
23
+ need production's secrets, such as `AUTH_LOCAL_SESSION_SECRET` and a sender for
24
+ the emails they send.
25
+
26
+ ## Who sets what
27
+
28
+ The host sets `APP_ENV`; a request never chooses it. JSKIT's own commands set
29
+ it where they own the run.
30
+
31
+ | Who | `APP_ENV` | `NODE_ENV` | `STAGING_EMAIL_TO`, `STAGING_SMS_TO` |
32
+ | --- | --- | --- | --- |
33
+ | `npm run develop`, `npm run dev` on a developer's machine | `development`, set by the scripts | unset | unset |
34
+ | A hosted session or preview | `development` | unset | unset |
35
+ | `jskit test` and the browser test servers | `test`, set by JSKIT | anything | unset |
36
+ | A build-check machine that starts the packaged build to see it start and answer health | `staging` | `production` | unset, so everything is logged |
37
+ | A staging server | `staging` | `production` | the testers' inbox and phone |
38
+ | A production server | `production` | `production` | ignored |
39
+
40
+ A server started with `npm start` reads `APP_ENV` from its environment, or from
41
+ `.env` (`APP_ENV=development` on a developer's machine; the foundations'
42
+ `.env.example` says so). A host puts both variables in the server's
43
+ environment, beside its other settings:
44
+
45
+ ```sh
46
+ APP_ENV=staging NODE_ENV=production STAGING_EMAIL_TO=qa@example.com npm start
47
+ ```
48
+
49
+ `jskit test` and the browser test servers run as `APP_ENV=test` whatever the
50
+ shell says, and refuse to run where `APP_ENV` is `staging` or `production`.
51
+
52
+ ## Starting refuses what is not clear
53
+
54
+ A server stops at startup, saying what to do, when:
55
+
56
+ - `APP_ENV` is missing: `APP_ENV is not set. Set APP_ENV to development, test,
57
+ staging or production: development on a developer's machine or in a preview,
58
+ staging or production (with NODE_ENV=production) on a server.`
59
+ - `APP_ENV` is anything else: `APP_ENV is "dev", which is not an environment
60
+ JSKIT knows. Set APP_ENV to development, test, staging or production.`
61
+ - `APP_ENV` is `staging` or `production` and `NODE_ENV` is not `production`:
62
+ `APP_ENV is staging, so NODE_ENV must be production, and it is not set. Set
63
+ NODE_ENV=production: it only picks optimised builds, and APP_ENV decides
64
+ everything else.`
65
+ - `SIDE_EFFECTS`, which `APP_ENV` replaced, is set: `SIDE_EFFECTS was replaced
66
+ by APP_ENV: remove SIDE_EFFECTS. APP_ENV=production acts for real; staging
67
+ sends email and SMS only to STAGING_EMAIL_TO and STAGING_SMS_TO; development
68
+ and test only log.`
69
+ - A development-only setting is set in staging or production, for example
70
+ `AUTH_LOCAL_RECOVERY_DEV_OUTPUT is for development only and APP_ENV is
71
+ staging. Remove it from the staging environment.`
72
+
73
+ It then logs one line saying where it runs and what that means, such as
74
+ `APP_ENV is staging: email goes only to qa@example.com (STAGING_EMAIL_TO), SMS
75
+ is logged (STAGING_SMS_TO is not set); …`.
76
+
77
+ ## Staging's test addresses
78
+
79
+ Staging is production's code and settings with nobody real at the other end.
80
+ `STAGING_EMAIL_TO` is one address, such as the testers' shared inbox; every
81
+ email goes there instead of to its recipient. The email's first line, in its
82
+ text and HTML, says `Staging: this email was for ada@example.com.`, it carries
83
+ an `X-Staging-Original-To` header, and the log says
84
+ `Staging: the password reset email to ada@example.com was sent to
85
+ qa@example.com (STAGING_EMAIL_TO) instead.` `STAGING_SMS_TO` is one phone
86
+ number, and SMS goes there the same way. Unset, each is logged as development
87
+ logs it, with what a tester needs, such as its link. Push notifications,
88
+ webhooks and connector writes are always logged in staging, and live payments
89
+ are refused there, as everywhere but production.
90
+
91
+ ## What JSKIT does
92
+
93
+ - Every HTML page the server sends, and every page the Vite development server
94
+ sends, names its environment in a `jskit-app-environment` meta tag. The
95
+ shell (`@jskit-ai/shell-web`) shows a small "Development", "Test" or
96
+ "Staging" banner from it, with no application code, and none in production.
97
+ The banner never takes a click or a tap. Screen readers read it as a note,
98
+ with a sentence such as "Development: emails and messages are logged, not
99
+ sent; payments use the sandbox." as its description. It has no label, so a
100
+ browser test's `getByLabel("Email")` never finds it.
101
+ - Local-password emails (confirmation and password reset) with an installed
102
+ sender go out as the table says. In staging the sender gets
103
+ `STAGING_EMAIL_TO` as `email` and the person's address as `originalEmail`,
104
+ which its email should show (`markStagingEmail` does). An application that
105
+ confirms new accounts at once while its email isn't set up uses
106
+ `auth.local.confirmation-mode`, which applies everywhere (see
107
+ [Authentication](/guide/app-setup/authentication)).
108
+ - Workspace invitations with a provided mailer go out as the table says, the
109
+ staging copy marked with whom it was for. A logged invitation answers
110
+ `status: "simulated"`, and the inviter copies the link.
111
+ - Accounts-hub email goes out as the table says.
112
+ - Connector operations that act on the world (send an email or message, post,
113
+ book or cancel, charge, invoice, trigger another system's events) are marked
114
+ `sideEffect`. Outside production they are checked like real ones, then
115
+ logged, and `invoke` answers `{ simulated: true }`. Reads run for real.
116
+ `createConnectorsFeature` reads `APP_ENV` itself; give
117
+ `createConnectionService` and `createPaymentCheckoutService`
118
+ `appEnv: appEnvironment(env)`, which they require.
119
+ - Payment checkout and the billing portal in the live payment environment are
120
+ refused outside production with `payment_sandbox_only`; the sandbox
121
+ environment works everywhere.
122
+
123
+ Supabase sends its own authentication emails from Supabase's servers; JSKIT
124
+ cannot redirect them. Point development and staging at a separate Supabase
125
+ project.
126
+
127
+ ## The application's own side effects
128
+
129
+ Code the application writes that reaches the world follows the same rule. Send
130
+ email and SMS through `deliverMessage`, which sends, redirects or logs each as
131
+ `APP_ENV` says; log anything else outside production with `logSideEffect`.
132
+
133
+ ```js
134
+ import { deliverMessage, logSideEffect, markStagingEmail } from "@jskit-ai/kernel/server/runtime/appEnvironment";
135
+ import { appEnvironment } from "@jskit-ai/kernel/shared/support/appEnvironment";
136
+
137
+ function sendReminder({ env, logger, mailer }, message) {
138
+ return deliverMessage({
139
+ env,
140
+ logger,
141
+ channel: "email",
142
+ to: message.to,
143
+ summary: `the reminder to ${message.to}`,
144
+ details: { subject: message.subject },
145
+ send: (to, { originalTo }) => mailer.send(markStagingEmail({ ...message, to }, originalTo))
146
+ });
147
+ }
148
+
149
+ async function notifyDevice({ env, logger, push }, notification) {
150
+ const appEnv = appEnvironment(env);
151
+ if (appEnv !== "production") {
152
+ logSideEffect(logger, appEnv, {
153
+ kind: "push notification",
154
+ summary: `the reminder to device ${notification.deviceId}`,
155
+ details: { deviceId: notification.deviceId }
156
+ });
157
+ return { simulated: true };
158
+ }
159
+ return push.send(notification);
160
+ }
161
+ ```
162
+
163
+ - Read `env` from the `runtime.env` capability, never a request.
164
+ - A configured driver or key (`EMAIL_DRIVER=ses`, a live payment key) does not
165
+ make anything real; only `APP_ENV=production` does.
166
+ - Test each environment the code treats differently. A test that proves a real
167
+ sender against a fake transport passes `APP_ENV: "production"` (and
168
+ `NODE_ENV: "production"` when it starts a whole server), and a staging test
169
+ sets `STAGING_EMAIL_TO` and checks that only that address received it.
@@ -50,5 +50,5 @@ How to use it:
50
50
  - [typed-features.md](./typed-features.md)
51
51
  - client features, composable, `use<Name>`, Vue component, client provider, props, emits, `inject`, `provide`, `ref`, `reactive`, `watch`, `addEventListener`, `setInterval`, module state, `Object.freeze` on a composable, `?.()` in a template, `jskit/typed-inject`, `jskit/collaborator-props`, `jskit/fixed-result-shape`, `jskit/released-listeners`, `jskit/no-module-state`, `jskit/no-frozen-vue-state`, `clientFeaturesConfig`, `shared resource:`
52
52
  - [client-features.md](./client-features.md)
53
- - sanity checks, is this sane, query count that grows with the rows, a list that stops at 20 or 100 rows, `createDocument()` per row of a batch, `jskit test`, one file at a time, test database preparation, `TEST_DB_NAME`, `mode: "patch"`, a route `rateLimit` nothing tests, `input.workspaceId`, a refactor or consolidation that drops behaviour, a JSKIT update, a changed theme or Vuetify default, `jskit.surface` with a parent, an assistant tool's output contract, a screen that renders everything, feedback covering an action, `NODE_ENV=production`, a production start
53
+ - sanity checks, is this sane, query count that grows with the rows, a list that stops at 20 or 100 rows, `createDocument()` per row of a batch, `jskit test`, one file at a time, test database preparation, `TEST_DB_NAME`, `mode: "patch"`, a route `rateLimit` nothing tests, `input.workspaceId`, a refactor or consolidation that drops behaviour, a JSKIT update, a changed theme or Vuetify default, `jskit.surface` with a parent, an assistant tool's output contract, a screen that renders everything, feedback covering an action, `APP_ENV=staging` or `production`, a production start
54
54
  - [Sanity checks](../sanity-checks.md)
@@ -54,7 +54,7 @@ Screen wrapper extension rules:
54
54
  - Use `requestFieldsets` only when a specialised caller intentionally needs a typed JSON:API sparse fieldset. Ordinary generated reads use the complete resource output contract.
55
55
  - Use `readEnabled` and `queryKeyFactory` on `useCrudViewScreen()` when the detail read needs the same gating or cache identity control as `useCrudView()`.
56
56
  - Use `CrudViewScreen` slots (`before-fields`, `fields`, `after-fields`, `supporting-content`) for page-specific domain sections while keeping shared load/error/retry chrome.
57
- - Use the `CrudAddEditScreen` `actions` slot for custom save buttons. Call its `submit()`, bind `addEdit.isSubmitDisabled`, and use `addEdit.validationAttempted`, `addEdit.validationErrors`, and `addEdit.resetValidation()` for local guidance. Set `addEditOptions.validationFeedback: false` to suppress only local validation feedback; clear a saved form in `addEditOptions.onSaveSuccess`.
57
+ - Use the `CrudAddEditScreen` `actions` slot for custom save buttons. Call its `submit()`, bind `addEdit.isSubmitDisabled` and `addEdit.isSubmitPending` (`ShellPageAction`'s `disabled` and `pending`, so Save keeps keyboard focus while it runs), and use `addEdit.validationAttempted`, `addEdit.validationErrors`, and `addEdit.resetValidation()` for local guidance. Set `addEditOptions.validationFeedback: false` to suppress only local validation feedback; clear a saved form in `addEditOptions.onSaveSuccess`.
58
58
  - Use `listRowActions` with `defineCrudListRowActions(...)` for row-level commands in `CrudListScreen`.
59
59
  - Use `syntheticRows` for display-only rows that do not come from the CRUD response, such as owner/master rows.
60
60