@cosmicdrift/kumiko-bundled-features 0.411.0 → 0.412.0
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/dist/agent-tools/agent-doc-lint.d.ts +9 -0
- package/dist/agent-tools/agent-doc-lint.js +42 -5
- package/dist/agent-tools/agent-manifest.d.ts +0 -1
- package/dist/agent-tools/agent-manifest.js +9 -99
- package/dist/agent-tools/api-docs/anchors.d.ts +14 -0
- package/dist/agent-tools/api-docs/anchors.js +49 -0
- package/dist/agent-tools/api-docs/check.d.ts +7 -0
- package/dist/agent-tools/api-docs/check.js +15 -0
- package/dist/agent-tools/api-docs/collect-events.d.ts +10 -0
- package/dist/agent-tools/api-docs/collect-events.js +90 -0
- package/dist/agent-tools/api-docs/collect.d.ts +15 -0
- package/dist/agent-tools/api-docs/collect.js +108 -0
- package/dist/agent-tools/api-docs/curl.d.ts +5 -0
- package/dist/agent-tools/api-docs/curl.js +24 -0
- package/dist/agent-tools/api-docs/error-table.d.ts +9 -0
- package/dist/agent-tools/api-docs/error-table.js +31 -0
- package/dist/agent-tools/api-docs/examples.d.ts +16 -0
- package/dist/agent-tools/api-docs/examples.js +25 -0
- package/dist/agent-tools/api-docs/generate.d.ts +19 -0
- package/dist/agent-tools/api-docs/generate.js +104 -0
- package/dist/agent-tools/api-docs/index-json.d.ts +15 -0
- package/dist/agent-tools/api-docs/index-json.js +6 -0
- package/dist/agent-tools/api-docs/index.d.ts +9 -0
- package/dist/agent-tools/api-docs/index.js +6 -0
- package/dist/agent-tools/api-docs/list-parameters.d.ts +61 -0
- package/dist/agent-tools/api-docs/list-parameters.js +28 -0
- package/dist/agent-tools/api-docs/markdown.d.ts +29 -0
- package/dist/agent-tools/api-docs/markdown.js +48 -0
- package/dist/agent-tools/api-docs/menu-path.d.ts +8 -0
- package/dist/agent-tools/api-docs/menu-path.js +60 -0
- package/dist/agent-tools/api-docs/model.d.ts +76 -0
- package/dist/agent-tools/api-docs/model.js +1 -0
- package/dist/agent-tools/api-docs/problems.d.ts +32 -0
- package/dist/agent-tools/api-docs/problems.js +28 -0
- package/dist/agent-tools/api-docs/render-events.d.ts +12 -0
- package/dist/agent-tools/api-docs/render-events.js +55 -0
- package/dist/agent-tools/api-docs/render-openapi.d.ts +10 -0
- package/dist/agent-tools/api-docs/render-openapi.js +170 -0
- package/dist/agent-tools/api-docs/render-overview.d.ts +11 -0
- package/dist/agent-tools/api-docs/render-overview.js +60 -0
- package/dist/agent-tools/api-docs/render-reference.d.ts +14 -0
- package/dist/agent-tools/api-docs/render-reference.js +50 -0
- package/dist/agent-tools/api-docs/render-tokens.d.ts +12 -0
- package/dist/agent-tools/api-docs/render-tokens.js +101 -0
- package/dist/agent-tools/api-docs/schema-fields.d.ts +16 -0
- package/dist/agent-tools/api-docs/schema-fields.js +141 -0
- package/dist/agent-tools/api-docs/section-ids.d.ts +25 -0
- package/dist/agent-tools/api-docs/section-ids.js +26 -0
- package/dist/agent-tools/api-docs/system-only.d.ts +5 -0
- package/dist/agent-tools/api-docs/system-only.js +7 -0
- package/dist/agent-tools/api-docs/texts/de.d.ts +123 -0
- package/dist/agent-tools/api-docs/texts/de.js +123 -0
- package/dist/agent-tools/api-docs/texts/en.d.ts +123 -0
- package/dist/agent-tools/api-docs/texts/en.js +123 -0
- package/dist/agent-tools/api-docs/texts/es.d.ts +123 -0
- package/dist/agent-tools/api-docs/texts/es.js +123 -0
- package/dist/agent-tools/api-docs/texts/fr.d.ts +123 -0
- package/dist/agent-tools/api-docs/texts/fr.js +123 -0
- package/dist/agent-tools/api-docs/texts/index.d.ts +14 -0
- package/dist/agent-tools/api-docs/texts/index.js +55 -0
- package/dist/agent-tools/api-docs/texts/it.d.ts +123 -0
- package/dist/agent-tools/api-docs/texts/it.js +123 -0
- package/dist/agent-tools/api-docs/texts/types.d.ts +18 -0
- package/dist/agent-tools/api-docs/texts/types.js +104 -0
- package/dist/agent-tools/api-docs/ui-writes.d.ts +12 -0
- package/dist/agent-tools/api-docs/ui-writes.js +73 -0
- package/dist/agent-tools/handler-schema.d.ts +5 -0
- package/dist/agent-tools/handler-schema.js +37 -0
- package/dist/agent-tools/index.d.ts +2 -1
- package/dist/agent-tools/index.js +2 -1
- package/dist/agent-tools/labels.d.ts +26 -0
- package/dist/agent-tools/labels.js +131 -0
- package/dist/inbound-mail-foundation/entities.d.ts +84 -0
- package/dist/inbound-mail-foundation/entities.js +96 -71
- package/dist/inbound-mail-foundation/feature.js +2 -2
- package/dist/personal-access-tokens/feature.d.ts +1 -0
- package/dist/personal-access-tokens/feature.js +4 -2
- package/dist/personal-access-tokens/handlers/create.write.js +2 -2
- package/dist/personal-access-tokens/i18n.js +5 -1
- package/dist/personal-access-tokens/index.d.ts +4 -2
- package/dist/personal-access-tokens/index.js +29 -2
- package/dist/personal-access-tokens/scope-events-check.d.ts +3 -0
- package/dist/personal-access-tokens/scope-events-check.js +18 -0
- package/dist/personal-access-tokens/screens.js +8 -2
- package/dist/personal-access-tokens/web/constants.d.ts +1 -0
- package/dist/personal-access-tokens/web/constants.js +1 -0
- package/dist/personal-access-tokens/web/scopes.d.ts +2 -0
- package/dist/personal-access-tokens/web/scopes.js +12 -0
- package/package.json +11 -11
- package/src/agent-tools/changes.json +24 -0
- package/src/inbound-mail-foundation/changes.json +6 -0
- package/src/personal-access-tokens/changes.json +6 -0
|
@@ -13,6 +13,7 @@ export const PatErrors = {
|
|
|
13
13
|
// default is a standing-credential risk; the existing 3650-day cap still
|
|
14
14
|
// lets callers who genuinely want a long-lived token pass it explicitly.
|
|
15
15
|
export const PAT_DEFAULT_EXPIRES_IN_DAYS = 90;
|
|
16
|
+
export const PAT_MAX_EXPIRES_IN_DAYS = 3650;
|
|
16
17
|
// Declarative projectionList screen id — the caller's own tokens, revoke as a
|
|
17
18
|
// row action. The app places it via r.nav.
|
|
18
19
|
export const PAT_SCREEN_ID = "api-tokens";
|
|
@@ -2,6 +2,7 @@ export type PatScopeDef = {
|
|
|
2
2
|
readonly label: string;
|
|
3
3
|
readonly read: readonly string[];
|
|
4
4
|
readonly write?: readonly string[];
|
|
5
|
+
readonly events?: readonly string[];
|
|
5
6
|
};
|
|
6
7
|
export type PatScopeConfig = Readonly<Record<string, PatScopeDef>>;
|
|
7
8
|
export type PatLevel = "read" | "write";
|
|
@@ -9,4 +10,5 @@ export declare function parseGrant(grant: string): {
|
|
|
9
10
|
domain: string;
|
|
10
11
|
level: string;
|
|
11
12
|
} | null;
|
|
13
|
+
export declare function expandScopeEvents(config: PatScopeConfig, granted: readonly string[]): string[];
|
|
12
14
|
export declare function expandScopes(config: PatScopeConfig, granted: readonly string[]): string[];
|
|
@@ -6,6 +6,18 @@ export function parseGrant(grant) {
|
|
|
6
6
|
return null;
|
|
7
7
|
return { domain: grant.slice(0, idx), level: grant.slice(idx + 1) };
|
|
8
8
|
}
|
|
9
|
+
// Union of the webhook events of every granted domain; read level already suffices to subscribe.
|
|
10
|
+
export function expandScopeEvents(config, granted) {
|
|
11
|
+
const out = new Set();
|
|
12
|
+
for (const grant of granted) {
|
|
13
|
+
const parsed = parseGrant(grant);
|
|
14
|
+
if (!parsed)
|
|
15
|
+
continue;
|
|
16
|
+
for (const qn of config[parsed.domain]?.events ?? [])
|
|
17
|
+
out.add(qn);
|
|
18
|
+
}
|
|
19
|
+
return [...out];
|
|
20
|
+
}
|
|
9
21
|
// Expand granted "<domain>:<level>" entries into the union of QN globs: read
|
|
10
22
|
// always grants the read QNs; write additionally grants the write QNs. Unknown
|
|
11
23
|
// domains contribute nothing (fail-closed — a scope dropped from config after a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-bundled-features",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.412.0",
|
|
4
4
|
"description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -614,9 +614,9 @@
|
|
|
614
614
|
}
|
|
615
615
|
},
|
|
616
616
|
"dependencies": {
|
|
617
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
618
|
-
"@cosmicdrift/kumiko-renderer": "0.
|
|
619
|
-
"@cosmicdrift/kumiko-types": "0.
|
|
617
|
+
"@cosmicdrift/kumiko-framework": "0.412.0",
|
|
618
|
+
"@cosmicdrift/kumiko-renderer": "0.412.0",
|
|
619
|
+
"@cosmicdrift/kumiko-types": "0.412.0",
|
|
620
620
|
"@mollie/api-client": "^4.6.0",
|
|
621
621
|
"@node-rs/argon2": "^2.2.2",
|
|
622
622
|
"@tiptap/core": "^3.32.2",
|
|
@@ -1254,19 +1254,19 @@
|
|
|
1254
1254
|
"LICENSE"
|
|
1255
1255
|
],
|
|
1256
1256
|
"devDependencies": {
|
|
1257
|
-
"@cosmicdrift/kumiko-locale-de": "0.
|
|
1258
|
-
"@cosmicdrift/kumiko-locale-es": "0.
|
|
1259
|
-
"@cosmicdrift/kumiko-locale-fr": "0.
|
|
1260
|
-
"@cosmicdrift/kumiko-locale-it": "0.
|
|
1261
|
-
"@cosmicdrift/kumiko-renderer-mail-html": "0.
|
|
1262
|
-
"@cosmicdrift/kumiko-testing": "0.
|
|
1257
|
+
"@cosmicdrift/kumiko-locale-de": "0.412.0",
|
|
1258
|
+
"@cosmicdrift/kumiko-locale-es": "0.412.0",
|
|
1259
|
+
"@cosmicdrift/kumiko-locale-fr": "0.412.0",
|
|
1260
|
+
"@cosmicdrift/kumiko-locale-it": "0.412.0",
|
|
1261
|
+
"@cosmicdrift/kumiko-renderer-mail-html": "0.412.0",
|
|
1262
|
+
"@cosmicdrift/kumiko-testing": "0.412.0",
|
|
1263
1263
|
"@testing-library/user-event": "^14.6.8",
|
|
1264
1264
|
"@types/sanitize-html": "^2.16.2",
|
|
1265
1265
|
"jsqr": "^1.4.0",
|
|
1266
1266
|
"unpdf": "^1.9.1"
|
|
1267
1267
|
},
|
|
1268
1268
|
"peerDependencies": {
|
|
1269
|
-
"@cosmicdrift/kumiko-testing": "0.
|
|
1269
|
+
"@cosmicdrift/kumiko-testing": "0.412.0"
|
|
1270
1270
|
},
|
|
1271
1271
|
"peerDependenciesMeta": {
|
|
1272
1272
|
"@cosmicdrift/kumiko-testing": {
|
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.412.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "kumiko api-docs generates HTTP API docs from the registry and the PAT scopes",
|
|
6
|
+
"detail": "`kumiko api-docs [--out <dir>] [--locales en,de] [--check]` reads `kumiko.config.ts` and writes `<out>/openapi.json` (OpenAPI 3.1 with only the handlers some PAT scope reaches, one request wrapper per handler with a `type` discriminator), `<out>/<locale>/overview.md` (endpoints, body, envelopes, error codes with HTTP status, versions, lists, batches, safe retries), `<out>/<locale>/tokens.md` (create path from the app's nav labels, scope table, expiry, rate limit, errors, revoke, security, optional plan note) and `<out>/<locale>/reference/<scope>.md` (per handler: title, description, required grant, field table, curl example, recorded response), plus `<out>/index.json` with order, source versions and language independent anchor ids per heading. Output is plain GFM with only `title` and `description` in the frontmatter, so Astro and Starlight render it as is, and it is byte identical for the same input. New `AppConfig.apiDocs` options: `appName`, `baseUrl` (required), `locales`, `planNote`, `uiOnlyWrites` (pattern plus reason), `texts` (paragraph overrides per locale) and `examplesDir`. `--check` writes nothing and exits 1 when a handler in a scope has no description or no description translation (new gap kind `handlerWithoutDescriptionTranslation`, key `handlerDescriptionKey(qn)`), when a write that a screen triggers lies in no scope and is not listed in `uiOnlyWrites`, when a `uiOnlyWrites` entry matches nothing, or when the committed output differs. Known gap: the screen write check only looks at features with at least one handler in a scope. New exports: `frameworkErrorHttpStatus`, `FrameworkErrorCode`, `patAuthRejectHttpStatus`, `PAT_RATE_LIMITED_CODE`, `qnMatches`, `patAllows`, `handlerDescriptionKey`, `patScopesFromFeature`, `PAT_MAX_EXPIRES_IN_DAYS`, and `ApiExampleFileSchema` from `@cosmicdrift/kumiko-types/api-example`."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.412.0",
|
|
10
|
+
"type": "improvement",
|
|
11
|
+
"title": "api-docs token guide covers client code, logs and leaks",
|
|
12
|
+
"detail": "The security list in `tokens.md` now says never to keep a token in an app or web page or in a log, and to revoke a token at once if it may have leaked, in all five locales. Regenerate with `kumiko api-docs`; `--check` reports the changed `tokens.md` until then."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"version": "0.412.0",
|
|
16
|
+
"type": "improvement",
|
|
17
|
+
"title": "api-docs names events by wireName and skips system-only handlers",
|
|
18
|
+
"detail": "`events.md` headings and anchors, the OpenAPI `webhooks` keys and their `summary` use the wire name; the contract QN stays as `x-kumiko-qn` in OpenAPI and as the anchor `qn` in `index.json`. Write and query handlers whose `access.roles` are only `[\"system\"]` are no longer documented, even when a scope pattern such as `app:write:monitor:*` matches them, and the `uiWriteOutsideScopes` check ignores them."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"version": "0.412.0",
|
|
22
|
+
"type": "improvement",
|
|
23
|
+
"title": "kumiko api-docs documents webhook events",
|
|
24
|
+
"detail": "When a scope lists events, the output gains `<locale>/events.md` (delivery text from `apiDocs.webhookDelivery`, versioning rules, one section per event with fields and a recorded example), an OpenAPI 3.1 `webhooks` section keyed by event name and an `events` page in `index.json`. New problems `webhookDeliveryTextMissing` and `webhookEventWithoutDescriptionTranslation`. Field descriptions come from `.describe()` on declared payloads and from the entity field translations on derived ones. `ApiDocsInput.webhookExamples` is optional; `kumiko api-docs` reads `<examplesDir>/webhooks/*.json`."
|
|
25
|
+
},
|
|
2
26
|
{
|
|
3
27
|
"version": "0.409.0",
|
|
4
28
|
"type": "improvement",
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.412.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "documents filed from a mail attachment are visible to whoever may read the mail",
|
|
6
|
+
"detail": "The `inbound-message` read model now declares `access.read` for the member roles: shared mailboxes are readable by every member, a personal mailbox only by its owner, admins included. `createInboundMessageEntity(memberRoles)` builds the entity for the configured roles; `inboundMessageEntity` stays exported with the default roles. The message queries filter rows as before and do not use this rule."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.409.0",
|
|
4
10
|
"type": "fix",
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.412.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "token scopes list the webhook events they release",
|
|
6
|
+
"detail": "`PatScopeDef.events` takes exact event names (no globs). Holding the scope at read or write level is enough to subscribe, `expandScopeEvents(config, granted)` returns the union. Boot fails when a scope lists an event without a public contract, for example an internal `r.defineEvent`. Revoking a token now has a title and a field label in every bundle locale."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.385.0",
|
|
4
10
|
"type": "improvement",
|