retell-sync-cli 3.10.0 → 3.11.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.
Files changed (2) hide show
  1. package/dist/cli.js +48 -0
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -134350,6 +134350,34 @@ async function serializeState(state, {
134350
134350
  }
134351
134351
  }
134352
134352
  }
134353
+ const roundPos = (p4) => ({
134354
+ x: Math.round(p4.x),
134355
+ y: Math.round(p4.y)
134356
+ });
134357
+ const positions = {};
134358
+ if (flowConfig.begin_tag_display_position) {
134359
+ positions.begin_tag = roundPos(flowConfig.begin_tag_display_position);
134360
+ delete flowConfig.begin_tag_display_position;
134361
+ }
134362
+ if (flowConfig.nodes) {
134363
+ for (const node of flowConfig.nodes) {
134364
+ if (node.id && node.display_position) {
134365
+ (positions.nodes ??= {})[node.id] = roundPos(node.display_position);
134366
+ delete node.display_position;
134367
+ }
134368
+ }
134369
+ }
134370
+ if (flowConfig.components) {
134371
+ for (const comp of flowConfig.components) {
134372
+ if (comp.name && comp.begin_tag_display_position) {
134373
+ (positions.components ??= {})[comp.name] = roundPos(comp.begin_tag_display_position);
134374
+ delete comp.begin_tag_display_position;
134375
+ }
134376
+ }
134377
+ }
134378
+ if (Object.keys(positions).length > 0) {
134379
+ files[path15.join(agentDirPath, ".positions.json")] = await writeJson(positions);
134380
+ }
134353
134381
  files[path15.join(agentDirPath, `conversation-flow.${configExt}`)] = isYaml ? await writeYaml(flowConfig, { comments: flowFieldDocs }) : isJsonc ? await writeJsonc(flowConfig, { comments: flowFieldDocs }) : await writeJson(flowConfig);
134354
134382
  }
134355
134383
  }
@@ -134473,6 +134501,26 @@ async function canonicalizeFromFiles(files) {
134473
134501
  if (flowResult) {
134474
134502
  const flowConfig = flowResult.reader(flowResult.content, zod_default.looseObject({}));
134475
134503
  await resolveFilePlaceholders2(flowConfig, resolveFileContent);
134504
+ const positionsFile = fileMap[`${agentDir}/.positions.json`];
134505
+ if (positionsFile) {
134506
+ const positions = readJson2(positionsFile, zod_default.looseObject({}));
134507
+ if (positions.begin_tag)
134508
+ flowConfig.begin_tag_display_position = positions.begin_tag;
134509
+ if (positions.nodes && Array.isArray(flowConfig.nodes)) {
134510
+ const nodePositions = positions.nodes;
134511
+ for (const node of flowConfig.nodes) {
134512
+ if (node.id && nodePositions[node.id])
134513
+ node.display_position = nodePositions[node.id];
134514
+ }
134515
+ }
134516
+ if (positions.components && Array.isArray(flowConfig.components)) {
134517
+ const compPositions = positions.components;
134518
+ for (const comp of flowConfig.components) {
134519
+ if (comp.name && compPositions[comp.name])
134520
+ comp.begin_tag_display_position = compPositions[comp.name];
134521
+ }
134522
+ }
134523
+ }
134476
134524
  conversationFlows.push({
134477
134525
  ...flowConfig,
134478
134526
  _id: agentMeta.response_engine.conversation_flow_id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "retell-sync-cli",
3
- "version": "3.10.0",
3
+ "version": "3.11.0",
4
4
  "description": "CLI tool for syncing Retell AI agents between local filesystem and API",
5
5
  "keywords": [
6
6
  "agents",