@jskit-ai/agent-docs 0.1.60 → 0.1.61

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.
@@ -184,11 +184,11 @@ The screen is also ready to show OAuth provider buttons, but only if providers a
184
184
  For this chapter, `config.server.js` keeps this empty:
185
185
 
186
186
  ```js
187
- config.auth = {
188
- oauth: {
189
- providers: [],
190
- defaultProvider: ""
191
- }
187
+ config.auth ||= {};
188
+ config.auth.profileMode = "standalone";
189
+ config.auth.oauth = {
190
+ providers: [],
191
+ defaultProvider: ""
192
192
  };
193
193
  ```
194
194
 
@@ -208,11 +208,10 @@ First, configure Google and Supabase:
208
208
  Then tell JSKIT to expose the provider in the login UI:
209
209
 
210
210
  ```js
211
- config.auth = {
212
- oauth: {
213
- providers: ["google"],
214
- defaultProvider: "google"
215
- }
211
+ config.auth ||= {};
212
+ config.auth.oauth = {
213
+ providers: ["google"],
214
+ defaultProvider: "google"
216
215
  };
217
216
  ```
218
217
 
@@ -575,15 +574,15 @@ That `requiresAuth: false` line is important. The auth surface must stay public,
575
574
  `config/server.js` also gets an auth stub:
576
575
 
577
576
  ```js
578
- config.auth = {
579
- oauth: {
580
- providers: [],
581
- defaultProvider: ""
582
- }
577
+ config.auth ||= {};
578
+ config.auth.profileMode = "standalone";
579
+ config.auth.oauth = {
580
+ providers: [],
581
+ defaultProvider: ""
583
582
  };
584
583
  ```
585
584
 
586
- That small block explains a lot of the default login screen. The stock UI is ready for OAuth providers such as Google, but this chapter keeps the provider list empty, so the page only shows the email/password and one-time-code flows. Later, if you enable a provider in Supabase and list it here, the same login screen can expose that button too.
585
+ That small block explains a lot of the default login screen and auth profile behavior. `profileMode: "standalone"` keeps this auth-only chapter on the temporary app-side profile mirror. The stock UI is ready for OAuth providers such as Google, but this chapter keeps the provider list empty, so the page only shows the email/password and one-time-code flows. Later, if you enable a provider in Supabase and list it here, the same login screen can expose that button too.
587
586
 
588
587
  The auth routes themselves are app-owned wrappers around the module-supplied default views. `src/pages/auth/login.vue` looks like this:
589
588
 
@@ -710,16 +710,16 @@ So the app has gained a new capability, but no visible part of the UI depends on
710
710
 
711
711
  This is the most important code path to read in this chapter.
712
712
 
713
- Inside `AuthSupabaseServiceProvider`, auth still resolves its profile mode from the environment:
713
+ Inside `AuthSupabaseServiceProvider`, auth resolves its profile mode from server app config:
714
714
 
715
715
  ```js
716
- const authProfileMode = resolveAuthProfileMode(env);
716
+ const authProfileMode = resolveAuthProfileMode(appConfig);
717
717
  let userProfileSyncService = fallbackStandaloneProfileSyncService;
718
718
 
719
- if (authProfileMode === AUTH_PROFILE_MODE_USERS) {
719
+ if (authProfileMode === PROFILE_MODE_USERS) {
720
720
  if (!scope.has("users.profile.sync.service")) {
721
721
  throw new Error(
722
- "AuthSupabaseServiceProvider requires users.profile.sync.service when AUTH_PROFILE_MODE=users."
722
+ "AuthSupabaseServiceProvider requires users.profile.sync.service when config.auth.profileMode is \"users\"."
723
723
  );
724
724
  }
725
725
  userProfileSyncService = scope.make("users.profile.sync.service");
@@ -728,9 +728,10 @@ if (authProfileMode === AUTH_PROFILE_MODE_USERS) {
728
728
 
729
729
  That snippet explains the whole consequence of this chapter.
730
730
 
731
- - The default mode is still `standalone`.
731
+ - The auth provider's server config still sets `config.auth.profileMode = "standalone"`.
732
+ - If `profileMode` is missing entirely, the runtime assumes `users`, but it is not missing in the auth-only scaffold.
732
733
  - The fallback service is still the in-memory profile sync service from the previous chapter.
733
- - Nothing in `database-runtime-mysql` changes `AUTH_PROFILE_MODE`.
734
+ - Nothing in `database-runtime-mysql` changes `config.auth.profileMode`.
734
735
  - Nothing in `database-runtime-mysql` provides `users.profile.sync.service`.
735
736
 
736
737
  So the auth layer keeps behaving the same way it did before:
@@ -39,7 +39,7 @@ This is the first chapter where the migration step is not just "nice to have."
39
39
 
40
40
  `users-core` writes:
41
41
 
42
- - `AUTH_PROFILE_MODE=users` into `.env`
42
+ - `config.auth.profileMode = "users"` into `config/server.js`
43
43
  - real users/account schema migrations into `migrations/`
44
44
 
45
45
  That means the app is expected to use the persistent users-backed profile sync service. If you skip `npm run db:migrate`, the code and routes are installed, but the required tables are still missing.
@@ -119,12 +119,13 @@ This is the first chapter where the app starts to feel like it has a real user m
119
119
 
120
120
  The most interesting files are spread across config, migrations, routing, and the app-owned account UI.
121
121
 
122
- ### `.env` flips auth into users mode
122
+ ### `config/server.js` flips auth into users mode
123
123
 
124
- The most important new line in `.env` is:
124
+ The most important new server-only config line is:
125
125
 
126
- ```dotenv
127
- AUTH_PROFILE_MODE=users
126
+ ```js
127
+ config.auth ||= {};
128
+ config.auth.profileMode = "users";
128
129
  ```
129
130
 
130
131
  That one line explains the deepest change in the chapter.
@@ -252,16 +253,16 @@ That is worth noticing because this is a higher level of scaffolding:
252
253
 
253
254
  ### Why auth uses the users layer
254
255
 
255
- In the previous chapter, auth still defaulted to the standalone profile sync fallback. The core logic in `AuthSupabaseServiceProvider` looks like this:
256
+ In the previous chapter, auth was explicitly configured for the standalone profile sync fallback. The core logic in `AuthSupabaseServiceProvider` looks like this:
256
257
 
257
258
  ```js
258
- const authProfileMode = resolveAuthProfileMode(env);
259
+ const authProfileMode = resolveAuthProfileMode(appConfig);
259
260
  let userProfileSyncService = fallbackStandaloneProfileSyncService;
260
261
 
261
- if (authProfileMode === AUTH_PROFILE_MODE_USERS) {
262
+ if (authProfileMode === PROFILE_MODE_USERS) {
262
263
  if (!scope.has("users.profile.sync.service")) {
263
264
  throw new Error(
264
- "AuthSupabaseServiceProvider requires users.profile.sync.service when AUTH_PROFILE_MODE=users."
265
+ "AuthSupabaseServiceProvider requires users.profile.sync.service when config.auth.profileMode is \"users\"."
265
266
  );
266
267
  }
267
268
  userProfileSyncService = scope.make("users.profile.sync.service");
@@ -272,7 +273,7 @@ The important part is concrete.
272
273
 
273
274
  After `users-web`:
274
275
 
275
- - `.env` sets `AUTH_PROFILE_MODE=users`
276
+ - `config/server.js` sets `config.auth.profileMode = "users"`
276
277
  - `users-core` supplies the users-backed sync service
277
278
  - the migrations supply the required tables
278
279
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/agent-docs",
3
- "version": "0.1.60",
3
+ "version": "0.1.61",
4
4
  "description": "Distributed JSKIT agent references, prompts, guides, and generated reference maps.",
5
5
  "type": "module",
6
6
  "files": [
@@ -244,7 +244,7 @@ Local functions
244
244
  - `resolveOAuthConfigFromAppConfig(appConfig)`
245
245
  - `resolveAllowedReturnToOrigins({ appConfig = {}, appPublicUrl = "" } = {})`
246
246
  - `resolveAuthProviderConfig(env, appConfig = {})`
247
- - `resolveAuthProfileMode(env)`
247
+ - `resolveAuthProfileMode(appConfig = {})`
248
248
  - `isDevAuthBypassEnabledForRegistration(env)`
249
249
  - `isDevAuthBypassRequested(env)`
250
250
  - `createInMemoryUserSettingsRepository()`