@voiceclaw/voiceclaw-plugin 1.0.3 → 1.0.6

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 +13 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -80,22 +80,27 @@ export default function register(api) {
80
80
  listAccountIds: (cfg) => {
81
81
  const accounts = cfg.channels?.voiceclaw?.accounts ?? {};
82
82
  const ids = Object.keys(accounts);
83
- // If top-level config exists, ensure 'default' is in the list
84
- if (cfg.plugins?.entries?.['voiceclaw-plugin']?.config && !ids.includes('default')) {
83
+ const hasPluginEntry = cfg.plugins?.entries?.['voiceclaw-plugin'] !== undefined;
84
+ console.log(`[VoiceClaw Plugin] listAccountIds called. hasPluginEntry: ${hasPluginEntry}, explicit channels: ${ids.join(',')}`);
85
+ // If the plugin acts as enabled, ensure 'default' is in the list
86
+ if (hasPluginEntry && !ids.includes('default')) {
85
87
  ids.push('default');
86
88
  }
89
+ console.log(`[VoiceClaw Plugin] listAccountIds returning: ${ids.join(',')}`);
87
90
  return ids;
88
91
  },
89
92
  resolveAccount: (cfg, accountId) => {
90
93
  const accounts = cfg.channels?.voiceclaw?.accounts ?? {};
91
94
  const id = accountId ?? 'default';
92
95
  const account = accounts[id] ?? {};
96
+ let finalAccount = account;
93
97
  // Merge with top-level plugin config if this is the default account
94
98
  if (id === 'default') {
95
99
  const topLevelConfig = cfg.plugins?.entries?.['voiceclaw-plugin']?.config ?? {};
96
- return { ...topLevelConfig, ...account };
100
+ finalAccount = { ...topLevelConfig, ...account };
97
101
  }
98
- return account;
102
+ console.log(`[VoiceClaw Plugin] resolveAccount for ${id} returning:`, finalAccount);
103
+ return finalAccount;
99
104
  },
100
105
  },
101
106
  outbound: {
@@ -119,11 +124,12 @@ export default function register(api) {
119
124
  },
120
125
  gateway: {
121
126
  start: async (ctx) => {
127
+ api.logger.info('VoiceClaw: gateway.start() called');
122
128
  handleInbound = ctx.processInbound;
123
129
  let accounts = ctx.config.channels?.voiceclaw?.accounts ?? {};
124
- // Auto-inject default account if top-level config exists and default isn't explicitly defined
125
- const topLevelConfig = ctx.config.plugins?.entries?.['voiceclaw-plugin']?.config;
126
- if (topLevelConfig && !accounts['default']) {
130
+ // Auto-inject default account if plugin entry exists and default isn't explicitly defined
131
+ const hasPluginEntry = ctx.config.plugins?.entries?.['voiceclaw-plugin'] !== undefined;
132
+ if (hasPluginEntry && !accounts['default']) {
127
133
  accounts = { ...accounts, default: {} };
128
134
  }
129
135
  for (const [accountId, baseAccount] of Object.entries(accounts)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voiceclaw/voiceclaw-plugin",
3
- "version": "1.0.3",
3
+ "version": "1.0.6",
4
4
  "description": "OpenClaw channel plugin for VoiceClaw — relay messages between your AI agent and the VoiceClaw iOS/macOS app via Siri",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",