adhdev 0.1.46 → 0.1.47

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/index.js +21 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1529,6 +1529,7 @@ var init_daemon_cdp = __esm({
1529
1529
  agentSessions = /* @__PURE__ */ new Map();
1530
1530
  logFn;
1531
1531
  extensionProviders = [];
1532
+ _lastDiscoverSig = "";
1532
1533
  constructor(port = 9333, logFn) {
1533
1534
  this.port = port;
1534
1535
  this.logFn = logFn || ((msg) => {
@@ -1910,13 +1911,17 @@ var init_daemon_cdp = __esm({
1910
1911
  typeMap.set(t.type, (typeMap.get(t.type) || 0) + 1);
1911
1912
  }
1912
1913
  const typeSummary = [...typeMap.entries()].map(([k, v]) => `${k}:${v}`).join(",");
1913
- this.log(`[CDP] discoverAgentWebviews: ${allTargets.length} total [${typeSummary}], ${iframes.length} iframes (browser=${this._browserConnected})`);
1914
- for (const t of allTargets) {
1915
- if (t.type !== "page" && t.type !== "worker" && t.type !== "service_worker") {
1916
- this.log(`[CDP] target: type=${t.type} url=${(t.url || "").substring(0, 120)}`);
1917
- }
1918
- if ((t.url || "").includes("vscode-webview")) {
1919
- this.log(`[CDP] webview: type=${t.type} url=${(t.url || "").substring(0, 150)}`);
1914
+ const sig = `${allTargets.length}:${iframes.length}:${typeSummary}`;
1915
+ if (sig !== this._lastDiscoverSig) {
1916
+ this._lastDiscoverSig = sig;
1917
+ this.log(`[CDP] discoverAgentWebviews: ${allTargets.length} total [${typeSummary}], ${iframes.length} iframes (browser=${this._browserConnected})`);
1918
+ for (const t of allTargets) {
1919
+ if (t.type !== "page" && t.type !== "worker" && t.type !== "service_worker") {
1920
+ this.log(`[CDP] target: type=${t.type} url=${(t.url || "").substring(0, 120)}`);
1921
+ }
1922
+ if ((t.url || "").includes("vscode-webview")) {
1923
+ this.log(`[CDP] webview: type=${t.type} url=${(t.url || "").substring(0, 150)}`);
1924
+ }
1920
1925
  }
1921
1926
  }
1922
1927
  const agents = [];
@@ -2613,7 +2618,9 @@ var init_daemon_p2p = __esm({
2613
2618
  const text = typeof msg === "string" ? msg : msg.toString("utf-8");
2614
2619
  try {
2615
2620
  const parsed = JSON.parse(text);
2616
- log(`Files message from peer ${peerId}: type=${parsed.type}`);
2621
+ if (parsed.type !== "command" && parsed.type !== "pty_input" && parsed.type !== "pty_resize") {
2622
+ log(`Files message from peer ${peerId}: type=${parsed.type}`);
2623
+ }
2617
2624
  if (parsed.type === "screenshot_start") {
2618
2625
  const peer = this.peers.get(peerId);
2619
2626
  if (peer) {
@@ -4153,12 +4160,10 @@ var init_daemon_commands = __esm({
4153
4160
  getCdp(ideType) {
4154
4161
  const key = ideType || this._currentIdeType;
4155
4162
  if (!key) {
4156
- console.log(`[getCdp] \u26A0 No ideType specified, cannot resolve CDP`);
4157
4163
  return null;
4158
4164
  }
4159
4165
  const m = this.ctx.cdpManagers.get(key.toLowerCase());
4160
4166
  if (m?.isConnected) return m;
4161
- console.log(`[getCdp] \u26A0 Target IDE "${key}" CDP not available`);
4162
4167
  return null;
4163
4168
  }
4164
4169
  /** Current IDE type extracted from command args (per-request) */
@@ -4264,7 +4269,12 @@ var init_daemon_commands = __esm({
4264
4269
  async handle(cmd, args) {
4265
4270
  this._currentIdeType = this.extractIdeType(args);
4266
4271
  this._currentProviderType = args?.agentType || args?.providerType || this._currentIdeType;
4267
- console.log(`[Cmd] ${cmd} \u2192 ideType=${this._currentIdeType || "none"} providerType=${this._currentProviderType || "none"}`);
4272
+ if (!this._currentIdeType && !this._currentProviderType) {
4273
+ const cdpCommands = ["send_chat", "read_chat", "list_chats", "new_chat", "switch_chat", "set_mode", "change_model", "resolve_action"];
4274
+ if (cdpCommands.includes(cmd)) {
4275
+ return { success: false, error: "No ideType specified \u2014 cannot route command" };
4276
+ }
4277
+ }
4268
4278
  switch (cmd) {
4269
4279
  // ─── CDP 직접 처리 ───────────────────
4270
4280
  case "read_chat":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adhdev",
3
- "version": "0.1.46",
3
+ "version": "0.1.47",
4
4
  "description": "ADHDev CLI — Detect, install and configure your IDE + AI agent extensions",
5
5
  "main": "dist/index.js",
6
6
  "bin": {