@axiom-lattice/core 13.2.0 → 13.3.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/dist/index.d.mts CHANGED
@@ -948,6 +948,8 @@ interface DatabaseConfig {
948
948
  password?: string;
949
949
  connectionString?: string;
950
950
  ssl?: boolean;
951
+ /** Verify the database server certificate when SSL is enabled (default: true). */
952
+ sslRejectUnauthorized?: boolean;
951
953
  }
952
954
  /**
953
955
  * Table information
@@ -9834,7 +9836,7 @@ declare const getSandBoxManager: (key?: string) => SandboxManagerProtocol;
9834
9836
  * Every consumer that reads or writes tenant-level sandbox data (skills,
9835
9837
  * plugins, knowledge, SDK bundles, the plugin host) derives its path from
9836
9838
  * these values instead of hardcoding `/root/.agents`. New deployments default
9837
- * to the non-root runtime (`/home/appuser`, image `0.2.0`). Old root deployments
9839
+ * to the non-root runtime (`/home/appuser`, image `0.2.1`). Old root deployments
9838
9840
  * opt out with `SANDBOX_RUNTIME_PROFILE=legacy-root` (or a legacy
9839
9841
  * `SANDBOX_HOME=/root` / `0.1.0` image for backward compatibility).
9840
9842
  *
@@ -9845,7 +9847,7 @@ declare const getSandBoxManager: (key?: string) => SandboxManagerProtocol;
9845
9847
  * process user's home, not the sandbox user's home.
9846
9848
  */
9847
9849
  /** Non-root default sandbox image. */
9848
- declare const NONROOT_SANDBOX_IMAGE = "kioko12520/sandbox:0.2.0";
9850
+ declare const NONROOT_SANDBOX_IMAGE = "kioko12520/sandbox:0.2.1";
9849
9851
  /** Legacy root sandbox image. */
9850
9852
  declare const LEGACY_ROOT_SANDBOX_IMAGE = "kioko12520/sandbox:0.1.0";
9851
9853
  /** Supported sandbox runtime profiles. */
@@ -9864,7 +9866,7 @@ interface ResolvedSandboxRuntime {
9864
9866
  *
9865
9867
  * `SANDBOX_RUNTIME_PROFILE` is the single recommended switch:
9866
9868
  *
9867
- * - omitted or `nonroot`: `/home/appuser`, image `0.2.0`
9869
+ * - omitted or `nonroot`: `/home/appuser`, image `0.2.1`
9868
9870
  * - `legacy-root`: `/root`, image `0.1.0`
9869
9871
  *
9870
9872
  * For backward compatibility, an explicit `SANDBOX_HOME=/root` or pinning the
package/dist/index.d.ts CHANGED
@@ -948,6 +948,8 @@ interface DatabaseConfig {
948
948
  password?: string;
949
949
  connectionString?: string;
950
950
  ssl?: boolean;
951
+ /** Verify the database server certificate when SSL is enabled (default: true). */
952
+ sslRejectUnauthorized?: boolean;
951
953
  }
952
954
  /**
953
955
  * Table information
@@ -9834,7 +9836,7 @@ declare const getSandBoxManager: (key?: string) => SandboxManagerProtocol;
9834
9836
  * Every consumer that reads or writes tenant-level sandbox data (skills,
9835
9837
  * plugins, knowledge, SDK bundles, the plugin host) derives its path from
9836
9838
  * these values instead of hardcoding `/root/.agents`. New deployments default
9837
- * to the non-root runtime (`/home/appuser`, image `0.2.0`). Old root deployments
9839
+ * to the non-root runtime (`/home/appuser`, image `0.2.1`). Old root deployments
9838
9840
  * opt out with `SANDBOX_RUNTIME_PROFILE=legacy-root` (or a legacy
9839
9841
  * `SANDBOX_HOME=/root` / `0.1.0` image for backward compatibility).
9840
9842
  *
@@ -9845,7 +9847,7 @@ declare const getSandBoxManager: (key?: string) => SandboxManagerProtocol;
9845
9847
  * process user's home, not the sandbox user's home.
9846
9848
  */
9847
9849
  /** Non-root default sandbox image. */
9848
- declare const NONROOT_SANDBOX_IMAGE = "kioko12520/sandbox:0.2.0";
9850
+ declare const NONROOT_SANDBOX_IMAGE = "kioko12520/sandbox:0.2.1";
9849
9851
  /** Legacy root sandbox image. */
9850
9852
  declare const LEGACY_ROOT_SANDBOX_IMAGE = "kioko12520/sandbox:0.1.0";
9851
9853
  /** Supported sandbox runtime profiles. */
@@ -9864,7 +9866,7 @@ interface ResolvedSandboxRuntime {
9864
9866
  *
9865
9867
  * `SANDBOX_RUNTIME_PROFILE` is the single recommended switch:
9866
9868
  *
9867
- * - omitted or `nonroot`: `/home/appuser`, image `0.2.0`
9869
+ * - omitted or `nonroot`: `/home/appuser`, image `0.2.1`
9868
9870
  * - `legacy-root`: `/root`, image `0.1.0`
9869
9871
  *
9870
9872
  * For backward compatibility, an explicit `SANDBOX_HOME=/root` or pinning the
package/dist/index.js CHANGED
@@ -5686,6 +5686,7 @@ var import_crypto4 = require("crypto");
5686
5686
  var ALGORITHM = "aes-256-gcm";
5687
5687
  var IV_LENGTH = 16;
5688
5688
  var SALT_LENGTH = 32;
5689
+ var AUTH_TAG_LENGTH = 16;
5689
5690
  var ITERATIONS = 1e5;
5690
5691
  var DEFAULT_ENCRYPTION_KEY = "lattice-default-encryption-key-dev-only-32b!";
5691
5692
  var cachedKey = null;
@@ -5707,7 +5708,7 @@ function encrypt(plaintext, key6) {
5707
5708
  const salt = (0, import_crypto4.randomBytes)(SALT_LENGTH);
5708
5709
  const iv = (0, import_crypto4.randomBytes)(IV_LENGTH);
5709
5710
  const derivedKey = (0, import_crypto4.pbkdf2Sync)(actualKey, salt, ITERATIONS, 32, "sha256");
5710
- const cipher = (0, import_crypto4.createCipheriv)(ALGORITHM, derivedKey, iv);
5711
+ const cipher = (0, import_crypto4.createCipheriv)(ALGORITHM, derivedKey, iv, { authTagLength: AUTH_TAG_LENGTH });
5711
5712
  const encrypted = Buffer.concat([cipher.update(plaintext, "utf8"), cipher.final()]);
5712
5713
  const authTag = cipher.getAuthTag();
5713
5714
  return Buffer.concat([salt, iv, encrypted, authTag]).toString("base64");
@@ -5717,10 +5718,10 @@ function decrypt(encrypted, key6) {
5717
5718
  const data = Buffer.from(encrypted, "base64");
5718
5719
  const salt = data.subarray(0, SALT_LENGTH);
5719
5720
  const iv = data.subarray(SALT_LENGTH, SALT_LENGTH + IV_LENGTH);
5720
- const authTag = data.subarray(-16);
5721
- const ciphertext = data.subarray(SALT_LENGTH + IV_LENGTH, -16);
5721
+ const authTag = data.subarray(-AUTH_TAG_LENGTH);
5722
+ const ciphertext = data.subarray(SALT_LENGTH + IV_LENGTH, -AUTH_TAG_LENGTH);
5722
5723
  const derivedKey = (0, import_crypto4.pbkdf2Sync)(actualKey, salt, ITERATIONS, 32, "sha256");
5723
- const decipher = (0, import_crypto4.createDecipheriv)(ALGORITHM, derivedKey, iv);
5724
+ const decipher = (0, import_crypto4.createDecipheriv)(ALGORITHM, derivedKey, iv, { authTagLength: AUTH_TAG_LENGTH });
5724
5725
  decipher.setAuthTag(authTag);
5725
5726
  return Buffer.concat([decipher.update(ciphertext), decipher.final()]).toString("utf8");
5726
5727
  }
@@ -9821,7 +9822,7 @@ function serializePluginMeta(plugin) {
9821
9822
  }
9822
9823
 
9823
9824
  // src/sandbox_lattice/sandboxPaths.ts
9824
- var NONROOT_SANDBOX_IMAGE = "kioko12520/sandbox:0.2.0";
9825
+ var NONROOT_SANDBOX_IMAGE = "kioko12520/sandbox:0.2.1";
9825
9826
  var LEGACY_ROOT_SANDBOX_IMAGE = "kioko12520/sandbox:0.1.0";
9826
9827
  function normalizeSandboxHome(value) {
9827
9828
  const trimmed = value.trim();
@@ -17126,6 +17127,60 @@ function failure(error) {
17126
17127
  return JSON.stringify({ success: false, error });
17127
17128
  }
17128
17129
 
17130
+ // src/capability/CapabilityRuntimeAccessor.ts
17131
+ function getRuntimeCapabilityConfig(executionConfig, capabilityType) {
17132
+ return readRecordProperty(getRuntimeCapabilityPolicy(executionConfig, capabilityType), "config");
17133
+ }
17134
+ function hasRuntimeCapabilityPolicy(executionConfig, capabilityType) {
17135
+ return getRuntimeCapabilityPolicy(executionConfig, capabilityType) !== void 0;
17136
+ }
17137
+ function getRuntimeCapabilityPolicy(executionConfig, capabilityType) {
17138
+ const configurable = readRecordProperty(executionConfig, "configurable");
17139
+ const context = readRecordProperty(executionConfig, "context");
17140
+ const runConfig = readRecordProperty(configurable, "runConfig") ?? readRecordProperty(context, "runConfig");
17141
+ const runtime = readRecordProperty(runConfig, "capabilityRuntime");
17142
+ const middleware = readRecordProperty(runtime, "middleware");
17143
+ return readRecordProperty(middleware, capabilityType);
17144
+ }
17145
+ function getRuntimeSkillSelection(executionConfig) {
17146
+ const policy = getRuntimeCapabilityPolicy(executionConfig, "skill");
17147
+ if (!policy) return { hasPolicy: false, enabled: true, readAll: false };
17148
+ const config = readRecordProperty(policy, "config") ?? {};
17149
+ const skills = config.skills;
17150
+ return {
17151
+ hasPolicy: true,
17152
+ enabled: policy.enabled !== false,
17153
+ ...Array.isArray(skills) && skills.every((skill) => typeof skill === "string") ? { skills: [...skills] } : {},
17154
+ readAll: config.readAll === true
17155
+ };
17156
+ }
17157
+ function readRecordProperty(value, property) {
17158
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
17159
+ const propertyValue = value[property];
17160
+ return typeof propertyValue === "object" && propertyValue !== null && !Array.isArray(propertyValue) ? propertyValue : void 0;
17161
+ }
17162
+
17163
+ // src/tool_lattice/sql/utils.ts
17164
+ function getEffectiveDatabaseKeys(exeConfig, staticDatabaseKeys) {
17165
+ const runtimeConfig = getRuntimeCapabilityConfig(exeConfig, "sql");
17166
+ if (runtimeConfig && Object.prototype.hasOwnProperty.call(runtimeConfig, "databaseKeys")) {
17167
+ const databaseKeys = runtimeConfig.databaseKeys;
17168
+ if (Array.isArray(databaseKeys) && databaseKeys.every((key6) => typeof key6 === "string")) {
17169
+ return databaseKeys;
17170
+ }
17171
+ return [];
17172
+ }
17173
+ return staticDatabaseKeys;
17174
+ }
17175
+ function getTenantIdFromConfig(exeConfig, getTenantId3) {
17176
+ const runConfig = exeConfig?.configurable?.runConfig || {};
17177
+ return runConfig.tenantId || (getTenantId3 ? getTenantId3() : "default");
17178
+ }
17179
+ function buildSslConfig(ssl, rejectUnauthorized) {
17180
+ if (!ssl) return void 0;
17181
+ return { rejectUnauthorized: rejectUnauthorized !== false };
17182
+ }
17183
+
17129
17184
  // src/tool_lattice/sql/SqlDatabaseManager.ts
17130
17185
  function splitQualifiedTableName(qualifiedName) {
17131
17186
  const parts = [];
@@ -17179,7 +17234,7 @@ var PostgresDatabase = class {
17179
17234
  database: this.config.database,
17180
17235
  user: this.config.user,
17181
17236
  password: this.config.password,
17182
- ssl: this.config.ssl ? { rejectUnauthorized: false } : void 0
17237
+ ssl: buildSslConfig(this.config.ssl, this.config.sslRejectUnauthorized)
17183
17238
  };
17184
17239
  this.pool = new Pool(poolConfig);
17185
17240
  const client = await this.pool.connect();
@@ -17339,7 +17394,7 @@ var MysqlDatabase = class {
17339
17394
  database: this.config.database,
17340
17395
  user: this.config.user,
17341
17396
  password: this.config.password,
17342
- ssl: this.config.ssl ? { rejectUnauthorized: false } : void 0
17397
+ ssl: buildSslConfig(this.config.ssl, this.config.sslRejectUnauthorized)
17343
17398
  };
17344
17399
  this.pool = mysql.createPool({
17345
17400
  ...poolConfig,
@@ -17703,58 +17758,6 @@ var sqlDatabaseManager = SqlDatabaseManager.getInstance();
17703
17758
  // src/tool_lattice/sql/list_tables_sql.ts
17704
17759
  var import_zod4 = __toESM(require("zod"));
17705
17760
  var import_langchain = require("langchain");
17706
-
17707
- // src/capability/CapabilityRuntimeAccessor.ts
17708
- function getRuntimeCapabilityConfig(executionConfig, capabilityType) {
17709
- return readRecordProperty(getRuntimeCapabilityPolicy(executionConfig, capabilityType), "config");
17710
- }
17711
- function hasRuntimeCapabilityPolicy(executionConfig, capabilityType) {
17712
- return getRuntimeCapabilityPolicy(executionConfig, capabilityType) !== void 0;
17713
- }
17714
- function getRuntimeCapabilityPolicy(executionConfig, capabilityType) {
17715
- const configurable = readRecordProperty(executionConfig, "configurable");
17716
- const context = readRecordProperty(executionConfig, "context");
17717
- const runConfig = readRecordProperty(configurable, "runConfig") ?? readRecordProperty(context, "runConfig");
17718
- const runtime = readRecordProperty(runConfig, "capabilityRuntime");
17719
- const middleware = readRecordProperty(runtime, "middleware");
17720
- return readRecordProperty(middleware, capabilityType);
17721
- }
17722
- function getRuntimeSkillSelection(executionConfig) {
17723
- const policy = getRuntimeCapabilityPolicy(executionConfig, "skill");
17724
- if (!policy) return { hasPolicy: false, enabled: true, readAll: false };
17725
- const config = readRecordProperty(policy, "config") ?? {};
17726
- const skills = config.skills;
17727
- return {
17728
- hasPolicy: true,
17729
- enabled: policy.enabled !== false,
17730
- ...Array.isArray(skills) && skills.every((skill) => typeof skill === "string") ? { skills: [...skills] } : {},
17731
- readAll: config.readAll === true
17732
- };
17733
- }
17734
- function readRecordProperty(value, property) {
17735
- if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
17736
- const propertyValue = value[property];
17737
- return typeof propertyValue === "object" && propertyValue !== null && !Array.isArray(propertyValue) ? propertyValue : void 0;
17738
- }
17739
-
17740
- // src/tool_lattice/sql/utils.ts
17741
- function getEffectiveDatabaseKeys(exeConfig, staticDatabaseKeys) {
17742
- const runtimeConfig = getRuntimeCapabilityConfig(exeConfig, "sql");
17743
- if (runtimeConfig && Object.prototype.hasOwnProperty.call(runtimeConfig, "databaseKeys")) {
17744
- const databaseKeys = runtimeConfig.databaseKeys;
17745
- if (Array.isArray(databaseKeys) && databaseKeys.every((key6) => typeof key6 === "string")) {
17746
- return databaseKeys;
17747
- }
17748
- return [];
17749
- }
17750
- return staticDatabaseKeys;
17751
- }
17752
- function getTenantIdFromConfig(exeConfig, getTenantId3) {
17753
- const runConfig = exeConfig?.configurable?.runConfig || {};
17754
- return runConfig.tenantId || (getTenantId3 ? getTenantId3() : "default");
17755
- }
17756
-
17757
- // src/tool_lattice/sql/list_tables_sql.ts
17758
17761
  var LIST_TABLES_SQL_DESCRIPTION = `List all tables in the connected SQL database. Returns a comma-separated list of table names. Use this tool first to understand what tables are available before querying the database.`;
17759
17762
  var SIMPLE_IDENTIFIER = /^[a-z_][a-z0-9_]*$/;
17760
17763
  function formatIdentifier(identifier) {