replicas-engine 0.1.625 → 0.1.626

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
@@ -2101,6 +2101,7 @@ Use this when:
2101
2101
  - The user asks for ClickHouse analytics or PostHog product data
2102
2102
  - The user asks to invoke a connected Modal function
2103
2103
  - The user asks to query or update a connected turbopuffer namespace
2104
+ - The user asks for PlanetScale organizations, databases, branches, or Insights data
2104
2105
  - The user asks to analyze text with Pangram
2105
2106
  - The user asks for Stripe customers, payments, invoices, subscriptions, or balances`;
2106
2107
  var REFERENCE9 = `# Plugins
@@ -2156,6 +2157,17 @@ const results = await Promise.all(customerIds.map((customer) =>
2156
2157
 
2157
2158
  Never attempt to import Composio, create a session, manage a connection, or call a provider with raw credentials. Those operations are intentionally unavailable inside the workspace.
2158
2159
 
2160
+ ## PlanetScale
2161
+
2162
+ PlanetScale is a native OAuth integration. Pass a relative path from the PlanetScale v1 API; Replicas refreshes access tokens server-side:
2163
+
2164
+ \`\`\`ts
2165
+ const organizations = await replicas.planetscale.request('/organizations');
2166
+ const databases = await replicas.planetscale.request('/organizations/acme/databases');
2167
+ \`\`\`
2168
+
2169
+ OAuth scopes control permitted operations. Confirm mutations before using POST, PUT, PATCH, or DELETE.
2170
+
2159
2171
  ## Modal
2160
2172
 
2161
2173
  Modal is a native integration and uses its official JavaScript SDK behind the Replicas gateway. Invoke a deployed function by name:
@@ -10960,7 +10972,7 @@ var DEFAULT_CODEX_ARGS = [
10960
10972
  var MIN_CODEX_CLI_VERSION = "0.144.6";
10961
10973
  var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
10962
10974
  var codexCliVersionEnsured = null;
10963
- var ENGINE_PACKAGE_VERSION = "0.1.625";
10975
+ var ENGINE_PACKAGE_VERSION = "0.1.626";
10964
10976
  var INITIALIZE_METHOD = "initialize";
10965
10977
  var INITIALIZED_NOTIFICATION = "initialized";
10966
10978
  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.625",
3
+ "version": "0.1.626",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -45,6 +45,20 @@ function providerPath(path) {
45
45
  return path;
46
46
  }
47
47
 
48
+ function providerClient(endpoint, extraOptions = () => ({})) {
49
+ return {
50
+ request: (path, options = {}) => request(endpoint, {
51
+ method: 'POST',
52
+ body: {
53
+ path: providerPath(path),
54
+ method: options.method,
55
+ body: options.body,
56
+ ...extraOptions(options),
57
+ },
58
+ }),
59
+ };
60
+ }
61
+
48
62
  const integrations = {
49
63
  list: () => request('/v1/engine/integrations'),
50
64
  };
@@ -79,26 +93,9 @@ const slack = {
79
93
  }),
80
94
  };
81
95
 
82
- const github = {
83
- request: (path, options = {}) =>
84
- request('/v1/engine/github/api', {
85
- method: 'POST',
86
- body: { path: providerPath(path), method: options.method, body: options.body },
87
- }),
88
- };
96
+ const github = providerClient('/v1/engine/github/api');
89
97
 
90
- const gitlab = {
91
- request: (path, options = {}) =>
92
- request('/v1/engine/gitlab/api', {
93
- method: 'POST',
94
- body: {
95
- path: providerPath(path),
96
- method: options.method,
97
- body: options.body,
98
- host: options.host,
99
- },
100
- }),
101
- };
98
+ const gitlab = providerClient('/v1/engine/gitlab/api', (options) => ({ host: options.host }));
102
99
 
103
100
  const sentry = {
104
101
  request: (path) => request('/v1/engine/sentry/api', { method: 'POST', body: { path } }),
@@ -117,6 +114,8 @@ const turbopuffer = {
117
114
  write: (namespace, params) => turbopufferRequest('write', namespace, params),
118
115
  };
119
116
 
117
+ const planetscale = providerClient('/v1/engine/planetscale/api');
118
+
120
119
  const pangramRequest = (operation, input) =>
121
120
  request('/v1/engine/pangram', { method: 'POST', body: { operation, ...input } });
122
121
  const pangram = {
@@ -124,5 +123,5 @@ const pangram = {
124
123
  plagiarism: (text) => pangramRequest('plagiarism', { text }),
125
124
  };
126
125
 
127
- export const replicas = { integrations, plugins, linear, slack, github, gitlab, sentry, modal, turbopuffer, pangram };
126
+ export const replicas = { integrations, plugins, linear, slack, github, gitlab, sentry, modal, pangram, planetscale, turbopuffer };
128
127
  export default replicas;
@@ -137,6 +137,29 @@ describe('@replicas/sdk', () => {
137
137
  server.stop(true);
138
138
  }
139
139
  });
140
+
141
+ test('calls PlanetScale through the workspace gateway', async () => {
142
+ let observed: { path: string; body: unknown } | null = null;
143
+ const server = Bun.serve({
144
+ port: 0,
145
+ async fetch(request) {
146
+ observed = { path: new URL(request.url).pathname, body: await request.json() };
147
+ return Response.json({ data: [] });
148
+ },
149
+ });
150
+ process.env.REPLICAS_MONOLITH_URL = server.url.toString().replace(/\/$/, '');
151
+ process.env.REPLICAS_ENGINE_SECRET = 'engine-secret';
152
+ process.env.REPLICAS_WORKSPACE_ID = 'workspace-1';
153
+ try {
154
+ await replicas.planetscale.request('/organizations');
155
+ expect(observed).toEqual({
156
+ path: '/v1/engine/planetscale/api',
157
+ body: { path: '/organizations' },
158
+ });
159
+ } finally {
160
+ server.stop(true);
161
+ }
162
+ });
140
163
  });
141
164
 
142
165
  test('analyzes text with Pangram through the workspace gateway', async () => {
@@ -91,6 +91,14 @@ export declare const PLUGIN_CATALOG: readonly [{
91
91
  readonly category: "data";
92
92
  readonly name: "PostHog";
93
93
  readonly description: "Manage projects, events, insights, dashboards, flags, and recordings.";
94
+ }, {
95
+ readonly id: "planetscale";
96
+ readonly toolkit: "planetscale";
97
+ readonly source: "native";
98
+ readonly authType: "oauth";
99
+ readonly category: "data";
100
+ readonly name: "PlanetScale";
101
+ readonly description: "Manage organizations, databases, branches, deploy requests, and Insights.";
94
102
  }, {
95
103
  readonly id: "stripe";
96
104
  readonly toolkit: "stripe";
@@ -121,6 +129,10 @@ export declare const PLUGIN_CATALOG: readonly [{
121
129
  readonly description: "Query and manage turbopuffer namespaces.";
122
130
  }];
123
131
  export type PluginId = (typeof PLUGIN_CATALOG)[number]['id'];
132
+ export type NativePluginId = Extract<(typeof PLUGIN_CATALOG)[number], {
133
+ source: 'native';
134
+ }>['id'];
135
+ export type ComposioPluginId = Exclude<PluginId, NativePluginId>;
124
136
  export type PluginScope = 'organization' | 'personal';
125
137
  export type PluginAuthType = (typeof PLUGIN_CATALOG)[number]['authType'];
126
138
  export type PluginCategory = (typeof PLUGIN_CATALOG)[number]['category'];
@@ -133,6 +145,7 @@ export interface PluginCatalogItem {
133
145
  category: PluginCategory;
134
146
  name: string;
135
147
  description: string;
148
+ source?: 'native';
136
149
  }
137
150
  export interface PluginConnectionSummary {
138
151
  id: string;
@@ -210,7 +223,7 @@ export interface WorkspaceIntegrationsResponse {
210
223
  native: WorkspaceNativeIntegrationStatus;
211
224
  }
212
225
  export interface PluginSearchRequest {
213
- plugin: PluginId;
226
+ plugin: ComposioPluginId;
214
227
  query: string;
215
228
  }
216
229
  export interface PluginToolSchema {
@@ -224,14 +237,14 @@ export interface PluginSearchResponse {
224
237
  tools: PluginToolSchema[];
225
238
  }
226
239
  export interface PluginDescribeRequest {
227
- plugin: PluginId;
240
+ plugin: ComposioPluginId;
228
241
  tools: string[];
229
242
  }
230
243
  export interface PluginDescribeResponse {
231
244
  tools: PluginToolSchema[];
232
245
  }
233
246
  export interface PluginExecuteRequest {
234
- plugin: PluginId;
247
+ plugin: ComposioPluginId;
235
248
  tool: string;
236
249
  arguments?: Record<string, unknown>;
237
250
  }
@@ -240,4 +253,5 @@ export interface PluginExecuteResponse {
240
253
  logId: string;
241
254
  }
242
255
  export declare function isPluginId(value: string): value is PluginId;
256
+ export declare function isComposioPluginId(value: string): value is ComposioPluginId;
243
257
  export declare function isPluginConnectionStatus(value: string): value is PluginConnectionStatus;
@@ -57,6 +57,9 @@ export interface ReplicasSdk {
57
57
  query<T = unknown>(namespace: string, params: Record<string, unknown>): Promise<T>;
58
58
  write<T = unknown>(namespace: string, params: Record<string, unknown>): Promise<T>;
59
59
  };
60
+ planetscale: {
61
+ request<T = unknown>(path: string, options?: ProviderRequestOptions): Promise<T>;
62
+ };
60
63
  pangram: {
61
64
  detect<T = unknown>(input: import('./routes/plugins').PangramAnalyzeRequest): Promise<T>;
62
65
  plagiarism<T = unknown>(text: string): Promise<T>;