meshwire 0.1.1 → 0.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meshwire",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "CLI and MCP tools for the MeshWire multi-agent messaging service",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -1,6 +1,7 @@
1
1
  // meshwire mesh — create, list, switch meshes
2
2
  import chalk from 'chalk';
3
3
  import { requireConfig, writeConfig, readConfig } from '../config.js';
4
+ import { writeMeshJson } from '../mesh-schema.js';
4
5
  import { MeshWireClient } from '../api.js';
5
6
 
6
7
  export async function cmdMesh(subcommand, opts) {
@@ -22,8 +23,23 @@ export async function cmdMesh(subcommand, opts) {
22
23
  }
23
24
 
24
25
  case 'use': {
25
- writeConfig({ meshId: opts.meshId });
26
- console.log(chalk.green(`✓ Active mesh set to: ${opts.meshId}`));
26
+ const { meshId } = opts;
27
+ // Write to global config
28
+ writeConfig({ meshId });
29
+
30
+ // Also write .mesh.json in the current workspace directory
31
+ // so this folder is associated with the mesh
32
+ const config = readConfig();
33
+ writeMeshJson({
34
+ mesh_id: meshId,
35
+ workspace_name: process.cwd().split(/[/\\]/).pop() || 'workspace',
36
+ agent_name: config.agentName || 'agent',
37
+ harness: config.harness || 'copilot',
38
+ });
39
+
40
+ console.log(chalk.green(`✓ Active mesh: ${meshId}`));
41
+ console.log(chalk.dim(` ~/.meshwire/config.json updated`));
42
+ console.log(chalk.dim(` .mesh.json written to current directory`));
27
43
  break;
28
44
  }
29
45
 
@@ -11,7 +11,7 @@ export async function cmdStatus() {
11
11
  if (!config.token) {
12
12
  console.log(chalk.yellow(' Not configured.'));
13
13
  console.log(chalk.dim(' Run `meshwire init` to set up your token and mesh.\n'));
14
- process.exit(1);
14
+ process.exit(0); // not configured is not an error
15
15
  }
16
16
 
17
17
  // Print config