replicas-engine 0.1.623 → 0.1.624

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/index.js CHANGED
@@ -2100,6 +2100,7 @@ Use this when:
2100
2100
  - The user asks to read or change Google Ads, Docs, Drive, Search Console, or Sheets data
2101
2101
  - The user asks for ClickHouse analytics or PostHog product data
2102
2102
  - The user asks to invoke a connected Modal function
2103
+ - The user asks to query or update a connected turbopuffer namespace
2103
2104
  - The user asks for Stripe customers, payments, invoices, subscriptions, or balances`;
2104
2105
  var REFERENCE9 = `# Plugins
2105
2106
 
@@ -2168,6 +2169,20 @@ const result = await replicas.modal.call({
2168
2169
  \`\`\`
2169
2170
 
2170
2171
  Function calls execute with the connected Modal token and may mutate external state. Confirm the requested action before invoking a function with side effects.
2172
+
2173
+ ## turbopuffer
2174
+
2175
+ turbopuffer is a native integration backed by its official TypeScript SDK. Use the provider-shaped helpers:
2176
+
2177
+ \`\`\`ts
2178
+ const namespaces = await replicas.turbopuffer.namespaces({ prefix: 'products' });
2179
+ const results = await replicas.turbopuffer.query('products', {
2180
+ rank_by: ['text', 'BM25', 'wireless headphones'],
2181
+ top_k: 10,
2182
+ });
2183
+ \`\`\`
2184
+
2185
+ \`write\` mutates namespace data. Confirm the requested change before calling it.
2171
2186
  `;
2172
2187
  var PLUGINS_ABILITY = {
2173
2188
  label: "Plugins",
@@ -10933,7 +10948,7 @@ var DEFAULT_CODEX_ARGS = [
10933
10948
  var MIN_CODEX_CLI_VERSION = "0.144.6";
10934
10949
  var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
10935
10950
  var codexCliVersionEnsured = null;
10936
- var ENGINE_PACKAGE_VERSION = "0.1.623";
10951
+ var ENGINE_PACKAGE_VERSION = "0.1.624";
10937
10952
  var INITIALIZE_METHOD = "initialize";
10938
10953
  var INITIALIZED_NOTIFICATION = "initialized";
10939
10954
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.623",
3
+ "version": "0.1.624",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -108,5 +108,14 @@ const modal = {
108
108
  call: (input) => request('/v1/engine/modal/call', { method: 'POST', body: input }),
109
109
  };
110
110
 
111
- export const replicas = { integrations, plugins, linear, slack, github, gitlab, sentry, modal };
111
+ const turbopufferRequest = (operation, namespace, params) =>
112
+ request('/v1/engine/turbopuffer', { method: 'POST', body: { operation, namespace, params } });
113
+ const turbopuffer = {
114
+ namespaces: (params) => turbopufferRequest('namespaces', undefined, params),
115
+ metadata: (namespace, params) => turbopufferRequest('metadata', namespace, params),
116
+ query: (namespace, params) => turbopufferRequest('query', namespace, params),
117
+ write: (namespace, params) => turbopufferRequest('write', namespace, params),
118
+ };
119
+
120
+ export const replicas = { integrations, plugins, linear, slack, github, gitlab, sentry, modal, turbopuffer };
112
121
  export default replicas;
@@ -114,4 +114,27 @@ describe('@replicas/sdk', () => {
114
114
  process.env.REPLICAS_WORKSPACE_ID = 'workspace-1';
115
115
  expect(() => replicas.github.request('//attacker.example/path')).toThrow('relative');
116
116
  });
117
+
118
+ test('queries turbopuffer through the workspace gateway', async () => {
119
+ let observed: { path: string; body: unknown } | null = null;
120
+ const server = Bun.serve({
121
+ port: 0,
122
+ async fetch(request) {
123
+ observed = { path: new URL(request.url).pathname, body: await request.json() };
124
+ return Response.json({ rows: [] });
125
+ },
126
+ });
127
+ process.env.REPLICAS_MONOLITH_URL = server.url.toString().replace(/\/$/, '');
128
+ process.env.REPLICAS_ENGINE_SECRET = 'engine-secret';
129
+ process.env.REPLICAS_WORKSPACE_ID = 'workspace-1';
130
+ try {
131
+ await replicas.turbopuffer.query('products', { top_k: 10 });
132
+ expect(observed).toEqual({
133
+ path: '/v1/engine/turbopuffer',
134
+ body: { operation: 'query', namespace: 'products', params: { top_k: 10 } },
135
+ });
136
+ } finally {
137
+ server.stop(true);
138
+ }
139
+ });
117
140
  });
@@ -105,6 +105,13 @@ export declare const PLUGIN_CATALOG: readonly [{
105
105
  readonly category: "data";
106
106
  readonly name: "Vercel";
107
107
  readonly description: "Manage projects, deployments, logs, domains, and infrastructure.";
108
+ }, {
109
+ readonly id: "turbopuffer";
110
+ readonly toolkit: "turbopuffer";
111
+ readonly authType: "api_key";
112
+ readonly category: "data";
113
+ readonly name: "turbopuffer";
114
+ readonly description: "Query and manage turbopuffer namespaces.";
108
115
  }];
109
116
  export type PluginId = (typeof PLUGIN_CATALOG)[number]['id'];
110
117
  export type PluginScope = 'organization' | 'personal';
@@ -156,7 +163,13 @@ export interface PluginConnectModalRequest {
156
163
  tokenId: string;
157
164
  tokenSecret: string;
158
165
  }
159
- export type PluginConnectRequest = PluginConnectPostHogRequest | PluginConnectClickHouseRequest | PluginConnectApiKeyRequest | PluginConnectModalRequest;
166
+ export declare const TURBOPUFFER_REGIONS: readonly ["aws-us-east-1", "aws-us-west-2", "gcp-us-central1", "gcp-europe-west3"];
167
+ export type TurbopufferRegion = (typeof TURBOPUFFER_REGIONS)[number];
168
+ export interface PluginConnectTurbopufferRequest {
169
+ apiKey: string;
170
+ region: TurbopufferRegion;
171
+ }
172
+ export type PluginConnectRequest = PluginConnectPostHogRequest | PluginConnectClickHouseRequest | PluginConnectApiKeyRequest | PluginConnectModalRequest | PluginConnectTurbopufferRequest;
160
173
  export interface ModalCallRequest {
161
174
  app: string;
162
175
  function: string;
@@ -164,6 +177,11 @@ export interface ModalCallRequest {
164
177
  kwargs?: Record<string, unknown>;
165
178
  environment?: string;
166
179
  }
180
+ export interface TurbopufferOperationRequest {
181
+ operation: 'namespaces' | 'metadata' | 'query' | 'write';
182
+ namespace?: string;
183
+ params?: Record<string, unknown>;
184
+ }
167
185
  export interface PluginConnectResponse {
168
186
  success: true;
169
187
  }
@@ -51,4 +51,10 @@ export interface ReplicasSdk {
51
51
  modal: {
52
52
  call<T = unknown>(input: import('./routes/plugins').ModalCallRequest): Promise<T>;
53
53
  };
54
+ turbopuffer: {
55
+ namespaces<T = unknown>(params?: Record<string, unknown>): Promise<T>;
56
+ metadata<T = unknown>(namespace: string, params?: Record<string, unknown>): Promise<T>;
57
+ query<T = unknown>(namespace: string, params: Record<string, unknown>): Promise<T>;
58
+ write<T = unknown>(namespace: string, params: Record<string, unknown>): Promise<T>;
59
+ };
54
60
  }