@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
@@ -1,72 +0,0 @@
1
- <!-- Generated from `packages/agent-docs/site/guide/framework/side-effects.md`. -->
2
-
3
- # Side effects and test copies
4
-
5
- An application reads one environment variable, `SIDE_EFFECTS`:
6
-
7
- - `live`: the application acts for real.
8
- - Anything else, including unset, means `simulate`: the copy is a **test
9
- copy**. It sends no real email, SMS, push notification, payment or
10
- third-party webhook. It simulates each one, writes it to the log, and every
11
- page shows a small "Test copy" banner.
12
-
13
- Only the copy that serves real people sets `SIDE_EFFECTS=live`. Development,
14
- previews, tests and staging leave it unset. The name has no platform prefix on
15
- purpose: any host can set it. The host sets it; a request never chooses it.
16
-
17
- ## What JSKIT does
18
-
19
- - Every HTML page the server sends, and every page the Vite development server
20
- sends, names the setting in a `jskit-side-effects` meta tag. The shell
21
- (`@jskit-ai/shell-web`) shows the "Test copy" banner from it, with no
22
- application code. The banner never takes a click or a tap. Screen readers
23
- read it as a note, with "emails, messages and payments are simulated, not
24
- sent" as its description. It has no label, so a browser test's
25
- `getByLabel("Email")` never finds it.
26
- - The server logs once at startup whether it acts for real. A production server
27
- that simulates logs a warning.
28
- - Local-password emails (confirmation and password reset) with an installed
29
- sender are logged, not sent: local auth uses its own simulated sender in
30
- place of the application's, which never runs in a test copy. An application
31
- that confirms new accounts at once while its email isn't set up uses
32
- `auth.local.confirmation-mode`, which a test copy keeps (see
33
- [Authentication](/guide/app-setup/authentication)).
34
- - Workspace invitations with a provided mailer are logged. The invitation
35
- answers `status: "simulated"`, and the inviter copies the link.
36
- - Accounts-hub email is logged, not sent.
37
- - Connector operations that act on the world (send an email or message, post,
38
- book or cancel, charge, invoice, trigger another system's events) are marked
39
- `sideEffect`. They are checked like real ones, then logged, and `invoke`
40
- answers `{ simulated: true }`. Reads run for real. `createConnectorsFeature`
41
- reads the setting itself; give `createConnectionService` and
42
- `createPaymentCheckoutService` `sideEffects: resolveSideEffectsMode(env)`.
43
- - Payment checkout and the billing portal in the live payment environment are
44
- refused with `payment_test_copy`; the sandbox environment works either way.
45
-
46
- Supabase sends its own authentication emails from Supabase's servers; JSKIT
47
- cannot simulate them. Point a test copy at a separate Supabase project.
48
-
49
- ## The application's own side effects
50
-
51
- Code the application writes that reaches the world follows the same rule.
52
- Decide at the point of the effect: log what would happen and answer as if it
53
- were done.
54
-
55
- ```js
56
- import { sideEffectsAreLive } from "@jskit-ai/kernel/shared/support/sideEffects";
57
- import { logSimulatedSideEffect } from "@jskit-ai/kernel/server/runtime/sideEffects";
58
-
59
- async function sendReminder({ env, logger, mailer }, message) {
60
- if (!sideEffectsAreLive(env)) {
61
- logSimulatedSideEffect(logger, { kind: "email", summary: `the reminder to ${message.to}`, details: { to: message.to } });
62
- return { simulated: true };
63
- }
64
- return mailer.send(message);
65
- }
66
- ```
67
-
68
- - Read `env` from the `runtime.env` capability, never a request.
69
- - A configured driver or key (`EMAIL_DRIVER=ses`, a live payment key) does not
70
- make a test copy live; only `SIDE_EFFECTS=live` does.
71
- - Test both modes. A test that proves a real sender against a fake transport
72
- sets `SIDE_EFFECTS: "live"` in its environment.