@jskit-ai/agent-docs 0.1.127 → 0.1.129
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/realtime.md +13 -13
- package/guide/agent/app-setup/upgrade-beta-1-to-final.md +13 -2
- package/guide/agent/app-setup/working-with-the-jskit-cli.md +6 -1
- package/guide/agent/generators/row-policies.md +2 -10
- package/package.json +1 -1
- package/reference/autogen/KERNEL_MAP.md +3 -3
- package/reference/autogen/packages/kernel.md +7 -5
- package/reference/autogen/tooling/create-app.md +0 -10
- package/reference/autogen/tooling/jskit-cli.md +0 -12
- package/reference/autogen/tooling/testUtils.md +9 -0
|
@@ -47,7 +47,7 @@ So the first visible value of the package is not a whole new screen. It is a tin
|
|
|
47
47
|
|
|
48
48
|
The app already had a browser dev server on `5173` and a backend runtime on `3000`.
|
|
49
49
|
|
|
50
|
-
`realtime`
|
|
50
|
+
`realtime` declares a websocket proxy for `/socket.io` in its published `package.json.jskit` metadata. The JSKIT Vite plugin reads that declaration from the installed npm graph and forwards websocket traffic from the frontend dev server on `5173` to the backend runtime on `3000`.
|
|
51
51
|
|
|
52
52
|
So one of the main values of this package is that you do **not** have to hand-edit Vite config just to make socket.io work in local development.
|
|
53
53
|
|
|
@@ -210,26 +210,26 @@ REALTIME_REDIS_URL=
|
|
|
210
210
|
|
|
211
211
|
That empty value is deliberate. It means the app can start with the in-memory adapter locally, and you can fill in a real Redis URL later if you need cross-instance fan-out.
|
|
212
212
|
|
|
213
|
-
###
|
|
213
|
+
### Package metadata declares the websocket proxy
|
|
214
214
|
|
|
215
|
-
|
|
215
|
+
The installed `@jskit-ai/realtime` package declares:
|
|
216
216
|
|
|
217
217
|
```json
|
|
218
218
|
{
|
|
219
|
-
"
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
219
|
+
"jskit": {
|
|
220
|
+
"vite": {
|
|
221
|
+
"proxy": {
|
|
222
|
+
"/socket.io": {
|
|
223
|
+
"changeOrigin": true,
|
|
224
|
+
"ws": true
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
227
|
}
|
|
228
|
-
|
|
228
|
+
}
|
|
229
229
|
}
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
`createJskitClientBootstrapPlugin({ proxyTarget })` reads that metadata directly. The application owns only its normal Vite config and proxy target; installing or removing the npm package changes the active proxy on the next Vite start without generated project state.
|
|
233
233
|
|
|
234
234
|
### `src/placement.js` includes the shell status placement
|
|
235
235
|
|
|
@@ -54,7 +54,7 @@ Move every package relationship from `jskit.dependsOn` to the appropriate standa
|
|
|
54
54
|
|
|
55
55
|
Pin `@jskit-ai/*` packages to exact versions. Remove `jskit.dependsOn` completely.
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
Rename provider-class `static dependsOn` to `static startsAfter`, then audit every entry. Keep only providers whose registration or boot must complete before the declaring provider reaches the same phase. JSKIT completes registration for the entire graph before beginning any boot method, so a lazily consumed service does not justify an ordering edge.
|
|
58
58
|
|
|
59
59
|
## 4. Remove Beta 1 project state
|
|
60
60
|
|
|
@@ -63,11 +63,22 @@ Delete these paths from the application:
|
|
|
63
63
|
```text
|
|
64
64
|
.jskit/lock.json
|
|
65
65
|
.jskit/verification/
|
|
66
|
+
.jskit/vite.dev.proxy.json
|
|
66
67
|
```
|
|
67
68
|
|
|
68
69
|
Remove ignore rules created solely for `.jskit/verification/`.
|
|
69
70
|
|
|
70
|
-
Do not translate
|
|
71
|
+
Do not translate these paths into replacements. Final Release derives package state from `package.json`, `package-lock.json`, installed package manifests, application config, migration files, and generated CI.
|
|
72
|
+
|
|
73
|
+
Delete the app-local Vite proxy loader and any `vite.shared.mjs` file used only for that generated JSON. Pass the application's API target to the standard plugin instead:
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
createJskitClientBootstrapPlugin({
|
|
77
|
+
proxyTarget: apiProxyTarget
|
|
78
|
+
})
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Installed packages now declare development proxies in `package.json.jskit.vite.proxy`, and the plugin derives the active proxy table directly whenever Vite starts.
|
|
71
82
|
|
|
72
83
|
## 5. Replace command usage
|
|
73
84
|
|
|
@@ -40,6 +40,9 @@ A JSKIT package is an ordinary npm package with a `jskit` object in `package.jso
|
|
|
40
40
|
"providers": []
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
+
"vite": {
|
|
44
|
+
"proxy": {}
|
|
45
|
+
},
|
|
43
46
|
"mutations": {
|
|
44
47
|
"dependencies": {
|
|
45
48
|
"runtime": {},
|
|
@@ -63,7 +66,9 @@ needed by generated application-owned source or application-level tooling. It
|
|
|
63
66
|
does not declare relationships between JSKIT packages and does not affect
|
|
64
67
|
package ordering.
|
|
65
68
|
|
|
66
|
-
`runtime.server.providers` and `runtime.client.providers` declare runtime entrypoints. A provider class may use `static
|
|
69
|
+
`runtime.server.providers` and `runtime.client.providers` declare runtime entrypoints. A provider class may use `static startsAfter` when its own registration or boot genuinely requires another provider to have completed the same lifecycle phase first. JSKIT registers every provider before booting any provider, so later service consumption does not require an ordering declaration.
|
|
70
|
+
|
|
71
|
+
`jskit.vite.proxy` declares development proxy requirements as path-keyed metadata. `createJskitClientBootstrapPlugin({ proxyTarget })` reads those declarations directly from the installed npm graph when Vite starts. Package installation does not generate an intermediate proxy file.
|
|
67
72
|
|
|
68
73
|
Use exact versions for `@jskit-ai/*` dependencies. npm's `package-lock.json` remains the reproducible installation record.
|
|
69
74
|
|
|
@@ -251,13 +251,7 @@ The owning provider creates the visibility object during `register()` and consum
|
|
|
251
251
|
class OrganisationUnitsProvider {
|
|
252
252
|
static id = "crud.organisation_units";
|
|
253
253
|
|
|
254
|
-
static
|
|
255
|
-
"runtime.actions",
|
|
256
|
-
"runtime.database",
|
|
257
|
-
"auth.policy.fastify",
|
|
258
|
-
"local.main",
|
|
259
|
-
"json-rest-api.core"
|
|
260
|
-
];
|
|
254
|
+
static startsAfter = ["json-rest-api.core", "local.main", "runtime.actions"];
|
|
261
255
|
|
|
262
256
|
register(app) {
|
|
263
257
|
app.instance(
|
|
@@ -345,8 +339,6 @@ The safety package depends on organisation-units and registers its grant:
|
|
|
345
339
|
class SafetyProvider {
|
|
346
340
|
static id = "safety.core";
|
|
347
341
|
|
|
348
|
-
static dependsOn = ["crud.organisation_units"];
|
|
349
|
-
|
|
350
342
|
register(app) {
|
|
351
343
|
registerOrganisationUnitVisibility(app, {
|
|
352
344
|
id: "safety-manager-descendants",
|
|
@@ -360,7 +352,7 @@ class SafetyProvider {
|
|
|
360
352
|
|
|
361
353
|
The organisation-units package never imports safety. Installing safety adds the grant; omitting safety leaves that grant absent.
|
|
362
354
|
|
|
363
|
-
|
|
355
|
+
No provider start-order declaration is needed here. JSKIT completes every provider's `register()` phase before any provider begins `boot()`, so safety's contribution is present before organisation-units seals the registry. The normal npm dependency points from safety to organisation-units because safety imports its registration API.
|
|
364
356
|
|
|
365
357
|
## Descendant visibility with a recursive CTE
|
|
366
358
|
|
package/package.json
CHANGED
|
@@ -511,7 +511,7 @@ Exports
|
|
|
511
511
|
Exports
|
|
512
512
|
- `Application`
|
|
513
513
|
- `createApplication(options = {})`
|
|
514
|
-
- `createProviderClass({ id,
|
|
514
|
+
- `createProviderClass({ id, startsAfter = [], register = null, boot = null, shutdown = null } = {})`
|
|
515
515
|
Local functions
|
|
516
516
|
- `normalizeStringArray(value)`
|
|
517
517
|
- `nowMilliseconds()`
|
|
@@ -555,7 +555,7 @@ Exports
|
|
|
555
555
|
- `KernelError`
|
|
556
556
|
- `ProviderNormalizationError`
|
|
557
557
|
- `DuplicateProviderError`
|
|
558
|
-
- `
|
|
558
|
+
- `ProviderStartOrderError`
|
|
559
559
|
- `ProviderLifecycleError`
|
|
560
560
|
|
|
561
561
|
### `runtime/kernelErrors.js`
|
|
@@ -563,7 +563,7 @@ Exports
|
|
|
563
563
|
- `KernelError`
|
|
564
564
|
- `ProviderNormalizationError`
|
|
565
565
|
- `DuplicateProviderError`
|
|
566
|
-
- `
|
|
566
|
+
- `ProviderStartOrderError`
|
|
567
567
|
- `ProviderLifecycleError`
|
|
568
568
|
|
|
569
569
|
### `runtime/serviceProvider.js`
|
|
@@ -127,7 +127,7 @@ Exports
|
|
|
127
127
|
Exports
|
|
128
128
|
- `Application`
|
|
129
129
|
- `createApplication(options = {})`
|
|
130
|
-
- `createProviderClass({ id,
|
|
130
|
+
- `createProviderClass({ id, startsAfter = [], register = null, boot = null, shutdown = null } = {})`
|
|
131
131
|
Local functions
|
|
132
132
|
- `normalizeStringArray(value)`
|
|
133
133
|
- `nowMilliseconds()`
|
|
@@ -171,7 +171,7 @@ Exports
|
|
|
171
171
|
- `KernelError`
|
|
172
172
|
- `ProviderNormalizationError`
|
|
173
173
|
- `DuplicateProviderError`
|
|
174
|
-
- `
|
|
174
|
+
- `ProviderStartOrderError`
|
|
175
175
|
- `ProviderLifecycleError`
|
|
176
176
|
|
|
177
177
|
### `shared/runtime/kernelErrors.js`
|
|
@@ -179,7 +179,7 @@ Exports
|
|
|
179
179
|
- `KernelError`
|
|
180
180
|
- `ProviderNormalizationError`
|
|
181
181
|
- `DuplicateProviderError`
|
|
182
|
-
- `
|
|
182
|
+
- `ProviderStartOrderError`
|
|
183
183
|
- `ProviderLifecycleError`
|
|
184
184
|
|
|
185
185
|
### `shared/runtime/serviceProvider.js`
|
|
@@ -706,13 +706,15 @@ Exports
|
|
|
706
706
|
- `resolveInstalledClientPackageIds(options)`
|
|
707
707
|
- `resolveLocalScopePackageIds({ appRoot })`
|
|
708
708
|
- `resolveInstalledClientModules({ appRoot })`
|
|
709
|
-
- `
|
|
709
|
+
- `resolveInstalledViteProxyEntries(installedPackages = [], { proxyTarget = "" } = {})`
|
|
710
|
+
- `createJskitClientBootstrapPlugin({ proxyTarget = "" } = {})`
|
|
710
711
|
Local functions
|
|
711
712
|
- `isLocalScopePackageId(value)`
|
|
712
713
|
- `readJsonFile(filePath, fallback)`
|
|
713
714
|
- `hasClientExport(packageJson)`
|
|
714
715
|
- `isPathInsideRoot(rootPath, candidatePath)`
|
|
715
716
|
- `splitSpecifierSuffix(source)`
|
|
717
|
+
- `resolveClientModulesFromInstalledPackages(installedPackages = [])`
|
|
716
718
|
- `normalizeClientModulePackageMetadataEntries(value)`
|
|
717
719
|
- `resolveClientRuntimeDedupeSpecifiers(userResolveConfig = {})`
|
|
718
720
|
|
|
@@ -930,7 +932,7 @@ Exports
|
|
|
930
932
|
- `KernelError`
|
|
931
933
|
- `ProviderNormalizationError`
|
|
932
934
|
- `DuplicateProviderError`
|
|
933
|
-
- `
|
|
935
|
+
- `ProviderStartOrderError`
|
|
934
936
|
- `ProviderLifecycleError`
|
|
935
937
|
- `KernelCoreServiceProvider`
|
|
936
938
|
|
|
@@ -207,11 +207,6 @@ Exports
|
|
|
207
207
|
Local functions
|
|
208
208
|
- `clientEntry(()`
|
|
209
209
|
|
|
210
|
-
### `templates/base-shell/vite.shared.mjs`
|
|
211
|
-
Exports
|
|
212
|
-
- `toPositiveInt(value, fallback)`
|
|
213
|
-
- `loadViteDevProxyEntries({ appRootUrl = import.meta.url, fallbackTarget = "" } = {})`
|
|
214
|
-
|
|
215
210
|
### `templates/minimal-shell/bin/server.js`
|
|
216
211
|
Exports
|
|
217
212
|
- None
|
|
@@ -315,11 +310,6 @@ Exports
|
|
|
315
310
|
Local functions
|
|
316
311
|
- `clientEntry(()`
|
|
317
312
|
|
|
318
|
-
### `templates/minimal-shell/vite.shared.mjs`
|
|
319
|
-
Exports
|
|
320
|
-
- `toPositiveInt(value, fallback)`
|
|
321
|
-
- `loadViteDevProxyEntries({ appRootUrl = import.meta.url, fallbackTarget = "" } = {})`
|
|
322
|
-
|
|
323
313
|
### bin
|
|
324
314
|
|
|
325
315
|
### `bin/jskit-create-app.js`
|
|
@@ -435,18 +435,6 @@ Local functions
|
|
|
435
435
|
- `isExactOptionReference(value = "", optionName = "")`
|
|
436
436
|
- `readEnvValue(content = "", key = "")`
|
|
437
437
|
|
|
438
|
-
### `src/server/cliRuntime/viteProxy.js`
|
|
439
|
-
Exports
|
|
440
|
-
- `createEmptyViteDevProxyConfig()`
|
|
441
|
-
- `normalizeViteDevProxyPath(value = "", { context = "vite proxy entry" } = {})`
|
|
442
|
-
- `normalizeViteDevProxyEntry(value = {}, { context = "vite proxy entry" } = {})`
|
|
443
|
-
- `normalizeViteDevProxyConfig(value = {}, { context = "vite proxy config" } = {})`
|
|
444
|
-
- `resolveViteDevProxyConfigAbsolutePath(appRoot)`
|
|
445
|
-
- `loadViteDevProxyConfig(appRoot, { context = "vite proxy config" } = {})`
|
|
446
|
-
- `writeViteDevProxyConfig(appRoot, config = {}, touchedFiles = null, { dryRun = false } = {})`
|
|
447
|
-
- `normalizeViteProxyMutationRecord(value = {})`
|
|
448
|
-
- `applyViteMutations(packageEntry, appRoot, viteMutations, options, managedVite, touchedFiles, { dryRun = false } = {})`
|
|
449
|
-
|
|
450
438
|
### `src/server/commandHandlers/app.js`
|
|
451
439
|
Exports
|
|
452
440
|
- `createAppCommands(ctx = {})`
|
|
@@ -22,6 +22,15 @@ Exports
|
|
|
22
22
|
- `startViteFixture({ fixtureRoot, configFile = "vite.config.mjs", env = {} } = {})`
|
|
23
23
|
- `stopProcess(runtime)`
|
|
24
24
|
|
|
25
|
+
### `currentJskitWorkspaces.mjs`
|
|
26
|
+
Exports
|
|
27
|
+
- `CURRENT_JSKIT_WORKSPACE_NPM_ENV`
|
|
28
|
+
- `restoreCurrentJskitDependencyVersions(appRoot, packages)`
|
|
29
|
+
- `stageCurrentJskitWorkspaces(appRoot)`
|
|
30
|
+
Local functions
|
|
31
|
+
- `readJson(filePath)`
|
|
32
|
+
- `collectCurrentJskitPackages()`
|
|
33
|
+
|
|
25
34
|
### `fakeFastify.mjs`
|
|
26
35
|
Exports
|
|
27
36
|
- `createFakeFastifyPolicyRuntime({ csrfHandler, autoRunPlugin = null } = {})`
|