@cydm/magic-shell-agent-node 0.1.4 → 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.
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "claude-code",
3
+ "type": "pty",
4
+ "command": "claude",
5
+ "args": ["--dangerously-skip-permissions"],
6
+ "capabilities": ["terminal", "bash", "file-edit", "vim", "tmux", "ansi256", "mouse"]
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "codex",
3
+ "type": "pty",
4
+ "command": "codex",
5
+ "args": ["--yolo", "--no-alt-screen"],
6
+ "capabilities": ["terminal", "bash", "file-edit", "ansi256", "mouse"]
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "echo",
3
+ "type": "stdio",
4
+ "command": "node",
5
+ "args": ["test/mocks/echo-agent.js"],
6
+ "capabilities": ["terminal", "test"]
7
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "pie-unity",
3
+ "type": "stdio",
4
+ "command": "pie-unity",
5
+ "args": ["--interactive"],
6
+ "capabilities": ["terminal", "file-edit", "web-search"],
7
+ "env": { "PIE_UNITY_MODE": "terminal" }
8
+ }
@@ -2591,6 +2591,17 @@
2591
2591
  }
2592
2592
  }
2593
2593
 
2594
+ function setSpawnCwd(cwd, { remember = false } = {}) {
2595
+ const next = (cwd || '').trim();
2596
+ const input = document.getElementById('spawnCwd');
2597
+ input.value = next;
2598
+ defaultSpawnCwd = next;
2599
+ localStorage.setItem('spawnCwd', defaultSpawnCwd);
2600
+ if (remember && next) {
2601
+ rememberCwd(next);
2602
+ }
2603
+ }
2604
+
2594
2605
  const searchParams = new URLSearchParams(window.location.search);
2595
2606
  const inferredRelayUrl = inferDefaultRelayUrl();
2596
2607
  document.getElementById('relayUrl').value = inferredRelayUrl;
@@ -3658,6 +3669,10 @@
3658
3669
  pushNodeTranscript,
3659
3670
  renderWorkers,
3660
3671
  syncWorkerPluginPreference,
3672
+ getSpawnCwd() {
3673
+ return (document.getElementById('spawnCwd').value || '').trim();
3674
+ },
3675
+ setSpawnCwd,
3661
3676
  setSessionDisplay(value) {
3662
3677
  document.getElementById('session-display').textContent = value;
3663
3678
  },
@@ -105,6 +105,18 @@
105
105
  }
106
106
 
107
107
  function handleControlMessage(msg, ctx) {
108
+ if (msg.controlKind === "result" && msg.controlName === "spawn_worker") {
109
+ if (msg.ok === false) {
110
+ ctx.pendingSpawnSessionId = null;
111
+ ctx.pendingSpawnAutoAttach = true;
112
+ ctx.resetSpawnButton();
113
+ ctx.writeSystemNotice(`SPAWN FAILED: ${msg.payload?.error || msg.error || "Unknown error"}`);
114
+ ctx.renderWorkers();
115
+ return true;
116
+ }
117
+ return false;
118
+ }
119
+
108
120
  if (msg.controlKind === "result" && msg.controlName === "get_primary_agent" && msg.payload && msg.payload.primary) {
109
121
  ctx.primaryAgent = msg.payload.primary || null;
110
122
  ctx.renderNodeHome();
@@ -145,6 +157,9 @@
145
157
  ctx.dirBrowserParentPath = msg.payload.parentPath || null;
146
158
  ctx.dirBrowserRepoRoot = msg.payload.repoRoot || null;
147
159
  ctx.dirBrowserEntries = msg.payload.entries || [];
160
+ if (!ctx.getSpawnCwd?.() && msg.payload.path) {
161
+ ctx.setSpawnCwd?.(msg.payload.path);
162
+ }
148
163
  ctx.renderDirBrowser();
149
164
  return true;
150
165
  }
@@ -165,6 +180,9 @@
165
180
  ctx.dirBrowserParentPath = msg.payload.parentPath || null;
166
181
  ctx.dirBrowserRepoRoot = msg.payload.repoRoot || null;
167
182
  ctx.dirBrowserEntries = msg.payload.entries || [];
183
+ if (!ctx.getSpawnCwd?.() && msg.payload.path) {
184
+ ctx.setSpawnCwd?.(msg.payload.path);
185
+ }
168
186
  ctx.renderDirBrowser();
169
187
  return true;
170
188
  }
@@ -6,6 +6,9 @@
6
6
  ctx.sessionId = null;
7
7
  ctx.setSessionDisplay("----");
8
8
  ctx.syncWorkerPluginPreference?.();
9
+ if (!ctx.getSpawnCwd?.()) {
10
+ ctx.requestDirBrowse?.();
11
+ }
9
12
  ctx.requestWorkerList();
10
13
  return true;
11
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cydm/magic-shell-agent-node",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Magic Shell Agent Node - Local agent connector",
5
5
  "homepage": "https://magicshell.ai",
6
6
  "keywords": [