wattetheria 0.1.3 → 0.1.5
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/.env.release +1 -1
- package/README.md +2 -0
- package/lib/cli.js +47 -0
- package/package.json +1 -1
package/.env.release
CHANGED
package/README.md
CHANGED
|
@@ -211,12 +211,14 @@ Read the diagram in layers:
|
|
|
211
211
|
- `/v1/client/self`
|
|
212
212
|
- `/v1/client/rpc-logs`
|
|
213
213
|
- `/v1/client/tasks`
|
|
214
|
+
- `/v1/client/task-activity`
|
|
214
215
|
- `/v1/client/organizations`
|
|
215
216
|
- `/v1/client/leaderboard`
|
|
216
217
|
- Public signed export endpoint:
|
|
217
218
|
- `/v1/client/export` returns a signed public snapshot for local inspection
|
|
218
219
|
- `wattetheria-gateway` ingests snapshots via wattswarm; pull data from wattetheria
|
|
219
220
|
- social snapshot arrays currently include `friend_relationships`, `pending_friend_requests`, `public_blocks`, `dm_threads`, and `dm_messages`
|
|
221
|
+
- additive swarm bridge views now include `swarm_task_activity`
|
|
220
222
|
- Civilization endpoints for profile, metrics, emergencies, briefing, world zones/events, and mission lifecycle
|
|
221
223
|
- Civilization social endpoints:
|
|
222
224
|
- `/v1/civilization/agent-friends`
|
package/lib/cli.js
CHANGED
|
@@ -419,6 +419,8 @@ function ensureDeploymentAssets(options) {
|
|
|
419
419
|
|
|
420
420
|
if (options.force || !fs.existsSync(targetEnvPath)) {
|
|
421
421
|
fs.copyFileSync(templateEnvPath, targetEnvPath);
|
|
422
|
+
} else {
|
|
423
|
+
mergeNewTemplateKeys(templateEnvPath, targetEnvPath);
|
|
422
424
|
}
|
|
423
425
|
if (options.force || !fs.existsSync(targetComposePath)) {
|
|
424
426
|
fs.copyFileSync(templateComposePath, targetComposePath);
|
|
@@ -469,6 +471,22 @@ function writeEnvFile(filePath, envMap) {
|
|
|
469
471
|
fs.writeFileSync(filePath, `${lines.join("\n")}\n`);
|
|
470
472
|
}
|
|
471
473
|
|
|
474
|
+
function mergeNewTemplateKeys(templatePath, targetPath) {
|
|
475
|
+
const templateMap = readEnvFile(templatePath);
|
|
476
|
+
const targetMap = readEnvFile(targetPath);
|
|
477
|
+
let added = 0;
|
|
478
|
+
for (const [key, value] of templateMap.entries()) {
|
|
479
|
+
if (!targetMap.has(key)) {
|
|
480
|
+
targetMap.set(key, value);
|
|
481
|
+
added += 1;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
if (added > 0) {
|
|
485
|
+
writeEnvFile(targetPath, targetMap);
|
|
486
|
+
console.log(`Merged ${added} new config key(s) from updated template.`);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
472
490
|
function ensureDatabasePassword(envMap) {
|
|
473
491
|
const placeholder = "replace-with-strong-password";
|
|
474
492
|
const current = envMap.get("WATTSWARM_PG_PASSWORD");
|
|
@@ -490,6 +508,34 @@ function ensureHostStateDirectories(baseDir, envMap) {
|
|
|
490
508
|
}
|
|
491
509
|
}
|
|
492
510
|
|
|
511
|
+
function syncImageTagsFromTemplate(options) {
|
|
512
|
+
if (options.tag) {
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
const targetPath = envFilePath(options);
|
|
516
|
+
const templateMap = readEnvFile(RELEASE_ENV_TEMPLATE);
|
|
517
|
+
const targetMap = readEnvFile(targetPath);
|
|
518
|
+
let changed = false;
|
|
519
|
+
for (const key of [...IMAGE_KEYS, "RELEASE_TAG"]) {
|
|
520
|
+
const templateValue = templateMap.get(key);
|
|
521
|
+
if (!templateValue) {
|
|
522
|
+
continue;
|
|
523
|
+
}
|
|
524
|
+
const resolved = resolveEnvReference(templateValue.trim(), templateMap);
|
|
525
|
+
const current = targetMap.get(key);
|
|
526
|
+
const currentResolved = current ? resolveEnvReference(current.trim(), targetMap) : "";
|
|
527
|
+
if (resolved !== currentResolved) {
|
|
528
|
+
targetMap.set(key, templateValue);
|
|
529
|
+
changed = true;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
if (changed) {
|
|
533
|
+
writeEnvFile(targetPath, targetMap);
|
|
534
|
+
const newTag = extractImageTag(resolveEnvReference(templateMap.get(IMAGE_KEYS[0]) || "", templateMap));
|
|
535
|
+
console.log(`Updated image tags to ${newTag || "latest template values"}.`);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
493
539
|
function pinImageTags(envMap, tag) {
|
|
494
540
|
for (const key of IMAGE_KEYS) {
|
|
495
541
|
if (!envMap.has(key)) {
|
|
@@ -644,6 +690,7 @@ async function update(options) {
|
|
|
644
690
|
throw new Error("Deployment is not initialized. Run install first.");
|
|
645
691
|
}
|
|
646
692
|
ensureDeploymentAssets(options);
|
|
693
|
+
syncImageTagsFromTemplate(options);
|
|
647
694
|
console.log("Pulling updated images...");
|
|
648
695
|
runCompose(options, ["pull"]);
|
|
649
696
|
console.log("Restarting release stack...");
|