@the-40-thieves/obsidian-tc-shared 1.13.0 → 1.14.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/config/auth-acl.schema.d.ts +36 -0
- package/dist/config/auth-acl.schema.d.ts.map +1 -0
- package/dist/config/auth-acl.schema.js +145 -0
- package/dist/config/auth-acl.schema.js.map +1 -0
- package/dist/config/indexing-embeddings.schema.d.ts +43 -0
- package/dist/config/indexing-embeddings.schema.d.ts.map +1 -0
- package/dist/config/indexing-embeddings.schema.js +209 -0
- package/dist/config/indexing-embeddings.schema.js.map +1 -0
- package/dist/config/observability.schema.d.ts +53 -0
- package/dist/config/observability.schema.d.ts.map +1 -0
- package/dist/config/observability.schema.js +249 -0
- package/dist/config/observability.schema.js.map +1 -0
- package/dist/config/reranker.schema.d.ts +12 -0
- package/dist/config/reranker.schema.d.ts.map +1 -0
- package/dist/config/reranker.schema.js +45 -0
- package/dist/config/reranker.schema.js.map +1 -0
- package/dist/config/retrieval.schema.d.ts +66 -0
- package/dist/config/retrieval.schema.d.ts.map +1 -0
- package/dist/config/retrieval.schema.js +299 -0
- package/dist/config/retrieval.schema.js.map +1 -0
- package/dist/config/runtime.schema.d.ts +59 -0
- package/dist/config/runtime.schema.d.ts.map +1 -0
- package/dist/config/runtime.schema.js +121 -0
- package/dist/config/runtime.schema.js.map +1 -0
- package/dist/config/server.schema.d.ts +644 -0
- package/dist/config/server.schema.d.ts.map +1 -0
- package/dist/config/server.schema.js +144 -0
- package/dist/config/server.schema.js.map +1 -0
- package/dist/config/tools.schema.d.ts +35 -0
- package/dist/config/tools.schema.d.ts.map +1 -0
- package/dist/config/tools.schema.js +115 -0
- package/dist/config/tools.schema.js.map +1 -0
- package/dist/config/vault.schema.d.ts +80 -0
- package/dist/config/vault.schema.d.ts.map +1 -0
- package/dist/config/vault.schema.js +157 -0
- package/dist/config/vault.schema.js.map +1 -0
- package/dist/config.schema.d.ts +12 -971
- package/dist/config.schema.d.ts.map +1 -1
- package/dist/config.schema.js +23 -1264
- package/dist/config.schema.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const AuthConfigSchema: z.ZodObject<{
|
|
3
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
4
|
+
jwt: "jwt";
|
|
5
|
+
none: "none";
|
|
6
|
+
}>>;
|
|
7
|
+
jwtSecret: z.ZodOptional<z.ZodString>;
|
|
8
|
+
tokenTtlSeconds: z.ZodDefault<z.ZodNumber>;
|
|
9
|
+
jwks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
10
|
+
jwksFile: z.ZodOptional<z.ZodString>;
|
|
11
|
+
jwksUri: z.ZodOptional<z.ZodString>;
|
|
12
|
+
algorithms: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
13
|
+
audience: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
14
|
+
issuer: z.ZodOptional<z.ZodString>;
|
|
15
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
16
|
+
authorizationServers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
|
+
resourceName: z.ZodOptional<z.ZodString>;
|
|
18
|
+
scopesSupported: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export declare const AclRuleSchema: z.ZodObject<{
|
|
21
|
+
glob: z.ZodString;
|
|
22
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const AclConfigSchema: z.ZodObject<{
|
|
25
|
+
readOnly: z.ZodDefault<z.ZodBoolean>;
|
|
26
|
+
defaultScopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
27
|
+
rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
28
|
+
glob: z.ZodString;
|
|
29
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
30
|
+
}, z.core.$strip>>>;
|
|
31
|
+
readPaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
32
|
+
writePaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
33
|
+
deletePaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
|
+
strictReadDefault: z.ZodDefault<z.ZodBoolean>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
//# sourceMappingURL=auth-acl.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-acl.schema.d.ts","sourceRoot":"","sources":["../../src/config/auth-acl.schema.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;iBAqHzB,CAAC;AACL,eAAO,MAAM,aAAa;;;iBAQxB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;iBAiD1B,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// WP1.1: extracted from ../config.schema.ts (which stays a compatibility facade re-exporting
|
|
2
|
+
// these same symbol names). Leaf schema — imports Zod only, no shared scalars needed here.
|
|
3
|
+
//
|
|
4
|
+
// Import direction is non-negotiable: this file must never import config.schema.ts,
|
|
5
|
+
// server.schema.ts, or any vault schema. Refinements that only read fields WITHIN auth or ACL
|
|
6
|
+
// move here with their schema; a refinement that reads ANOTHER domain (e.g. the http/auth
|
|
7
|
+
// interlock in ServerConfigSchema.superRefine) stays in config.schema.ts.
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
export const AuthConfigSchema = z
|
|
10
|
+
.object({
|
|
11
|
+
mode: z
|
|
12
|
+
.enum(["none", "jwt"])
|
|
13
|
+
.default("none")
|
|
14
|
+
.describe("Authentication mode. `none` grants every request full wildcard scopes and is refused on a non-loopback HTTP bind; `jwt` requires a jwtSecret or a JWKS."),
|
|
15
|
+
jwtSecret: z
|
|
16
|
+
.string()
|
|
17
|
+
.min(32)
|
|
18
|
+
.optional()
|
|
19
|
+
.describe("Shared secret for HS256 verification, minimum 32 characters. Secret. HS256 tokens verify ONLY against this, never against the JWKS."),
|
|
20
|
+
tokenTtlSeconds: z
|
|
21
|
+
.number()
|
|
22
|
+
.int()
|
|
23
|
+
.positive()
|
|
24
|
+
.default(86400)
|
|
25
|
+
.describe("Maximum accepted token AGE in seconds, measured from the token's `iat`. This caps age INDEPENDENTLY of `exp`: a token with a one-year expiry is still rejected once it is older than this, so a long-lived credential needs this raised to match."),
|
|
26
|
+
// THE-297 — asymmetric verification (RS256/ES256/EdDSA) behind the TokenVerifier seam.
|
|
27
|
+
// `jwks` is an inline JWKS document; `jwksFile` a path loaded once at transport boot (file
|
|
28
|
+
// or inline only — no URL fetch: no new network attack surface). Key rotation = multiple
|
|
29
|
+
// keys in the set, selected by the token's `kid` header (jose). HS256 stays available
|
|
30
|
+
// beside it; alg-confusion is structurally impossible (HS256 verifies ONLY against
|
|
31
|
+
// jwtSecret, asymmetric algs ONLY against the JWKS).
|
|
32
|
+
jwks: z
|
|
33
|
+
.record(z.string(), z.unknown())
|
|
34
|
+
.optional()
|
|
35
|
+
.describe("Inline JWKS document for asymmetric verification (RS256/ES256/EdDSA). Rotation is multiple keys in the set, selected by the token's `kid`."),
|
|
36
|
+
jwksFile: z
|
|
37
|
+
.string()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe("Path to a JWKS document, loaded once at transport boot. Adds no network dependency; prefer it over jwksUri when the keys are static."),
|
|
40
|
+
// THE-658: fetch the JWKS from an authorization server's `jwks_uri`.
|
|
41
|
+
//
|
|
42
|
+
// THE-297 deliberately allowed inline/file ONLY, reasoning that a URL fetch adds network
|
|
43
|
+
// attack surface. That reasoning still holds and is why this is OPT-IN and unset by default —
|
|
44
|
+
// it is not a silent reversal. What it buys is the thing that made adopting a real
|
|
45
|
+
// authorization server a code change rather than a config change: with inline keys, every AS
|
|
46
|
+
// key rotation means an operator hand-copying a JWKS and redeploying, so rotation (the entire
|
|
47
|
+
// point of asymmetric verification) becomes a manual outage risk.
|
|
48
|
+
//
|
|
49
|
+
// The added surface is bounded: jose caches the fetched set and re-fetches only on an unknown
|
|
50
|
+
// `kid`, the URL is operator-configured (never derived from a request), and a fetch failure
|
|
51
|
+
// rejects the token rather than falling back to any other key source.
|
|
52
|
+
jwksUri: z
|
|
53
|
+
.string()
|
|
54
|
+
.url()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe("URL of an authorization server's JWKS (its `jwks_uri`), fetched and cached for asymmetric verification. Opt-in: it adds a network dependency to token verification, which jwks/jwksFile do not. Use it when an external AS rotates keys."),
|
|
57
|
+
algorithms: z
|
|
58
|
+
.array(z.string())
|
|
59
|
+
.optional()
|
|
60
|
+
.describe("Explicit allowlist of accepted JWT algorithms. Algorithm confusion is structurally impossible regardless: HS256 verifies only against jwtSecret and asymmetric algorithms only against the JWKS."),
|
|
61
|
+
// THE-456 — audience/issuer binding. When set, the JWT verifier enforces them (jose rejects a
|
|
62
|
+
// token whose `aud`/`iss` does not match), closing the confused-deputy / token-passthrough gap
|
|
63
|
+
// the MCP 2025-11-25 authorization spec requires of a protected resource. `audience` defaults to
|
|
64
|
+
// the configured `resource` URI (below) when PRM is set, so a token an external AS minted for a
|
|
65
|
+
// DIFFERENT service is rejected here. Both unset (and no PRM `resource`) keeps the current
|
|
66
|
+
// behavior for local self-issued HS256 tokens.
|
|
67
|
+
audience: z
|
|
68
|
+
.union([z.string(), z.array(z.string())])
|
|
69
|
+
.optional()
|
|
70
|
+
.describe("Expected `aud` claim. Binding it rejects a token an issuer minted for a DIFFERENT service (confused deputy). Required with a JWKS or a non-loopback bind; defaults to `resource` when Protected Resource Metadata is configured."),
|
|
71
|
+
issuer: z
|
|
72
|
+
.string()
|
|
73
|
+
.optional()
|
|
74
|
+
.describe("Expected `iss` claim. Setting it also requires an audience — validating the issuer alone does not establish that the token was meant for this server."),
|
|
75
|
+
// MCP 2025-11-25 / RFC 9728 Protected Resource Metadata (THE-278). All optional; the HS256 token
|
|
76
|
+
// format is unchanged. When `resource` + at least one `authorizationServers` entry are set, the
|
|
77
|
+
// HTTP transport advertises a spec-compliant PRM document + WWW-Authenticate challenge for the
|
|
78
|
+
// OAuth 2.1 resource-server role. The authorization-server half (token issuance / DCR / OIDC)
|
|
79
|
+
// stays out of scope until a real external AS exists.
|
|
80
|
+
resource: z
|
|
81
|
+
.string()
|
|
82
|
+
.url()
|
|
83
|
+
.optional()
|
|
84
|
+
.describe("This server's canonical resource URI (RFC 9728). Set together with authorizationServers to advertise Protected Resource Metadata; also serves as the default bound audience."),
|
|
85
|
+
authorizationServers: z
|
|
86
|
+
.array(z.string().url())
|
|
87
|
+
.optional()
|
|
88
|
+
.describe("Authorization server issuer URLs advertised in the Protected Resource Metadata document. At least one is needed for PRM to be served."),
|
|
89
|
+
resourceName: z
|
|
90
|
+
.string()
|
|
91
|
+
.optional()
|
|
92
|
+
.describe("Human-readable resource name published in the Protected Resource Metadata document."),
|
|
93
|
+
scopesSupported: z
|
|
94
|
+
.array(z.string())
|
|
95
|
+
.optional()
|
|
96
|
+
.describe("Scopes advertised as supported in the Protected Resource Metadata document."),
|
|
97
|
+
})
|
|
98
|
+
.refine((c) => c.mode !== "jwt" || !!c.jwtSecret || !!c.jwks || !!c.jwksFile || !!c.jwksUri, {
|
|
99
|
+
message: "auth.mode 'jwt' requires jwtSecret (>=32 chars) or a JWKS (jwks / jwksFile / jwksUri)",
|
|
100
|
+
path: ["jwtSecret"],
|
|
101
|
+
});
|
|
102
|
+
export const AclRuleSchema = z.object({
|
|
103
|
+
glob: z.string().min(1).describe("Glob matched against the vault-relative note path."),
|
|
104
|
+
scopes: z
|
|
105
|
+
.array(z.string())
|
|
106
|
+
.default([])
|
|
107
|
+
.describe("Scopes REQUIRED to operate on paths matching this rule (P1.4): a caller must hold every listed scope, in addition to the tool's own required scopes, to read/write/delete a matching path. The LAST matching rule wins, replacing rather than merging the scopes of earlier matches. An empty list adds no requirement. Enforced at dispatch on tool operations; it does not filter search/enumeration result visibility, which is governed by readPaths."),
|
|
108
|
+
});
|
|
109
|
+
export const AclConfigSchema = z.object({
|
|
110
|
+
readOnly: z
|
|
111
|
+
.boolean()
|
|
112
|
+
.default(false)
|
|
113
|
+
.describe("Reject every mutating operation on this vault regardless of the scopes a caller holds."),
|
|
114
|
+
defaultScopes: z
|
|
115
|
+
.array(z.string())
|
|
116
|
+
.default([])
|
|
117
|
+
.describe("Scopes REQUIRED to operate on a path that matches no rule (P1.4). Empty (the default) adds no requirement."),
|
|
118
|
+
rules: z
|
|
119
|
+
.array(AclRuleSchema)
|
|
120
|
+
.default([])
|
|
121
|
+
.describe("Ordered glob-to-required-scope rules enforced at dispatch (P1.4). Later matches override earlier ones."),
|
|
122
|
+
// Per-path operation ACL (G2.2 section 5 / G2.4). Optional and back-compatible:
|
|
123
|
+
// when a field is omitted that operation kind is unrestricted (M0 behavior);
|
|
124
|
+
// when present it is a glob whitelist — a path must match at least one entry.
|
|
125
|
+
// camelCase mirrors the rest of the config (readOnly, defaultScopes).
|
|
126
|
+
readPaths: z
|
|
127
|
+
.array(z.string())
|
|
128
|
+
.optional()
|
|
129
|
+
.describe("Glob whitelist for reads: a path must match at least one entry. Omitted leaves reads unrestricted (see strictReadDefault)."),
|
|
130
|
+
writePaths: z
|
|
131
|
+
.array(z.string())
|
|
132
|
+
.optional()
|
|
133
|
+
.describe("Glob whitelist for writes: a path must match at least one entry. Omitted leaves writes unrestricted."),
|
|
134
|
+
deletePaths: z
|
|
135
|
+
.array(z.string())
|
|
136
|
+
.optional()
|
|
137
|
+
.describe("Glob whitelist for deletes: a path must match at least one entry. Omitted leaves deletes unrestricted."),
|
|
138
|
+
/** When true, an UNDEFINED readPaths whitelist fails CLOSED on the request path (read_note et
|
|
139
|
+
* al.), not just bridge enumeration (THE-268). Default false = M0 allow-all back-compat. */
|
|
140
|
+
strictReadDefault: z
|
|
141
|
+
.boolean()
|
|
142
|
+
.default(false)
|
|
143
|
+
.describe("When true, an UNDEFINED readPaths whitelist fails CLOSED on the request path rather than only on bridge enumeration. Default false preserves allow-all back-compatibility."),
|
|
144
|
+
});
|
|
145
|
+
//# sourceMappingURL=auth-acl.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-acl.schema.js","sourceRoot":"","sources":["../../src/config/auth-acl.schema.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,2FAA2F;AAC3F,EAAE;AACF,oFAAoF;AACpF,8FAA8F;AAC9F,0FAA0F;AAC1F,0EAA0E;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;SACrB,OAAO,CAAC,MAAM,CAAC;SACf,QAAQ,CACP,yJAAyJ,CAC1J;IACH,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,EAAE;SACV,QAAQ,CACP,qIAAqI,CACtI;IACH,eAAe,EAAE,CAAC;SACf,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,mPAAmP,CACpP;IACH,uFAAuF;IACvF,2FAA2F;IAC3F,yFAAyF;IACzF,sFAAsF;IACtF,mFAAmF;IACnF,qDAAqD;IACrD,IAAI,EAAE,CAAC;SACJ,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;SAC/B,QAAQ,EAAE;SACV,QAAQ,CACP,4IAA4I,CAC7I;IACH,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,sI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,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CACP,4HAA4H,CAC7H;IACH,UAAU,EAAE,CAAC;SACV,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CACP,sGAAsG,CACvG;IACH,WAAW,EAAE,CAAC;SACX,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CACP,wGAAwG,CACzG;IACH;iGAC6F;IAC7F,iBAAiB,EAAE,CAAC;SACjB,OAAO,EAAE;SACT,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,4KAA4K,CAC7K;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const EmbeddingsConfigSchema: z.ZodObject<{
|
|
3
|
+
provider: z.ZodDefault<z.ZodString>;
|
|
4
|
+
model: z.ZodDefault<z.ZodString>;
|
|
5
|
+
dimensions: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
7
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
8
|
+
apiKeyEnv: z.ZodOptional<z.ZodString>;
|
|
9
|
+
modulePath: z.ZodOptional<z.ZodString>;
|
|
10
|
+
revision: z.ZodOptional<z.ZodString>;
|
|
11
|
+
pooling: z.ZodOptional<z.ZodString>;
|
|
12
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
batchSize: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
maxBatchTokens: z.ZodDefault<z.ZodNumber>;
|
|
15
|
+
concurrency: z.ZodDefault<z.ZodNumber>;
|
|
16
|
+
truncate: z.ZodDefault<z.ZodBoolean>;
|
|
17
|
+
chunkContext: z.ZodDefault<z.ZodBoolean>;
|
|
18
|
+
queryPrefix: z.ZodDefault<z.ZodString>;
|
|
19
|
+
documentPrefix: z.ZodDefault<z.ZodString>;
|
|
20
|
+
modelTier: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
dense: z.ZodObject<{
|
|
22
|
+
baseUrl: z.ZodString;
|
|
23
|
+
model: z.ZodDefault<z.ZodString>;
|
|
24
|
+
revision: z.ZodOptional<z.ZodString>;
|
|
25
|
+
pooling: z.ZodDefault<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
full: z.ZodOptional<z.ZodObject<{
|
|
28
|
+
baseUrl: z.ZodString;
|
|
29
|
+
model: z.ZodDefault<z.ZodString>;
|
|
30
|
+
revision: z.ZodOptional<z.ZodString>;
|
|
31
|
+
authToken: z.ZodOptional<z.ZodString>;
|
|
32
|
+
dimensions: z.ZodDefault<z.ZodNumber>;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export declare const IndexingConfigSchema: z.ZodPrefault<z.ZodObject<{
|
|
37
|
+
writeConcurrency: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
writeConcurrencyPerVault: z.ZodDefault<z.ZodNumber>;
|
|
39
|
+
queueMax: z.ZodDefault<z.ZodNumber>;
|
|
40
|
+
streamingWalk: z.ZodDefault<z.ZodBoolean>;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
export type IndexingConfig = z.infer<typeof IndexingConfigSchema>;
|
|
43
|
+
//# sourceMappingURL=indexing-embeddings.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexing-embeddings.schema.d.ts","sourceRoot":"","sources":["../../src/config/indexing-embeddings.schema.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqMjC,CAAC;AAOH,eAAO,MAAM,oBAAoB;;;;;kBAoClB,CAAC;AAChB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
// WP1.4: extracted from ../config.schema.ts (which stays a compatibility facade re-exporting
|
|
2
|
+
// these same symbol names). Leaf schema — imports Zod only, no shared scalars needed here.
|
|
3
|
+
//
|
|
4
|
+
// Import direction is non-negotiable: this file must never import config.schema.ts,
|
|
5
|
+
// server.schema.ts, or any other schema module. IndexingConfigSchema chains only
|
|
6
|
+
// `.prefault({})` (a default-application combinator, not a `.refine`/`.superRefine`) — there is
|
|
7
|
+
// no cross-domain field read to keep back in config.schema.ts, so the whole schema moves here.
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
export const EmbeddingsConfigSchema = z.object({
|
|
10
|
+
provider: z
|
|
11
|
+
.string()
|
|
12
|
+
.min(1)
|
|
13
|
+
.default("ollama")
|
|
14
|
+
.describe("Embeddings backend name, resolved against the provider registry at startup. Built-ins: ollama, openai, voyage, cohere, bge-m3, model-tier (splits dense and multi-vector across two services), the generic openai-compatible, and the profile-gated module. An unregistered name is a startup error listing every valid option."),
|
|
15
|
+
model: z
|
|
16
|
+
.string()
|
|
17
|
+
.default("nomic-embed-text")
|
|
18
|
+
.describe("Embedding model name as the provider names it."),
|
|
19
|
+
dimensions: z
|
|
20
|
+
.number()
|
|
21
|
+
.int()
|
|
22
|
+
.positive()
|
|
23
|
+
.default(768)
|
|
24
|
+
.describe("Stored vector width, and the width of the vec0 column. Changing it requires a fresh index — existing vectors are not re-projected."),
|
|
25
|
+
baseUrl: z
|
|
26
|
+
.string()
|
|
27
|
+
.url()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("Provider base URL. Required for self-hosted runners; hosted providers default to their public API."),
|
|
30
|
+
apiKey: z
|
|
31
|
+
.string()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe("Provider API key. Secret — never logged or returned by a tool."),
|
|
34
|
+
apiKeyEnv: z
|
|
35
|
+
.string()
|
|
36
|
+
.min(1)
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("Name of the environment variable holding the provider API key. Needed for generic providers, which have no entry in the built-in per-vendor variable map. An inline apiKey takes precedence."),
|
|
39
|
+
modulePath: z
|
|
40
|
+
.string()
|
|
41
|
+
.min(1)
|
|
42
|
+
.optional()
|
|
43
|
+
.describe("Module exporting createEmbeddingProvider, for provider 'module'. Resolved against the config file's directory. Refused under the hardened security profile, and refused on CLI/eval entry points (module providers load only from the server's boot wiring). The factory may be sync or async (an async factory is awaited). It must return an object with a non-empty string id, provider, and model — id is what chunk_embeddings.model and the vec fingerprint identify the provider by, so two module providers sharing (or omitting) id are indistinguishable to the index — a positive integer dimensions, and embed(texts). Validated at load time, before first use."),
|
|
44
|
+
revision: z
|
|
45
|
+
.string()
|
|
46
|
+
.min(1)
|
|
47
|
+
.optional()
|
|
48
|
+
.describe("Model revision / commit / checkpoint id. Folded into vec_index_fingerprint, so declaring it makes a checkpoint upgrade at the SAME model name and width rebuild the index instead of silently serving the old checkpoint's vectors against queries embedded by the new one. Omitting it reproduces today's behaviour exactly."),
|
|
49
|
+
pooling: z
|
|
50
|
+
.string()
|
|
51
|
+
.min(1)
|
|
52
|
+
.optional()
|
|
53
|
+
.describe("Pooling strategy the backend applies (e.g. 'mean', 'last-token'). Folded into the representation identity persisted as vec_index_fingerprint, so changing it rebuilds the vector index rather than serving vectors pooled a different way against queries pooled the new way. The rebuild reuses the stored embeddings — it does not re-embed, and costs no provider calls."),
|
|
54
|
+
// GH #171/#172: local-runner indexing robustness. Local models are far slower than hosted APIs,
|
|
55
|
+
// and a stock local runner (llama-server) crashes on a token-dense batch, so these are
|
|
56
|
+
// configurable with local-safe defaults. `timeoutMs` bounds each embed request (was a hardcoded
|
|
57
|
+
// 30s with no knob). `batchSize` caps inputs/request; `maxBatchTokens` caps a request's estimated
|
|
58
|
+
// tokens (chars/4) so a dense sub-batch is split before it overruns a local runner's budget (a
|
|
59
|
+
// single over-budget text still goes alone). `concurrency` is how many embed requests run in flight.
|
|
60
|
+
// THE-390: `maxBatchTokens` must stay UNDER the provider's loaded context — Ollama defaults to
|
|
61
|
+
// n_ctx 4096 and 400-rejects a request whose summed tokens exceed it, and the chars/4 estimate
|
|
62
|
+
// undercounts real tokenization (~2-2.5x on link-dense markdown). 2048 estimated keeps a batch
|
|
63
|
+
// inside a 4096 context with that drift; the indexer also bisects + retries a rejected batch,
|
|
64
|
+
// so an occasional overshoot costs a retry, not the reindex.
|
|
65
|
+
timeoutMs: z
|
|
66
|
+
.number()
|
|
67
|
+
.int()
|
|
68
|
+
.positive()
|
|
69
|
+
.default(120000)
|
|
70
|
+
.describe("Timeout in ms for a single embed request. Defaults high because local runners are far slower than hosted APIs."),
|
|
71
|
+
batchSize: z.number().int().positive().default(512).describe("Maximum inputs per embed request."),
|
|
72
|
+
maxBatchTokens: z
|
|
73
|
+
.number()
|
|
74
|
+
.int()
|
|
75
|
+
.positive()
|
|
76
|
+
.default(2048)
|
|
77
|
+
.describe("Estimated-token ceiling per request (chars/4), splitting a dense sub-batch before it overruns a local runner's budget. Must stay UNDER the provider's loaded context: Ollama defaults to n_ctx 4096 and rejects an over-budget request, and the chars/4 estimate undercounts real tokenization on link-dense markdown."),
|
|
78
|
+
concurrency: z
|
|
79
|
+
.number()
|
|
80
|
+
.int()
|
|
81
|
+
.positive()
|
|
82
|
+
.default(4)
|
|
83
|
+
.describe("How many embed requests run in flight at once."),
|
|
84
|
+
// THE-387: Matryoshka (MRL) dimension truncation. When true, a provider that returns vectors
|
|
85
|
+
// WIDER than `dimensions` is truncated to the first `dimensions` components + renormalised (so a
|
|
86
|
+
// wide MRL model such as Qwen3-8B at 4096 can be stored at 1024). Off by default; a non-MRL width
|
|
87
|
+
// mismatch still errors rather than silently truncating meaningless prefixes.
|
|
88
|
+
truncate: z
|
|
89
|
+
.boolean()
|
|
90
|
+
.default(false)
|
|
91
|
+
.describe("Matryoshka (MRL) truncation: accept a provider vector WIDER than `dimensions` by keeping the first `dimensions` components and renormalising. Off by default so a non-MRL width mismatch errors instead of silently storing a meaningless prefix."),
|
|
92
|
+
/** THE-406: contextual chunk enrichment. When true, each chunk is embedded and BM25-indexed as
|
|
93
|
+
* "{note title}{ — heading breadcrumb}\n\n{content}" instead of the bare section text — the
|
|
94
|
+
* chunker strips heading lines into metadata, so title/heading-only evidence is otherwise
|
|
95
|
+
* invisible to both retrieval streams. Display content (chunks.content) stays raw. The chunk
|
|
96
|
+
* content hash covers the enriched text, so flipping this re-embeds the vault on the next
|
|
97
|
+
* reconcile. DEFAULT ON since THE-408: measured +0.223 nDCG@10 (p=0.0001) with the divergence
|
|
98
|
+
* rebuild now enrichment-aware. UPGRADE NOTE: an index built with the flag off re-embeds in
|
|
99
|
+
* full on the first reconcile after upgrading (hash change) — set `chunkContext: false` to
|
|
100
|
+
* keep the old representation. */
|
|
101
|
+
chunkContext: z
|
|
102
|
+
.boolean()
|
|
103
|
+
.default(true)
|
|
104
|
+
.describe('Embed and BM25-index each chunk as "{title}{ — heading breadcrumb}\\n\\n{content}" rather than bare section text, so title- and heading-only evidence is visible to both retrieval streams. Displayed content stays raw. The chunk hash covers the enriched text, so changing this re-embeds the vault on the next reconcile.'),
|
|
105
|
+
/** THE-405: asymmetric instruct prefixes for models whose cards require them (e.g.
|
|
106
|
+
* Qwen3-Embedding's "Instruct: ...\nQuery: " on the query side, documents plain). Applied at
|
|
107
|
+
* the provider factory: `queryPrefix` on embeds marked input:"query", `documentPrefix` on
|
|
108
|
+
* everything else (indexing). BOTH default empty — nomic-style prefixes measured HARMFUL on
|
|
109
|
+
* this vault (2026-07-11), so nothing changes unless a config opts in. Changing
|
|
110
|
+
* `documentPrefix` re-embeds nothing by itself (hashes cover chunk text, not the prefix) —
|
|
111
|
+
* pair a document-prefix change with a fresh cacheDir. */
|
|
112
|
+
queryPrefix: z
|
|
113
|
+
.string()
|
|
114
|
+
.default("")
|
|
115
|
+
.describe("Instruct prefix prepended to query-side embeds, for models whose cards require one. Empty by default — such prefixes measured harmful on this corpus."),
|
|
116
|
+
documentPrefix: z
|
|
117
|
+
.string()
|
|
118
|
+
.default("")
|
|
119
|
+
.describe("Instruct prefix prepended to document-side (indexing) embeds. Empty by default. Changing it re-embeds nothing on its own, since hashes cover chunk text and not the prefix — pair a change with a fresh cacheDir."),
|
|
120
|
+
/** #237: polyglot model tier - dense retrieval from Qwen3 via the Rust TEI service,
|
|
121
|
+
* sparse+ColBERT from BGE-M3 via the Python service (services/bge-m3-service). Required when
|
|
122
|
+
* provider is "model-tier". The two are SEPARATE streams fused by RRF on ranks;
|
|
123
|
+
* embeddings.dimensions is the Qwen dense width (the vec0 column). */
|
|
124
|
+
modelTier: z
|
|
125
|
+
.object({
|
|
126
|
+
dense: z
|
|
127
|
+
.object({
|
|
128
|
+
baseUrl: z
|
|
129
|
+
.string()
|
|
130
|
+
.url()
|
|
131
|
+
.describe("Base URL of the dense (Qwen3 via Rust TEI) embedding service."),
|
|
132
|
+
model: z
|
|
133
|
+
.string()
|
|
134
|
+
.default("Qwen/Qwen3-Embedding-0.6B")
|
|
135
|
+
.describe("Dense model id. Its width is what embeddings.dimensions must match."),
|
|
136
|
+
revision: z
|
|
137
|
+
.string()
|
|
138
|
+
.optional()
|
|
139
|
+
.describe("Pinned model revision for the dense service. PROVENANCE ONLY: it moves neither provider.id nor vec_index_fingerprint, so changing it does not rebuild the index. Use the top-level embeddings.revision to force a re-embed — it applies to model-tier too."),
|
|
140
|
+
pooling: z
|
|
141
|
+
.string()
|
|
142
|
+
.default("last-token")
|
|
143
|
+
.describe("Pooling strategy for the dense model."),
|
|
144
|
+
})
|
|
145
|
+
.describe("Dense retrieval half of the model tier. Required when provider is model-tier."),
|
|
146
|
+
full: z
|
|
147
|
+
.object({
|
|
148
|
+
baseUrl: z.string().url().describe("Base URL of the multi-vector (BGE-M3) service."),
|
|
149
|
+
model: z.string().default("BAAI/bge-m3").describe("Multi-vector model id."),
|
|
150
|
+
revision: z
|
|
151
|
+
.string()
|
|
152
|
+
.optional()
|
|
153
|
+
.describe("Pinned model revision for the multi-vector service. PROVENANCE ONLY: it moves neither provider.id nor vec_index_fingerprint, so changing it does not rebuild the index. Use the top-level embeddings.revision to force a re-embed — it applies to model-tier too."),
|
|
154
|
+
authToken: z
|
|
155
|
+
.string()
|
|
156
|
+
.optional()
|
|
157
|
+
.describe("Bearer token for the multi-vector service. Secret."),
|
|
158
|
+
dimensions: z
|
|
159
|
+
.number()
|
|
160
|
+
.int()
|
|
161
|
+
.positive()
|
|
162
|
+
.default(1024)
|
|
163
|
+
.describe("Dense width of the multi-vector model, separate from embeddings.dimensions."),
|
|
164
|
+
})
|
|
165
|
+
.optional()
|
|
166
|
+
.describe("Sparse and ColBERT half of the model tier. Absent disables the retrieval.sparse and retrieval.colbert streams."),
|
|
167
|
+
})
|
|
168
|
+
.optional()
|
|
169
|
+
.describe("Polyglot model tier: dense retrieval from one service and sparse/ColBERT from another, fused by RRF on ranks. Required when provider is model-tier."),
|
|
170
|
+
});
|
|
171
|
+
// THE-458 (audit #5): index-on-write coordinator concurrency + backpressure. Fully defaulted so a
|
|
172
|
+
// config predating it validates unchanged. `writeConcurrency` bounds concurrent index/embed calls
|
|
173
|
+
// across ALL vaults; `writeConcurrencyPerVault` bounds them per vault (audit recommends 2–4);
|
|
174
|
+
// `queueMax` is a soft distinct-pending-path cap that surfaces backpressure in server_health (writes
|
|
175
|
+
// are never dropped).
|
|
176
|
+
export const IndexingConfigSchema = z
|
|
177
|
+
.object({
|
|
178
|
+
writeConcurrency: z
|
|
179
|
+
.number()
|
|
180
|
+
.int()
|
|
181
|
+
.positive()
|
|
182
|
+
.default(8)
|
|
183
|
+
.describe("Ceiling on concurrent index/embed calls across ALL vaults."),
|
|
184
|
+
writeConcurrencyPerVault: z
|
|
185
|
+
.number()
|
|
186
|
+
.int()
|
|
187
|
+
.positive()
|
|
188
|
+
.default(4)
|
|
189
|
+
.describe("Ceiling on concurrent index/embed calls for a single vault."),
|
|
190
|
+
queueMax: z
|
|
191
|
+
.number()
|
|
192
|
+
.int()
|
|
193
|
+
.positive()
|
|
194
|
+
.default(1000)
|
|
195
|
+
.describe("Soft cap on distinct pending paths, surfaced as backpressure in server_health. Writes are never dropped when it is exceeded."),
|
|
196
|
+
/** THE-490/THE-591: indexVault's opt-in per-directory-sorted streaming walk
|
|
197
|
+
* (walkVaultStream), vs the default eager walkVault that materializes the whole sorted
|
|
198
|
+
* file list before any note is processed. Measured -43% peak RSS on a full reindex; index
|
|
199
|
+
* OUTPUT is unchanged either way (test/index-stream-walk-equivalence.test.ts). Until this
|
|
200
|
+
* flag existed, none of the three production callers (add_vault, the boot reconcile, the
|
|
201
|
+
* index_vault tool) ever set it, so the flag was unreachable outside tests — OFF by default
|
|
202
|
+
* and stays off until enabling it is a deliberate decision, not a de facto one. */
|
|
203
|
+
streamingWalk: z
|
|
204
|
+
.boolean()
|
|
205
|
+
.default(false)
|
|
206
|
+
.describe("Walk the vault lazily per-directory (walkVaultStream) instead of materializing the full sorted file list before indexing starts. Lower peak memory on large vaults; index output is unchanged either way."),
|
|
207
|
+
})
|
|
208
|
+
.prefault({});
|
|
209
|
+
//# sourceMappingURL=indexing-embeddings.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexing-embeddings.schema.js","sourceRoot":"","sources":["../../src/config/indexing-embeddings.schema.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,2FAA2F;AAC3F,EAAE;AACF,oFAAoF;AACpF,iFAAiF;AACjF,gGAAgG;AAChG,+FAA+F;AAC/F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,OAAO,CAAC,QAAQ,CAAC;SACjB,QAAQ,CACP,iUAAiU,CAClU;IACH,KAAK,EAAE,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AAC;SACxB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,OAAO,CAAC,CAAC,CAAC;SACV,QAAQ,CAAC,6DAA6D,CAAC;IAC1E,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CACP,8HAA8H,CAC/H;IACH;;;;;;wFAMoF;IACpF,aAAa,EAAE,CAAC;SACb,OAAO,EAAE;SACT,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,2MAA2M,CAC5M;CACJ,CAAC;KACD,QAAQ,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ObservabilityConfigSchema: z.ZodObject<{
|
|
3
|
+
otel: z.ZodPrefault<z.ZodObject<{
|
|
4
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
5
|
+
headers: z.ZodPrefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
6
|
+
}, z.core.$strip>>;
|
|
7
|
+
prometheus: z.ZodPrefault<z.ZodObject<{
|
|
8
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
bind: z.ZodDefault<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
morgiana: z.ZodPrefault<z.ZodObject<{
|
|
13
|
+
spool: z.ZodDefault<z.ZodBoolean>;
|
|
14
|
+
httpEndpoint: z.ZodOptional<z.ZodString>;
|
|
15
|
+
httpHeaders: z.ZodPrefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
retention: z.ZodPrefault<z.ZodObject<{
|
|
18
|
+
eventLogDays: z.ZodDefault<z.ZodNumber>;
|
|
19
|
+
tracesDays: z.ZodDefault<z.ZodNumber>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export declare const SnapshotsConfigSchema: z.ZodPrefault<z.ZodObject<{
|
|
23
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
24
|
+
retention: z.ZodDefault<z.ZodNumber>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
export declare const MaintenanceConfigSchema: z.ZodPrefault<z.ZodObject<{
|
|
27
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
28
|
+
intervalMinutes: z.ZodDefault<z.ZodNumber>;
|
|
29
|
+
jobsCompleteRetentionDays: z.ZodDefault<z.ZodNumber>;
|
|
30
|
+
reconcileIntervalMinutes: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
episodesRetentionDays: z.ZodDefault<z.ZodNumber>;
|
|
32
|
+
retrievalsRetentionDays: z.ZodDefault<z.ZodNumber>;
|
|
33
|
+
jobsFailedRetentionDays: z.ZodDefault<z.ZodNumber>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
export declare const WatchConfigSchema: z.ZodPrefault<z.ZodObject<{
|
|
36
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
37
|
+
debounceMs: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
export declare const SchedulerConfigSchema: z.ZodPrefault<z.ZodObject<{
|
|
40
|
+
eventLoopDeferMs: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
export declare const PlaneConfigSchema: z.ZodPrefault<z.ZodObject<{
|
|
43
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
44
|
+
intervalMinutes: z.ZodDefault<z.ZodNumber>;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
export declare const PlurConfigSchema: z.ZodObject<{
|
|
47
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
48
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
49
|
+
apiPrefix: z.ZodDefault<z.ZodString>;
|
|
50
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
51
|
+
command: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
//# sourceMappingURL=observability.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observability.schema.d.ts","sourceRoot":"","sources":["../../src/config/observability.schema.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;iBA8EpC,CAAC;AAGH,eAAO,MAAM,qBAAqB;;;kBAgBnB,CAAC;AAGhB,eAAO,MAAM,uBAAuB;;;;;;;;kBAmErB,CAAC;AAOhB,eAAO,MAAM,iBAAiB;;;kBAiBf,CAAC;AAWhB,eAAO,MAAM,qBAAqB;;kBAWnB,CAAC;AAIhB,eAAO,MAAM,iBAAiB;;;kBAef,CAAC;AAUhB,eAAO,MAAM,gBAAgB;;;;;;iBAgC3B,CAAC"}
|