@crvouga/mockingbird-service-llamacloud 0.2.0 → 1.0.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/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # Changelog — @crvouga/mockingbird-service-llamacloud
2
2
 
3
- ## 0.2.0 (2026-09-24)
3
+ ## 1.0.0 (2026-09-24)
4
+
5
+ ### ⚠️ Breaking changes
6
+
7
+ - vendor branding for every service; purge internal mocks and consumer names ([f689534](https://github.com/crvouga/mockingbird/commit/f6895343543550dafcb7d76b426cae7635e03226))
8
+
9
+ ### Dependencies
10
+
11
+ - `@crvouga/mockingbird-service-sqlite`
12
+
13
+ ## 0.2.0 (2026-09-23)
4
14
 
5
15
  ### Features
6
16
 
package/README.md CHANGED
@@ -24,7 +24,7 @@ any Fetch server.
24
24
  ## Usage
25
25
 
26
26
  ```bash
27
- npx mockingbird-llamacloud serve --port 8805 --index geviti-member-kb-v1 --project Default
27
+ npx mockingbird-llamacloud serve --port 8805 --index acme-member-kb-v1 --project Default
28
28
  ```
29
29
 
30
30
  Point the app at it:
@@ -32,12 +32,12 @@ Point the app at it:
32
32
  | Consumer | Setting |
33
33
  | --- | --- |
34
34
  | Backend `LlamaCloudKnowledgeAdapter` | `LLAMACLOUD_BASE_URL=http://127.0.0.1:8805/api/v1` (seam **G-L1**: the adapter hardcodes `https://api.cloud.llamaindex.ai/api/v1` today), plus `LLAMACLOUD_API_KEY` (any value) and `LLAMACLOUD_INDEX_NAME` / `LLAMACLOUD_PROJECT_NAME` matching a seeded pipeline |
35
- | Makor chat (`llama_cloud_services`) | `LLAMA_CLOUD_BASE_URL=http://127.0.0.1:8805` (no `/api/v1`; verified below, no code change needed) |
35
+ | Python chat service (`llama_cloud_services`) | `LLAMA_CLOUD_BASE_URL=http://127.0.0.1:8805` (no `/api/v1`; verified below, no code change needed) |
36
36
 
37
37
  ```ts
38
38
  import { createRuntime } from "@crvouga/mockingbird-service-llamacloud"
39
39
 
40
- const llama = createRuntime({ pipelines: [{ name: "geviti-member-kb-v1", projectName: "Default" }] })
40
+ const llama = createRuntime({ pipelines: [{ name: "acme-member-kb-v1", projectName: "Default" }] })
41
41
  const admin = (path: string, body: unknown) =>
42
42
  llama.fetch(
43
43
  new Request(`http://llamacloud.test/__admin${path}`, {
@@ -89,12 +89,12 @@ Node metadata is sent under both `metadata` (read by our backend) and `extra_inf
89
89
  official client model's field name). Without live credentials, which of the two the real API
90
90
  sends is unverified.
91
91
 
92
- ### Makor chat SDK: verified call sequence
92
+ ### Python chat SDK: verified call sequence
93
93
 
94
94
  The catalog listed this as unverified. It has now been checked against the installed SDK:
95
95
  llama-cloud-services **0.6.88**, llama-cloud **0.1.45** and llama-index-core **0.14.10**, the
96
- versions pinned in `apps/makor-ecosystem/uv.lock`. The wheels were read, and
97
- `llamacloud.sdk.test.ts` runs the real Makor `LlamaCloudClient` file on the real SDK against the
96
+ versions the consumer app's Python chat service pins. The wheels were read, and
97
+ `llamacloud.sdk.test.ts` runs that service's real `LlamaCloudClient` file on the real SDK against the
98
98
  served mock. `LlamaCloudIndex(name, project_name=…, api_key=…)` followed by
99
99
  `.as_retriever(similarity_top_k=5).aretrieve(q)` makes these calls:
100
100
 
@@ -107,13 +107,13 @@ served mock. `LlamaCloudIndex(name, project_name=…, api_key=…)` followed by
107
107
  4. `POST /api/v1/pipelines/{id}/retrieve {query, dense_similarity_top_k: 5}`.
108
108
 
109
109
  The base URL comes from `base_url` or `LLAMA_CLOUD_BASE_URL`, falling back to
110
- `https://api.cloud.llamaindex.ai` (`llama_index.core.ingestion.api_utils.get_client`). Makor
111
- passes no `base_url`, so setting the environment variable is enough. The SDK's pydantic models
110
+ `https://api.cloud.llamaindex.ai` (`llama_index.core.ingestion.api_utils.get_client`). The
111
+ client passes no `base_url`, so setting the environment variable is enough. The SDK's pydantic models
112
112
  are strict: `Pipeline.status` must be `CREATED` or `DELETING`, and `embedding_config` is
113
113
  required. The mock satisfies both, and the SDK test fails if a shape drifts.
114
114
 
115
- **Discrepancy:** Makor's `llamacloud_project_name` defaults to `"default"` (lowercase). The
116
- backend's default is `"Default"`. Project lookup is exact, so Makor needs
115
+ **Discrepancy:** the Python client's `llamacloud_project_name` defaults to `"default"` (lowercase). The
116
+ backend's default is `"Default"`. Project lookup is exact, so it needs
117
117
  `LLAMACLOUD_PROJECT_NAME=Default`, or a seeded `default` project. Otherwise the client degrades
118
118
  to empty results, which the acceptance tests cover.
119
119
 
@@ -122,7 +122,8 @@ To run the SDK test:
122
122
  ```bash
123
123
  uv venv /tmp/llama && VIRTUAL_ENV=/tmp/llama uv pip install \
124
124
  llama-cloud-services==0.6.88 llama-cloud==0.1.45 llama-index-core==0.14.10
125
- MOCKINGBIRD_LLAMACLOUD_PYTHON=/tmp/llama/bin/python bun test llamacloud.sdk
125
+ MOCKINGBIRD_LLAMACLOUD_PYTHON=/tmp/llama/bin/python \
126
+ MOCKINGBIRD_LLAMACLOUD_PY_CLIENT=/path/to/llamacloud_client.py bun test llamacloud.sdk
126
127
  ```
127
128
 
128
129
  ### Admin (beyond the standard contract)
@@ -157,7 +158,7 @@ Neither consumer can add headers, so a namespace can be chosen three ways:
157
158
  - a `/ns/<name>` prefix on the base URL;
158
159
  - the API key: `PUT /__admin/credentials {"credentials": {"<LLAMACLOUD_API_KEY>": "<namespace>"}}`.
159
160
 
160
- Each namespace starts with the seeded pipelines, by default `geviti-member-kb-v1` in project
161
+ Each namespace starts with the seeded pipelines, by default `acme-member-kb-v1` in project
161
162
  `Default`. The request journal records operation ids, statuses and pipeline and document ids. It
162
163
  never records queries, document text or titles.
163
164
 
@@ -179,7 +180,7 @@ never records queries, document text or titles.
179
180
  | `createRuntime` | function | The mock with the full service contract (health, admin, namespaces, credentials, presets). Options: `pipelines`, `settings`, `clock`, `seed`, `adminKey`, `onLog`, `sqlite`. |
180
181
  | `LLAMACLOUD_PRESETS` | object | Every named fault preset. |
181
182
  | `LLAMACLOUD_NAMESPACE` | string | The service name, `"llamacloud"`. |
182
- | `DEFAULT_PIPELINES`, `DEFAULT_PIPELINE_NAME`, `DEFAULT_PROJECT_NAME`, `DEFAULT_SETTINGS` | values | The seed: `geviti-member-kb-v1` in `Default`, top-k 5, any key. |
183
+ | `DEFAULT_PIPELINES`, `DEFAULT_PIPELINE_NAME`, `DEFAULT_PROJECT_NAME`, `DEFAULT_SETTINGS` | values | The seed: `acme-member-kb-v1` in `Default`, top-k 5, any key. |
183
184
  | `rank`, `terms` | functions | The default term-overlap ranking and its tokenizer. |
184
185
  | `uuidFrom` | function | The stable UUID derivation used for project, pipeline and document ids. |
185
186
  | `document`, `operationIds`, `supportedOperationIds` | values | The vendored OpenAPI contract and its operation ids. |
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createRuntime
3
- } from "./chunk-UP32DVYJ.js";
3
+ } from "./chunk-6X3YC57G.js";
4
4
 
5
5
  // ../../adapters/node/dist/cli.js
6
6
  import { readFile } from "node:fs/promises";
@@ -318,7 +318,7 @@ var serveTarget = {
318
318
  index: {
319
319
  type: "string",
320
320
  value: "<name[,name\u2026]>",
321
- description: "Pipelines (indexes) to create in the Default project (the app's LLAMACLOUD_INDEX_NAME); default geviti-member-kb-v1"
321
+ description: "Pipelines (indexes) to create in the Default project (the app's LLAMACLOUD_INDEX_NAME); default acme-member-kb-v1"
322
322
  },
323
323
  project: {
324
324
  type: "string",
@@ -338,7 +338,7 @@ var serveTarget = {
338
338
  return createRuntime({
339
339
  ...index ? {
340
340
  pipelines: index.split(",").map((name) => name.trim()).filter(Boolean).map((name) => ({ name, ...project ? { projectName: project } : {} }))
341
- } : project ? { pipelines: [{ name: "geviti-member-kb-v1", projectName: project }] } : {},
341
+ } : project ? { pipelines: [{ name: "acme-member-kb-v1", projectName: project }] } : {},
342
342
  ...key ? { settings: { apiKeys: [key] } } : {},
343
343
  ...common.adminKey !== void 0 ? { adminKey: common.adminKey } : {},
344
344
  ...common.seed !== void 0 ? { seed: common.seed } : {},
@@ -347,7 +347,7 @@ var serveTarget = {
347
347
  },
348
348
  banner: () => [
349
349
  "auth: Authorization: Bearer <LLAMACLOUD_API_KEY>",
350
- "backend: LLAMACLOUD_BASE_URL=<this>/api/v1; Makor chat SDK: LLAMA_CLOUD_BASE_URL=<this>",
350
+ "backend: LLAMACLOUD_BASE_URL=<this>/api/v1; Python chat SDK: LLAMA_CLOUD_BASE_URL=<this>",
351
351
  "namespaces: x-mockingbird-namespace, /ns/<name>/\u2026, or PUT /__admin/credentials {<api key>: <ns>}"
352
352
  ]
353
353
  };
@@ -359,4 +359,4 @@ export {
359
359
  createServer2 as createServer,
360
360
  serveTarget
361
361
  };
362
- //# sourceMappingURL=chunk-J2WKZZ5I.js.map
362
+ //# sourceMappingURL=chunk-2JPUVXO4.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../adapters/node/src/cli.ts", "../../../adapters/node/src/serve.ts", "../../../adapters/node/src/listen.ts", "../src/server.ts"],
4
- "sourcesContent": ["import { readFile } from \"node:fs/promises\"\nimport { type ParseArgsConfig, parseArgs } from \"node:util\"\nimport type { RequestLog, ServiceInstance, ServiceRuntime } from \"@crvouga/mockingbird-service\"\nimport { type Listening, listen } from \"./listen.js\"\n\nexport type CliOption = {\n type: \"string\" | \"boolean\"\n description: string\n /** Shown in help; the value placeholder, e.g. `<port>`. */\n value?: string\n default?: string | boolean\n}\n\nexport type CliValues = Record<string, string | boolean | undefined>\n\nexport type CliCommand = {\n summary: string\n usage?: string\n options?: Record<string, CliOption>\n /** Resolves to an exit code; a server command resolves only when it stops. */\n run(values: CliValues, positionals: string[]): Promise<number>\n}\n\nexport type CliSpec = {\n bin: string\n description: string\n commands: Record<string, CliCommand>\n}\n\nconst optionHelp = (options: Record<string, CliOption>): string[] =>\n Object.entries(options).map(([name, option]) => {\n const flag = `--${name}${option.type === \"string\" ? ` ${option.value ?? \"<value>\"}` : \"\"}`\n const fallback = option.default !== undefined ? ` (default: ${String(option.default)})` : \"\"\n return ` ${flag.padEnd(30)} ${option.description}${fallback}`\n })\n\nconst help = (spec: CliSpec): string =>\n [\n `${spec.bin} \u2014 ${spec.description}`,\n \"\",\n \"Usage:\",\n ` ${spec.bin} <command> [options]`,\n \"\",\n \"Commands:\",\n ...Object.entries(spec.commands).map(([name, c]) => ` ${name.padEnd(30)} ${c.summary}`),\n \"\",\n `Run \\`${spec.bin} <command> --help\\` for a command's options.`,\n ].join(\"\\n\")\n\nconst commandHelp = (spec: CliSpec, name: string, command: CliCommand): string =>\n [\n `${spec.bin} ${name} \u2014 ${command.summary}`,\n \"\",\n \"Usage:\",\n ` ${command.usage ?? `${spec.bin} ${name} [options]`}`,\n ...(command.options ? [\"\", \"Options:\", ...optionHelp(command.options)] : []),\n ].join(\"\\n\")\n\n/** Parse `argv` against `spec` and run the chosen command. Resolves to an exit code. */\nexport const runCli = async (spec: CliSpec, argv: string[]): Promise<number> => {\n // Two-word commands (`corpus pull`) win over one-word ones.\n const pair = argv.length >= 2 ? `${argv[0]} ${argv[1]}` : undefined\n const words = pair !== undefined && spec.commands[pair] ? 2 : 1\n const name = words === 2 ? pair : argv[0]\n const rest = argv.slice(words)\n if (name === undefined || name === \"--help\" || name === \"-h\" || name === \"help\") {\n console.log(help(spec))\n return 0\n }\n const command = spec.commands[name]\n if (!command) {\n console.error(`${spec.bin}: unknown command ${JSON.stringify(name)}\\n\\n${help(spec)}`)\n return 2\n }\n if (rest.includes(\"--help\") || rest.includes(\"-h\")) {\n console.log(commandHelp(spec, name, command))\n return 0\n }\n let parsed: { values: CliValues; positionals: string[] }\n try {\n parsed = parseArgs({\n args: rest,\n allowPositionals: true,\n strict: true,\n options: Object.fromEntries(\n Object.entries(command.options ?? {}).map(([key, option]) => [\n key,\n {\n type: option.type,\n ...(option.default !== undefined ? { default: option.default } : {}),\n },\n ]),\n ) as ParseArgsConfig[\"options\"],\n }) as { values: CliValues; positionals: string[] }\n } catch (error) {\n console.error(\n `${spec.bin} ${name}: ${error instanceof Error ? error.message : String(error)}\\n\\n${commandHelp(spec, name, command)}`,\n )\n return 2\n }\n return command.run(parsed.values, parsed.positionals)\n}\n\n// \u2500\u2500 serve \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport type LogFormat = \"pretty\" | \"json\" | \"off\"\n\nexport type CommonServeOptions = {\n adminKey: string | undefined\n seed: string | undefined\n onLog: ((entry: RequestLog) => void) | undefined\n}\n\n/**\n * What a service contributes to `serve`: how to build its runtime from CLI flags,\n * and what to say at startup. Every service's `./server` entry exports one as\n * `serveTarget`, which is also how `serve --config` finds services by name.\n */\nexport type ServeTarget = {\n name: string\n defaultPort: number\n /** Serve flags beyond the common ones. */\n options?: Record<string, CliOption>\n create(\n values: CliValues,\n common: CommonServeOptions,\n ): Promise<ServiceRuntime<ServiceInstance>> | ServiceRuntime<ServiceInstance>\n /** Startup lines after the listen address, e.g. the loaded corpus version. */\n banner?(runtime: ServiceRuntime<ServiceInstance>): string[]\n}\n\nconst COMMON_SERVE_OPTIONS: Record<string, CliOption> = {\n port: { type: \"string\", value: \"<port>\", description: \"Port to listen on\" },\n host: { type: \"string\", value: \"<host>\", description: \"Interface to bind\", default: \"127.0.0.1\" },\n \"admin-key\": {\n type: \"string\",\n value: \"<key>\",\n description: \"Require x-mockingbird-admin-key on /__admin/* (env MOCKINGBIRD_ADMIN_KEY)\",\n },\n seed: { type: \"string\", value: \"<seed>\", description: \"Seed for every random choice\" },\n log: {\n type: \"string\",\n value: \"<pretty|json|off>\",\n description: \"Request log format\",\n default: \"pretty\",\n },\n \"log-requests\": {\n type: \"boolean\",\n description:\n \"One JSON line per request: namespace, operationId, status, ids touched (never bodies). Same as --log json\",\n },\n config: {\n type: \"string\",\n value: \"<file>\",\n description: \"Serve every service in a mockingbird.json config instead\",\n },\n}\n\nconst formatLog = (format: LogFormat) => {\n if (format === \"off\") return undefined\n if (format === \"json\") return (entry: RequestLog) => console.log(JSON.stringify(entry))\n return (entry: RequestLog) => {\n const op = entry.operationId ?? (entry.unmatched ? \"UNMATCHED\" : \"-\")\n const ns = entry.namespace === \"default\" ? \"\" : ` [${entry.namespace}]`\n const fault = entry.faultId ? ` fault=${entry.faultId}` : \"\"\n const adopted = entry.adopted ? \" adopted\" : \"\"\n console.log(\n `${entry.service} ${entry.method} ${entry.path} ${entry.status} ${op} ${entry.durationMs}ms${ns}${fault}${adopted}`,\n )\n }\n}\n\nconst asString = (value: string | boolean | undefined): string | undefined =>\n typeof value === \"string\" ? value : undefined\n\n/** A service entry in `mockingbird.json`. */\nexport type ConfigService = {\n port?: number\n host?: string\n adminKey?: string\n seed?: string\n /** Service-specific serve flags, by long name: `{ \"webhook-url\": \"\u2026\" }`. */\n options?: Record<string, string | boolean>\n}\n\nexport type MockingbirdConfig = {\n /** Keyed by service name: `junction` loads `@crvouga/mockingbird-service-junction`. */\n services: Record<string, ConfigService>\n log?: LogFormat\n}\n\nconst loadTarget = async (name: string, own: ServeTarget): Promise<ServeTarget> => {\n if (name === own.name) return own\n const specifier = `@crvouga/mockingbird-service-${name}/server`\n try {\n const mod = (await import(specifier)) as { serveTarget?: ServeTarget }\n if (!mod.serveTarget) throw new Error(`${specifier} exports no serveTarget`)\n return mod.serveTarget\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error)\n throw new Error(\n `cannot load service \"${name}\": ${reason}. Install @crvouga/mockingbird-service-${name}.`,\n )\n }\n}\n\nconst start = async (\n target: ServeTarget,\n values: CliValues,\n config: { port: number; host: string; adminKey?: string; seed?: string; log: LogFormat },\n): Promise<Listening> => {\n const runtime = await target.create(values, {\n adminKey: config.adminKey,\n seed: config.seed,\n onLog: formatLog(config.log),\n })\n const listening = await listen(runtime, { port: config.port, host: config.host })\n console.log(`${target.name} mock listening on ${listening.url}`)\n console.log(`${target.name} health: GET ${listening.url}/health`)\n console.log(\n `${target.name} admin: ${listening.url}/__admin (${config.adminKey ? \"x-mockingbird-admin-key required\" : \"open \u2014 pass --admin-key to lock\"})`,\n )\n for (const line of target.banner?.(runtime) ?? []) console.log(`${target.name} ${line}`)\n return listening\n}\n\nconst untilSignal = async (servers: Listening[]): Promise<number> =>\n new Promise((resolve) => {\n const stop = async () => {\n await Promise.allSettled(servers.map((s) => s.close()))\n resolve(0)\n }\n process.once(\"SIGINT\", stop)\n process.once(\"SIGTERM\", stop)\n })\n\n/** The standard `serve` command for a service, including multi-service `--config`. */\nexport const serveCommand = (target: ServeTarget): CliCommand => ({\n summary: `Serve the ${target.name} mock over HTTP`,\n options: { ...COMMON_SERVE_OPTIONS, ...target.options },\n async run(values) {\n const log = (\n values[\"log-requests\"] === true ? \"json\" : (asString(values.log) ?? \"pretty\")\n ) as LogFormat\n if (![\"pretty\", \"json\", \"off\"].includes(log)) {\n console.error(`--log must be pretty, json or off (got ${log})`)\n return 2\n }\n const configPath = asString(values.config)\n if (configPath !== undefined) {\n const config = JSON.parse(await readFile(configPath, \"utf8\")) as MockingbirdConfig\n const servers: Listening[] = []\n try {\n for (const [name, entry] of Object.entries(config.services ?? {})) {\n const each = await loadTarget(name, target)\n servers.push(\n await start(each, entry.options ?? {}, {\n port: entry.port ?? each.defaultPort,\n host: entry.host ?? \"127.0.0.1\",\n ...(entry.adminKey !== undefined ? { adminKey: entry.adminKey } : {}),\n ...(entry.seed !== undefined ? { seed: entry.seed } : {}),\n log: config.log ?? log,\n }),\n )\n }\n } catch (error) {\n await Promise.allSettled(servers.map((s) => s.close()))\n console.error(error instanceof Error ? error.message : String(error))\n return 1\n }\n return untilSignal(servers)\n }\n const port = asString(values.port)\n const adminKey = asString(values[\"admin-key\"]) ?? process.env.MOCKINGBIRD_ADMIN_KEY\n const seed = asString(values.seed)\n let listening: Listening\n try {\n listening = await start(target, values, {\n port: port === undefined ? target.defaultPort : Number.parseInt(port, 10),\n host: asString(values.host) ?? \"127.0.0.1\",\n ...(adminKey !== undefined ? { adminKey } : {}),\n ...(seed !== undefined ? { seed } : {}),\n log,\n })\n } catch (error) {\n console.error(error instanceof Error ? error.message : String(error))\n return 1\n }\n return untilSignal([listening])\n },\n})\n", "import { createServer } from \"node:http\"\nimport type { FetchAPI } from \"@crvouga/mockingbird-core\"\n\n/** Options for {@link serve}. */\nexport type NodeServeOptions = {\n port?: number\n host?: string\n}\n\n/**\n * Serve any Mockingbird {@link FetchAPI} over `node:http`.\n * Port defaults to `0`, so the OS assigns an ephemeral port (read from `server.address()`).\n */\nexport const serve = async (api: FetchAPI, options: NodeServeOptions = {}) => {\n const server = createServer(async (req, res) => {\n const chunks: Buffer[] = []\n for await (const chunk of req) {\n chunks.push(Buffer.from(chunk))\n }\n const body = Buffer.concat(chunks)\n const address = server.address()\n const port = typeof address === \"object\" && address !== null ? address.port : undefined\n const base = `http://${req.headers.host ?? `localhost:${port ?? 80}`}`\n const raw = req.url ?? \"/\"\n const url = new URL(raw.replace(/^\\/+/, \"/\"), base)\n const method = req.method ?? \"GET\"\n const init: RequestInit = { method, headers: req.headers as Record<string, string> }\n if (method !== \"GET\" && method !== \"HEAD\" && body.length > 0) {\n init.body = body\n }\n const aborted = new AbortController()\n res.once(\"close\", () => {\n if (!res.writableFinished) aborted.abort()\n })\n init.signal = aborted.signal\n const request = new Request(url, init)\n let response: Response\n try {\n response = await api.fetch(request)\n } catch (error) {\n // A `drop` fault: destroy the socket so the client sees the connection die.\n if ((error as { code?: string }).code === \"MOCKINGBIRD_DROP\") {\n req.socket.destroy()\n return\n }\n res.writeHead(500, { \"content-type\": \"application/json\" })\n res.end(\n JSON.stringify({\n error: {\n type: \"mockingbird_internal\",\n message: error instanceof Error ? error.message : String(error),\n },\n }),\n )\n return\n }\n // Headers#entries() joins repeated headers; Set-Cookie must stay one header per cookie.\n const headers: Record<string, string | string[]> = Object.fromEntries(response.headers)\n const cookies = response.headers.getSetCookie()\n if (cookies.length > 0) headers[\"set-cookie\"] = cookies\n if (!response.body) {\n res.writeHead(response.status, headers)\n res.end()\n return\n }\n // Stream the body chunk by chunk: event streams and long-polls must not be buffered.\n res.writeHead(response.status, headers)\n res.flushHeaders()\n const reader = response.body.getReader()\n try {\n for (;;) {\n const { done, value } = await reader.read()\n if (done) break\n if (!res.write(value)) await new Promise<void>((resolve) => res.once(\"drain\", resolve))\n }\n res.end()\n } catch {\n res.destroy()\n } finally {\n reader.releaseLock()\n }\n })\n await new Promise<void>((resolve, reject) => {\n server.once(\"error\", reject)\n server.listen(options.port ?? 0, options.host, resolve)\n })\n return server\n}\n", "import type { Server } from \"node:http\"\nimport type { FetchAPI } from \"@crvouga/mockingbird-core\"\nimport { serve } from \"./serve.js\"\n\nexport type ListenOptions = {\n /** Default `0`: the OS picks a free port. */\n port?: number\n /** Default `127.0.0.1`: a mock should not be reachable off the machine by accident. */\n host?: string\n}\n\n/** A running server, with the address it actually bound. */\nexport type Listening = {\n url: string\n port: number\n host: string\n server: Server\n close(): Promise<void>\n}\n\nexport const listen = async (api: FetchAPI, options: ListenOptions = {}): Promise<Listening> => {\n const host = options.host ?? \"127.0.0.1\"\n const server = await serve(api, { port: options.port ?? 0, host })\n const address = server.address()\n const port = typeof address === \"object\" && address !== null ? address.port : (options.port ?? 0)\n const shown = host.includes(\":\") ? `[${host}]` : host\n return {\n url: `http://${shown}:${port}`,\n port,\n host,\n server,\n close: () =>\n new Promise<void>((resolve, reject) => {\n // Stop accepting first, then drop keep-alive sockets so close() can finish.\n server.close((error) => {\n if (error && (error as { code?: string }).code !== \"ERR_SERVER_NOT_RUNNING\") reject(error)\n else resolve()\n })\n server.closeAllConnections?.()\n }),\n }\n}\n", "/// <reference types=\"node\" />\nimport { type Listening, listen, type ServeTarget } from \"@crvouga/mockingbird-adapter-node\"\nimport { createRuntime, type LlamaCloudRuntime, type LlamaCloudRuntimeOptions } from \"./runtime.js\"\n\n/** Port `mockingbird-llamacloud serve` listens on when none is given. */\nexport const DEFAULT_PORT = 8805\n\nexport type LlamaCloudServerOptions = LlamaCloudRuntimeOptions & {\n /** Default `0`: the OS picks a free port. */\n port?: number\n /** Default `127.0.0.1`. */\n host?: string\n}\n\nexport type LlamaCloudServer = Listening & { runtime: LlamaCloudRuntime }\n\n/** Serve the LlamaCloud mock over `node:http`. */\nexport const createServer = async (\n options: LlamaCloudServerOptions = {},\n): Promise<LlamaCloudServer> => {\n const { port, host, ...rest } = options\n const runtime = createRuntime(rest)\n const listening = await listen(runtime, {\n port: port ?? 0,\n ...(host !== undefined ? { host } : {}),\n })\n return { ...listening, runtime }\n}\n\nconst text = (value: string | boolean | undefined) =>\n typeof value === \"string\" ? value : undefined\n\n/** How `serve` (and `serve --config`) builds the LlamaCloud mock from flags. */\nexport const serveTarget: ServeTarget = {\n name: \"llamacloud\",\n defaultPort: DEFAULT_PORT,\n options: {\n index: {\n type: \"string\",\n value: \"<name[,name\u2026]>\",\n description:\n \"Pipelines (indexes) to create in the Default project (the app's LLAMACLOUD_INDEX_NAME); default geviti-member-kb-v1\",\n },\n project: {\n type: \"string\",\n value: \"<name>\",\n description:\n \"Project those pipelines live in (the app's LLAMACLOUD_PROJECT_NAME); default Default\",\n },\n \"api-key\": {\n type: \"string\",\n value: \"<key>\",\n description: \"Accept only this bearer key (default: any non-empty key)\",\n },\n },\n create: (values, common) => {\n const index = text(values.index)\n const project = text(values.project)\n const key = text(values[\"api-key\"])\n return createRuntime({\n ...(index\n ? {\n pipelines: index\n .split(\",\")\n .map((name) => name.trim())\n .filter(Boolean)\n .map((name) => ({ name, ...(project ? { projectName: project } : {}) })),\n }\n : project\n ? { pipelines: [{ name: \"geviti-member-kb-v1\", projectName: project }] }\n : {}),\n ...(key ? { settings: { apiKeys: [key] } } : {}),\n ...(common.adminKey !== undefined ? { adminKey: common.adminKey } : {}),\n ...(common.seed !== undefined ? { seed: common.seed } : {}),\n ...(common.onLog ? { onLog: common.onLog } : {}),\n })\n },\n banner: () => [\n \"auth: Authorization: Bearer <LLAMACLOUD_API_KEY>\",\n \"backend: LLAMACLOUD_BASE_URL=<this>/api/v1; Makor chat SDK: LLAMA_CLOUD_BASE_URL=<this>\",\n \"namespaces: x-mockingbird-namespace, /ns/<name>/\u2026, or PUT /__admin/credentials {<api key>: <ns>}\",\n ],\n}\n"],
5
- "mappings": ";;;;;AAAA,SAAS,gBAAgB;AACzB,SAA+B,iBAAiB;;;ACDhD,SAAS,oBAAoB;AAatB,IAAM,QAAQ,OAAO,KAAe,UAA4B,CAAA,MAAM;AAC3E,QAAM,SAAS,aAAa,OAAO,KAAK,QAAO;AAC7C,UAAM,SAAmB,CAAA;AACzB,qBAAiB,SAAS,KAAK;AAC7B,aAAO,KAAK,OAAO,KAAK,KAAK,CAAC;IAChC;AACA,UAAM,OAAO,OAAO,OAAO,MAAM;AACjC,UAAM,UAAU,OAAO,QAAO;AAC9B,UAAM,OAAO,OAAO,YAAY,YAAY,YAAY,OAAO,QAAQ,OAAO;AAC9E,UAAM,OAAO,UAAU,IAAI,QAAQ,QAAQ,aAAa,QAAQ,EAAE,EAAE;AACpE,UAAM,MAAM,IAAI,OAAO;AACvB,UAAM,MAAM,IAAI,IAAI,IAAI,QAAQ,QAAQ,GAAG,GAAG,IAAI;AAClD,UAAM,SAAS,IAAI,UAAU;AAC7B,UAAM,OAAoB,EAAE,QAAQ,SAAS,IAAI,QAAiC;AAClF,QAAI,WAAW,SAAS,WAAW,UAAU,KAAK,SAAS,GAAG;AAC5D,WAAK,OAAO;IACd;AACA,UAAM,UAAU,IAAI,gBAAe;AACnC,QAAI,KAAK,SAAS,MAAK;AACrB,UAAI,CAAC,IAAI;AAAkB,gBAAQ,MAAK;IAC1C,CAAC;AACD,SAAK,SAAS,QAAQ;AACtB,UAAM,UAAU,IAAI,QAAQ,KAAK,IAAI;AACrC,QAAI;AACJ,QAAI;A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ACT,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,EACzB,OAAO,OAAO,EACd,IAAI,CAAC,UAAU,EAAE,MAAM,GAAI,UAAU,EAAE,aAAa,QAAQ,IAAI,CAAC,EAAG,EAAE;AAAA,MAC3E,IACA,UACE,EAAE,WAAW,CAAC,EAAE,MAAM,uBAAuB,aAAa,QAAQ,CAAC,EAAE,IACrE,CAAC;AAAA,MACP,GAAI,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC;AAAA,MAC9C,GAAI,OAAO,aAAa,SAAY,EAAE,UAAU,OAAO,SAAS,IAAI,CAAC;AAAA,MACrE,GAAI,OAAO,SAAS,SAAY,EAAE,MAAM,OAAO,KAAK,IAAI,CAAC;AAAA,MACzD,GAAI,OAAO,QAAQ,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AAAA,IAChD,CAAC;AAAA,EACH;AAAA,EACA,QAAQ,MAAM;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { readFile } from \"node:fs/promises\"\nimport { type ParseArgsConfig, parseArgs } from \"node:util\"\nimport type { RequestLog, ServiceInstance, ServiceRuntime } from \"@crvouga/mockingbird-service\"\nimport { type Listening, listen } from \"./listen.js\"\n\nexport type CliOption = {\n type: \"string\" | \"boolean\"\n description: string\n /** Shown in help; the value placeholder, e.g. `<port>`. */\n value?: string\n default?: string | boolean\n}\n\nexport type CliValues = Record<string, string | boolean | undefined>\n\nexport type CliCommand = {\n summary: string\n usage?: string\n options?: Record<string, CliOption>\n /** Resolves to an exit code; a server command resolves only when it stops. */\n run(values: CliValues, positionals: string[]): Promise<number>\n}\n\nexport type CliSpec = {\n bin: string\n description: string\n commands: Record<string, CliCommand>\n}\n\nconst optionHelp = (options: Record<string, CliOption>): string[] =>\n Object.entries(options).map(([name, option]) => {\n const flag = `--${name}${option.type === \"string\" ? ` ${option.value ?? \"<value>\"}` : \"\"}`\n const fallback = option.default !== undefined ? ` (default: ${String(option.default)})` : \"\"\n return ` ${flag.padEnd(30)} ${option.description}${fallback}`\n })\n\nconst help = (spec: CliSpec): string =>\n [\n `${spec.bin} \u2014 ${spec.description}`,\n \"\",\n \"Usage:\",\n ` ${spec.bin} <command> [options]`,\n \"\",\n \"Commands:\",\n ...Object.entries(spec.commands).map(([name, c]) => ` ${name.padEnd(30)} ${c.summary}`),\n \"\",\n `Run \\`${spec.bin} <command> --help\\` for a command's options.`,\n ].join(\"\\n\")\n\nconst commandHelp = (spec: CliSpec, name: string, command: CliCommand): string =>\n [\n `${spec.bin} ${name} \u2014 ${command.summary}`,\n \"\",\n \"Usage:\",\n ` ${command.usage ?? `${spec.bin} ${name} [options]`}`,\n ...(command.options ? [\"\", \"Options:\", ...optionHelp(command.options)] : []),\n ].join(\"\\n\")\n\n/** Parse `argv` against `spec` and run the chosen command. Resolves to an exit code. */\nexport const runCli = async (spec: CliSpec, argv: string[]): Promise<number> => {\n // Two-word commands (`corpus pull`) win over one-word ones.\n const pair = argv.length >= 2 ? `${argv[0]} ${argv[1]}` : undefined\n const words = pair !== undefined && spec.commands[pair] ? 2 : 1\n const name = words === 2 ? pair : argv[0]\n const rest = argv.slice(words)\n if (name === undefined || name === \"--help\" || name === \"-h\" || name === \"help\") {\n console.log(help(spec))\n return 0\n }\n const command = spec.commands[name]\n if (!command) {\n console.error(`${spec.bin}: unknown command ${JSON.stringify(name)}\\n\\n${help(spec)}`)\n return 2\n }\n if (rest.includes(\"--help\") || rest.includes(\"-h\")) {\n console.log(commandHelp(spec, name, command))\n return 0\n }\n let parsed: { values: CliValues; positionals: string[] }\n try {\n parsed = parseArgs({\n args: rest,\n allowPositionals: true,\n strict: true,\n options: Object.fromEntries(\n Object.entries(command.options ?? {}).map(([key, option]) => [\n key,\n {\n type: option.type,\n ...(option.default !== undefined ? { default: option.default } : {}),\n },\n ]),\n ) as ParseArgsConfig[\"options\"],\n }) as { values: CliValues; positionals: string[] }\n } catch (error) {\n console.error(\n `${spec.bin} ${name}: ${error instanceof Error ? error.message : String(error)}\\n\\n${commandHelp(spec, name, command)}`,\n )\n return 2\n }\n return command.run(parsed.values, parsed.positionals)\n}\n\n// \u2500\u2500 serve \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport type LogFormat = \"pretty\" | \"json\" | \"off\"\n\nexport type CommonServeOptions = {\n adminKey: string | undefined\n seed: string | undefined\n onLog: ((entry: RequestLog) => void) | undefined\n}\n\n/**\n * What a service contributes to `serve`: how to build its runtime from CLI flags,\n * and what to say at startup. Every service's `./server` entry exports one as\n * `serveTarget`, which is also how `serve --config` finds services by name.\n */\nexport type ServeTarget = {\n name: string\n defaultPort: number\n /** Serve flags beyond the common ones. */\n options?: Record<string, CliOption>\n create(\n values: CliValues,\n common: CommonServeOptions,\n ): Promise<ServiceRuntime<ServiceInstance>> | ServiceRuntime<ServiceInstance>\n /** Startup lines after the listen address, e.g. the loaded corpus version. */\n banner?(runtime: ServiceRuntime<ServiceInstance>): string[]\n}\n\nconst COMMON_SERVE_OPTIONS: Record<string, CliOption> = {\n port: { type: \"string\", value: \"<port>\", description: \"Port to listen on\" },\n host: { type: \"string\", value: \"<host>\", description: \"Interface to bind\", default: \"127.0.0.1\" },\n \"admin-key\": {\n type: \"string\",\n value: \"<key>\",\n description: \"Require x-mockingbird-admin-key on /__admin/* (env MOCKINGBIRD_ADMIN_KEY)\",\n },\n seed: { type: \"string\", value: \"<seed>\", description: \"Seed for every random choice\" },\n log: {\n type: \"string\",\n value: \"<pretty|json|off>\",\n description: \"Request log format\",\n default: \"pretty\",\n },\n \"log-requests\": {\n type: \"boolean\",\n description:\n \"One JSON line per request: namespace, operationId, status, ids touched (never bodies). Same as --log json\",\n },\n config: {\n type: \"string\",\n value: \"<file>\",\n description: \"Serve every service in a mockingbird.json config instead\",\n },\n}\n\nconst formatLog = (format: LogFormat) => {\n if (format === \"off\") return undefined\n if (format === \"json\") return (entry: RequestLog) => console.log(JSON.stringify(entry))\n return (entry: RequestLog) => {\n const op = entry.operationId ?? (entry.unmatched ? \"UNMATCHED\" : \"-\")\n const ns = entry.namespace === \"default\" ? \"\" : ` [${entry.namespace}]`\n const fault = entry.faultId ? ` fault=${entry.faultId}` : \"\"\n const adopted = entry.adopted ? \" adopted\" : \"\"\n console.log(\n `${entry.service} ${entry.method} ${entry.path} ${entry.status} ${op} ${entry.durationMs}ms${ns}${fault}${adopted}`,\n )\n }\n}\n\nconst asString = (value: string | boolean | undefined): string | undefined =>\n typeof value === \"string\" ? value : undefined\n\n/** A service entry in `mockingbird.json`. */\nexport type ConfigService = {\n port?: number\n host?: string\n adminKey?: string\n seed?: string\n /** Service-specific serve flags, by long name: `{ \"webhook-url\": \"\u2026\" }`. */\n options?: Record<string, string | boolean>\n}\n\nexport type MockingbirdConfig = {\n /** Keyed by service name: `junction` loads `@crvouga/mockingbird-service-junction`. */\n services: Record<string, ConfigService>\n log?: LogFormat\n}\n\nconst loadTarget = async (name: string, own: ServeTarget): Promise<ServeTarget> => {\n if (name === own.name) return own\n const specifier = `@crvouga/mockingbird-service-${name}/server`\n try {\n const mod = (await import(specifier)) as { serveTarget?: ServeTarget }\n if (!mod.serveTarget) throw new Error(`${specifier} exports no serveTarget`)\n return mod.serveTarget\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error)\n throw new Error(\n `cannot load service \"${name}\": ${reason}. Install @crvouga/mockingbird-service-${name}.`,\n )\n }\n}\n\nconst start = async (\n target: ServeTarget,\n values: CliValues,\n config: { port: number; host: string; adminKey?: string; seed?: string; log: LogFormat },\n): Promise<Listening> => {\n const runtime = await target.create(values, {\n adminKey: config.adminKey,\n seed: config.seed,\n onLog: formatLog(config.log),\n })\n const listening = await listen(runtime, { port: config.port, host: config.host })\n console.log(`${target.name} mock listening on ${listening.url}`)\n console.log(`${target.name} health: GET ${listening.url}/health`)\n console.log(\n `${target.name} admin: ${listening.url}/__admin (${config.adminKey ? \"x-mockingbird-admin-key required\" : \"open \u2014 pass --admin-key to lock\"})`,\n )\n for (const line of target.banner?.(runtime) ?? []) console.log(`${target.name} ${line}`)\n return listening\n}\n\nconst untilSignal = async (servers: Listening[]): Promise<number> =>\n new Promise((resolve) => {\n const stop = async () => {\n await Promise.allSettled(servers.map((s) => s.close()))\n resolve(0)\n }\n process.once(\"SIGINT\", stop)\n process.once(\"SIGTERM\", stop)\n })\n\n/** The standard `serve` command for a service, including multi-service `--config`. */\nexport const serveCommand = (target: ServeTarget): CliCommand => ({\n summary: `Serve the ${target.name} mock over HTTP`,\n options: { ...COMMON_SERVE_OPTIONS, ...target.options },\n async run(values) {\n const log = (\n values[\"log-requests\"] === true ? \"json\" : (asString(values.log) ?? \"pretty\")\n ) as LogFormat\n if (![\"pretty\", \"json\", \"off\"].includes(log)) {\n console.error(`--log must be pretty, json or off (got ${log})`)\n return 2\n }\n const configPath = asString(values.config)\n if (configPath !== undefined) {\n const config = JSON.parse(await readFile(configPath, \"utf8\")) as MockingbirdConfig\n const servers: Listening[] = []\n try {\n for (const [name, entry] of Object.entries(config.services ?? {})) {\n const each = await loadTarget(name, target)\n servers.push(\n await start(each, entry.options ?? {}, {\n port: entry.port ?? each.defaultPort,\n host: entry.host ?? \"127.0.0.1\",\n ...(entry.adminKey !== undefined ? { adminKey: entry.adminKey } : {}),\n ...(entry.seed !== undefined ? { seed: entry.seed } : {}),\n log: config.log ?? log,\n }),\n )\n }\n } catch (error) {\n await Promise.allSettled(servers.map((s) => s.close()))\n console.error(error instanceof Error ? error.message : String(error))\n return 1\n }\n return untilSignal(servers)\n }\n const port = asString(values.port)\n const adminKey = asString(values[\"admin-key\"]) ?? process.env.MOCKINGBIRD_ADMIN_KEY\n const seed = asString(values.seed)\n let listening: Listening\n try {\n listening = await start(target, values, {\n port: port === undefined ? target.defaultPort : Number.parseInt(port, 10),\n host: asString(values.host) ?? \"127.0.0.1\",\n ...(adminKey !== undefined ? { adminKey } : {}),\n ...(seed !== undefined ? { seed } : {}),\n log,\n })\n } catch (error) {\n console.error(error instanceof Error ? error.message : String(error))\n return 1\n }\n return untilSignal([listening])\n },\n})\n", "import { createServer } from \"node:http\"\nimport type { FetchAPI } from \"@crvouga/mockingbird-core\"\n\n/** Options for {@link serve}. */\nexport type NodeServeOptions = {\n port?: number\n host?: string\n}\n\n/**\n * Serve any Mockingbird {@link FetchAPI} over `node:http`.\n * Port defaults to `0`, so the OS assigns an ephemeral port (read from `server.address()`).\n */\nexport const serve = async (api: FetchAPI, options: NodeServeOptions = {}) => {\n const server = createServer(async (req, res) => {\n const chunks: Buffer[] = []\n for await (const chunk of req) {\n chunks.push(Buffer.from(chunk))\n }\n const body = Buffer.concat(chunks)\n const address = server.address()\n const port = typeof address === \"object\" && address !== null ? address.port : undefined\n const base = `http://${req.headers.host ?? `localhost:${port ?? 80}`}`\n const raw = req.url ?? \"/\"\n const url = new URL(raw.replace(/^\\/+/, \"/\"), base)\n const method = req.method ?? \"GET\"\n const init: RequestInit = { method, headers: req.headers as Record<string, string> }\n if (method !== \"GET\" && method !== \"HEAD\" && body.length > 0) {\n init.body = body\n }\n const aborted = new AbortController()\n res.once(\"close\", () => {\n if (!res.writableFinished) aborted.abort()\n })\n init.signal = aborted.signal\n const request = new Request(url, init)\n let response: Response\n try {\n response = await api.fetch(request)\n } catch (error) {\n // A `drop` fault: destroy the socket so the client sees the connection die.\n if ((error as { code?: string }).code === \"MOCKINGBIRD_DROP\") {\n req.socket.destroy()\n return\n }\n res.writeHead(500, { \"content-type\": \"application/json\" })\n res.end(\n JSON.stringify({\n error: {\n type: \"mockingbird_internal\",\n message: error instanceof Error ? error.message : String(error),\n },\n }),\n )\n return\n }\n // Headers#entries() joins repeated headers; Set-Cookie must stay one header per cookie.\n const headers: Record<string, string | string[]> = Object.fromEntries(response.headers)\n const cookies = response.headers.getSetCookie()\n if (cookies.length > 0) headers[\"set-cookie\"] = cookies\n if (!response.body) {\n res.writeHead(response.status, headers)\n res.end()\n return\n }\n // Stream the body chunk by chunk: event streams and long-polls must not be buffered.\n res.writeHead(response.status, headers)\n res.flushHeaders()\n const reader = response.body.getReader()\n try {\n for (;;) {\n const { done, value } = await reader.read()\n if (done) break\n if (!res.write(value)) await new Promise<void>((resolve) => res.once(\"drain\", resolve))\n }\n res.end()\n } catch {\n res.destroy()\n } finally {\n reader.releaseLock()\n }\n })\n await new Promise<void>((resolve, reject) => {\n server.once(\"error\", reject)\n server.listen(options.port ?? 0, options.host, resolve)\n })\n return server\n}\n", "import type { Server } from \"node:http\"\nimport type { FetchAPI } from \"@crvouga/mockingbird-core\"\nimport { serve } from \"./serve.js\"\n\nexport type ListenOptions = {\n /** Default `0`: the OS picks a free port. */\n port?: number\n /** Default `127.0.0.1`: a mock should not be reachable off the machine by accident. */\n host?: string\n}\n\n/** A running server, with the address it actually bound. */\nexport type Listening = {\n url: string\n port: number\n host: string\n server: Server\n close(): Promise<void>\n}\n\nexport const listen = async (api: FetchAPI, options: ListenOptions = {}): Promise<Listening> => {\n const host = options.host ?? \"127.0.0.1\"\n const server = await serve(api, { port: options.port ?? 0, host })\n const address = server.address()\n const port = typeof address === \"object\" && address !== null ? address.port : (options.port ?? 0)\n const shown = host.includes(\":\") ? `[${host}]` : host\n return {\n url: `http://${shown}:${port}`,\n port,\n host,\n server,\n close: () =>\n new Promise<void>((resolve, reject) => {\n // Stop accepting first, then drop keep-alive sockets so close() can finish.\n server.close((error) => {\n if (error && (error as { code?: string }).code !== \"ERR_SERVER_NOT_RUNNING\") reject(error)\n else resolve()\n })\n server.closeAllConnections?.()\n }),\n }\n}\n", "/// <reference types=\"node\" />\nimport { type Listening, listen, type ServeTarget } from \"@crvouga/mockingbird-adapter-node\"\nimport { createRuntime, type LlamaCloudRuntime, type LlamaCloudRuntimeOptions } from \"./runtime.js\"\n\n/** Port `mockingbird-llamacloud serve` listens on when none is given. */\nexport const DEFAULT_PORT = 8805\n\nexport type LlamaCloudServerOptions = LlamaCloudRuntimeOptions & {\n /** Default `0`: the OS picks a free port. */\n port?: number\n /** Default `127.0.0.1`. */\n host?: string\n}\n\nexport type LlamaCloudServer = Listening & { runtime: LlamaCloudRuntime }\n\n/** Serve the LlamaCloud mock over `node:http`. */\nexport const createServer = async (\n options: LlamaCloudServerOptions = {},\n): Promise<LlamaCloudServer> => {\n const { port, host, ...rest } = options\n const runtime = createRuntime(rest)\n const listening = await listen(runtime, {\n port: port ?? 0,\n ...(host !== undefined ? { host } : {}),\n })\n return { ...listening, runtime }\n}\n\nconst text = (value: string | boolean | undefined) =>\n typeof value === \"string\" ? value : undefined\n\n/** How `serve` (and `serve --config`) builds the LlamaCloud mock from flags. */\nexport const serveTarget: ServeTarget = {\n name: \"llamacloud\",\n defaultPort: DEFAULT_PORT,\n options: {\n index: {\n type: \"string\",\n value: \"<name[,name\u2026]>\",\n description:\n \"Pipelines (indexes) to create in the Default project (the app's LLAMACLOUD_INDEX_NAME); default acme-member-kb-v1\",\n },\n project: {\n type: \"string\",\n value: \"<name>\",\n description:\n \"Project those pipelines live in (the app's LLAMACLOUD_PROJECT_NAME); default Default\",\n },\n \"api-key\": {\n type: \"string\",\n value: \"<key>\",\n description: \"Accept only this bearer key (default: any non-empty key)\",\n },\n },\n create: (values, common) => {\n const index = text(values.index)\n const project = text(values.project)\n const key = text(values[\"api-key\"])\n return createRuntime({\n ...(index\n ? {\n pipelines: index\n .split(\",\")\n .map((name) => name.trim())\n .filter(Boolean)\n .map((name) => ({ name, ...(project ? { projectName: project } : {}) })),\n }\n : project\n ? { pipelines: [{ name: \"acme-member-kb-v1\", projectName: project }] }\n : {}),\n ...(key ? { settings: { apiKeys: [key] } } : {}),\n ...(common.adminKey !== undefined ? { adminKey: common.adminKey } : {}),\n ...(common.seed !== undefined ? { seed: common.seed } : {}),\n ...(common.onLog ? { onLog: common.onLog } : {}),\n })\n },\n banner: () => [\n \"auth: Authorization: Bearer <LLAMACLOUD_API_KEY>\",\n \"backend: LLAMACLOUD_BASE_URL=<this>/api/v1; Python chat SDK: LLAMA_CLOUD_BASE_URL=<this>\",\n \"namespaces: x-mockingbird-namespace, /ns/<name>/\u2026, or PUT /__admin/credentials {<api key>: <ns>}\",\n ],\n}\n"],
5
+ "mappings": ";;;;;AAAA,SAAS,gBAAgB;AACzB,SAA+B,iBAAiB;;;ACDhD,SAAS,oBAAoB;AAatB,IAAM,QAAQ,OAAO,KAAe,UAA4B,CAAA,MAAM;AAC3E,QAAM,SAAS,aAAa,OAAO,KAAK,QAAO;AAC7C,UAAM,SAAmB,CAAA;AACzB,qBAAiB,SAAS,KAAK;AAC7B,aAAO,KAAK,OAAO,KAAK,KAAK,CAAC;IAChC;AACA,UAAM,OAAO,OAAO,OAAO,MAAM;AACjC,UAAM,UAAU,OAAO,QAAO;AAC9B,UAAM,OAAO,OAAO,YAAY,YAAY,YAAY,OAAO,QAAQ,OAAO;AAC9E,UAAM,OAAO,UAAU,IAAI,QAAQ,QAAQ,aAAa,QAAQ,EAAE,EAAE;AACpE,UAAM,MAAM,IAAI,OAAO;AACvB,UAAM,MAAM,IAAI,IAAI,IAAI,QAAQ,QAAQ,GAAG,GAAG,IAAI;AAClD,UAAM,SAAS,IAAI,UAAU;AAC7B,UAAM,OAAoB,EAAE,QAAQ,SAAS,IAAI,QAAiC;AAClF,QAAI,WAAW,SAAS,WAAW,UAAU,KAAK,SAAS,GAAG;AAC5D,WAAK,OAAO;IACd;AACA,UAAM,UAAU,IAAI,gBAAe;AACnC,QAAI,KAAK,SAAS,MAAK;AACrB,UAAI,CAAC,IAAI;AAAkB,gBAAQ,MAAK;IAC1C,CAAC;AACD,SAAK,SAAS,QAAQ;AACtB,UAAM,UAAU,IAAI,QAAQ,KAAK,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A,QACE,WAAW,MACR,MAAM,GAAG,EACT,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,EACzB,OAAO,OAAO,EACd,IAAI,CAAC,UAAU,EAAE,MAAM,GAAI,UAAU,EAAE,aAAa,QAAQ,IAAI,CAAC,EAAG,EAAE;AAAA,MAC3E,IACA,UACE,EAAE,WAAW,CAAC,EAAE,MAAM,qBAAqB,aAAa,QAAQ,CAAC,EAAE,IACnE,CAAC;AAAA,MACP,GAAI,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC;AAAA,MAC9C,GAAI,OAAO,aAAa,SAAY,EAAE,UAAU,OAAO,SAAS,IAAI,CAAC;AAAA,MACrE,GAAI,OAAO,SAAS,SAAY,EAAE,MAAM,OAAO,KAAK,IAAI,CAAC;AAAA,MACzD,GAAI,OAAO,QAAQ,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AAAA,IAChD,CAAC;AAAA,EACH;AAAA,EACA,QAAQ,MAAM;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
6
6
  "names": ["createServer"]
7
7
  }
@@ -1471,7 +1471,7 @@ var restoreNamespace = (sqlite, namespace, snapshot) => {
1471
1471
  };
1472
1472
 
1473
1473
  // ../core/dist/version.js
1474
- var PACKAGE_VERSION = true ? "0.2.0" : UNRELEASED_VERSION;
1474
+ var PACKAGE_VERSION = true ? "1.0.0" : UNRELEASED_VERSION;
1475
1475
 
1476
1476
  // ../core/dist/webhooks.js
1477
1477
  var json2 = (status, body) => new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } });
@@ -2151,7 +2151,7 @@ var bodyIssues = (context, contentType = "application/json") => {
2151
2151
  };
2152
2152
 
2153
2153
  // src/generated/openapi.ts
2154
- var document = JSON.parse(`{"openapi":"3.1.0","info":{"title":"LlamaCloud platform API (Mockingbird subset)","description":"Stateful mock subset of the LlamaCloud (LlamaIndex managed index) platform API: project and\\npipeline lookup, pipeline retrieval, and pipeline documents (list, get, create, upsert,\\ndelete). Covers both of our consumers: the backend's plain-\`fetch\` knowledge adapter and the\\nMakor chat service's \`llama_cloud_services.LlamaCloudIndex(...).as_retriever().aretrieve()\`.\\n","version":"1","x-mockingbird-upstream":{"note":"Hand-authored from the wire shapes of the official Python client (llama-cloud 0.1.45, the Fern-generated client that llama-cloud-services 0.6.88 drives) and our backend adapter (llamacloud-knowledge.adapter.ts). Response models are trimmed to the fields those clients require or read."}},"servers":[{"url":"https://api.cloud.llamaindex.ai"}],"security":[{"bearerAuth":[]}],"paths":{"/api/v1/projects":{"get":{"operationId":"ListProjects","description":"The SDK's project lookup (\`resolve_project\` by \`project_name\`).","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"project_name","in":"query","schema":{"type":"string","maxLength":64}},{"name":"organization_id","in":"query","schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Matching projects","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/api/v1/projects/{project_id}":{"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","x-mockingbird-resource-ref":{"type":"project","missing":"00000000-0000-4000-8000-00000000dead"}}}],"get":{"operationId":"GetProject","description":"The retriever's project lookup by id (\`as_retriever\` passes \`project_id\`).","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"organization_id","in":"query","schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"The project","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/v1/pipelines":{"get":{"operationId":"SearchPipelines","description":"Our backend lists by \`project_name\` and picks \`name == LLAMACLOUD_INDEX_NAME\`; the SDK searches by \`project_id\` + \`pipeline_name\` + \`pipeline_type=MANAGED\`.","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"project_id","in":"query","schema":{"type":"string","maxLength":64,"x-mockingbird-resource-ref":{"type":"project","missing":"00000000-0000-4000-8000-00000000dead"}}},{"name":"project_name","in":"query","schema":{"type":"string","maxLength":64}},{"name":"pipeline_name","in":"query","schema":{"type":"string","maxLength":64}},{"name":"pipeline_type","in":"query","schema":{"type":"string","enum":["PLAYGROUND","MANAGED"]}},{"name":"organization_id","in":"query","schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Matching pipelines","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Pipeline"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/api/v1/pipelines/{pipeline_id}":{"parameters":[{"$ref":"#/components/parameters/PipelineId"}],"get":{"operationId":"GetPipeline","description":"The retriever's pipeline lookup by id.","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"The pipeline","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pipeline"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/v1/pipelines/{pipeline_id}/retrieve":{"parameters":[{"$ref":"#/components/parameters/PipelineId"}],"post":{"operationId":"RunSearch","description":"Retrieval. Answered from a scripted rule (\`PUT /__admin/retrieval\`) whose \`contains\` matches the query, else a deterministic term-overlap ranking over the stored documents.","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"project_id","in":"query","schema":{"type":"string","maxLength":64}},{"name":"organization_id","in":"query","schema":{"type":"string","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveParams"}}}},"responses":{"200":{"description":"Retrieval results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveResults"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"}}}},"/api/v1/pipelines/{pipeline_id}/documents":{"parameters":[{"$ref":"#/components/parameters/PipelineId"}],"get":{"operationId":"ListPipelineDocuments","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"skip","in":"query","schema":{"type":"integer","minimum":0,"maximum":1000}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000}}],"responses":{"200":{"description":"The pipeline's documents, oldest first","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CloudDocument"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"}}},"post":{"operationId":"CreateBatchPipelineDocuments","description":"Insert documents (the SDK's \`insert\`); an id that already exists is replaced.","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudDocumentBatch"}}}},"responses":{"200":{"description":"The stored documents","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CloudDocument"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"}}},"put":{"operationId":"UpsertBatchPipelineDocuments","description":"Upsert by id (our backend uses the article slug as the id).","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudDocumentBatch"}}}},"responses":{"200":{"description":"The stored documents","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CloudDocument"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"}}}},"/api/v1/pipelines/{pipeline_id}/documents/{document_id}":{"parameters":[{"$ref":"#/components/parameters/PipelineId"},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","x-mockingbird-resource-ref":{"type":"document","missing":"missing-document"}}}],"get":{"operationId":"GetPipelineDocument","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"The document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudDocument"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"operationId":"DeletePipelineDocument","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"204":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"PipelineId":{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","x-mockingbird-resource-ref":{"type":"pipeline","missing":"00000000-0000-4000-8000-0000000beef0"}}}},"responses":{"Unauthorized":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Detail"}}}},"NotFound":{"description":"Unknown resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Detail"}}}},"ValidationFailed":{"description":"FastAPI validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"schemas":{"Detail":{"type":"object","required":["detail"],"properties":{"detail":{"type":"string"}}},"HTTPValidationError":{"type":"object","required":["detail"],"properties":{"detail":{"type":"array","items":{"type":"object","required":["loc","msg","type"],"properties":{"loc":{"type":"array","items":{"type":["string","integer"]}},"msg":{"type":"string"},"type":{"type":"string"}}}}}},"Project":{"type":"object","required":["id","name","organization_id"],"properties":{"id":{"type":"string","x-mockingbird-resource":{"type":"project","identity":true}},"name":{"type":"string"},"organization_id":{"type":"string"},"is_default":{"type":"boolean"},"ad_hoc_eval_dataset_id":{"type":["string","null"]},"created_at":{"type":"string","x-mockingbird-volatile":{"kind":"timestamp"}},"updated_at":{"type":"string","x-mockingbird-volatile":{"kind":"timestamp"}}}},"Pipeline":{"type":"object","required":["id","name","project_id","embedding_config"],"properties":{"id":{"type":"string","x-mockingbird-resource":{"type":"pipeline","identity":true}},"name":{"type":"string"},"project_id":{"type":"string"},"pipeline_type":{"type":"string","enum":["PLAYGROUND","MANAGED"]},"embedding_config":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"component":{"type":"object"}}},"status":{"type":"string","enum":["CREATED","DELETING"]},"created_at":{"type":"string","x-mockingbird-volatile":{"kind":"timestamp"}},"updated_at":{"type":"string","x-mockingbird-volatile":{"kind":"timestamp"}}}},"CloudDocumentCreate":{"type":"object","required":["text","metadata"],"properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","maxLength":4000},"metadata":{"type":"object","maxProperties":8,"additionalProperties":true,"properties":{"file_name":{"type":"string","maxLength":120},"title":{"type":"string","maxLength":200},"slug":{"type":"string","maxLength":80},"contentType":{"type":"string","maxLength":40},"sourceUrl":{"type":["string","null"],"maxLength":400},"updatedAt":{"type":"string","maxLength":40}}},"excluded_embed_metadata_keys":{"type":"array","maxItems":8,"items":{"type":"string","maxLength":40}},"excluded_llm_metadata_keys":{"type":"array","maxItems":8,"items":{"type":"string","maxLength":40}},"page_positions":{"type":["array","null"],"maxItems":8,"items":{"type":"integer"}}}},"CloudDocumentBatch":{"type":"array","minItems":1,"maxItems":5,"items":{"$ref":"#/components/schemas/CloudDocumentCreate"}},"CloudDocument":{"type":"object","required":["id","text","metadata"],"properties":{"id":{"type":"string","x-mockingbird-resource":{"type":"document","identity":true}},"text":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"excluded_embed_metadata_keys":{"type":"array","items":{"type":"string"}},"excluded_llm_metadata_keys":{"type":"array","items":{"type":"string"}},"page_positions":{"type":["array","null"],"items":{"type":"integer"}},"status_metadata":{"type":["object","null"]}}},"RetrieveParams":{"type":"object","required":["query"],"properties":{"query":{"type":"string","minLength":1,"maxLength":400},"dense_similarity_top_k":{"type":"integer","minimum":1,"maximum":100},"sparse_similarity_top_k":{"type":"integer","minimum":1,"maximum":100},"enable_reranking":{"type":"boolean"},"rerank_top_n":{"type":"integer","minimum":1,"maximum":100},"alpha":{"type":"number","minimum":0,"maximum":1},"retrieval_mode":{"type":"string","enum":["chunks","files_via_metadata","files_via_content","auto_routed"]},"files_top_k":{"type":"integer","minimum":1,"maximum":100},"retrieve_image_nodes":{"type":"boolean"},"retrieve_page_screenshot_nodes":{"type":"boolean"},"retrieve_page_figure_nodes":{"type":"boolean"},"class_name":{"type":"string","maxLength":40},"dense_similarity_cutoff":{"type":["number","null"]},"search_filters":{"type":["object","null"]},"search_filters_inference_schema":{"type":["object","null"]}}},"TextNodeWithScore":{"type":"object","required":["node","score"],"properties":{"node":{"type":"object","required":["id_","text","metadata"],"properties":{"id_":{"type":"string"},"text":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"extra_info":{"type":"object","additionalProperties":true},"class_name":{"type":"string"},"mimetype":{"type":"string"},"start_char_idx":{"type":["integer","null"]},"end_char_idx":{"type":["integer","null"]},"excluded_embed_metadata_keys":{"type":"array","items":{"type":"string"}},"excluded_llm_metadata_keys":{"type":"array","items":{"type":"string"}},"relationships":{"type":"object"},"text_template":{"type":"string"},"metadata_template":{"type":"string"},"metadata_seperator":{"type":"string"}}},"score":{"type":["number","null"]},"class_name":{"type":"string"}}},"RetrieveResults":{"type":"object","required":["pipeline_id","retrieval_nodes"],"properties":{"pipeline_id":{"type":"string"},"retrieval_nodes":{"type":"array","items":{"$ref":"#/components/schemas/TextNodeWithScore"}},"image_nodes":{"type":"array","items":{"type":"object"}},"page_figure_nodes":{"type":"array","items":{"type":"object"}},"retrieval_latency":{"type":"object","additionalProperties":{"type":"number"}},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"inferred_search_filters":{"type":["object","null"]},"class_name":{"type":"string"}}}}}}`);
2154
+ var document = JSON.parse(`{"openapi":"3.1.0","info":{"title":"LlamaCloud platform API (Mockingbird subset)","description":"Stateful mock subset of the LlamaCloud (LlamaIndex managed index) platform API: project and\\npipeline lookup, pipeline retrieval, and pipeline documents (list, get, create, upsert,\\ndelete). Covers both of our consumers: the backend's plain-\`fetch\` knowledge adapter and the\\nPython chat service's \`llama_cloud_services.LlamaCloudIndex(...).as_retriever().aretrieve()\`.\\n","version":"1","x-mockingbird-upstream":{"note":"Hand-authored from the wire shapes of the official Python client (llama-cloud 0.1.45, the Fern-generated client that llama-cloud-services 0.6.88 drives) and our backend adapter (llamacloud-knowledge.adapter.ts). Response models are trimmed to the fields those clients require or read."}},"servers":[{"url":"https://api.cloud.llamaindex.ai"}],"security":[{"bearerAuth":[]}],"paths":{"/api/v1/projects":{"get":{"operationId":"ListProjects","description":"The SDK's project lookup (\`resolve_project\` by \`project_name\`).","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"project_name","in":"query","schema":{"type":"string","maxLength":64}},{"name":"organization_id","in":"query","schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Matching projects","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/api/v1/projects/{project_id}":{"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","x-mockingbird-resource-ref":{"type":"project","missing":"00000000-0000-4000-8000-00000000dead"}}}],"get":{"operationId":"GetProject","description":"The retriever's project lookup by id (\`as_retriever\` passes \`project_id\`).","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"organization_id","in":"query","schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"The project","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/v1/pipelines":{"get":{"operationId":"SearchPipelines","description":"Our backend lists by \`project_name\` and picks \`name == LLAMACLOUD_INDEX_NAME\`; the SDK searches by \`project_id\` + \`pipeline_name\` + \`pipeline_type=MANAGED\`.","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"project_id","in":"query","schema":{"type":"string","maxLength":64,"x-mockingbird-resource-ref":{"type":"project","missing":"00000000-0000-4000-8000-00000000dead"}}},{"name":"project_name","in":"query","schema":{"type":"string","maxLength":64}},{"name":"pipeline_name","in":"query","schema":{"type":"string","maxLength":64}},{"name":"pipeline_type","in":"query","schema":{"type":"string","enum":["PLAYGROUND","MANAGED"]}},{"name":"organization_id","in":"query","schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Matching pipelines","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Pipeline"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/api/v1/pipelines/{pipeline_id}":{"parameters":[{"$ref":"#/components/parameters/PipelineId"}],"get":{"operationId":"GetPipeline","description":"The retriever's pipeline lookup by id.","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"The pipeline","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pipeline"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/v1/pipelines/{pipeline_id}/retrieve":{"parameters":[{"$ref":"#/components/parameters/PipelineId"}],"post":{"operationId":"RunSearch","description":"Retrieval. Answered from a scripted rule (\`PUT /__admin/retrieval\`) whose \`contains\` matches the query, else a deterministic term-overlap ranking over the stored documents.","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"project_id","in":"query","schema":{"type":"string","maxLength":64}},{"name":"organization_id","in":"query","schema":{"type":"string","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveParams"}}}},"responses":{"200":{"description":"Retrieval results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveResults"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"}}}},"/api/v1/pipelines/{pipeline_id}/documents":{"parameters":[{"$ref":"#/components/parameters/PipelineId"}],"get":{"operationId":"ListPipelineDocuments","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"skip","in":"query","schema":{"type":"integer","minimum":0,"maximum":1000}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000}}],"responses":{"200":{"description":"The pipeline's documents, oldest first","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CloudDocument"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"}}},"post":{"operationId":"CreateBatchPipelineDocuments","description":"Insert documents (the SDK's \`insert\`); an id that already exists is replaced.","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudDocumentBatch"}}}},"responses":{"200":{"description":"The stored documents","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CloudDocument"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"}}},"put":{"operationId":"UpsertBatchPipelineDocuments","description":"Upsert by id (our backend uses the article slug as the id).","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudDocumentBatch"}}}},"responses":{"200":{"description":"The stored documents","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CloudDocument"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"}}}},"/api/v1/pipelines/{pipeline_id}/documents/{document_id}":{"parameters":[{"$ref":"#/components/parameters/PipelineId"},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","x-mockingbird-resource-ref":{"type":"document","missing":"missing-document"}}}],"get":{"operationId":"GetPipelineDocument","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"The document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudDocument"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"operationId":"DeletePipelineDocument","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"204":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"PipelineId":{"name":"pipeline_id","in":"path","required":true,"schema":{"type":"string","x-mockingbird-resource-ref":{"type":"pipeline","missing":"00000000-0000-4000-8000-0000000beef0"}}}},"responses":{"Unauthorized":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Detail"}}}},"NotFound":{"description":"Unknown resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Detail"}}}},"ValidationFailed":{"description":"FastAPI validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"schemas":{"Detail":{"type":"object","required":["detail"],"properties":{"detail":{"type":"string"}}},"HTTPValidationError":{"type":"object","required":["detail"],"properties":{"detail":{"type":"array","items":{"type":"object","required":["loc","msg","type"],"properties":{"loc":{"type":"array","items":{"type":["string","integer"]}},"msg":{"type":"string"},"type":{"type":"string"}}}}}},"Project":{"type":"object","required":["id","name","organization_id"],"properties":{"id":{"type":"string","x-mockingbird-resource":{"type":"project","identity":true}},"name":{"type":"string"},"organization_id":{"type":"string"},"is_default":{"type":"boolean"},"ad_hoc_eval_dataset_id":{"type":["string","null"]},"created_at":{"type":"string","x-mockingbird-volatile":{"kind":"timestamp"}},"updated_at":{"type":"string","x-mockingbird-volatile":{"kind":"timestamp"}}}},"Pipeline":{"type":"object","required":["id","name","project_id","embedding_config"],"properties":{"id":{"type":"string","x-mockingbird-resource":{"type":"pipeline","identity":true}},"name":{"type":"string"},"project_id":{"type":"string"},"pipeline_type":{"type":"string","enum":["PLAYGROUND","MANAGED"]},"embedding_config":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"component":{"type":"object"}}},"status":{"type":"string","enum":["CREATED","DELETING"]},"created_at":{"type":"string","x-mockingbird-volatile":{"kind":"timestamp"}},"updated_at":{"type":"string","x-mockingbird-volatile":{"kind":"timestamp"}}}},"CloudDocumentCreate":{"type":"object","required":["text","metadata"],"properties":{"id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","maxLength":4000},"metadata":{"type":"object","maxProperties":8,"additionalProperties":true,"properties":{"file_name":{"type":"string","maxLength":120},"title":{"type":"string","maxLength":200},"slug":{"type":"string","maxLength":80},"contentType":{"type":"string","maxLength":40},"sourceUrl":{"type":["string","null"],"maxLength":400},"updatedAt":{"type":"string","maxLength":40}}},"excluded_embed_metadata_keys":{"type":"array","maxItems":8,"items":{"type":"string","maxLength":40}},"excluded_llm_metadata_keys":{"type":"array","maxItems":8,"items":{"type":"string","maxLength":40}},"page_positions":{"type":["array","null"],"maxItems":8,"items":{"type":"integer"}}}},"CloudDocumentBatch":{"type":"array","minItems":1,"maxItems":5,"items":{"$ref":"#/components/schemas/CloudDocumentCreate"}},"CloudDocument":{"type":"object","required":["id","text","metadata"],"properties":{"id":{"type":"string","x-mockingbird-resource":{"type":"document","identity":true}},"text":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"excluded_embed_metadata_keys":{"type":"array","items":{"type":"string"}},"excluded_llm_metadata_keys":{"type":"array","items":{"type":"string"}},"page_positions":{"type":["array","null"],"items":{"type":"integer"}},"status_metadata":{"type":["object","null"]}}},"RetrieveParams":{"type":"object","required":["query"],"properties":{"query":{"type":"string","minLength":1,"maxLength":400},"dense_similarity_top_k":{"type":"integer","minimum":1,"maximum":100},"sparse_similarity_top_k":{"type":"integer","minimum":1,"maximum":100},"enable_reranking":{"type":"boolean"},"rerank_top_n":{"type":"integer","minimum":1,"maximum":100},"alpha":{"type":"number","minimum":0,"maximum":1},"retrieval_mode":{"type":"string","enum":["chunks","files_via_metadata","files_via_content","auto_routed"]},"files_top_k":{"type":"integer","minimum":1,"maximum":100},"retrieve_image_nodes":{"type":"boolean"},"retrieve_page_screenshot_nodes":{"type":"boolean"},"retrieve_page_figure_nodes":{"type":"boolean"},"class_name":{"type":"string","maxLength":40},"dense_similarity_cutoff":{"type":["number","null"]},"search_filters":{"type":["object","null"]},"search_filters_inference_schema":{"type":["object","null"]}}},"TextNodeWithScore":{"type":"object","required":["node","score"],"properties":{"node":{"type":"object","required":["id_","text","metadata"],"properties":{"id_":{"type":"string"},"text":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"extra_info":{"type":"object","additionalProperties":true},"class_name":{"type":"string"},"mimetype":{"type":"string"},"start_char_idx":{"type":["integer","null"]},"end_char_idx":{"type":["integer","null"]},"excluded_embed_metadata_keys":{"type":"array","items":{"type":"string"}},"excluded_llm_metadata_keys":{"type":"array","items":{"type":"string"}},"relationships":{"type":"object"},"text_template":{"type":"string"},"metadata_template":{"type":"string"},"metadata_seperator":{"type":"string"}}},"score":{"type":["number","null"]},"class_name":{"type":"string"}}},"RetrieveResults":{"type":"object","required":["pipeline_id","retrieval_nodes"],"properties":{"pipeline_id":{"type":"string"},"retrieval_nodes":{"type":"array","items":{"$ref":"#/components/schemas/TextNodeWithScore"}},"image_nodes":{"type":"array","items":{"type":"object"}},"page_figure_nodes":{"type":"array","items":{"type":"object"}},"retrieval_latency":{"type":"object","additionalProperties":{"type":"number"}},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"inferred_search_filters":{"type":["object","null"]},"class_name":{"type":"string"}}}}}}`);
2155
2155
  var operationIds = ["ListProjects", "GetProject", "SearchPipelines", "GetPipeline", "RunSearch", "ListPipelineDocuments", "UpsertBatchPipelineDocuments", "CreateBatchPipelineDocuments", "GetPipelineDocument", "DeletePipelineDocument"];
2156
2156
  var supportedOperationIds = ["ListProjects", "GetProject", "SearchPipelines", "GetPipeline", "RunSearch", "ListPipelineDocuments", "UpsertBatchPipelineDocuments", "CreateBatchPipelineDocuments", "GetPipelineDocument", "DeletePipelineDocument"];
2157
2157
 
@@ -2214,7 +2214,7 @@ var scriptedNode = (node, index) => ({
2214
2214
  // src/state.ts
2215
2215
  var DEFAULT_SETTINGS = { apiKeys: [], defaultTopK: 5 };
2216
2216
  var DEFAULT_PROJECT_NAME = "Default";
2217
- var DEFAULT_PIPELINE_NAME = "geviti-member-kb-v1";
2217
+ var DEFAULT_PIPELINE_NAME = "acme-member-kb-v1";
2218
2218
  var DEFAULT_PIPELINES = [
2219
2219
  { name: DEFAULT_PIPELINE_NAME, projectName: DEFAULT_PROJECT_NAME }
2220
2220
  ];
@@ -2693,4 +2693,4 @@ export {
2693
2693
  LLAMACLOUD_NAMESPACE,
2694
2694
  LlamaCloudAPI
2695
2695
  };
2696
- //# sourceMappingURL=chunk-UP32DVYJ.js.map
2696
+ //# sourceMappingURL=chunk-6X3YC57G.js.map