@odla-ai/chapter 0.40.1 → 0.40.3
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/README.md +9 -4
- package/dist/{chunk-4K2Q5JBC.js → chunk-O22RRPBT.js} +232 -84
- package/dist/chunk-O22RRPBT.js.map +1 -0
- package/dist/index.cjs +24 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -6
- package/dist/index.d.ts +14 -6
- package/dist/index.js +24 -9
- package/dist/index.js.map +1 -1
- package/dist/ui/admin/index.d.ts +6 -2
- package/dist/ui/admin/index.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/worker/index.cjs +73 -19
- package/dist/worker/index.cjs.map +1 -1
- package/dist/worker/index.js +73 -19
- package/dist/worker/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-4K2Q5JBC.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -2142,7 +2142,14 @@ function createChapterIntegration(chapter, options = {}) {
|
|
|
2142
2142
|
},
|
|
2143
2143
|
rules: { ...crmDesc.rules, ...chapter.rules },
|
|
2144
2144
|
seeds,
|
|
2145
|
-
secrets: []
|
|
2145
|
+
secrets: chapter.account === "none" ? [] : [{
|
|
2146
|
+
// Released Chapter workers request this effective name. odla-db maps
|
|
2147
|
+
// it to the canonical reserved `$clerk_secret` value written by
|
|
2148
|
+
// `odla-ai secrets set-clerk-key`.
|
|
2149
|
+
name: "clerk_secret_key",
|
|
2150
|
+
description: "Clerk backend key (set with odla-ai secrets set-clerk-key) required by the configured Chapter account model.",
|
|
2151
|
+
required: true
|
|
2152
|
+
}],
|
|
2146
2153
|
probes: [
|
|
2147
2154
|
...crmDesc.probes ?? [],
|
|
2148
2155
|
// The snapshot route is deliberately private. A credential-free smoke
|
|
@@ -2642,8 +2649,8 @@ function validateBuilderLibraryDocument(value, options = {}) {
|
|
|
2642
2649
|
if (sourceType === "chapter" && (resource.scope.kind !== "chapter" || resource.scope.chapterId !== sourceAppId)) {
|
|
2643
2650
|
errors.push(`document.resources.${resource.id}: Chapter sources may author only their own chapter scope`);
|
|
2644
2651
|
}
|
|
2645
|
-
if (sourceType === "built_not_found" && resource.scope.kind === "chapter") {
|
|
2646
|
-
errors.push(`document.resources.${resource.id}: Built Not Found
|
|
2652
|
+
if (sourceType === "built_not_found" && resource.scope.kind === "chapter" && !(options.allowedChapterIds ?? []).includes(resource.scope.chapterId)) {
|
|
2653
|
+
errors.push(`document.resources.${resource.id}: Built Not Found may target only configured Chapters`);
|
|
2647
2654
|
}
|
|
2648
2655
|
}
|
|
2649
2656
|
if (errors.length) return { ok: false, errors };
|
|
@@ -2675,7 +2682,7 @@ function projectBuilderLibraryDelivery(document, target) {
|
|
|
2675
2682
|
return {
|
|
2676
2683
|
...document,
|
|
2677
2684
|
target,
|
|
2678
|
-
resources: document.source.type === "built_not_found" ? document.resources.filter((resource) => resource.scope.kind === "global") : document.resources
|
|
2685
|
+
resources: document.source.type === "built_not_found" ? document.resources.filter((resource) => resource.scope.kind === "global" || resource.scope.kind === "chapter" && resource.scope.chapterId === target.appId) : document.resources
|
|
2679
2686
|
};
|
|
2680
2687
|
}
|
|
2681
2688
|
function promoteBuilderLibraryResource(input) {
|
|
@@ -3647,7 +3654,14 @@ async function createClerkUser(secretKey, input, fetchImpl = fetch) {
|
|
|
3647
3654
|
headers: { authorization: `Bearer ${secretKey}`, "content-type": "application/json" },
|
|
3648
3655
|
body: JSON.stringify(body)
|
|
3649
3656
|
});
|
|
3650
|
-
if (res.ok)
|
|
3657
|
+
if (res.ok) {
|
|
3658
|
+
const body2 = typeof res.json === "function" ? await res.json().catch(() => null) : null;
|
|
3659
|
+
return {
|
|
3660
|
+
ok: true,
|
|
3661
|
+
status: res.status,
|
|
3662
|
+
...typeof body2?.id === "string" && body2.id ? { userId: body2.id } : {}
|
|
3663
|
+
};
|
|
3664
|
+
}
|
|
3651
3665
|
const healed = heal(res.status);
|
|
3652
3666
|
const repair = input.repairMetadata ?? {
|
|
3653
3667
|
...input.publicMetadata !== void 0 ? { publicMetadata: input.publicMetadata } : {},
|
|
@@ -3749,7 +3763,7 @@ var clerkIntegration = {
|
|
|
3749
3763
|
},
|
|
3750
3764
|
{
|
|
3751
3765
|
name: "clerk_secret_key",
|
|
3752
|
-
description: "Clerk backend key (sk_*) \u2014 powers account creation, the public role claim,
|
|
3766
|
+
description: "Effective Clerk backend key (sk_*), stored canonically by set-clerk-key in reserved $clerk_secret \u2014 powers account creation, the public role claim, backend-only private profile signals, and odla-db user resolution.",
|
|
3753
3767
|
pattern: "sk_",
|
|
3754
3768
|
mode: "full",
|
|
3755
3769
|
required: false
|
|
@@ -3782,15 +3796,16 @@ var clerkIntegration = {
|
|
|
3782
3796
|
provision: {
|
|
3783
3797
|
human: [
|
|
3784
3798
|
"Run `npx clerk auth login` \u2014 the one interactive step; the agent then creates + configures the Clerk app with the Clerk CLI (no pk_ to hand-paste).",
|
|
3785
|
-
'For auth mode "full": create the Clerk user-sync webhook
|
|
3799
|
+
'For auth mode "full": create the Clerk user-sync webhook, store its whsec_, and transfer the sk_ with `odla-ai secrets set-clerk-key --env <env> --stdin` (write-only).'
|
|
3786
3800
|
],
|
|
3787
3801
|
cli: [
|
|
3788
3802
|
"Clerk CLI (`npx clerk apps create/link/config patch`) creates + configures the instance and pulls the pk_.",
|
|
3789
|
-
"odla `provision` records it: setAuth(env, publishableKey) -> apps-registry (issuer/JWKS derived from the key)."
|
|
3803
|
+
"odla `provision` records it: setAuth(env, publishableKey) -> apps-registry (issuer/JWKS derived from the key).",
|
|
3804
|
+
"odla `secrets set-clerk-key` stores one environment-scoped reserved credential consumed by odla-db and Chapter."
|
|
3790
3805
|
],
|
|
3791
3806
|
doctor: [
|
|
3792
3807
|
"registry auth[env] present when the app mounts <SignIn>?",
|
|
3793
|
-
'auth mode "full" => whsec_ and clerk_secret_key
|
|
3808
|
+
'auth mode "full" => whsec_ present and the effective clerk_secret_key reports set via the reserved Clerk credential status?'
|
|
3794
3809
|
]
|
|
3795
3810
|
}
|
|
3796
3811
|
};
|