@jskit-ai/agent-docs 0.1.340 → 0.1.342
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-setup/authentication.md +5 -5
- package/guide/agent/app-setup/database-layer.md +56 -6
- package/guide/agent/app-setup/multi-homing.md +3 -3
- package/guide/agent/app-setup/run-an-accounts-hub.md +9 -9
- package/guide/agent/app-setup/sign-in-through-oidc-issuer.md +8 -6
- package/guide/agent/app-setup/upgrading-jskit.md +52 -4
- package/guide/agent/framework/environments.md +21 -9
- package/guide/agent/framework/sanity-checks.md +11 -11
- package/guide/agent/framework/security-pass.md +12 -12
- package/package.json +1 -1
- package/patterns/feature-package/example/booking-engine/package.json +1 -1
- package/patterns/minimal-foundation/example/package.json +3 -3
- package/patterns/shell-foundation/example/package.json +4 -4
- package/patterns/shell-foundation/example/packages/main/package.json +1 -1
- package/reference/autogen/KERNEL_MAP.md +1 -1
- package/reference/autogen/PATTERN_INDEX.md +38 -38
- package/reference/autogen/packages/assistant-runtime.md +12 -0
- package/reference/autogen/packages/auth-provider-local-core.md +8 -8
- package/reference/autogen/packages/auth-provider-local-db-core.md +20 -0
- package/reference/autogen/packages/auth-provider-oidc-core.md +5 -1
- package/reference/autogen/packages/auth-provider-supabase-core.md +2 -2
- package/reference/autogen/packages/console-core.md +4 -0
- package/reference/autogen/packages/database-runtime.md +15 -0
- package/reference/autogen/packages/kernel.md +2 -1
- package/reference/autogen/packages/oidc-issuer-core.md +7 -3
- package/reference/autogen/packages/rewarded-core.md +16 -0
- package/reference/autogen/packages/users-core.md +4 -0
- package/reference/autogen/packages/workspaces-core.md +4 -0
- package/skills/jskit/references/database-layer.md +56 -6
- package/skills/jskit/references/environments.md +21 -9
- package/skills/jskit/references/multi-homing.md +3 -3
- package/skills/jskit/references/pattern-index.md +38 -38
- package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +3 -3
- package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +4 -4
- package/skills/jskit/references/patterns/app/shell-foundation/example/packages/main/package.json +1 -1
- package/skills/jskit/references/patterns/auth/accounts-hub/PATTERN.md +2 -2
- package/skills/jskit/references/patterns/auth/accounts-hub/example/package.json +3 -3
- package/skills/jskit/references/patterns/auth/oidc-sign-in/example/.env.example +1 -1
- package/skills/jskit/references/patterns/auth/oidc-sign-in/example/package.json +2 -2
- package/skills/jskit/references/patterns/auth/supabase-auth/example/package.json +1 -1
- package/skills/jskit/references/patterns/connectors/calendar-cli/example/package.json +5 -5
- package/skills/jskit/references/patterns/connectors/event-delivery/PATTERN.md +1 -1
- package/skills/jskit/references/patterns/crud/crud-feature-package/example/packages/books/package.json +3 -3
- package/skills/jskit/references/patterns/database/mysql-application/PATTERN.md +3 -3
- package/skills/jskit/references/patterns/database/mysql-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/database/postgres-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/realtime/realtime-application/PATTERN.md +2 -2
- package/skills/jskit/references/patterns/realtime/realtime-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/server/feature-package/example/booking-engine/package.json +1 -1
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users/package.json +3 -3
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users-workspace/package.json +6 -6
- package/skills/jskit/references/sanity-checks.md +11 -11
- package/skills/jskit/references/security-pass.md +12 -12
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
"db:migrate:status": "knex --knexfile ./knexfile.js migrate:list"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@jskit-ai/connectors-core": "0.2.
|
|
11
|
-
"@jskit-ai/connector-google-calendar": "0.2.
|
|
12
|
-
"@jskit-ai/database-runtime": "0.1.
|
|
13
|
-
"@jskit-ai/database-runtime-mysql": "0.1.
|
|
14
|
-
"@jskit-ai/kernel": "0.2.
|
|
10
|
+
"@jskit-ai/connectors-core": "0.2.45",
|
|
11
|
+
"@jskit-ai/connector-google-calendar": "0.2.45",
|
|
12
|
+
"@jskit-ai/database-runtime": "0.1.278",
|
|
13
|
+
"@jskit-ai/database-runtime-mysql": "0.1.276",
|
|
14
|
+
"@jskit-ai/kernel": "0.2.28",
|
|
15
15
|
"knex": "^3.1.0"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -131,7 +131,7 @@ const reconcile = workflows.createFunction(
|
|
|
131
131
|
async ({ step }) => step.run("reconcile-due", () => reports.reconcileDueRequests())
|
|
132
132
|
);
|
|
133
133
|
// `fastify` is the app's existing server. The SDK validates signed requests
|
|
134
|
-
// using INNGEST_SIGNING_KEY from the
|
|
134
|
+
// using INNGEST_SIGNING_KEY from the environment of the app's staging or production server.
|
|
135
135
|
await fastify.register(fastifyPlugin, { client: workflows, functions: [report, reconcile] });
|
|
136
136
|
```
|
|
137
137
|
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"./shared": "./src/shared/index.js"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@jskit-ai/crud-core": "0.2.
|
|
13
|
-
"@jskit-ai/resource-core": "0.1.
|
|
14
|
-
"@jskit-ai/resource-crud-core": "0.1.
|
|
12
|
+
"@jskit-ai/crud-core": "0.2.46",
|
|
13
|
+
"@jskit-ai/resource-core": "0.1.219",
|
|
14
|
+
"@jskit-ai/resource-crud-core": "0.1.221"
|
|
15
15
|
},
|
|
16
16
|
"jskit": {
|
|
17
17
|
"kind": "runtime",
|
|
@@ -52,7 +52,7 @@ Knex discovers package-owned migrations from the installed dependency graph.
|
|
|
52
52
|
`example/package.json` contains the runtime dependency and database scripts.
|
|
53
53
|
`example/knexfile.js` loads an optional local `.env` and fixes the MySQL dialect.
|
|
54
54
|
`example/scripts/prepare-database.js` is the portable migrate-then-seed
|
|
55
|
-
entrypoint for managed sessions and
|
|
55
|
+
entrypoint for managed sessions and for staging and production servers. It loads the optional `.env`
|
|
56
56
|
as the knexfile does, and migrates the database `DB_NAME` names without
|
|
57
57
|
creating it: the hosting environment or a database administrator creates it
|
|
58
58
|
first. `example/.env.example` names the connection values and separate test
|
|
@@ -83,8 +83,8 @@ server its own copy of `BROWSER_TEST_DB_NAME`, restored from the same kind of
|
|
|
83
83
|
snapshot and seeded in one transaction by the app's fixture `seed`, which
|
|
84
84
|
restores any migration-owned baseline rows the app needs. Every server serves
|
|
85
85
|
the production build. Both refuse the application's database (`DB_NAME`,
|
|
86
|
-
`DATABASE_URL`'s, the Knex connection's), `
|
|
87
|
-
database and its copies. Provision `TEST_DB_NAME`, `BROWSER_TEST_DB_NAME` and
|
|
86
|
+
`DATABASE_URL`'s, the Knex connection's), `STAGING_DB_NAME`,
|
|
87
|
+
`PRODUCTION_DB_NAME` and the other test database and its copies. Provision `TEST_DB_NAME`, `BROWSER_TEST_DB_NAME` and
|
|
88
88
|
their numbered copies with grants for the application account (a `<app>_%`
|
|
89
89
|
grant covers them); a user who may create no copies runs one file or worker at
|
|
90
90
|
a time. Two test runs at once need different database names. Test-only server
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"test": "jskit test --databases"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@jskit-ai/database-runtime": "0.1.
|
|
13
|
-
"@jskit-ai/database-runtime-postgres": "0.1.
|
|
12
|
+
"@jskit-ai/database-runtime": "0.1.278",
|
|
13
|
+
"@jskit-ai/database-runtime-postgres": "0.1.275"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -22,8 +22,8 @@ delivery semantics are clear. A single-process application does not need Redis.
|
|
|
22
22
|
## Product decisions
|
|
23
23
|
|
|
24
24
|
Decide which events are public contracts, their scopes and payloads, reconnect
|
|
25
|
-
behavior, whether a connection indicator belongs in the UI, and whether
|
|
26
|
-
|
|
25
|
+
behavior, whether a connection indicator belongs in the UI, and whether
|
|
26
|
+
staging or production needs a Redis backplane.
|
|
27
27
|
|
|
28
28
|
## Invariants
|
|
29
29
|
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"./shared": "./src/shared/index.js"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@jskit-ai/crud-core": "0.2.
|
|
14
|
-
"@jskit-ai/resource-crud-core": "0.1.
|
|
15
|
-
"@jskit-ai/users-core": "0.2.
|
|
13
|
+
"@jskit-ai/crud-core": "0.2.46",
|
|
14
|
+
"@jskit-ai/resource-crud-core": "0.1.221",
|
|
15
|
+
"@jskit-ai/users-core": "0.2.56"
|
|
16
16
|
},
|
|
17
17
|
"jskit": {
|
|
18
18
|
"kind": "runtime",
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
"./shared": "./src/shared/index.js"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@jskit-ai/crud-core": "0.2.
|
|
14
|
-
"@jskit-ai/resource-crud-core": "0.1.
|
|
15
|
-
"@jskit-ai/users-core": "0.2.
|
|
16
|
-
"@jskit-ai/workspaces-core": "0.2.
|
|
13
|
+
"@jskit-ai/crud-core": "0.2.46",
|
|
14
|
+
"@jskit-ai/resource-crud-core": "0.1.221",
|
|
15
|
+
"@jskit-ai/users-core": "0.2.56",
|
|
16
|
+
"@jskit-ai/workspaces-core": "0.2.56"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@jskit-ai/kernel": "0.2.
|
|
20
|
-
"@jskit-ai/resource-runtime": "0.2.
|
|
19
|
+
"@jskit-ai/kernel": "0.2.28",
|
|
20
|
+
"@jskit-ai/resource-runtime": "0.2.42"
|
|
21
21
|
},
|
|
22
22
|
"jskit": {
|
|
23
23
|
"kind": "runtime",
|
|
@@ -165,22 +165,22 @@ A consolidation drops behaviour there without a failing build.
|
|
|
165
165
|
`router.back()` and hand-made back controls, so Up lands inside the app
|
|
166
166
|
even on a page opened from a link.
|
|
167
167
|
|
|
168
|
-
###
|
|
169
|
-
|
|
170
|
-
- A
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
- On an empty
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
production](/guide/app-setup/authentication#the-first-account-in-production-local-auth)).
|
|
168
|
+
### Staging and production settings
|
|
169
|
+
|
|
170
|
+
- A server sets `APP_ENV=staging` or `production` and `NODE_ENV=production`
|
|
171
|
+
([Environments](environments.md)); only then does local auth
|
|
172
|
+
ask for a setup code and refuse development settings.
|
|
173
|
+
- On an empty database there, local auth asks for the first account's setup
|
|
174
|
+
code, so whoever reaches a new server first cannot own it ([The first account
|
|
175
|
+
in staging and
|
|
176
|
+
production](/guide/app-setup/authentication#the-first-account-in-staging-and-production-local-auth)).
|
|
177
177
|
Give any registration of your own the same protection.
|
|
178
178
|
- `config.securityHeaders` sends the security headers, with the content
|
|
179
179
|
security policy reported, not enforced, by default; read them on a
|
|
180
180
|
production build ([Security
|
|
181
181
|
headers](/guide/app-setup/initial-scaffolding#security-headers)).
|
|
182
|
-
- Email confirmation needs `auth.local.confirmation-sender`
|
|
183
|
-
|
|
182
|
+
- Email confirmation needs `auth.local.confirmation-sender` there, or the
|
|
183
|
+
server refuses to start while anyone may register ([Email
|
|
184
184
|
confirmation](/guide/app-setup/authentication#email-confirmation-local-auth)).
|
|
185
185
|
- Changing the assistant's instructions needs `assistant.settings.update` or
|
|
186
186
|
the surface's own permission ([Who may change the
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
A security pass makes an app refuse what it should. Genesis's security pass
|
|
6
6
|
skill (`genesis-security-pass`) holds the method: map every way in, work
|
|
7
|
-
through authorization, sign-in, input, secrets, production settings and
|
|
7
|
+
through authorization, sign-in, input, secrets, staging and production settings and
|
|
8
8
|
dependencies, prove each finding by sending the input that breaks it, and keep
|
|
9
9
|
a test that fails without each fix. This page says where each of those lives in
|
|
10
10
|
a JSKIT app. The rules it applies are already in [Typed features](typed-features.md),
|
|
@@ -75,7 +75,7 @@ a JSKIT app. The rules it applies are already in [Typed features](typed-features
|
|
|
75
75
|
invitations, costly reads, calls to a paid service) declares
|
|
76
76
|
`rateLimit: { max, timeWindow }`, refused with 429 `kernel.http.rateLimited`.
|
|
77
77
|
Each limit gets a test expecting the 429.
|
|
78
|
-
- Sign-in cookies are httpOnly, and in production `Secure` with the `__Host-`
|
|
78
|
+
- Sign-in cookies are httpOnly, and in staging and production `Secure` with the `__Host-`
|
|
79
79
|
prefix; `AUTH_COOKIE_SAME_SITE` is `lax` or `strict`
|
|
80
80
|
([Sign-in cookies and SameSite](/guide/app-setup/authentication#sign-in-cookies-and-samesite)).
|
|
81
81
|
Every unsafe `/api` method checks its CSRF token unless the route sets
|
|
@@ -89,20 +89,20 @@ a JSKIT app. The rules it applies are already in [Typed features](typed-features
|
|
|
89
89
|
an account exists. Give the app's own invitation, lookup and sign-up routes
|
|
90
90
|
the same answer.
|
|
91
91
|
|
|
92
|
-
##
|
|
92
|
+
## Staging and production settings and secrets
|
|
93
93
|
|
|
94
94
|
- `APP_ENV=staging` or `APP_ENV=production`, with `NODE_ENV=production`, set by
|
|
95
|
-
the Deployment's Serve step, makes a server
|
|
95
|
+
the Deployment's Serve step, makes a server a staging or production server
|
|
96
96
|
([Environments](environments.md)). There local auth requires
|
|
97
97
|
`AUTH_LOCAL_SESSION_SECRET`, refuses `AUTH_DEV_BYPASS_ENABLED` and
|
|
98
98
|
`AUTH_LOCAL_RECOVERY_DEV_OUTPUT`, and refuses to start without a confirmation
|
|
99
99
|
sender while anyone may register
|
|
100
|
-
([
|
|
101
|
-
- On an empty production database the first account needs the
|
|
102
|
-
(403 `auth.local.setup.codeRequired`), so whoever reaches a new
|
|
103
|
-
first cannot own it. A registration or admin bootstrap of the app's own
|
|
100
|
+
([Staging and production settings](sanity-checks.md#staging-and-production-settings)).
|
|
101
|
+
- On an empty staging or production database the first account needs the
|
|
102
|
+
setup code (403 `auth.local.setup.codeRequired`), so whoever reaches a new
|
|
103
|
+
staging or production server first cannot own it. A registration or admin bootstrap of the app's own
|
|
104
104
|
needs the same protection
|
|
105
|
-
([The first account in production](/guide/app-setup/authentication#the-first-account-in-production-local-auth)).
|
|
105
|
+
([The first account in staging and production](/guide/app-setup/authentication#the-first-account-in-staging-and-production-local-auth)).
|
|
106
106
|
- `AUTH_LOCAL_SESSION_SECRET` and every other secret live in private Env, read
|
|
107
107
|
on the server, and the Deployment generates the session secret. Nothing
|
|
108
108
|
secret goes in `config/public.js`, which the browser imports, or in a
|
|
@@ -111,8 +111,8 @@ a JSKIT app. The rules it applies are already in [Typed features](typed-features
|
|
|
111
111
|
server error."; an `AppError`'s message is shown at any status, so it never
|
|
112
112
|
carries internals
|
|
113
113
|
([Internal failures are plain errors](typed-features.md#internal-failures-are-plain-errors)).
|
|
114
|
-
- `config.securityHeaders` sets the security headers.
|
|
115
|
-
transport security, framing protection and a content security policy that is
|
|
114
|
+
- `config.securityHeaders` sets the security headers. Staging and production
|
|
115
|
+
add transport security, framing protection and a content security policy that is
|
|
116
116
|
reported, not enforced, by default; enforce it once the pages run without
|
|
117
117
|
violations, and read the headers on a production build
|
|
118
118
|
([Security headers](/guide/app-setup/initial-scaffolding#security-headers)).
|
|
@@ -129,7 +129,7 @@ a JSKIT app. The rules it applies are already in [Typed features](typed-features
|
|
|
129
129
|
workspace), a write without `csrf-token`, and one request past each
|
|
130
130
|
`rateLimit` (429). A body that does not validate, sent without a session,
|
|
131
131
|
must get the refusal, not field errors.
|
|
132
|
-
-
|
|
132
|
+
- Staging and production settings: start the server with `APP_ENV=staging`, `NODE_ENV=production` and the
|
|
133
133
|
test database, and check that it stops without `AUTH_LOCAL_SESSION_SECRET`,
|
|
134
134
|
that registering asks for the setup code, and the response headers.
|
|
135
135
|
- Run `npm audit` and `npm run verify`.
|