@k9o/extensions 1.0.0 → 1.1.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/README.md +96 -0
- package/dist/{chunk-DDCQOYU7.js → chunk-72WCKHWA.js} +2 -2
- package/dist/chunk-72WCKHWA.js.map +1 -0
- package/dist/{chunk-JED6CNPT.js → chunk-MIBROCBJ.js} +2 -2
- package/dist/chunk-MIBROCBJ.js.map +1 -0
- package/dist/extensions/cairn.d.ts +2 -4
- package/dist/extensions/cairn.js +1 -1
- package/dist/extensions/paperless.d.ts +3 -5
- package/dist/extensions/paperless.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/extensions/cairn.ts +4 -9
- package/src/extensions/paperless.ts +5 -10
- package/dist/chunk-DDCQOYU7.js.map +0 -1
- package/dist/chunk-JED6CNPT.js.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @k9o/extensions
|
|
2
|
+
|
|
3
|
+
Typed bindings for Kilimanjaro platform extensions, resolved by slug with `k9o.extension(slug)`.
|
|
4
|
+
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- [Install](#install)
|
|
8
|
+
- [Quick start](#quick-start)
|
|
9
|
+
- [Current limitations](#current-limitations)
|
|
10
|
+
- [Using through @k9o/core](#using-through-k9ocore)
|
|
11
|
+
- [Appendix](#appendix)
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @k9o/extensions
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bun add @k9o/extensions
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pnpm add @k9o/extensions
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Requires TypeScript 5.6+ for the bundled types. See [Requirements](#requirements).
|
|
28
|
+
|
|
29
|
+
## Quick start
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { k9o } from "@k9o/extensions";
|
|
33
|
+
|
|
34
|
+
const cairn = k9o.extension("cairn");
|
|
35
|
+
|
|
36
|
+
async function createTasksCollection() {
|
|
37
|
+
return cairn.collections.create({ name: "tasks", dimension: 3, metric: "cosine" });
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- The returned object is typed for the slug you pass.
|
|
42
|
+
- An unknown slug is a compile-time error, and it also throws an `Error` at runtime.
|
|
43
|
+
- See [Methods by extension](#methods-by-extension) for what each extension offers.
|
|
44
|
+
|
|
45
|
+
## Current limitations
|
|
46
|
+
|
|
47
|
+
- In this release the bindings define the typed contract only.
|
|
48
|
+
- Calling a method rejects with an `Error` saying the runtime is not implemented.
|
|
49
|
+
- No request is sent to the platform.
|
|
50
|
+
- Until method dispatch is available, call extensions over HTTP.
|
|
51
|
+
|
|
52
|
+
## Using through @k9o/core
|
|
53
|
+
|
|
54
|
+
`@k9o/core` exposes the same factory as `client.extensions.extension(slug)`.
|
|
55
|
+
|
|
56
|
+
## Appendix
|
|
57
|
+
|
|
58
|
+
### Requirements
|
|
59
|
+
|
|
60
|
+
| Requirement | Version |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| TypeScript | 5.6 or newer |
|
|
63
|
+
|
|
64
|
+
### Methods by extension
|
|
65
|
+
|
|
66
|
+
| Extension | Method | What it does |
|
|
67
|
+
| --- | --- | --- |
|
|
68
|
+
| `paperless` | `documents.uploadAndOcr({ buffer, filename, language? })` | Uploads a document and returns its OCR text. |
|
|
69
|
+
| `paperless` | `workspace.init()` | Initializes the workspace. |
|
|
70
|
+
| `cairn` | `collections.create({ name, dimension, metric? })` | Creates a collection. |
|
|
71
|
+
| `cairn` | `collections.list()` | Lists collections. |
|
|
72
|
+
| `cairn` | `vectors.upsert({ collection, records })` | Inserts or updates vectors. |
|
|
73
|
+
| `cairn` | `vectors.query({ collection, embedding, topK?, filter? })` | Finds the nearest vectors. |
|
|
74
|
+
| `cairn` | `vectors.delete({ collection, ids })` | Deletes vectors by id. |
|
|
75
|
+
|
|
76
|
+
### Imports
|
|
77
|
+
|
|
78
|
+
| Import | What it gives you |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| `@k9o/extensions` | `k9o`, plus the types `ExtensionSlug`, `Extension`, `PaperlessExtension`, `CairnExtension`. |
|
|
81
|
+
| `@k9o/extensions/paperless` | The paperless binding. |
|
|
82
|
+
| `@k9o/extensions/cairn` | The cairn binding. |
|
|
83
|
+
|
|
84
|
+
### Related packages
|
|
85
|
+
|
|
86
|
+
| Package | What it does |
|
|
87
|
+
| --- | --- |
|
|
88
|
+
| `@k9o/core` | The full platform client. |
|
|
89
|
+
| `@k9o/gate` | End-user identity and JWT verification. |
|
|
90
|
+
| `@k9o/kibo` | Vault and key operations. |
|
|
91
|
+
|
|
92
|
+
Platform apex: https://api.k9o.io. Documentation: https://kilimanjaro.dev.
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
Apache-2.0 © Formelo Inc. See `LICENSE` and `NOTICE`.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var stub = (op) => {
|
|
3
3
|
return () => Promise.reject(
|
|
4
4
|
new Error(
|
|
5
|
-
`paperless.${op}
|
|
5
|
+
`paperless.${op} is not available yet: the extension runtime is not implemented in this version of @k9o/extensions.`
|
|
6
6
|
)
|
|
7
7
|
);
|
|
8
8
|
};
|
|
@@ -18,4 +18,4 @@ var paperlessExtension = {
|
|
|
18
18
|
export {
|
|
19
19
|
paperlessExtension
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-72WCKHWA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/extensions/paperless.ts"],"sourcesContent":["/**\n * `paperless` extension typed binding — Paperless: AI Workflows extension\n * (Trailblazer class). Brand-absorbed from\n * Formelo Inc. \"Paperless: AI Workflows\" (existing App Store product).\n *\n * The typed contract is available now. Per-method runtime calls are not implemented yet and reject\n * with an error that says so.\n */\n\n/** Document upload + OCR result shape. */\nexport type UploadAndOcrResult = {\n documentId: string;\n ocrText: string;\n pages: number;\n language: string | null;\n};\n\n/** Workflow-init response envelope (v1 BFF guide-not-binding per\n * paperless v2.1 spec +; version: 2 envelope marker required). */\nexport type WorkspaceInitResponse = {\n version: 2;\n // Shape past `version` is BFF-author-flexible (by design);\n // mobile client consumes whatever\n // shape the BFF emits as long as the version marker is present.\n [key: string]: unknown;\n};\n\n/** Typed binding interface for the `paperless` extension. */\nexport interface PaperlessExtension {\n documents: {\n uploadAndOcr(params: {\n buffer: Uint8Array | ArrayBuffer;\n filename: string;\n language?: string;\n }): Promise<UploadAndOcrResult>;\n };\n workspace: {\n init(): Promise<WorkspaceInitResponse>;\n };\n}\n\n/** Runtime stub: every method rejects until per-method runtime calls are implemented. */\nconst stub = (op: string): (() => Promise<never>) => {\n return (): Promise<never> =>\n Promise.reject(\n new Error(\n `paperless.${op} is not available yet: the extension runtime is not implemented in this version of @k9o/extensions.`,\n ),\n );\n};\n\nexport const paperlessExtension: PaperlessExtension = {\n documents: {\n uploadAndOcr: stub(\"documents.uploadAndOcr\") as PaperlessExtension[\"documents\"][\"uploadAndOcr\"],\n },\n workspace: {\n init: stub(\"workspace.init\") as PaperlessExtension[\"workspace\"][\"init\"],\n },\n};\n"],"mappings":";AA0CA,IAAM,OAAO,CAAC,OAAuC;AACnD,SAAO,MACL,QAAQ;AAAA,IACN,IAAI;AAAA,MACF,aAAa,EAAE;AAAA,IACjB;AAAA,EACF;AACJ;AAEO,IAAM,qBAAyC;AAAA,EACpD,WAAW;AAAA,IACT,cAAc,KAAK,wBAAwB;AAAA,EAC7C;AAAA,EACA,WAAW;AAAA,IACT,MAAM,KAAK,gBAAgB;AAAA,EAC7B;AACF;","names":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var stub = (op) => {
|
|
3
3
|
return () => Promise.reject(
|
|
4
4
|
new Error(
|
|
5
|
-
`cairn.${op}
|
|
5
|
+
`cairn.${op} is not available yet: the extension runtime is not implemented in this version of @k9o/extensions.`
|
|
6
6
|
)
|
|
7
7
|
);
|
|
8
8
|
};
|
|
@@ -21,4 +21,4 @@ var cairnExtension = {
|
|
|
21
21
|
export {
|
|
22
22
|
cairnExtension
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
24
|
+
//# sourceMappingURL=chunk-MIBROCBJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/extensions/cairn.ts"],"sourcesContent":["/**\n * `cairn` extension typed binding — Cairn: vector store / knowledge-base\n * extension (Trailblazer class). Surface stripped\n * of SQL Studio ops (SQL is core platform; canonical home is the Console\n * query-studio surface).\n *\n * The typed contract is available now. Per-method runtime calls are not implemented yet and reject\n * with an error that says so.\n */\n\n/** Vector record shape for upsert. */\nexport type VectorRecord = {\n id: string;\n embedding: number[];\n metadata?: Record<string, unknown>;\n};\n\n/** Query-result shape from semantic search. */\nexport type QueryResult = {\n id: string;\n score: number;\n metadata: Record<string, unknown> | null;\n};\n\n/** Typed binding interface for the `cairn` extension. */\nexport interface CairnExtension {\n vectors: {\n upsert(params: { collection: string; records: VectorRecord[] }): Promise<{ upserted: number }>;\n query(params: {\n collection: string;\n embedding: number[];\n topK?: number;\n filter?: Record<string, unknown>;\n }): Promise<QueryResult[]>;\n delete(params: { collection: string; ids: string[] }): Promise<{ deleted: number }>;\n };\n collections: {\n create(params: { name: string; dimension: number; metric?: \"cosine\" | \"euclidean\" | \"dot\" }): Promise<{\n name: string;\n dimension: number;\n }>;\n list(): Promise<{ collections: { name: string; dimension: number; count: number }[] }>;\n };\n}\n\n/** Runtime stub: every method rejects until per-method runtime calls are implemented. */\nconst stub = (op: string): (() => Promise<never>) => {\n return (): Promise<never> =>\n Promise.reject(\n new Error(\n `cairn.${op} is not available yet: the extension runtime is not implemented in this version of @k9o/extensions.`,\n ),\n );\n};\n\nexport const cairnExtension: CairnExtension = {\n vectors: {\n upsert: stub(\"vectors.upsert\") as CairnExtension[\"vectors\"][\"upsert\"],\n query: stub(\"vectors.query\") as CairnExtension[\"vectors\"][\"query\"],\n delete: stub(\"vectors.delete\") as CairnExtension[\"vectors\"][\"delete\"],\n },\n collections: {\n create: stub(\"collections.create\") as CairnExtension[\"collections\"][\"create\"],\n list: stub(\"collections.list\") as CairnExtension[\"collections\"][\"list\"],\n },\n};\n"],"mappings":";AA8CA,IAAM,OAAO,CAAC,OAAuC;AACnD,SAAO,MACL,QAAQ;AAAA,IACN,IAAI;AAAA,MACF,SAAS,EAAE;AAAA,IACb;AAAA,EACF;AACJ;AAEO,IAAM,iBAAiC;AAAA,EAC5C,SAAS;AAAA,IACP,QAAQ,KAAK,gBAAgB;AAAA,IAC7B,OAAO,KAAK,eAAe;AAAA,IAC3B,QAAQ,KAAK,gBAAgB;AAAA,EAC/B;AAAA,EACA,aAAa;AAAA,IACX,QAAQ,KAAK,oBAAoB;AAAA,IACjC,MAAM,KAAK,kBAAkB;AAAA,EAC/B;AACF;","names":[]}
|
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
* of SQL Studio ops (SQL is core platform; canonical home is the Console
|
|
5
5
|
* query-studio surface).
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* arrives). Interface shape derived from PO functional-specification.md
|
|
10
|
-
* + the `k9o.extension(name).from(collection)` reference.
|
|
7
|
+
* The typed contract is available now. Per-method runtime calls are not implemented yet and reject
|
|
8
|
+
* with an error that says so.
|
|
11
9
|
*/
|
|
12
10
|
/** Vector record shape for upsert. */
|
|
13
11
|
type VectorRecord = {
|
package/dist/extensions/cairn.js
CHANGED
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
* (Trailblazer class). Brand-absorbed from
|
|
4
4
|
* Formelo Inc. "Paperless: AI Workflows" (existing App Store product).
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* arrives). Interface shape derived from PO functional-specification.md
|
|
9
|
-
* authoring + the invoke-extension contract.
|
|
6
|
+
* The typed contract is available now. Per-method runtime calls are not implemented yet and reject
|
|
7
|
+
* with an error that says so.
|
|
10
8
|
*/
|
|
11
9
|
/** Document upload + OCR result shape. */
|
|
12
10
|
type UploadAndOcrResult = {
|
|
@@ -16,7 +14,7 @@ type UploadAndOcrResult = {
|
|
|
16
14
|
language: string | null;
|
|
17
15
|
};
|
|
18
16
|
/** Workflow-init response envelope (v1 BFF guide-not-binding per
|
|
19
|
-
* paperless v2.1 spec
|
|
17
|
+
* paperless v2.1 spec +; version: 2 envelope marker required). */
|
|
20
18
|
type WorkspaceInitResponse = {
|
|
21
19
|
version: 2;
|
|
22
20
|
[key: string]: unknown;
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k9o/extensions",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Kilimanjaro extensions consumption SDK — k9o.extension(slug) typed Stack-SDK factory. Sibling of @k9o/gate (Identity-Aware Kernel) and future @k9o/kibo (data/compute pillar) per 3-pillar brand architecture.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
package/src/extensions/cairn.ts
CHANGED
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
* of SQL Studio ops (SQL is core platform; canonical home is the Console
|
|
5
5
|
* query-studio surface).
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* arrives). Interface shape derived from PO functional-specification.md
|
|
10
|
-
* + the `k9o.extension(name).from(collection)` reference.
|
|
7
|
+
* The typed contract is available now. Per-method runtime calls are not implemented yet and reject
|
|
8
|
+
* with an error that says so.
|
|
11
9
|
*/
|
|
12
10
|
|
|
13
11
|
/** Vector record shape for upsert. */
|
|
@@ -45,15 +43,12 @@ export interface CairnExtension {
|
|
|
45
43
|
};
|
|
46
44
|
}
|
|
47
45
|
|
|
48
|
-
/** Runtime stub
|
|
49
|
-
* wires the per-method HTTP dispatch + codegen-from-OpenAPI pipeline. */
|
|
46
|
+
/** Runtime stub: every method rejects until per-method runtime calls are implemented. */
|
|
50
47
|
const stub = (op: string): (() => Promise<never>) => {
|
|
51
48
|
return (): Promise<never> =>
|
|
52
49
|
Promise.reject(
|
|
53
50
|
new Error(
|
|
54
|
-
`cairn.${op}
|
|
55
|
-
`factory + typed-binding contract scaffolded at v2.5.68p-stack-sdk-pass1; ` +
|
|
56
|
-
`per-method HTTP dispatch lands at v2.5.68p-stack-sdk-pass2 (codegen-from-OpenAPI).`,
|
|
51
|
+
`cairn.${op} is not available yet: the extension runtime is not implemented in this version of @k9o/extensions.`,
|
|
57
52
|
),
|
|
58
53
|
);
|
|
59
54
|
};
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
* (Trailblazer class). Brand-absorbed from
|
|
4
4
|
* Formelo Inc. "Paperless: AI Workflows" (existing App Store product).
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* arrives). Interface shape derived from PO functional-specification.md
|
|
9
|
-
* authoring + the invoke-extension contract.
|
|
6
|
+
* The typed contract is available now. Per-method runtime calls are not implemented yet and reject
|
|
7
|
+
* with an error that says so.
|
|
10
8
|
*/
|
|
11
9
|
|
|
12
10
|
/** Document upload + OCR result shape. */
|
|
@@ -18,7 +16,7 @@ export type UploadAndOcrResult = {
|
|
|
18
16
|
};
|
|
19
17
|
|
|
20
18
|
/** Workflow-init response envelope (v1 BFF guide-not-binding per
|
|
21
|
-
* paperless v2.1 spec
|
|
19
|
+
* paperless v2.1 spec +; version: 2 envelope marker required). */
|
|
22
20
|
export type WorkspaceInitResponse = {
|
|
23
21
|
version: 2;
|
|
24
22
|
// Shape past `version` is BFF-author-flexible (by design);
|
|
@@ -41,15 +39,12 @@ export interface PaperlessExtension {
|
|
|
41
39
|
};
|
|
42
40
|
}
|
|
43
41
|
|
|
44
|
-
/** Runtime stub
|
|
45
|
-
* wires the per-method HTTP dispatch + codegen-from-OpenAPI pipeline. */
|
|
42
|
+
/** Runtime stub: every method rejects until per-method runtime calls are implemented. */
|
|
46
43
|
const stub = (op: string): (() => Promise<never>) => {
|
|
47
44
|
return (): Promise<never> =>
|
|
48
45
|
Promise.reject(
|
|
49
46
|
new Error(
|
|
50
|
-
`paperless.${op}
|
|
51
|
-
`factory + typed-binding contract scaffolded at v2.5.68p-stack-sdk-pass1; ` +
|
|
52
|
-
`per-method HTTP dispatch lands at v2.5.68p-stack-sdk-pass2 (codegen-from-OpenAPI).`,
|
|
47
|
+
`paperless.${op} is not available yet: the extension runtime is not implemented in this version of @k9o/extensions.`,
|
|
53
48
|
),
|
|
54
49
|
);
|
|
55
50
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/extensions/paperless.ts"],"sourcesContent":["/**\n * `paperless` extension typed binding — Paperless: AI Workflows extension\n * (Trailblazer class). Brand-absorbed from\n * Formelo Inc. \"Paperless: AI Workflows\" (existing App Store product).\n *\n * Surface scope at v2 launch (scaffold; per-method runtime implementation\n * lands in v2.5.68p-stack-sdk-pass2 when codegen-from-OpenAPI pipeline\n * arrives). Interface shape derived from PO functional-specification.md\n * authoring + the invoke-extension contract.\n */\n\n/** Document upload + OCR result shape. */\nexport type UploadAndOcrResult = {\n documentId: string;\n ocrText: string;\n pages: number;\n language: string | null;\n};\n\n/** Workflow-init response envelope (v1 BFF guide-not-binding per\n * paperless v2.1 spec §8 + §18; version: 2 envelope marker required). */\nexport type WorkspaceInitResponse = {\n version: 2;\n // Shape past `version` is BFF-author-flexible (by design);\n // mobile client consumes whatever\n // shape the BFF emits as long as the version marker is present.\n [key: string]: unknown;\n};\n\n/** Typed binding interface for the `paperless` extension. */\nexport interface PaperlessExtension {\n documents: {\n uploadAndOcr(params: {\n buffer: Uint8Array | ArrayBuffer;\n filename: string;\n language?: string;\n }): Promise<UploadAndOcrResult>;\n };\n workspace: {\n init(): Promise<WorkspaceInitResponse>;\n };\n}\n\n/** Runtime stub — emits `UNIMPLEMENTED` until v2.5.68p-stack-sdk-pass2\n * wires the per-method HTTP dispatch + codegen-from-OpenAPI pipeline. */\nconst stub = (op: string): (() => Promise<never>) => {\n return (): Promise<never> =>\n Promise.reject(\n new Error(\n `paperless.${op} runtime not yet implemented in @k9o/extensions@0.3.0; ` +\n `factory + typed-binding contract scaffolded at v2.5.68p-stack-sdk-pass1; ` +\n `per-method HTTP dispatch lands at v2.5.68p-stack-sdk-pass2 (codegen-from-OpenAPI).`,\n ),\n );\n};\n\nexport const paperlessExtension: PaperlessExtension = {\n documents: {\n uploadAndOcr: stub(\"documents.uploadAndOcr\") as PaperlessExtension[\"documents\"][\"uploadAndOcr\"],\n },\n workspace: {\n init: stub(\"workspace.init\") as PaperlessExtension[\"workspace\"][\"init\"],\n },\n};\n"],"mappings":";AA6CA,IAAM,OAAO,CAAC,OAAuC;AACnD,SAAO,MACL,QAAQ;AAAA,IACN,IAAI;AAAA,MACF,aAAa,EAAE;AAAA,IAGjB;AAAA,EACF;AACJ;AAEO,IAAM,qBAAyC;AAAA,EACpD,WAAW;AAAA,IACT,cAAc,KAAK,wBAAwB;AAAA,EAC7C;AAAA,EACA,WAAW;AAAA,IACT,MAAM,KAAK,gBAAgB;AAAA,EAC7B;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/extensions/cairn.ts"],"sourcesContent":["/**\n * `cairn` extension typed binding — Cairn: vector store / knowledge-base\n * extension (Trailblazer class). Surface stripped\n * of SQL Studio ops (SQL is core platform; canonical home is the Console\n * query-studio surface).\n *\n * Surface scope at v2 launch (scaffold; per-method runtime implementation\n * lands in v2.5.68p-stack-sdk-pass2 when codegen-from-OpenAPI pipeline\n * arrives). Interface shape derived from PO functional-specification.md\n * + the `k9o.extension(name).from(collection)` reference.\n */\n\n/** Vector record shape for upsert. */\nexport type VectorRecord = {\n id: string;\n embedding: number[];\n metadata?: Record<string, unknown>;\n};\n\n/** Query-result shape from semantic search. */\nexport type QueryResult = {\n id: string;\n score: number;\n metadata: Record<string, unknown> | null;\n};\n\n/** Typed binding interface for the `cairn` extension. */\nexport interface CairnExtension {\n vectors: {\n upsert(params: { collection: string; records: VectorRecord[] }): Promise<{ upserted: number }>;\n query(params: {\n collection: string;\n embedding: number[];\n topK?: number;\n filter?: Record<string, unknown>;\n }): Promise<QueryResult[]>;\n delete(params: { collection: string; ids: string[] }): Promise<{ deleted: number }>;\n };\n collections: {\n create(params: { name: string; dimension: number; metric?: \"cosine\" | \"euclidean\" | \"dot\" }): Promise<{\n name: string;\n dimension: number;\n }>;\n list(): Promise<{ collections: { name: string; dimension: number; count: number }[] }>;\n };\n}\n\n/** Runtime stub — emits `UNIMPLEMENTED` until v2.5.68p-stack-sdk-pass2\n * wires the per-method HTTP dispatch + codegen-from-OpenAPI pipeline. */\nconst stub = (op: string): (() => Promise<never>) => {\n return (): Promise<never> =>\n Promise.reject(\n new Error(\n `cairn.${op} runtime not yet implemented in @k9o/extensions@0.3.0; ` +\n `factory + typed-binding contract scaffolded at v2.5.68p-stack-sdk-pass1; ` +\n `per-method HTTP dispatch lands at v2.5.68p-stack-sdk-pass2 (codegen-from-OpenAPI).`,\n ),\n );\n};\n\nexport const cairnExtension: CairnExtension = {\n vectors: {\n upsert: stub(\"vectors.upsert\") as CairnExtension[\"vectors\"][\"upsert\"],\n query: stub(\"vectors.query\") as CairnExtension[\"vectors\"][\"query\"],\n delete: stub(\"vectors.delete\") as CairnExtension[\"vectors\"][\"delete\"],\n },\n collections: {\n create: stub(\"collections.create\") as CairnExtension[\"collections\"][\"create\"],\n list: stub(\"collections.list\") as CairnExtension[\"collections\"][\"list\"],\n },\n};\n"],"mappings":";AAiDA,IAAM,OAAO,CAAC,OAAuC;AACnD,SAAO,MACL,QAAQ;AAAA,IACN,IAAI;AAAA,MACF,SAAS,EAAE;AAAA,IAGb;AAAA,EACF;AACJ;AAEO,IAAM,iBAAiC;AAAA,EAC5C,SAAS;AAAA,IACP,QAAQ,KAAK,gBAAgB;AAAA,IAC7B,OAAO,KAAK,eAAe;AAAA,IAC3B,QAAQ,KAAK,gBAAgB;AAAA,EAC/B;AAAA,EACA,aAAa;AAAA,IACX,QAAQ,KAAK,oBAAoB;AAAA,IACjC,MAAM,KAAK,kBAAkB;AAAA,EAC/B;AACF;","names":[]}
|