towns-agent 4.1.2 → 5.0.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/index.js CHANGED
@@ -31422,7 +31422,7 @@ var import_debug3 = __toESM(require_src(), 1);
31422
31422
  var import_protobuf22 = require("@bufbuild/protobuf");
31423
31423
 
31424
31424
  // package.json
31425
- var version = "4.1.2";
31425
+ var version = "5.0.0";
31426
31426
 
31427
31427
  // src/modules/utils.ts
31428
31428
  var getPackageManager = () => {
@@ -32080,6 +32080,29 @@ function migrateLegacyAgentCodeReferences(projectDir) {
32080
32080
  }
32081
32081
  return updatedFiles;
32082
32082
  }
32083
+ function migrateSeedIdToConversationSeedId(projectDir) {
32084
+ const sourceFiles = [];
32085
+ collectProjectSourceFiles(projectDir, sourceFiles);
32086
+ const updatedFiles = [];
32087
+ for (const sourceFile of sourceFiles) {
32088
+ const content = import_fs.default.readFileSync(sourceFile, "utf-8");
32089
+ if (!content.includes(APP_FRAMEWORK_PACKAGE) && !content.includes(LEGACY_AGENT_PACKAGE)) {
32090
+ continue;
32091
+ }
32092
+ const updatedContent = content.split("\n").map((line) => {
32093
+ const trimmed = line.trimStart();
32094
+ if (trimmed.startsWith("//") || trimmed.startsWith("*") || trimmed.startsWith("/*")) {
32095
+ return line;
32096
+ }
32097
+ return line.replace(/(?<=\w)\.seedId\b/g, ".conversationSeedId");
32098
+ }).join("\n");
32099
+ if (updatedContent !== content) {
32100
+ import_fs.default.writeFileSync(sourceFile, updatedContent);
32101
+ updatedFiles.push(import_path.default.relative(projectDir, sourceFile));
32102
+ }
32103
+ }
32104
+ return updatedFiles;
32105
+ }
32083
32106
  function runLegacyAgentMigration(projectDir, packageJsonPath) {
32084
32107
  const packageJson = JSON.parse(import_fs.default.readFileSync(packageJsonPath, "utf-8"));
32085
32108
  const dependencySections = migrateLegacyAgentDependency(packageJson);
@@ -32120,6 +32143,13 @@ async function update(_argv) {
32120
32143
  `Updated code references from makeTownsAgent/@towns-labs/agent in ${migrationResult.codeFilesUpdated.length} file(s).`
32121
32144
  );
32122
32145
  }
32146
+ const seedIdMigrations = migrateSeedIdToConversationSeedId(projectDir);
32147
+ if (seedIdMigrations.length > 0) {
32148
+ console.log(
32149
+ (0, import_picocolors3.green)("\u2713"),
32150
+ `Migrated .seedId to .conversationSeedId in ${seedIdMigrations.length} file(s).`
32151
+ );
32152
+ }
32123
32153
  const [dlxBin, ...dlxArgs] = dlxCommand.split(" ");
32124
32154
  const packageJsonBefore = JSON.parse(import_fs.default.readFileSync(packageJsonPath, "utf-8"));
32125
32155
  const versionsBefore = getTownsVersions(packageJsonBefore);