replicas-engine 0.1.622 → 0.1.623

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
@@ -2099,10 +2099,11 @@ Use this when:
2099
2099
  - The user asks to manage Calendly events, invitees, or scheduling links
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
+ - The user asks to invoke a connected Modal function
2102
2103
  - The user asks for Stripe customers, payments, invoices, subscriptions, or balances`;
2103
2104
  var REFERENCE9 = `# Plugins
2104
2105
 
2105
- Plugins are TypeScript libraries, not MCP servers. Import \`@replicas/sdk\`; Replicas authenticates the workspace and selects only the owner\u2019s personal connection or the organization fallback. Composio credentials, sessions, and project keys are never exposed.
2106
+ Plugins are TypeScript libraries, not MCP servers. Import \`@replicas/sdk\`; Replicas authenticates the workspace and selects only the owner\u2019s personal connection or the organization fallback. Provider credentials, sessions, and project keys are never exposed.
2106
2107
 
2107
2108
  Plugin tools may read or write provider data according to the connected account's permissions. Only execute write or destructive tools when they match the user's request.
2108
2109
 
@@ -2152,6 +2153,21 @@ const results = await Promise.all(customerIds.map((customer) =>
2152
2153
  \`\`\`
2153
2154
 
2154
2155
  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.
2156
+
2157
+ ## Modal
2158
+
2159
+ Modal is a native integration and uses its official JavaScript SDK behind the Replicas gateway. Invoke a deployed function by name:
2160
+
2161
+ \`\`\`ts
2162
+ const result = await replicas.modal.call({
2163
+ app: 'my-app',
2164
+ function: 'my-function',
2165
+ args: ['input'],
2166
+ environment: 'main',
2167
+ });
2168
+ \`\`\`
2169
+
2170
+ Function calls execute with the connected Modal token and may mutate external state. Confirm the requested action before invoking a function with side effects.
2155
2171
  `;
2156
2172
  var PLUGINS_ABILITY = {
2157
2173
  label: "Plugins",
@@ -10917,7 +10933,7 @@ var DEFAULT_CODEX_ARGS = [
10917
10933
  var MIN_CODEX_CLI_VERSION = "0.144.6";
10918
10934
  var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
10919
10935
  var codexCliVersionEnsured = null;
10920
- var ENGINE_PACKAGE_VERSION = "0.1.622";
10936
+ var ENGINE_PACKAGE_VERSION = "0.1.623";
10921
10937
  var INITIALIZE_METHOD = "initialize";
10922
10938
  var INITIALIZED_NOTIFICATION = "initialized";
10923
10939
  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.622",
3
+ "version": "0.1.623",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -104,5 +104,9 @@ const sentry = {
104
104
  request: (path) => request('/v1/engine/sentry/api', { method: 'POST', body: { path } }),
105
105
  };
106
106
 
107
- export const replicas = { integrations, plugins, linear, slack, github, gitlab, sentry };
107
+ const modal = {
108
+ call: (input) => request('/v1/engine/modal/call', { method: 'POST', body: input }),
109
+ };
110
+
111
+ export const replicas = { integrations, plugins, linear, slack, github, gitlab, sentry, modal };
108
112
  export default replicas;
@@ -85,6 +85,29 @@ describe('@replicas/sdk', () => {
85
85
  }
86
86
  });
87
87
 
88
+ test('invokes Modal through the workspace gateway', async () => {
89
+ let observed: { path: string; body: unknown } | null = null;
90
+ const server = Bun.serve({
91
+ port: 0,
92
+ async fetch(request) {
93
+ observed = { path: new URL(request.url).pathname, body: await request.json() };
94
+ return Response.json({ ok: true });
95
+ },
96
+ });
97
+ process.env.REPLICAS_MONOLITH_URL = server.url.toString().replace(/\/$/, '');
98
+ process.env.REPLICAS_ENGINE_SECRET = 'engine-secret';
99
+ process.env.REPLICAS_WORKSPACE_ID = 'workspace-1';
100
+ try {
101
+ await replicas.modal.call({ app: 'example', function: 'run', args: ['input'] });
102
+ expect(observed).toEqual({
103
+ path: '/v1/engine/modal/call',
104
+ body: { app: 'example', function: 'run', args: ['input'] },
105
+ });
106
+ } finally {
107
+ server.stop(true);
108
+ }
109
+ });
110
+
88
111
  test('rejects provider URLs that can escape the allowed origin', async () => {
89
112
  process.env.REPLICAS_MONOLITH_URL = 'https://api.example.com';
90
113
  process.env.REPLICAS_ENGINE_SECRET = 'engine-secret';
@@ -77,6 +77,13 @@ export declare const PLUGIN_CATALOG: readonly [{
77
77
  readonly category: "business";
78
78
  readonly name: "LinkedIn";
79
79
  readonly description: "Manage profiles, organizations, posts, and professional activity.";
80
+ }, {
81
+ readonly id: "modal";
82
+ readonly toolkit: "modal";
83
+ readonly authType: "basic";
84
+ readonly category: "data";
85
+ readonly name: "Modal";
86
+ readonly description: "Invoke deployed functions through Modal compute.";
80
87
  }, {
81
88
  readonly id: "posthog";
82
89
  readonly toolkit: "posthog";
@@ -145,7 +152,18 @@ export interface PluginConnectApiKeyRequest {
145
152
  apiKey: string;
146
153
  }
147
154
  export type PluginConnectCloudflareRequest = PluginConnectApiKeyRequest;
148
- export type PluginConnectRequest = PluginConnectPostHogRequest | PluginConnectClickHouseRequest | PluginConnectApiKeyRequest;
155
+ export interface PluginConnectModalRequest {
156
+ tokenId: string;
157
+ tokenSecret: string;
158
+ }
159
+ export type PluginConnectRequest = PluginConnectPostHogRequest | PluginConnectClickHouseRequest | PluginConnectApiKeyRequest | PluginConnectModalRequest;
160
+ export interface ModalCallRequest {
161
+ app: string;
162
+ function: string;
163
+ args?: unknown[];
164
+ kwargs?: Record<string, unknown>;
165
+ environment?: string;
166
+ }
149
167
  export interface PluginConnectResponse {
150
168
  success: true;
151
169
  }
@@ -48,4 +48,7 @@ export interface ReplicasSdk {
48
48
  sentry: {
49
49
  request<T = unknown>(path: string): Promise<T>;
50
50
  };
51
+ modal: {
52
+ call<T = unknown>(input: import('./routes/plugins').ModalCallRequest): Promise<T>;
53
+ };
51
54
  }