aiex-cli 0.1.1-beta.4 → 0.1.1-beta.6

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.
@@ -1 +1 @@
1
- import{ft as e}from"./vue-i18n-Du42D0vb.js";var t={$schema:`http://json-schema.org/draft-07/schema#`,$id:`https://raw.githubusercontent.com/OSpoon/aiex-cli/main/app/cli/schemas/table-schema.json`,title:`aiex Table Schema`,description:`Defines an AIEX Drizzle-backed schema dialect file for schema-to-SQLite migration.`,type:`object`,required:[`title`,`type`,`table`,`properties`],additionalProperties:!1,properties:{$schema:{type:`string`,description:`Pointer to this schema file for IDE validation.`,format:`uri`,default:`https://raw.githubusercontent.com/OSpoon/aiex-cli/main/app/cli/schemas/table-schema.json`},title:{type:`string`,minLength:1,description:`Human-readable table title (e.g. 'User', 'OrderItem').`},description:{type:`string`,description:`Optional table description.`},type:{type:`string`,const:`object`,description:`Must be 'object' — each file defines one table.`},table:{$ref:`#/$defs/tableConfig`,description:`Table-level configuration.`},properties:{$ref:`#/$defs/properties`,description:`Column definitions keyed by property name (camelCase).`},required:{type:`array`,items:{type:`string`},description:`List of property names that are NOT NULL.`,default:[]},examples:{type:`array`,description:`Few-shot examples used by AI extraction prompts.`,items:{$ref:`#/$defs/examplePair`},default:[]}},$defs:{tableConfig:{type:`object`,required:[`name`],additionalProperties:!1,properties:{name:{type:`string`,minLength:1,pattern:`^[a-z][a-z0-9_]*$`,description:`SQLite table name in snake_case (lowercase letters, digits, underscores).`,examples:[`users`,`order_items`,`blog_posts`]},timestamps:{type:`boolean`,default:!1,description:`Automatically add created_at and updated_at TIMESTAMP columns.`},softDelete:{type:`boolean`,default:!1,description:`Automatically add deleted_at nullable TIMESTAMP column.`}}},properties:{type:`object`,minProperties:1,propertyNames:{type:`string`,pattern:`^[A-Za-z][A-Za-z0-9_]*$`},additionalProperties:{$ref:`#/$defs/property`},description:`Column definitions. Keys must start with a letter and contain only letters, digits, or underscores.`},property:{type:`object`,required:[`type`],additionalProperties:!1,properties:{description:{type:`string`,description:`Description of the column.`},type:{$ref:`#/$defs/columnType`,description:`Column data type.`},format:{$ref:`#/$defs/formatType`,description:`Semantic format hint that influences the SQLite column type.`},primary:{type:`boolean`,default:!1,description:`Mark this column as PRIMARY KEY. Only one per table.`},autoIncrement:{type:`boolean`,default:!1,description:`AUTO_INCREMENT for integer primary keys.`},unique:{type:`boolean`,default:!1,description:`Add UNIQUE constraint.`},default:{description:`Default value for the column. Type should match the column type.`},pattern:{type:`string`,description:`Regular expression guidance for extraction and validation. Not emitted as a SQLite constraint because SQLite has no portable built-in REGEXP support.`},enum:{type:`array`,items:{oneOf:[{type:`string`},{type:`number`}]},description:`Enumeration of allowed values for this field. Emitted as a SQLite CHECK constraint.`},examples:{type:`array`,description:`Example values for this field (injected into AI prompt).`,items:{}},xPrompt:{type:`string`,description:`Custom extraction instruction for this field, overrides the default AI prompt (prefixed with 'x-' to stay valid JSON Schema).`},minLength:{type:`integer`,minimum:0,description:`Minimum string length. Emitted as a SQLite CHECK constraint.`},maxLength:{type:`integer`,minimum:1,description:`Maximum string length. Emitted as a SQLite CHECK constraint.`},minimum:{type:`number`,description:`Minimum numeric value. Emitted as a SQLite CHECK constraint.`},maximum:{type:`number`,description:`Maximum numeric value. Emitted as a SQLite CHECK constraint.`},drizzle:{$ref:`#/$defs/drizzleConfig`,description:`Drizzle ORM specific overrides.`},nested:{$ref:`#/$defs/nestedConfig`,description:`Create a separate related table instead of embedding as JSON.`},foreignKey:{$ref:`#/$defs/foreignKeyRef`,description:`Foreign key reference to another table.`},properties:{$ref:`#/$defs/properties`,description:`Sub-properties when type is 'object'. Ignored unless nested.enabled or drizzle.mode='json'.`},items:{$ref:`#/$defs/property`,description:`Item schema when type is 'array'. Ignored unless items.nested.enabled.`},required:{type:`array`,items:{type:`string`},description:`Required sub-properties for nested objects.`}}},columnType:{type:`string`,enum:[`string`,`integer`,`number`,`boolean`,`object`,`array`,`null`],description:`Data type. Maps to SQLite as: string→TEXT, integer→INTEGER, number→REAL, boolean→INTEGER(boolean), object→TEXT(json), array→TEXT(json), null→TEXT.`},formatType:{type:`string`,enum:[`date-time`,`email`,`uri`,`json`],description:`Format hints: 'date-time' → INTEGER(timestamp), 'json' → TEXT(json), 'email'/'uri' → TEXT (no special mapping).`},drizzleConfig:{type:`object`,additionalProperties:!1,properties:{mode:{type:`string`,enum:[`json`,`timestamp`,`timestamp_ms`,`boolean`,`bigint`],description:`Override Drizzle column mode. 'json' stores as TEXT(json), 'timestamp'/'timestamp_ms' as INTEGER, 'boolean' as INTEGER(boolean), 'bigint' as INTEGER(bigint).`}}},examplePair:{type:`object`,required:[`text`,`output`],additionalProperties:!1,properties:{text:{type:`string`,minLength:1,description:`Source text example.`},output:{type:`object`,description:`Expected extracted output for the source text example.`}}},nestedConfig:{type:`object`,required:[`enabled`,`relation`],additionalProperties:!1,properties:{enabled:{type:`boolean`,const:!0,description:`Must be true to activate nested table creation.`},relation:{type:`string`,enum:[`has-one`,`has-many`],description:`'has-one' → one() relation, 'has-many' → many() relation. Only one level of nesting is supported.`}}},foreignKeyRef:{type:`object`,required:[`table`,`column`],additionalProperties:!1,properties:{table:{type:`string`,minLength:1,description:`Target table name (snake_case).`},column:{type:`string`,minLength:1,description:`Target column name in the referenced table.`}}}}},n=Object.prototype.hasOwnProperty;function r(e,t,n){for(n of e.keys())if(i(n,t))return n}function i(e,t){var a,o,s;if(e===t)return!0;if(e&&t&&(a=e.constructor)===t.constructor){if(a===Date)return e.getTime()===t.getTime();if(a===RegExp)return e.toString()===t.toString();if(a===Array){if((o=e.length)===t.length)for(;o--&&i(e[o],t[o]););return o===-1}if(a===Set){if(e.size!==t.size)return!1;for(o of e)if(s=o,s&&typeof s==`object`&&(s=r(t,s),!s)||!t.has(s))return!1;return!0}if(a===Map){if(e.size!==t.size)return!1;for(o of e)if(s=o[0],s&&typeof s==`object`&&(s=r(t,s),!s)||!i(o[1],t.get(s)))return!1;return!0}if(a===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(a===DataView){if((o=e.byteLength)===t.byteLength)for(;o--&&e.getInt8(o)===t.getInt8(o););return o===-1}if(ArrayBuffer.isView(e)){if((o=e.byteLength)===t.byteLength)for(;o--&&e[o]===t[o];);return o===-1}if(!a||typeof e==`object`){for(a in o=0,e)if(n.call(e,a)&&++o&&!n.call(t,a)||!(a in t)||!i(e[a],t[a]))return!1;return Object.keys(t).length===o}}return e!==e&&t!==t}function a(t){let n=e(t);try{return structuredClone(n)}catch{return JSON.parse(JSON.stringify(n))}}function o(e,t){return i(e,t)}export{o as n,t as r,a as t};
1
+ import{ft as e}from"./vue-i18n-Du42D0vb.js";var t={$schema:`http://json-schema.org/draft-07/schema#`,$id:`https://raw.githubusercontent.com/OSpoon/aiex-cli/main/app/cli/schemas/table-schema.json`,title:`aiex Table Schema`,description:`Defines an AIEX Drizzle-backed schema dialect file for schema-to-SQLite migration.`,type:`object`,required:[`title`,`type`,`table`,`properties`],additionalProperties:!1,properties:{$schema:{type:`string`,description:`Pointer to this schema file for IDE validation.`,format:`uri`,default:`https://raw.githubusercontent.com/OSpoon/aiex-cli/main/app/cli/schemas/table-schema.json`},title:{type:`string`,minLength:1,description:`Human-readable table title (e.g. 'User', 'OrderItem').`},description:{type:`string`,description:`Optional table description.`},type:{type:`string`,const:`object`,description:`Must be 'object' — each file defines one table.`},table:{$ref:`#/$defs/tableConfig`,description:`Table-level configuration.`},properties:{$ref:`#/$defs/properties`,description:`Column definitions keyed by property name (camelCase).`},required:{type:`array`,items:{type:`string`},description:`List of property names that are NOT NULL.`,default:[]},examples:{type:`array`,description:`Few-shot examples used by AI extraction prompts.`,items:{$ref:`#/$defs/examplePair`},default:[]}},$defs:{tableConfig:{type:`object`,required:[`name`],additionalProperties:!1,properties:{name:{type:`string`,minLength:1,pattern:`^[a-z][a-z0-9_]*$`,description:`SQLite table name in snake_case (lowercase letters, digits, underscores).`,examples:[`users`,`order_items`,`blog_posts`]},timestamps:{type:`boolean`,default:!1,description:`Automatically add created_at and updated_at TIMESTAMP columns.`},softDelete:{type:`boolean`,default:!1,description:`Automatically add deleted_at nullable TIMESTAMP column.`}}},properties:{type:`object`,minProperties:1,propertyNames:{type:`string`,pattern:`^[A-Za-z][A-Za-z0-9_]*$`},additionalProperties:{$ref:`#/$defs/property`},description:`Column definitions. Keys must start with a letter and contain only letters, digits, or underscores.`},property:{type:`object`,required:[`type`],additionalProperties:!1,properties:{description:{type:`string`,description:`Description of the column.`},type:{$ref:`#/$defs/columnType`,description:`Column data type.`},format:{$ref:`#/$defs/formatType`,description:`Semantic format hint that influences the SQLite column type.`},primary:{type:`boolean`,default:!1,description:`Mark this column as PRIMARY KEY. Only one per table.`},autoIncrement:{type:`boolean`,default:!1,description:`AUTO_INCREMENT for integer primary keys.`},unique:{type:`boolean`,default:!1,description:`Add UNIQUE constraint.`},default:{description:`Default value for the column. Type should match the column type.`},pattern:{type:`string`,description:`Regular expression guidance for extraction and validation. Not emitted as a SQLite constraint because SQLite has no portable built-in REGEXP support.`},enum:{type:`array`,items:{oneOf:[{type:`string`},{type:`number`}]},description:`Enumeration of allowed values for this field. Emitted as a SQLite CHECK constraint.`},examples:{type:`array`,description:`Example values for this field (injected into AI prompt).`,items:{}},xPrompt:{type:`string`,description:`Custom extraction instruction for this field, overrides the default AI prompt (prefixed with 'x-' to stay valid JSON Schema).`},minLength:{type:`integer`,minimum:0,description:`Minimum string length. Emitted as a SQLite CHECK constraint.`},maxLength:{type:`integer`,minimum:1,description:`Maximum string length. Emitted as a SQLite CHECK constraint.`},minimum:{type:`number`,description:`Minimum numeric value. Emitted as a SQLite CHECK constraint.`},maximum:{type:`number`,description:`Maximum numeric value. Emitted as a SQLite CHECK constraint.`},drizzle:{$ref:`#/$defs/drizzleConfig`,description:`Drizzle ORM specific overrides.`},nested:{$ref:`#/$defs/nestedConfig`,description:`Create a separate related table instead of embedding as JSON.`},foreignKey:{$ref:`#/$defs/foreignKeyRef`,description:`Foreign key reference to another table.`},properties:{$ref:`#/$defs/properties`,description:`Sub-properties when type is 'object'. Ignored unless nested.enabled or drizzle.mode='json'.`},items:{$ref:`#/$defs/property`,description:`Item schema when type is 'array'. Ignored unless items.nested.enabled.`},required:{type:`array`,items:{type:`string`},description:`Required sub-properties for nested objects.`}}},columnType:{type:`string`,enum:[`string`,`integer`,`number`,`boolean`,`object`,`array`,`null`],description:`Data type. Maps to SQLite as: string→TEXT, integer→INTEGER, number→REAL, boolean→INTEGER(boolean), object→TEXT(json), array→TEXT(json), null→TEXT.`},formatType:{type:`string`,enum:[`date-time`,`email`,`uri`,`json`],description:`Format hints: 'date-time' → INTEGER(timestamp), 'json' → TEXT(json), 'email'/'uri' → TEXT (no special mapping).`},drizzleConfig:{type:`object`,additionalProperties:!1,properties:{mode:{type:`string`,enum:[`json`,`timestamp`,`timestamp_ms`,`boolean`,`bigint`],description:`Override Drizzle column mode. 'json' stores as TEXT(json), 'timestamp'/'timestamp_ms' as INTEGER, 'boolean' as INTEGER(boolean), 'bigint' as INTEGER(bigint).`}}},examplePair:{type:`object`,required:[`text`,`output`],additionalProperties:!1,properties:{text:{type:`string`,minLength:1,description:`Source text example.`},output:{type:`object`,description:`Expected extracted output for the source text example.`}}},nestedConfig:{type:`object`,required:[`enabled`,`relation`],additionalProperties:!1,properties:{enabled:{type:`boolean`,const:!0,description:`Must be true to activate nested table creation.`},relation:{type:`string`,enum:[`has-one`,`has-many`],description:`'has-one' → one() relation, 'has-many' → many() relation. Only one level of nesting is supported.`}}},foreignKeyRef:{type:`object`,required:[`table`,`column`],additionalProperties:!1,properties:{table:{type:`string`,minLength:1,description:`Target table name (snake_case).`},column:{type:`string`,minLength:1,description:`Target column name in the referenced table.`}}}}},n=Object.prototype.hasOwnProperty;function r(e,t,n){for(n of e.keys())if(i(n,t))return n}function i(e,t){var a,o,s;if(e===t)return!0;if(e&&t&&(a=e.constructor)===t.constructor){if(a===Date)return e.getTime()===t.getTime();if(a===RegExp)return e.toString()===t.toString();if(a===Array){if((o=e.length)===t.length)for(;o--&&i(e[o],t[o]););return o===-1}if(a===Set){if(e.size!==t.size)return!1;for(o of e)if(s=o,s&&typeof s==`object`&&(s=r(t,s),!s)||!t.has(s))return!1;return!0}if(a===Map){if(e.size!==t.size)return!1;for(o of e)if(s=o[0],s&&typeof s==`object`&&(s=r(t,s),!s)||!i(o[1],t.get(s)))return!1;return!0}if(a===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(a===DataView){if((o=e.byteLength)===t.byteLength)for(;o--&&e.getInt8(o)===t.getInt8(o););return o===-1}if(ArrayBuffer.isView(e)){if((o=e.byteLength)===t.byteLength)for(;o--&&e[o]===t[o];);return o===-1}if(!a||typeof e==`object`){for(a in o=0,e)if(n.call(e,a)&&++o&&!n.call(t,a)||!(a in t)||!i(e[a],t[a]))return!1;return Object.keys(t).length===o}}return e!==e&&t!==t}function a(t){let n=e(t);try{return structuredClone(n)}catch{return JSON.parse(JSON.stringify(n))}}function o(e,t){return i(e,t)}function s(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function c(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,`$1_$2`).replace(/[^a-z0-9]+/gi,`_`).replace(/^_+|_+$/g,``).replace(/_+/g,`_`).toLowerCase().replace(/^[^a-z]+/,``)}function l(e){if(!s(e))return e;let t=a(e),n=t.title?.trim()??``;return t.title=n,t.table={...t.table,name:c(n)},t}export{t as a,o as i,l as n,a as r,c as t};
@@ -16,15 +16,15 @@
16
16
  if (dark) document.documentElement.classList.add("jscb-dark")
17
17
  })()
18
18
  </script>
19
- <script type="module" crossorigin src="/assets/index-CaO28Qd9.js"></script>
19
+ <script type="module" crossorigin src="/assets/index-CuCVFoOf.js"></script>
20
20
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-DWTEM3RW.js">
21
21
  <link rel="modulepreload" crossorigin href="/assets/chunk-DtRyYLXJ.js">
22
22
  <link rel="modulepreload" crossorigin href="/assets/vue-i18n-Du42D0vb.js">
23
- <link rel="modulepreload" crossorigin href="/assets/object-utils-DsuRi0p9.js">
23
+ <link rel="modulepreload" crossorigin href="/assets/schemaNaming-COq_SZOU.js">
24
24
  <link rel="modulepreload" crossorigin href="/assets/api-client-CpqFbcyH.js">
25
25
  <link rel="modulepreload" crossorigin href="/assets/dialog-CnZ7jH1l.js">
26
26
  <link rel="modulepreload" crossorigin href="/assets/dist-CElVIpns.js">
27
- <link rel="stylesheet" crossorigin href="/assets/index-BPjoJ1T3.css">
27
+ <link rel="stylesheet" crossorigin href="/assets/index-C2XZlABi.css">
28
28
  </head>
29
29
  <body>
30
30
  <div id="app"></div>
@@ -401,19 +401,6 @@ const zhCN = {
401
401
  },
402
402
  ocrFallbackOptions: { localAuto: "视觉模型或本地 OCR" }
403
403
  },
404
- prompt: {
405
- defaultSystem: `你是一个专业的数据抽取助手。你的任务是从文本中抽取结构化数据,并基于下方提供的数据结构定义返回 JSON 对象。
406
-
407
- {schema}
408
-
409
- 抽取要求:
410
- 1. 严格按照结构中定义的字段名称和类型抽取数据
411
- 2. 如果文本中缺少某个字段的信息,将该字段设为 null
412
- 3. 不要添加结构定义之外的字段
413
- 4. 保持数据准确性和完整性`,
414
- defaultUser: `请从以下文本中抽取数据:
415
- {text}`
416
- },
417
404
  fields: {
418
405
  config: "字段配置",
419
406
  fewShotExamples: "少样本示例",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aiex-cli",
3
3
  "type": "module",
4
- "version": "0.1.1-beta.4",
4
+ "version": "0.1.1-beta.6",
5
5
  "description": "JSON Schema → SQLite with AI-powered data extraction",
6
6
  "author": "OSpoon <zxin088@gmail.com>",
7
7
  "license": "MIT",