@jskit-ai/agent-docs 0.1.17 → 0.1.18

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.
@@ -591,12 +591,12 @@ registerProfileSyncLifecycleContributor(app, "workspaces.core.profileSyncLifecyc
591
591
  return Object.freeze({
592
592
  contributorId: "workspaces.core.profileSync",
593
593
  order: 100,
594
- async afterIdentityProfileSynced({ profile, created, options } = {}) {
595
- if (!created || !profile || typeof workspaceService?.provisionWorkspaceForNewUser !== "function") {
594
+ async afterIdentityProfileSynced({ profile, options } = {}) {
595
+ if (!profile || typeof workspaceService?.ensureProvisionedWorkspaceForAuthenticatedUser !== "function") {
596
596
  return;
597
597
  }
598
598
 
599
- await workspaceService.provisionWorkspaceForNewUser(profile, options);
599
+ await workspaceService.ensureProvisionedWorkspaceForAuthenticatedUser(profile, options);
600
600
  }
601
601
  });
602
602
  });
@@ -604,7 +604,9 @@ registerProfileSyncLifecycleContributor(app, "workspaces.core.profileSyncLifecyc
604
604
 
605
605
  That means the workspace package does not need to patch auth directly to learn that a user was added. It listens through the `users-core` lifecycle registry instead.
606
606
 
607
- For this chapter's `tenancyMode = "personal"` setup, that contributor now does real work. When a brand-new JSKIT user is synchronized from auth, `workspaces-core` uses the lifecycle seam to provision that user's first personal workspace automatically.
607
+ For this chapter's `tenancyMode = "personal"` setup, that contributor now does real work. When an authenticated JSKIT user is synchronized from auth, `workspaces-core` ensures that user's personal workspace exists.
608
+
609
+ That detail matters for the retrofit path described earlier in this chapter. If the app started on `none`, then later switched to `personal`, the first sign-in after that switch still needs to backfill the personal workspace for the already-existing user record. The lifecycle contributor handles that because the workspace provision step is idempotent.
608
610
 
609
611
  - `users-core` owns the "user was synchronized" lifecycle
610
612
  - `workspaces-core` subscribes to that lifecycle through the registry
@@ -568,6 +568,7 @@ So `update` is for reapplying package-owned managed changes, not for generic dep
568
568
  The best guide example is the tenancy-mode recovery path from the multi-homing chapter. If you installed `workspaces-core` or `workspaces-web` while the app was still on `tenancyMode = "none"`, then later changed the app to `personal`, the missing gated scaffold does not backfill automatically. The recovery path is:
569
569
 
570
570
  ```bash
571
+ npx jskit update package users-core
571
572
  npx jskit update package workspaces-core
572
573
  npx jskit update package workspaces-web
573
574
  ```
@@ -284,6 +284,28 @@ That file is the shared CRUD contract. The UI generator reads it to decide:
284
284
 
285
285
  So even though the server scaffold writes many files, the resource file is the bridge between the server and UI halves.
286
286
 
287
+ ### One install boundary to remember
288
+
289
+ `crud-server-generator scaffold` also adds a new local app package dependency such as:
290
+
291
+ ```text
292
+ @local/contacts
293
+ ```
294
+
295
+ So before you build or run the app again, install that new local package:
296
+
297
+ ```bash
298
+ npm install
299
+ ```
300
+
301
+ If you are verifying the guide against a local JSKIT checkout and have already been using local package links, rerun:
302
+
303
+ ```bash
304
+ npm run devlinks
305
+ ```
306
+
307
+ The same rule applies after later server scaffolds such as `addresses` and `comments`. The UI generator can still read the generated resource file directly, but the app runtime needs the local package install boundary to be completed before the CRUD can boot normally.
308
+
287
309
  For standard CRUDs, that file is now intentionally compact. It uses `defineCrudResource(...)` from `@jskit-ai/resource-crud-core`, authors the canonical `schema` / `searchSchema` / `defaultSort` / `autofilter` shape once, and lets JSKIT derive the standard CRUD operation contracts from it.
288
310
 
289
311
  ### Step 3: scaffold the UI
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/agent-docs",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "Distributed JSKIT agent workflows, guides, and generated reference maps.",
5
5
  "type": "module",
6
6
  "files": [
@@ -166,7 +166,7 @@ Exports
166
166
 
167
167
  ### `src/server/cliRuntime/mutations/fileMutations.js`
168
168
  Exports
169
- - `applyFileMutations(packageEntry, appRoot, preparedMutations, managedFiles, managedMigrations, touchedFiles, warnings = [], existingManagedFiles = [])`
169
+ - `applyFileMutations(packageEntry, appRoot, preparedMutations, managedFiles, managedMigrations, touchedFiles, warnings = [], existingManagedFiles = [], { reapplyManagedAppFiles = false } = {})`
170
170
  - `prepareFileMutations(packageEntry, options, appRoot, fileMutations, existingManagedFiles = [])`
171
171
 
172
172
  ### `src/server/cliRuntime/mutations/installMigrationMutation.js`