@jskit-ai/agent-docs 0.1.3 → 0.1.5

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 (74) hide show
  1. package/DISTR_AGENT.md +11 -1
  2. package/guide/agent/app-extras/assistant.md +1 -1
  3. package/guide/agent/app-extras/realtime.md +1 -1
  4. package/guide/agent/app-setup/a-more-interesting-shell.md +1 -1
  5. package/guide/agent/app-setup/authentication.md +9 -1
  6. package/guide/agent/app-setup/console.md +1 -1
  7. package/guide/agent/app-setup/database-layer.md +1 -1
  8. package/guide/agent/app-setup/initial-scaffolding.md +1 -1
  9. package/guide/agent/app-setup/multi-homing.md +3 -1
  10. package/guide/agent/app-setup/users.md +1 -1
  11. package/guide/agent/app-setup/working-with-the-jskit-cli.md +1 -1
  12. package/guide/agent/generators/advanced-cruds.md +163 -1
  13. package/guide/agent/generators/crud-generators.md +30 -1
  14. package/guide/agent/generators/intro.md +1 -1
  15. package/guide/agent/generators/ui-generators.md +1 -1
  16. package/guide/agent/index.md +1 -1
  17. package/package.json +1 -1
  18. package/reference/autogen/packages/agent-docs.md +19 -1
  19. package/reference/autogen/packages/assistant-core.md +1 -1
  20. package/reference/autogen/packages/assistant-runtime.md +1 -1
  21. package/reference/autogen/packages/assistant.md +1 -1
  22. package/reference/autogen/packages/auth-core.md +1 -1
  23. package/reference/autogen/packages/auth-provider-supabase-core.md +1 -1
  24. package/reference/autogen/packages/auth-web.md +1 -1
  25. package/reference/autogen/packages/console-core.md +1 -1
  26. package/reference/autogen/packages/console-web.md +1 -1
  27. package/reference/autogen/packages/crud-core.md +1 -1
  28. package/reference/autogen/packages/crud-server-generator.md +1 -1
  29. package/reference/autogen/packages/crud-ui-generator.md +1 -1
  30. package/reference/autogen/packages/database-runtime-mysql.md +1 -1
  31. package/reference/autogen/packages/database-runtime-postgres.md +1 -1
  32. package/reference/autogen/packages/database-runtime.md +1 -1
  33. package/reference/autogen/packages/http-runtime.md +1 -1
  34. package/reference/autogen/packages/kernel.md +1 -1
  35. package/reference/autogen/packages/realtime.md +1 -1
  36. package/reference/autogen/packages/shell-web.md +1 -1
  37. package/reference/autogen/packages/storage-runtime.md +1 -1
  38. package/reference/autogen/packages/ui-generator.md +1 -1
  39. package/reference/autogen/packages/uploads-image-web.md +1 -1
  40. package/reference/autogen/packages/uploads-runtime.md +1 -1
  41. package/reference/autogen/packages/users-core.md +1 -1
  42. package/reference/autogen/packages/users-web.md +1 -1
  43. package/reference/autogen/packages/workspaces-core.md +1 -1
  44. package/reference/autogen/packages/workspaces-web.md +1 -1
  45. package/reference/autogen/tooling/config-eslint.md +1 -1
  46. package/reference/autogen/tooling/create-app.md +1 -1
  47. package/reference/autogen/tooling/jskit-catalog.md +1 -1
  48. package/reference/autogen/tooling/jskit-cli.md +1 -1
  49. package/reference/autogen/tooling/test-support.md +1 -1
  50. package/reference/autogen/tooling/testUtils.md +1 -1
  51. package/skills/jskit-review/SKILL.md +12 -2
  52. package/templates/APP_BLUEPRINT.md +9 -0
  53. package/templates/WORKBOARD.md +3 -3
  54. package/templates/app/AGENTS.md +15 -3
  55. package/workflow/bootstrap.md +17 -2
  56. package/workflow/feature-delivery.md +19 -3
  57. package/workflow/review.md +9 -3
  58. package/workflow/scoping.md +10 -1
  59. package/workflow/workboard.md +1 -1
  60. package/guide/human/app-extras/assistant.md +0 -693
  61. package/guide/human/app-extras/realtime.md +0 -268
  62. package/guide/human/app-setup/a-more-interesting-shell.md +0 -732
  63. package/guide/human/app-setup/authentication.md +0 -961
  64. package/guide/human/app-setup/console.md +0 -350
  65. package/guide/human/app-setup/database-layer.md +0 -820
  66. package/guide/human/app-setup/initial-scaffolding.md +0 -753
  67. package/guide/human/app-setup/multi-homing.md +0 -793
  68. package/guide/human/app-setup/users.md +0 -402
  69. package/guide/human/app-setup/working-with-the-jskit-cli.md +0 -1047
  70. package/guide/human/generators/advanced-cruds.md +0 -921
  71. package/guide/human/generators/crud-generators.md +0 -554
  72. package/guide/human/generators/intro.md +0 -107
  73. package/guide/human/generators/ui-generators.md +0 -663
  74. package/guide/human/index.md +0 -37
@@ -1,350 +0,0 @@
1
- # Console
2
-
3
- This chapter adds a separate `console` surface and looks at how JSKIT keeps that operator slice separate from the normal account/user layer.
4
-
5
- The important architectural change is simple:
6
-
7
- - `users-web` owns account UI
8
- - `console-web` owns console UI
9
- - `console-core` owns the console schema, bootstrap flag, routes, and services behind it
10
-
11
- ## Recap from previous chapters
12
-
13
- To get back to the same starting point as the end of the previous chapter, run:
14
-
15
- ```bash
16
- SUPABASE_URL=...
17
- SUPABASE_KEY=...
18
- DB_HOST=127.0.0.1
19
- DB_PORT=3306
20
- DB_NAME=exampleapp
21
- DB_USER=exampleapp
22
- DB_PASSWORD=secret
23
-
24
- npx @jskit-ai/create-app exampleapp --tenancy-mode none
25
- cd exampleapp
26
- npm install
27
-
28
- npx jskit add package shell-web
29
- npx jskit add package auth-provider-supabase-core \
30
- --auth-supabase-url "$SUPABASE_URL" \
31
- --auth-supabase-publishable-key "$SUPABASE_KEY" \
32
- --app-public-url "http://localhost:5173"
33
- npx jskit add bundle auth-base
34
- npx jskit add package database-runtime-mysql \
35
- --db-host "$DB_HOST" \
36
- --db-port "$DB_PORT" \
37
- --db-name "$DB_NAME" \
38
- --db-user "$DB_USER" \
39
- --db-password "$DB_PASSWORD"
40
- npx jskit add package users-web
41
- npm install
42
- npm run db:migrate
43
- ```
44
-
45
- If you are already continuing from the previous chapter, you are already in the right place and can skip that setup.
46
-
47
- ## Installing `console-web`
48
-
49
- From inside `exampleapp`, run:
50
-
51
- ```bash
52
- npx jskit add package console-web
53
- npm install
54
- npm run db:migrate
55
- ```
56
-
57
- `console-web` brings one important dependency with it:
58
-
59
- - `console-core` owns the console schema, owner check, bootstrap flag, and API routes
60
- - `console-web` owns the console surface scaffold, settings shell, and menu placement
61
-
62
- So the console is a real vertical slice now. The users packages no longer know about it.
63
-
64
- ## What the console is for
65
-
66
- The console is not a second home page, and it is not the same as account settings.
67
-
68
- Its role is much lower-level than that.
69
-
70
- - `account` is for the current user's own profile and settings
71
- - `console` is for the people who run the app as a whole
72
-
73
- So when you think about the console, think in terms of app runtime and operations, not personal preferences.
74
-
75
- This is the surface where you would expect to put things like:
76
-
77
- - site-wide bans or other cross-user moderation controls
78
- - server error logging and inspection
79
- - operational diagnostics
80
- - maintenance or repair scripts
81
- - global feature switches
82
- - whole-app settings that affect every user, not just the current one
83
-
84
- In other words, the console is the place for configuring and inspecting the runtime of the application as a whole.
85
-
86
- That is why the starter console page describes itself as:
87
-
88
- - operator tools
89
- - scripts
90
- - diagnostics
91
-
92
- It is also why the console surface has stricter access rules than `/account`. `/account` is for any signed-in user. `console` is for trusted operators with low-level control over the running app.
93
-
94
- ## Running it
95
-
96
- Start both processes:
97
-
98
- ```bash
99
- npm run dev
100
- npm run server
101
- ```
102
-
103
- Then sign in.
104
-
105
- Once you are authenticated, two things matter:
106
-
107
- - the app now knows who you are as a persistent JSKIT user
108
- - the console bootstrap logic can determine whether you are the console owner
109
-
110
- Open:
111
-
112
- ```text
113
- http://localhost:5173/console
114
- ```
115
-
116
- In a fresh app, the console is intentionally simple.
117
-
118
- - `/console` is the surface landing page
119
- - `/console/settings` is the first nested shell route under it
120
-
121
- That simplicity is useful. It shows the surface boundary clearly before later modules add real console tools.
122
-
123
- ## Why console access is stricter than account access
124
-
125
- This is the most important idea in the chapter.
126
-
127
- The account surface only requires authentication. The console surface requires a specific access flag: `console_owner`.
128
-
129
- That means the guide now has two different kinds of authenticated routes:
130
-
131
- - normal authenticated routes such as `/account`
132
- - privileged authenticated routes such as `/console`
133
-
134
- This is a very useful distinction for junior developers to see early, because many real apps need both:
135
-
136
- - somewhere for every signed-in user
137
- - somewhere only for the app owner or operators
138
-
139
- ## The first console owner
140
-
141
- In a fresh app, the console owner is not configured by hand in a seed file. Instead, JSKIT assigns the first console owner lazily during authenticated bootstrap.
142
-
143
- The rule is simple:
144
-
145
- - when the users bootstrap contributor has already identified a signed-in user
146
- - and the later console bootstrap contributor runs for that same request
147
- - and the singleton console settings record has no owner yet
148
- - **that user becomes the initial console owner**
149
-
150
- So the first real authenticated user to pass through that path claims the console. After that, the console owner check becomes strict.
151
-
152
- This is why the console chapter belongs after the users chapter:
153
-
154
- - before persistent users exist, there is nobody to own the console
155
- - once persistent users exist, JSKIT can finally attach console ownership to a real user id
156
-
157
- ## What `console-web` adds to the app
158
-
159
- The console surface is spread across surface config, access policy config, the placement registry, and the persistent `console_settings` table.
160
-
161
- ### `config/public.js` defines the surface
162
-
163
- The console surface definition is small, but very important:
164
-
165
- ```js
166
- config.surfaceDefinitions.console = {
167
- id: "console",
168
- label: "Console",
169
- pagesRoot: "console",
170
- enabled: true,
171
- requiresAuth: true,
172
- requiresWorkspace: false,
173
- accessPolicyId: "console_owner",
174
- origin: ""
175
- };
176
- ```
177
-
178
- Two details matter most:
179
-
180
- - `requiresAuth: true`
181
- - `accessPolicyId: "console_owner"`
182
-
183
- So this is not just a named route tree. It is a surface with its own access contract.
184
-
185
- ### `config/surfaceAccessPolicies.js` defines the rule
186
-
187
- The matching access policy is:
188
-
189
- ```js
190
- surfaceAccessPolicies.console_owner = {
191
- requireAuth: true,
192
- requireFlagsAll: ["console_owner"]
193
- };
194
- ```
195
-
196
- This is the first clear example in the guide of a surface guarded by a named flag rather than only by authentication.
197
-
198
- ### The starter console routes are app-owned
199
-
200
- After the previous chapter, the app now has:
201
-
202
- ```text
203
- src/pages/console.vue
204
- src/pages/console/index.vue
205
- src/pages/console/settings.vue
206
- src/pages/console/settings/index.vue
207
- ```
208
-
209
- This follows the same route-owner pattern the guide has already shown on `home` and `settings`.
210
-
211
- - `src/pages/console.vue` is the console surface wrapper
212
- - `src/pages/console/index.vue` is the console landing page
213
- - `src/pages/console/settings.vue` is the nested settings shell
214
- - `src/pages/console/settings/index.vue` is the initial developer-owned stub
215
-
216
- That last file is intentionally empty, because later modules are expected to add real console settings sections into the `console-settings:primary-menu` outlet.
217
-
218
- ### `src/placement.js` wires the first console menu entry
219
-
220
- The starter placement block is:
221
-
222
- ```js
223
- addPlacement({
224
- id: "console.web.menu.settings",
225
- target: "shell-layout:primary-menu",
226
- surfaces: ["console"],
227
- order: 100,
228
- componentToken: "local.main.ui.menu-link-item",
229
- props: {
230
- label: "Settings",
231
- to: "/console/settings",
232
- icon: "mdi-cog-outline"
233
- },
234
- when: ({ auth }) => Boolean(auth?.authenticated)
235
- });
236
- ```
237
-
238
- This is why the console drawer immediately has a `Settings` entry.
239
-
240
- The important design point is the same as in earlier chapters:
241
-
242
- - the shell layout stays generic
243
- - the placement registry decides what appears in that surface
244
-
245
- ## Under the hood
246
-
247
- ### `console-core` installs the `console_settings` schema
248
-
249
- The console migration creates a singleton console settings table:
250
-
251
- ```js
252
- await knex.schema.createTable("console_settings", (table) => {
253
- table.bigInteger("id").primary();
254
- table.bigInteger("owner_user_id").unsigned().nullable().references("id").inTable("users").onDelete("SET NULL");
255
- table.timestamp("created_at", { useTz: false }).notNullable().defaultTo(knex.fn.now());
256
- table.timestamp("updated_at", { useTz: false }).notNullable().defaultTo(knex.fn.now());
257
- });
258
-
259
- await knex("console_settings").insert({
260
- id: 1,
261
- created_at: knex.fn.now(),
262
- updated_at: knex.fn.now()
263
- });
264
- ```
265
-
266
- That table is the anchor for console ownership.
267
-
268
- There is only one console settings record, and it can point at exactly one `owner_user_id`.
269
-
270
- ### The console service claims the first owner lazily
271
-
272
- The core console service is small enough to read in one glance:
273
-
274
- ```js
275
- async function ensureInitialConsoleMember(userId, options = {}) {
276
- const normalizedUserId = normalizeRecordId(userId, { fallback: null });
277
- if (!normalizedUserId) {
278
- throw new AppError(400, "Invalid console user.");
279
- }
280
-
281
- return consoleSettingsRepository.ensureOwnerUserId(normalizedUserId, options);
282
- }
283
-
284
- async function requireConsoleOwner(context = {}, options = {}) {
285
- const actorUserId = normalizeRecordId(context?.actor?.id, { fallback: null });
286
- if (!actorUserId) {
287
- throw new AppError(401, "Authentication required.");
288
- }
289
-
290
- const ownerUserId = await ensureInitialConsoleMember(actorUserId, options);
291
- if (actorUserId !== ownerUserId) {
292
- throw new AppError(403, "Forbidden.");
293
- }
294
- }
295
- ```
296
-
297
- That explains the whole startup story.
298
-
299
- - if no console owner exists yet, the first authenticated user can become it
300
- - once an owner exists, everyone else fails the ownership check
301
-
302
- So the console is seeded lazily, not through a hard-coded seed user.
303
-
304
- ### `console-core` adds the console access flag to the bootstrap payload
305
-
306
- After the users bootstrap contributor has already built the authenticated session payload, the later `console-core` bootstrap contributor extends it with the console flag:
307
-
308
- ```js
309
- surfaceAccess: {
310
- ...surfaceAccess,
311
- consoleowner: consoleOwner
312
- }
313
- ```
314
-
315
- This detail is easy to miss, but it matters:
316
-
317
- - `users-core` identifies the authenticated user and writes `session.userId`
318
- - `console-core` reads that authenticated user id
319
- - `console-core` seeds or checks the singleton console owner record
320
- - then `console-core` writes `surfaceAccess.consoleowner` into the bootstrap payload
321
-
322
- That is how JSKIT can reason about console access at surface level without making the users packages know anything about the console.
323
-
324
- So the console chapter is really about a three-part contract:
325
-
326
- - a surface definition in public config
327
- - an ownership check on the server
328
- - a persistent owner slot in the database
329
-
330
- That is why the console feels like a real app feature already, even before later chapters add CRUDs and richer operator tools into it.
331
-
332
- ## Summary
333
-
334
- This chapter introduced the first privileged operator surface in the guide.
335
-
336
- - `console-web` added the `console` surface and its starter UI scaffold
337
- - `console-core` added the console schema, services, bootstrap contributor, and ownership rules
338
- - the app gained a new surface that is stricter than `/account`
339
-
340
- That stricter access model is the key idea to keep:
341
-
342
- - `/account` is for any signed-in user
343
- - `/console` is only for the console owner
344
-
345
- So the app now has both:
346
-
347
- - a normal authenticated user area
348
- - a privileged operator area with its own server-side ownership check
349
-
350
- The next chapter changes the routing model again by adding workspace-aware surfaces instead of only global ones.