@ultimat3/ai 31.60.0 → 31.61.1

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.
Files changed (2) hide show
  1. package/package.json +11 -11
  2. package/src/prompt-fence.ts +5 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultimat3/ai",
3
- "version": "31.60.0",
3
+ "version": "31.61.1",
4
4
  "description": "LLM gateway, versioned prompts, evals as tests, embeddings, hybrid vector search, RAG",
5
5
  "keywords": [
6
6
  "ultimate",
@@ -45,17 +45,17 @@
45
45
  "test": "bun test"
46
46
  },
47
47
  "dependencies": {
48
- "@ultimat3/action": "31.60.0",
49
- "@ultimat3/cache": "31.60.0",
50
- "@ultimat3/core": "31.60.0",
51
- "@ultimat3/db": "31.60.0",
52
- "@ultimat3/http": "31.60.0",
53
- "@ultimat3/jobs": "31.60.0",
54
- "@ultimat3/money": "31.60.0",
55
- "@ultimat3/schema": "31.60.0",
56
- "@ultimat3/time": "31.60.0"
48
+ "@ultimat3/action": "31.61.1",
49
+ "@ultimat3/cache": "31.61.1",
50
+ "@ultimat3/core": "31.61.1",
51
+ "@ultimat3/db": "31.61.1",
52
+ "@ultimat3/http": "31.61.1",
53
+ "@ultimat3/jobs": "31.61.1",
54
+ "@ultimat3/money": "31.61.1",
55
+ "@ultimat3/schema": "31.61.1",
56
+ "@ultimat3/time": "31.61.1"
57
57
  },
58
58
  "devDependencies": {
59
- "@ultimat3/policy": "31.60.0"
59
+ "@ultimat3/policy": "31.61.1"
60
60
  }
61
61
  }
@@ -1,7 +1,7 @@
1
1
  // The data fences of a prompt template: which XML-style tag pairs enclose each `{{slot}}`, and the
2
- // neutraliser `render` applies to the prompt those values were assembled into. A fence is the template's declaration
3
- // that a slot is DATA; a value that writes the fence's own closer would end it early and speak as
4
- // the prompt (#689), so that closer is broken — never deleted, the model still reads every word.
2
+ // neutraliser `render` applies to the prompt those values were assembled into. A fence is the
3
+ // template's declaration that a slot is DATA; a value that writes the fence's own closer would end
4
+ // it early and speak as the prompt (#689), so that closer is broken, never deleted.
5
5
 
6
6
  /** `<name>` or `<name attr="…">` — a fence opener. Self-closing and closing tags are not openers. */
7
7
  const OPEN = /<([A-Za-z_][\w.-]*)(?:\s[^<>]*)?(?<!\/)>/g;
@@ -81,7 +81,8 @@ export function promptFences(template: string): Readonly<Record<string, readonly
81
81
  return out;
82
82
  }
83
83
 
84
- const escapeName = (name: string): string => name.replace(/[.-]/g, '\\$&');
84
+ // A fence name is literal data in the closer pattern: it may contain any regex metacharacter.
85
+ const escapeName = (name: string): string => name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
85
86
 
86
87
  /** Where a fenced slot's value landed in the rendered prompt: `[start, end)`. */
87
88
  export interface FencedSpan {