@voiceclaw/voiceclaw-plugin 1.1.9 → 1.2.1

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.
@@ -37,10 +37,10 @@ export declare const voiceClawPlugin: {
37
37
  resolveAccount: (cfg: Record<string, any>, accountId?: string) => ResolvedAccount | undefined;
38
38
  isConfigured: (account: ResolvedAccount) => Promise<boolean>;
39
39
  unconfiguredReason: () => string;
40
- isEnabled: (account: ResolvedAccount) => boolean;
40
+ isEnabled: (account: any) => boolean;
41
41
  disabledReason: () => string;
42
- describeAccount: (account: ResolvedAccount) => {
43
- accountId: string;
42
+ describeAccount: (account: any) => {
43
+ accountId: any;
44
44
  enabled: boolean;
45
45
  configured: boolean;
46
46
  };
@@ -53,7 +53,15 @@ export declare const voiceClawPlugin: {
53
53
  applyAccountConfig: ({ cfg, accountId, input }: any) => any;
54
54
  };
55
55
  onboarding: {
56
- configure: (ctx: any) => Promise<"skip" | {
56
+ channel: any;
57
+ getStatus: (ctx: any) => Promise<{
58
+ channel: any;
59
+ configured: boolean;
60
+ statusLines: string[];
61
+ selectionHint: string;
62
+ quickstartScore: number;
63
+ }>;
64
+ configure: (ctx: any) => Promise<{
57
65
  cfg: any;
58
66
  accountId: string;
59
67
  }>;
@@ -79,12 +79,12 @@ export const voiceClawPlugin = {
79
79
  return loadSavedToken(account.accountId) !== null || Boolean(account.pairingCode);
80
80
  },
81
81
  unconfiguredReason: () => 'no pairing code',
82
- isEnabled: (account) => account.enabled !== false,
82
+ isEnabled: (account) => account?.enabled !== false,
83
83
  disabledReason: () => 'disabled',
84
84
  describeAccount: (account) => ({
85
- accountId: account.accountId,
86
- enabled: account.enabled !== false,
87
- configured: loadSavedToken(account.accountId) !== null || Boolean(account.pairingCode),
85
+ accountId: account?.accountId ?? 'default',
86
+ enabled: account?.enabled !== false,
87
+ configured: account ? (loadSavedToken(account.accountId) !== null || Boolean(account.pairingCode)) : false,
88
88
  }),
89
89
  setAccountEnabled: ({ cfg, accountId, enabled }) => {
90
90
  const accounts = { ...cfg.channels?.voiceclaw?.accounts };
@@ -160,8 +160,26 @@ export const voiceClawPlugin = {
160
160
  };
161
161
  },
162
162
  },
163
- // ── Onboarding (interactive setup via `openclaw channels add`)
163
+ // ── Onboarding adapter (ChannelOnboardingAdapter shape) ──────
164
164
  onboarding: {
165
+ channel: 'voiceclaw',
166
+ getStatus: async (ctx) => {
167
+ const cfg = ctx.cfg;
168
+ const accountIds = resolveAccountIds(cfg);
169
+ const hasAnyAccount = accountIds.length > 0;
170
+ const configured = hasAnyAccount && accountIds.some((id) => {
171
+ const account = resolveVoiceClawAccount(cfg, id);
172
+ return account && (loadSavedToken(id) !== null || Boolean(account.pairingCode));
173
+ });
174
+ const statusLabel = configured ? 'configured' : 'not configured';
175
+ return {
176
+ channel: 'voiceclaw',
177
+ configured,
178
+ statusLines: [`VoiceClaw: ${statusLabel}`],
179
+ selectionHint: configured ? 'configured' : 'not configured',
180
+ quickstartScore: 0,
181
+ };
182
+ },
165
183
  configure: async (ctx) => {
166
184
  let pairingCode = ctx.options?.token;
167
185
  if (!pairingCode && ctx.prompter) {
@@ -173,9 +191,10 @@ export const voiceClawPlugin = {
173
191
  });
174
192
  }
175
193
  if (!pairingCode || pairingCode.trim() === '') {
176
- return 'skip';
194
+ // Return a no-op result instead of 'skip' since configure must return { cfg, accountId }
195
+ return { cfg: ctx.cfg, accountId: 'default' };
177
196
  }
178
- const cfg = { ...ctx.config };
197
+ const cfg = { ...ctx.cfg };
179
198
  if (!cfg.channels)
180
199
  cfg.channels = {};
181
200
  if (!cfg.channels.voiceclaw)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voiceclaw/voiceclaw-plugin",
3
- "version": "1.1.9",
3
+ "version": "1.2.1",
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",