@tinycloud/operations 0.7.4-beta.2 → 0.7.4-beta.3

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.
@@ -6231,6 +6231,15 @@ function nodeFailure(action) {
6231
6231
  function sqlServiceFailure(error, action) {
6232
6232
  const auth = authorizationFailure(error, action);
6233
6233
  if (auth !== void 0) return auth;
6234
+ if (isRecord2(error) && error.code === "SQL_REQUEST_TOO_LARGE") {
6235
+ return {
6236
+ status: "error",
6237
+ error: operationError(
6238
+ "INPUT_INVALID",
6239
+ SQL_REQUEST_TOO_LARGE_MESSAGE
6240
+ )
6241
+ };
6242
+ }
6234
6243
  if (isRecord2(error) && error.code === "SQL_RESPONSE_TOO_LARGE") {
6235
6244
  return {
6236
6245
  status: "error",
@@ -6243,6 +6252,9 @@ function sqlServiceFailure(error, action) {
6243
6252
  return nodeFailure(action);
6244
6253
  }
6245
6254
  function sqlMutationFailure(error) {
6255
+ if (isRecord2(error) && error.code === "SQL_REQUEST_TOO_LARGE") {
6256
+ return { status: "error", error: operationError("INPUT_INVALID", SQL_REQUEST_TOO_LARGE_MESSAGE) };
6257
+ }
6246
6258
  const storageFull = storageFullOperationError(error);
6247
6259
  if (storageFull) return { status: "error", error: storageFull };
6248
6260
  return {
@@ -6272,7 +6284,7 @@ function isByte(value) {
6272
6284
  function isRecord2(value) {
6273
6285
  return typeof value === "object" && value !== null && !Array.isArray(value);
6274
6286
  }
6275
- var import_node_sql_parser, import_zod3, DEFAULT_MAX_ROWS, MAX_MAX_ROWS, DEFAULT_MAX_BYTES, MAX_MAX_BYTES, SCHEMA_MAX_ROWS, SCHEMA_MAX_BYTES, MAX_PARAMETERS, MAX_SQL_LENGTH, SQL_WRITE_AUTHORITY_NOTICE, SCHEMA_QUERY, sqlParser, SpaceSchema, DatabaseSchema, SafeNumberSchema, Base64Schema, SqlInputValueSchema, SqlParamsSchema, RequiredSqlParamsSchema, SqlOutputValueSchema, SqlTargetInputSchema, SqlQueryInputSchema, SqlExecuteInputSchema, SqlLimitsOutputSchema, SqlSchemaInspectOutputSchema, SqlQueryOutputSchema, SqlExecuteOutputSchema, AUTHENTICATED_POSTURES, SQL_EXPOSURE, SQL_SCHEMA_SENSITIVITY, SQL_QUERY_SENSITIVITY, SQL_EXECUTE_SENSITIVITY, sqlOperationDefinitions;
6287
+ var import_node_sql_parser, import_zod3, DEFAULT_MAX_ROWS, MAX_MAX_ROWS, DEFAULT_MAX_BYTES, MAX_MAX_BYTES, SCHEMA_MAX_ROWS, SCHEMA_MAX_BYTES, MAX_PARAMETERS, MAX_SQL_LENGTH, SQL_WRITE_AUTHORITY_NOTICE, SQL_REQUEST_TOO_LARGE_MESSAGE, SCHEMA_QUERY, sqlParser, SpaceSchema, DatabaseSchema, SafeNumberSchema, Base64Schema, SqlInputValueSchema, SqlParamsSchema, RequiredSqlParamsSchema, SqlOutputValueSchema, SqlTargetInputSchema, SqlQueryInputSchema, SqlExecuteInputSchema, SqlLimitsOutputSchema, SqlSchemaInspectOutputSchema, SqlQueryOutputSchema, SqlExecuteOutputSchema, AUTHENTICATED_POSTURES, SQL_EXPOSURE, SQL_SCHEMA_SENSITIVITY, SQL_QUERY_SENSITIVITY, SQL_EXECUTE_SENSITIVITY, sqlOperationDefinitions;
6276
6288
  var init_sql = __esm({
6277
6289
  "src/operations/sql.ts"() {
6278
6290
  "use strict";
@@ -6290,6 +6302,7 @@ var init_sql = __esm({
6290
6302
  MAX_PARAMETERS = 100;
6291
6303
  MAX_SQL_LENGTH = 64 * 1024;
6292
6304
  SQL_WRITE_AUTHORITY_NOTICE = "Approving tinycloud.sql/write grants full read/write/schema mutation authority over this exact database; the MCP tool itself accepts only one parameterized INSERT, UPDATE, or DELETE.";
6305
+ SQL_REQUEST_TOO_LARGE_MESSAGE = "SQL request too large.";
6293
6306
  SCHEMA_QUERY = `SELECT type, name, tbl_name, sql
6294
6307
  FROM sqlite_schema
6295
6308
  WHERE type IN ('table', 'view', 'index', 'trigger')
@@ -6723,6 +6736,7 @@ function missingSchema(error) {
6723
6736
  function copyFailure(error) {
6724
6737
  if (isObject(error) && isObject(error.meta) && error.meta.status === 409) return new OperationInvocationError(operationError("NODE_ERROR", "The fast, searchable copy is unavailable and needs the node team. Answer from the records; do not retry or ask for another approval.", { retryable: false, details: { reason: "copy_unavailable" } }));
6725
6738
  if (isObject(error) && error.code === "SQL_RESPONSE_TOO_LARGE") return new OperationInvocationError(operationError("SQL_RESULT_LIMIT_EXCEEDED", "Narrow the fast-copy query to return fewer records or fields."));
6739
+ if (isObject(error) && error.code === "SQL_REQUEST_TOO_LARGE") return new OperationInvocationError(operationError("INPUT_INVALID", "Fast-copy request too large."));
6726
6740
  return new OperationInvocationError(appsFailure(error));
6727
6741
  }
6728
6742
  async function execute(db, sql, params = []) {