@jini-ai/search 0.0.0-stage → 0.6.10

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 (67) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +76 -2
  3. package/dist/api.d.ts +92 -0
  4. package/dist/api.d.ts.map +1 -0
  5. package/dist/api.js +2 -0
  6. package/dist/api.js.map +1 -0
  7. package/dist/contract.d.ts +219 -0
  8. package/dist/contract.d.ts.map +1 -0
  9. package/dist/contract.js +46 -0
  10. package/dist/contract.js.map +1 -0
  11. package/dist/contribution.d.ts +61 -0
  12. package/dist/contribution.d.ts.map +1 -0
  13. package/dist/contribution.js +124 -0
  14. package/dist/contribution.js.map +1 -0
  15. package/dist/digest.d.ts +13 -0
  16. package/dist/digest.d.ts.map +1 -0
  17. package/dist/digest.js +55 -0
  18. package/dist/digest.js.map +1 -0
  19. package/dist/index.d.ts +8 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +8 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/indexer.d.ts +50 -0
  24. package/dist/indexer.d.ts.map +1 -0
  25. package/dist/indexer.js +402 -0
  26. package/dist/indexer.js.map +1 -0
  27. package/dist/ports.d.ts +194 -0
  28. package/dist/ports.d.ts.map +1 -0
  29. package/dist/ports.js +2 -0
  30. package/dist/ports.js.map +1 -0
  31. package/dist/registry.d.ts +33 -0
  32. package/dist/registry.d.ts.map +1 -0
  33. package/dist/registry.js +81 -0
  34. package/dist/registry.js.map +1 -0
  35. package/dist/service.d.ts +37 -0
  36. package/dist/service.d.ts.map +1 -0
  37. package/dist/service.js +118 -0
  38. package/dist/service.js.map +1 -0
  39. package/dist/testkit/assert.d.ts +14 -0
  40. package/dist/testkit/assert.d.ts.map +1 -0
  41. package/dist/testkit/assert.js +20 -0
  42. package/dist/testkit/assert.js.map +1 -0
  43. package/dist/testkit/conformance.d.ts +32 -0
  44. package/dist/testkit/conformance.d.ts.map +1 -0
  45. package/dist/testkit/conformance.js +453 -0
  46. package/dist/testkit/conformance.js.map +1 -0
  47. package/dist/testkit/fakes.d.ts +56 -0
  48. package/dist/testkit/fakes.d.ts.map +1 -0
  49. package/dist/testkit/fakes.js +114 -0
  50. package/dist/testkit/fakes.js.map +1 -0
  51. package/dist/testkit/index.d.ts +9 -0
  52. package/dist/testkit/index.d.ts.map +1 -0
  53. package/dist/testkit/index.js +9 -0
  54. package/dist/testkit/index.js.map +1 -0
  55. package/dist/testkit/memory-provider.d.ts +23 -0
  56. package/dist/testkit/memory-provider.d.ts.map +1 -0
  57. package/dist/testkit/memory-provider.js +237 -0
  58. package/dist/testkit/memory-provider.js.map +1 -0
  59. package/dist/tokens.d.ts +9 -0
  60. package/dist/tokens.d.ts.map +1 -0
  61. package/dist/tokens.js +12 -0
  62. package/dist/tokens.js.map +1 -0
  63. package/dist/tools.d.ts +74 -0
  64. package/dist/tools.d.ts.map +1 -0
  65. package/dist/tools.js +194 -0
  66. package/dist/tools.js.map +1 -0
  67. package/package.json +75 -3
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,77 @@
1
- # Temporary Holding Version
1
+ # @jini-ai/search
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A generic site-search capability: one provider contract every search backend implements, a
4
+ registry for those providers, a single-writer indexer, a query service that re-checks access before
5
+ showing a hit, agent tools, and a conformance kit that every provider must pass unchanged.
6
+
7
+ The engine holds no product wiring. A host supplies its document sources, its index bookkeeping
8
+ table, its per-site target pointer and its access check as ports (`src/ports.ts`), and binds the
9
+ results through the composition tokens.
10
+
11
+ ## Entry points
12
+
13
+ | Import | Runtime | What it gives you |
14
+ |---|---|---|
15
+ | `@jini-ai/search` | universal | The contract (`SearchProvider`, documents, keys, revisions, tombstones), host ports, the `SearchService`/`SearchIndexer` APIs, `createSearchProviderRegistry`, `validateSearchProvider`, and the tokens `SearchProviderRegistryToken`, `SearchServiceToken`, `SearchIndexerToken`, `SearchDocumentSourceToken` (many). |
16
+ | `@jini-ai/search/tools` | universal | Agent tools over a `SearchService`. |
17
+ | `@jini-ai/search/contribution` | node | `defineSearchProviderContribution({ filename })` for plugin-contributed providers, loaded through `@jini-ai/agent-plugins`' executable contribution loader (an optional peer dependency), plus `contributeProviders`. |
18
+ | `@jini-ai/search/testkit` | universal | `runSearchProviderConformance`, the in-memory reference provider, and fakes (`createFakeHttpClient`, `createUnavailableHttpClient`, `createInMemorySearchState`, `createStaticAccessPort`, `createPredicateAccessPort`). Test-only. |
19
+
20
+ ## Plugin providers
21
+
22
+ A plugin ships a manifest at its package root, under the filename the host chooses:
23
+
24
+ ```json
25
+ { "schemaVersion": 1, "providers": [{ "id": "meilisearch", "label": "Meilisearch", "module": "dist/provider.mjs" }] }
26
+ ```
27
+
28
+ The module's default export must be a `SearchProvider` whose `id` equals the manifest id. Plugin
29
+ providers are public-only: one that declares `capabilities.acceptsRestricted: true` is refused,
30
+ because audience-restricted content may only live in the host's own built-in provider. Every fault
31
+ becomes a refusal line, never a boot crash.
32
+
33
+ ## Running the conformance kit
34
+
35
+ ```ts
36
+ import { test } from 'vitest';
37
+ import { runSearchProviderConformance, createUnavailableHttpClient } from '@jini-ai/search/testkit';
38
+
39
+ runSearchProviderConformance({
40
+ name: 'my provider',
41
+ test,
42
+ makeProvider: () => createMyProvider(),
43
+ makeContext: ({ siteId, indexName }) => ({ workspaceId: 'w', siteId, indexName, mode: 'test', credentials, httpClient, timeoutMs: 5000, now: Date.now }),
44
+ }, { makeUnavailableContext: input => ({ ...contextFor(input), httpClient: createUnavailableHttpClient() }) });
45
+ ```
46
+
47
+ The runner is injected, so the kit works with vitest, node:test or jest. Each case uses its own
48
+ index name, drops and re-creates it first, and settles `pending` writes through `awaitTask` when the
49
+ provider declares `asyncIndexing`.
50
+
51
+ ## What a built-in provider must implement
52
+
53
+ The owner's built-in provider is a plain `SearchProvider`, registered by the composition root as a
54
+ core provider (`createSearchProviderRegistry({}, { seed: [{ id: 'builtin', provider }] })`). It must:
55
+
56
+ - use `id: 'builtin'` (`BUILTIN_SEARCH_PROVIDER_ID`, also the registry's default) and
57
+ `credentialKeys: []`;
58
+ - declare honest capabilities. `acceptsRestricted: true` is allowed here and only here, since the
59
+ built-in is the one provider that may hold audience-restricted documents. It must then return a
60
+ restricted document only to a query whose `audiences` intersect the document's;
61
+ - keep its data in its own tables, reached through `ctx.storage`, created by its own TS migration.
62
+ It never reads or writes host tables;
63
+ - partition everything by `ctx.indexName`, so two sites or two generations never see each
64
+ other's documents;
65
+ - follow the revision rules. Revisions are numbers. A write (document or tombstone) whose revision
66
+ is not strictly greater than what is held for the key is `stale` and changes nothing. `remove`
67
+ writes a versioned tombstone, also for a key that was never indexed, so a delayed lower-revision
68
+ upsert can never resurrect a removed document. `revisionOf` reports absent as
69
+ `{ revision: null, deleted: false }` and a tombstone as `{ revision, deleted: true }`;
70
+ - report one write outcome per input, in input order;
71
+ - return plain-text snippets (never HTML) with highlight ranges as UTF-16 offsets inside the snippet;
72
+ - reject empty or whitespace query text as `invalid_request`, and paginate with an opaque cursor that
73
+ gives stable pages with no overlap;
74
+ - never throw. A definite refusal is `rejected`. An indeterminate outcome (timeout, storage down) is
75
+ `unknown`;
76
+ - pass `runSearchProviderConformance` unchanged. The in-memory reference provider in the testkit
77
+ shows the expected semantics, but it is not the built-in and must never be registered in a host.
package/dist/api.d.ts ADDED
@@ -0,0 +1,92 @@
1
+ /**
2
+ * @file The two runtime objects a host consumes (FROZEN for this build, 2026-10-21; change additively).
3
+ *
4
+ * Consumers (a public `/api/search` route, a theme search block, agent tools) only ever receive a
5
+ * {@link SearchService}. The composition root alone holds the {@link SearchIndexer} and wires it to
6
+ * the host event bus and a background job.
7
+ */
8
+ import type { SearchPage, SearchQuery } from './contract.js';
9
+ import type { SearchSiteTargets, SearchSourceEvent, SearchStatusCounts } from './ports.js';
10
+ export type SearchUnavailableReason = 'not_configured' | 'timeout' | 'provider_unavailable' | 'provider_error' | 'access_check_failed';
11
+ export type SearchServiceResult = {
12
+ readonly status: 'ok';
13
+ readonly providerId: string;
14
+ readonly page: SearchPage;
15
+ } | {
16
+ readonly status: 'invalid';
17
+ readonly message: string;
18
+ } | {
19
+ readonly status: 'unavailable';
20
+ readonly reason: SearchUnavailableReason;
21
+ };
22
+ export interface SearchTargetStatus {
23
+ readonly providerId: string;
24
+ readonly generation: number;
25
+ readonly registered: boolean;
26
+ readonly counts: SearchStatusCounts;
27
+ }
28
+ export interface SearchStatus {
29
+ readonly siteId: string;
30
+ readonly active: SearchTargetStatus | null;
31
+ readonly building: SearchTargetStatus | null;
32
+ }
33
+ export interface SearchService {
34
+ /**
35
+ * Run a query against the site's ACTIVE target, then drop every hit the access port does not
36
+ * confirm as visible right now. `audiences` comes only from the host's viewer resolution; it is
37
+ * ignored (public only) when the active provider does not accept restricted content.
38
+ */
39
+ query(required: {
40
+ readonly siteId: string;
41
+ readonly workspaceId: string;
42
+ readonly query: Omit<SearchQuery, 'audiences'>;
43
+ }, optional?: {
44
+ readonly audiences?: readonly string[];
45
+ }): Promise<SearchServiceResult>;
46
+ status(required: {
47
+ readonly siteId: string;
48
+ }): Promise<SearchStatus>;
49
+ }
50
+ export interface SearchBackfillResult {
51
+ /** Every source scanned to completion for the building (or active) target. */
52
+ readonly done: boolean;
53
+ readonly written: number;
54
+ /** The building target was promoted to active in this call. */
55
+ readonly promoted: boolean;
56
+ }
57
+ export interface SearchIndexer {
58
+ /** Event names to subscribe to (union of every source's `events`). */
59
+ readonly eventNames: readonly string[];
60
+ /** Bus handler: re-load the named document and write it (or its tombstone) to every target. */
61
+ handleEvent(required: {
62
+ readonly event: SearchSourceEvent;
63
+ }): Promise<void>;
64
+ /** Retry `failed` rows and settle `pending`/`unknown` rows (awaitTask / revisionOf). Bounded. */
65
+ reconcile(required: {
66
+ readonly siteId: string;
67
+ readonly workspaceId: string;
68
+ }, optional?: {
69
+ readonly limit?: number;
70
+ }): Promise<{
71
+ readonly settled: number;
72
+ readonly remaining: number;
73
+ }>;
74
+ /**
75
+ * Resumable backfill of the building target (else the active one) from each source's `scan`,
76
+ * continuing from the stored watermark; promotes building→active atomically once every source is
77
+ * done and nothing is pending/unknown. Bounded by `optional.pageBudget` pages.
78
+ */
79
+ backfill(required: {
80
+ readonly siteId: string;
81
+ readonly workspaceId: string;
82
+ }, optional?: {
83
+ readonly pageBudget?: number;
84
+ }): Promise<SearchBackfillResult>;
85
+ /** Start a rebuild into a new generation of `providerId` (a provider switch or a full reindex). */
86
+ startRebuild(required: {
87
+ readonly siteId: string;
88
+ readonly workspaceId: string;
89
+ readonly providerId: string;
90
+ }): Promise<SearchSiteTargets>;
91
+ }
92
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE3F,MAAM,MAAM,uBAAuB,GAC/B,gBAAgB,GAChB,SAAS,GACT,sBAAsB,GACtB,gBAAgB,GAChB,qBAAqB,CAAC;AAE1B,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GACjF;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACxD;IAAE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CA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QAAQ,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,iGAAiG;IACjG,SAAS,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1L;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC1J,mGAAmG;IACnG,YAAY,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC5I"}
package/dist/api.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":""}
@@ -0,0 +1,219 @@
1
+ /**
2
+ * @file The site-search provider contract (FROZEN for this build, 2026-10-21; change additively).
3
+ *
4
+ * One interface every search backend implements: the owner's built-in provider, vendor plugins
5
+ * (Meilisearch first) and the in-memory reference provider the conformance kit runs against. The
6
+ * host never talks to a backend except through {@link SearchProvider}; the indexer
7
+ * (`indexer.ts`) is the ONE writer and the query service (`service.ts`) the ONE reader.
8
+ *
9
+ * Decisions folded in from the 2026-10-21 provider gap check (they override the first design):
10
+ * - Keys are namespaced site/workspace/collection/document, so two sites can never collide even when
11
+ * they share a vendor index or a document id.
12
+ * - `revision` is a NUMBER (a string version sorts "10" before "9"). A write whose revision is not
13
+ * strictly greater than what the provider holds for that key — including a tombstone — is `stale`
14
+ * and changes nothing, so a delayed write can never resurrect a removed document.
15
+ * - Removal writes a versioned tombstone, also for a key that was never indexed.
16
+ * - Vendors are PUBLIC-ONLY: only a provider declaring `acceptsRestricted` may receive a document
17
+ * with restricted visibility (the indexer turns such a write into a removal for every other
18
+ * provider). Snippets are plain text plus highlight ranges, never HTML.
19
+ * - Facets are not in v1 (declared-but-never-returned was a contract bug).
20
+ * - Methods never throw: definite refusals are `rejected`, indeterminate outcomes (timeout, network,
21
+ * provider down) are `unknown` and are reconciled, never blindly retried.
22
+ */
23
+ import type { HttpClientPort } from '@jini-ai/core/primitives';
24
+ import type { ProviderContext, ProviderResult } from '@jini-ai/core/provider-registry';
25
+ /** The contract name used by the provider registry and plugin contributions. */
26
+ export declare const SEARCH_CONTRACT = "search";
27
+ /** The id the owner's in-process provider registers under; also the per-site default. */
28
+ export declare const BUILTIN_SEARCH_PROVIDER_ID = "builtin";
29
+ /** A document's identity. Every part is part of the key; none is optional. */
30
+ export interface SearchDocumentKey {
31
+ readonly siteId: string;
32
+ readonly workspaceId: string;
33
+ /** e.g. `post`, `page`, `product`. Grammar `^[a-z][a-z0-9_]{0,63}$`. */
34
+ readonly collection: string;
35
+ readonly documentId: string;
36
+ }
37
+ /** Who may see a document. Restricted documents reach only providers with `acceptsRestricted`. */
38
+ export type SearchVisibility = {
39
+ readonly kind: 'public';
40
+ } | {
41
+ readonly kind: 'restricted';
42
+ readonly audiences: readonly string[];
43
+ };
44
+ export type SearchFieldValue = string | number | boolean | readonly string[];
45
+ export interface SearchDocument {
46
+ readonly key: SearchDocumentKey;
47
+ /** Non-negative safe integer, strictly increasing per key across every change incl. removal. */
48
+ readonly revision: number;
49
+ readonly locale?: string;
50
+ /** Site-relative public URL, e.g. `/blog/hello`. */
51
+ readonly url: string;
52
+ /** Plain text; a provider must never interpret it as markup. */
53
+ readonly title: string;
54
+ /** Plain text; a provider must never interpret it as markup. */
55
+ readonly body: string;
56
+ /** Filterable attributes (exact match only in v1). */
57
+ readonly fields?: Readonly<Record<string, SearchFieldValue>>;
58
+ readonly visibility: SearchVisibility;
59
+ }
60
+ /** A versioned removal. A later upsert must carry a strictly greater revision to revive the key. */
61
+ export interface SearchTombstone {
62
+ readonly key: SearchDocumentKey;
63
+ readonly revision: number;
64
+ }
65
+ export interface SearchQuery {
66
+ /** Required, trimmed non-empty; an empty text is `rejected` with `invalid_request`. */
67
+ readonly text: string;
68
+ readonly collections?: readonly string[];
69
+ readonly locale?: string;
70
+ /** Exact-match filters on `SearchDocument.fields`. */
71
+ readonly filters?: Readonly<Record<string, string | number | boolean>>;
72
+ /** Set ONLY by the host from the viewer's principal, never from user input. Absent = public only. */
73
+ readonly audiences?: readonly string[];
74
+ /** 1..100; default 10. */
75
+ readonly limit?: number;
76
+ /** Opaque cursor from a previous page of the same query. */
77
+ readonly cursor?: string;
78
+ }
79
+ /** UTF-16 code-unit offsets into `SearchHit.snippet`, `start < end <= snippet.length`. */
80
+ export interface SearchHighlight {
81
+ readonly start: number;
82
+ readonly end: number;
83
+ }
84
+ export interface SearchHit {
85
+ readonly key: SearchDocumentKey;
86
+ /** The revision the provider returned this hit from (the service revalidates it). */
87
+ readonly revision: number;
88
+ readonly url: string;
89
+ readonly title: string;
90
+ /** Plain text excerpt of the body (no HTML). May be empty only when the body is empty. */
91
+ readonly snippet: string;
92
+ readonly highlights: readonly SearchHighlight[];
93
+ /** Provider-private relevance; only the ordering within one page is meaningful. */
94
+ readonly score: number;
95
+ }
96
+ export interface SearchPage {
97
+ readonly hits: readonly SearchHit[];
98
+ readonly nextCursor?: string;
99
+ }
100
+ export interface SearchCapabilities {
101
+ /** Only the in-process built-in provider may set this; vendors must declare `false`. */
102
+ readonly acceptsRestricted: boolean;
103
+ readonly typoTolerance: boolean;
104
+ readonly locales: readonly string[] | 'any';
105
+ /** Max documents/tombstones per write call. */
106
+ readonly maxBatch: number;
107
+ /** Writes may answer `pending` with a `taskId`; the provider then implements `awaitTask`. */
108
+ readonly asyncIndexing: boolean;
109
+ }
110
+ /** Per-key outcome of one write call. A write call reports one outcome per input, in input order. */
111
+ export type SearchWriteStatus =
112
+ /** Durable and visible to queries. */
113
+ 'applied'
114
+ /** Ignored: the provider already holds an equal or greater revision (document or tombstone). */
115
+ | 'stale'
116
+ /** Accepted asynchronously; settle with `awaitTask(taskId)`. */
117
+ | 'pending'
118
+ /** Refused for this key only (e.g. too large); the message is caller-safe. */
119
+ | 'rejected';
120
+ export interface SearchWriteOutcome {
121
+ readonly key: SearchDocumentKey;
122
+ readonly revision: number;
123
+ readonly status: SearchWriteStatus;
124
+ readonly message?: string;
125
+ }
126
+ export interface SearchWriteResult {
127
+ readonly outcomes: readonly SearchWriteOutcome[];
128
+ /** Set when any outcome is `pending`. */
129
+ readonly taskId?: string;
130
+ }
131
+ export type SearchTaskState = 'pending' | 'succeeded' | 'failed';
132
+ /** What the provider holds for a key: absent (never written), a live document or a tombstone. */
133
+ export interface SearchRevisionState {
134
+ readonly key: SearchDocumentKey;
135
+ readonly revision: number | null;
136
+ readonly deleted: boolean;
137
+ }
138
+ /**
139
+ * Pre-resolved per call by the host. Credentials come from the host's vault, never from the plugin
140
+ * manifest; the HTTP client is the host's guarded egress client (no raw fetch in a provider).
141
+ */
142
+ export interface SearchProviderContext extends ProviderContext {
143
+ readonly siteId: string;
144
+ /** Unique per install + site + provider + generation (see `searchIndexName`). */
145
+ readonly indexName: string;
146
+ readonly credentials: Readonly<Record<string, string>>;
147
+ readonly httpClient: HttpClientPort;
148
+ /** Hard per-request budget; a provider maps an overrun to `unknown`/`timeout`. */
149
+ readonly timeoutMs: number;
150
+ readonly now: () => number;
151
+ /** Opaque host storage handle for in-process providers (the built-in); vendors ignore it. */
152
+ readonly storage?: unknown;
153
+ }
154
+ /**
155
+ * A search backend. Stateless between calls (all state lives in the backend, keyed by
156
+ * `ctx.indexName`), never throws, and never reads or writes host tables except through
157
+ * `ctx.storage` on its own tables.
158
+ */
159
+ export interface SearchProvider {
160
+ readonly id: string;
161
+ readonly label: string;
162
+ readonly capabilities: SearchCapabilities;
163
+ /** Names of the credential values the host must supply in `ctx.credentials`. */
164
+ readonly credentialKeys: readonly string[];
165
+ /** Create the index if missing and apply settings. Idempotent. */
166
+ ensureIndex(ctx: SearchProviderContext, required?: Record<string, never>): Promise<ProviderResult<void>>;
167
+ /** Delete the whole index (an old generation after a switch). Absent index is `ok`. */
168
+ dropIndex(ctx: SearchProviderContext, required?: Record<string, never>): Promise<ProviderResult<void>>;
169
+ upsert(ctx: SearchProviderContext, required: {
170
+ readonly documents: readonly SearchDocument[];
171
+ }): Promise<ProviderResult<SearchWriteResult>>;
172
+ remove(ctx: SearchProviderContext, required: {
173
+ readonly tombstones: readonly SearchTombstone[];
174
+ }): Promise<ProviderResult<SearchWriteResult>>;
175
+ /** Only documents keyed to `ctx.siteId` and `ctx.workspaceId` match, even when other tenants share the index. */
176
+ query(ctx: SearchProviderContext, required: {
177
+ readonly query: SearchQuery;
178
+ }): Promise<ProviderResult<SearchPage>>;
179
+ revisionOf(ctx: SearchProviderContext, required: {
180
+ readonly keys: readonly SearchDocumentKey[];
181
+ }): Promise<ProviderResult<readonly SearchRevisionState[]>>;
182
+ /** Required when `capabilities.asyncIndexing`; reports the state of an earlier `pending` write. */
183
+ awaitTask?(ctx: SearchProviderContext, required: {
184
+ readonly taskId: string;
185
+ }): Promise<ProviderResult<SearchTaskState>>;
186
+ }
187
+ /** What a plugin module's default export must be (validated by `contribution.ts`). */
188
+ export type SearchProviderModule = SearchProvider;
189
+ /**
190
+ * The single string form of a key, for maps, state rows and vendor document ids. Each part is
191
+ * `encodeURIComponent`-ed so a `/` inside a part can never forge another key.
192
+ * @complexity O(total key length).
193
+ */
194
+ export declare function encodeSearchKey(required: {
195
+ readonly key: SearchDocumentKey;
196
+ }): string;
197
+ /** Inverse of {@link encodeSearchKey}; `undefined` for anything that is not exactly four parts. */
198
+ export declare function decodeSearchKey(required: {
199
+ readonly encoded: string;
200
+ }): SearchDocumentKey | undefined;
201
+ /**
202
+ * The backend index name for one install, site, provider and generation. Derived from the install
203
+ * id (never the site slug) so two installs sharing a vendor account cannot collide, and the
204
+ * generation suffix is what makes a provider switch or full rebuild an atomic pointer flip.
205
+ * The identity is a SHA-256 digest (160 bits kept) of the COMPLETE, unambiguously encoded
206
+ * (installId, siteId, providerId) tuple: a lossy slug (`site-a` vs `site_a`, two long ids sharing a
207
+ * prefix) would give two sites one index, and dropping one site's generation would delete the
208
+ * other's. The generation stays a distinct, readable suffix, never truncated; the provider prefix is
209
+ * only a readable label.
210
+ * Output grammar `[a-z0-9_]`, at most 120 chars (fits Meilisearch and Algolia index-name rules).
211
+ * @complexity O(input length).
212
+ */
213
+ export declare function searchIndexName(required: {
214
+ readonly installId: string;
215
+ readonly siteId: string;
216
+ readonly providerId: string;
217
+ readonly generation: number;
218
+ }): string;
219
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGvF,gFAAgF;AAChF,eAAO,MAAM,eAAe,WAAW,CAAC;AAExC,yFAAyF;AACzF,eAAO,MAAM,0BAA0B,YAAY,CAAC;AAEpD,8EAA8E;AAC9E,MAAM,WAAW,iBAA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