@lokascript/framework 2.7.2 → 2.8.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/api/index.js +6 -2
- package/dist/api/index.js.map +1 -1
- package/dist/core/index.js +41 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/tokenization/base-tokenizer.d.ts +24 -0
- package/dist/core/tokenization/base-tokenizer.d.ts.map +1 -1
- package/dist/core/tokenization/extractors.d.ts +6 -0
- package/dist/core/tokenization/extractors.d.ts.map +1 -1
- package/dist/core/tokenization/index.js +41 -1
- package/dist/core/tokenization/index.js.map +1 -1
- package/dist/generation/index.js +2 -1
- package/dist/generation/index.js.map +1 -1
- package/dist/generation/pattern-generator.d.ts.map +1 -1
- package/dist/index.cjs +47 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +47 -3
- package/dist/index.js.map +1 -1
- package/dist/multilingual/index.js +41 -1
- package/dist/multilingual/index.js.map +1 -1
- package/dist/testing/index.js +4 -12
- package/dist/testing/index.js.map +1 -1
- package/package.json +2 -2
- package/src/core/tokenization/base-tokenizer.ts +55 -1
- package/src/core/tokenization/colon-qualifier.test.ts +129 -0
- package/src/core/tokenization/extractors.ts +6 -0
- package/src/generation/pattern-generator.ts +5 -1
- package/src/ir/protocol-json.test.ts +21 -0
- package/src/ir/references.test.ts +5 -2
- package/src/prompts/prompt-generator.ts +4 -1
package/dist/api/index.js
CHANGED
|
@@ -1372,7 +1372,8 @@ function buildFormatString(schema, profile, keyword) {
|
|
|
1372
1372
|
if (profile.wordOrder === "SVO" || profile.wordOrder === "VSO") {
|
|
1373
1373
|
parts.push(keyword);
|
|
1374
1374
|
}
|
|
1375
|
-
|
|
1375
|
+
const sortedRoles = sortRolesByWordOrder(schema.roles, profile.wordOrder);
|
|
1376
|
+
for (const role of sortedRoles) {
|
|
1376
1377
|
const marker = getMarkerForRole(role, profile);
|
|
1377
1378
|
const roleName = `{${role.role}}`;
|
|
1378
1379
|
if (marker) {
|
|
@@ -1855,7 +1856,9 @@ function buildProtocolSection() {
|
|
|
1855
1856
|
3. No spaces around the colon in role:value pairs
|
|
1856
1857
|
4. Strings with spaces must be quoted: \`patient:"hello world"\`
|
|
1857
1858
|
5. Selectors start with \`#\`, \`.\`, \`[\`, \`@\`, or \`*\`
|
|
1858
|
-
6.
|
|
1859
|
+
6. A selector containing a space, a combinator (\`>\` \`+\` \`~\`), or a comma must use a selector literal: \`patient:<ul > li/>\`, \`patient:<.a, .b/>\`
|
|
1860
|
+
7. Inside a structural role (\`body\`, \`then\`, \`else\`, \`condition\`, \`loop-body\`, \`variable\`, \`catch\`, \`finally\`) a \`[...]\` value is always a nested command. Write an attribute selector there as \`condition:<[data-active]/>\`
|
|
1861
|
+
8. Output must be valid bracket syntax: \`[action role:value ...]\``;
|
|
1859
1862
|
return {
|
|
1860
1863
|
id: "protocol",
|
|
1861
1864
|
title: "LSE Protocol",
|
|
@@ -1868,6 +1871,7 @@ function buildValueTypeSection() {
|
|
|
1868
1871
|
|
|
1869
1872
|
| Type | Syntax | Example |
|
|
1870
1873
|
|------|--------|---------|
|
|
1874
|
+
| Selector literal | Delimited by \`<\` and \`/>\` | \`<ul > li/>\`, \`<.a, .b/>\`, \`<[data-id]/>\` |
|
|
1871
1875
|
| Selector | Starts with \`#\` \`.\` \`[\` \`@\` \`*\` | \`#button\`, \`.active\`, \`[data-id]\` |
|
|
1872
1876
|
| String | Quoted with \`"\` or \`'\` | \`"hello world"\`, \`'json'\` |
|
|
1873
1877
|
| Boolean | Exact: \`true\` / \`false\` | \`visible:true\` |
|