@layer-ai/core 0.5.10 → 0.5.12

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.
@@ -31,7 +31,7 @@ router.get('/', async (req, res) => {
31
31
  `;
32
32
  const params = [userId];
33
33
  if (gate) {
34
- query += ` AND gate_name = $2`;
34
+ query += ` AND gate_id = $2`;
35
35
  params.push(gate);
36
36
  }
37
37
  query += ` ORDER BY created_at DESC LIMIT $${params.length + 1} OFFSET $${params.length + 2}`;
@@ -1 +1 @@
1
- {"version":3,"file":"task-analysis.d.ts","sourceRoot":"","sources":["../../src/services/task-analysis.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,YAAY,EAAmC,MAAM,eAAe,CAAC;AAqD9F,wBAAsB,WAAW,CAC/B,WAAW,EAAE,MAAM,EACnB,eAAe,CAAC,EAAE;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GACA,OAAO,CAAC,YAAY,CAAC,CAqGvB"}
1
+ {"version":3,"file":"task-analysis.d.ts","sourceRoot":"","sources":["../../src/services/task-analysis.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,YAAY,EAAmC,MAAM,eAAe,CAAC;AAqD9F,wBAAsB,WAAW,CAC/B,WAAW,EAAE,MAAM,EACnB,eAAe,CAAC,EAAE;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GACA,OAAO,CAAC,YAAY,CAAC,CA6GvB"}
@@ -115,9 +115,15 @@ Return JSON with:
115
115
  throw new Error('Unexpected response type from Claude');
116
116
  }
117
117
  let jsonText = responseContent.text.trim();
118
+ // Extract JSON from code blocks
118
119
  if (jsonText.startsWith('```')) {
119
120
  jsonText = jsonText.replace(/^```(?:json)?\n?/, '').replace(/\n?```$/, '');
120
121
  }
122
+ // Extract JSON object if there's additional text after it
123
+ const jsonMatch = jsonText.match(/\{[\s\S]*\}/);
124
+ if (jsonMatch) {
125
+ jsonText = jsonMatch[0];
126
+ }
121
127
  const mapping = JSON.parse(jsonText);
122
128
  if (typeof (mapping) !== 'object' || Array.isArray(mapping)) {
123
129
  throw new Error('Mapping is in wrong format');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layer-ai/core",
3
- "version": "0.5.10",
3
+ "version": "0.5.12",
4
4
  "description": "Core API routes and services for Layer AI",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",