@dayzehq/cli 0.0.0-stage → 0.2.0

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 (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +305 -2
  3. package/dist/add.d.ts +6 -0
  4. package/dist/add.js +72 -0
  5. package/dist/admin.d.ts +110 -0
  6. package/dist/admin.js +408 -0
  7. package/dist/agent-bridge.d.ts +50 -0
  8. package/dist/agent-bridge.js +146 -0
  9. package/dist/agent-mcp.d.ts +4 -0
  10. package/dist/agent-mcp.js +36 -0
  11. package/dist/ai-consent.d.ts +18 -0
  12. package/dist/ai-consent.js +93 -0
  13. package/dist/args.d.ts +5 -0
  14. package/dist/args.js +127 -0
  15. package/dist/auth.d.ts +20 -0
  16. package/dist/auth.js +198 -0
  17. package/dist/channel.d.ts +55 -0
  18. package/dist/channel.js +250 -0
  19. package/dist/chat.d.ts +67 -0
  20. package/dist/chat.js +170 -0
  21. package/dist/cli-errors.d.ts +13 -0
  22. package/dist/cli-errors.js +30 -0
  23. package/dist/coding-context.d.ts +12 -0
  24. package/dist/coding-context.js +130 -0
  25. package/dist/coding.d.ts +35 -0
  26. package/dist/coding.js +283 -0
  27. package/dist/config.d.ts +36 -0
  28. package/dist/config.js +149 -0
  29. package/dist/day.d.ts +22 -0
  30. package/dist/day.js +54 -0
  31. package/dist/dayze-cli-runtime +0 -0
  32. package/dist/dayze-days.d.ts +56 -0
  33. package/dist/dayze-days.js +276 -0
  34. package/dist/doctor.d.ts +32 -0
  35. package/dist/doctor.js +225 -0
  36. package/dist/focus.d.ts +9 -0
  37. package/dist/focus.js +163 -0
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +675 -0
  40. package/dist/inventory.d.ts +73 -0
  41. package/dist/inventory.js +1272 -0
  42. package/dist/life.d.ts +48 -0
  43. package/dist/life.js +146 -0
  44. package/dist/me.d.ts +94 -0
  45. package/dist/me.js +789 -0
  46. package/dist/people.d.ts +232 -0
  47. package/dist/people.js +2034 -0
  48. package/dist/projects.d.ts +21 -0
  49. package/dist/projects.js +132 -0
  50. package/dist/request-deadline.d.ts +11 -0
  51. package/dist/request-deadline.js +34 -0
  52. package/dist/runtime-build.json +1 -0
  53. package/dist/ui.d.ts +37 -0
  54. package/dist/ui.js +219 -0
  55. package/dist/version.d.ts +4 -0
  56. package/dist/version.js +16 -0
  57. package/package.json +54 -4
@@ -0,0 +1,93 @@
1
+ import { authHeader } from './config.js';
2
+ import * as ui from './ui.js';
3
+ /** Matches lib/privacy/ai-sharing-consent.ts — keep the string identical for stream/HTTP checks. */
4
+ export const AI_SHARING_CONSENT_REQUIRED_CODE = 'AI_SHARING_CONSENT_REQUIRED';
5
+ /** Absolute Settings URL (product surface; not derived from apiBase). */
6
+ export const AI_SHARING_PRIVACY_SETTINGS_URL = 'https://dayze.com/settings?tab=privacy';
7
+ export class AiSharingConsentRequiredError extends Error {
8
+ code = AI_SHARING_CONSENT_REQUIRED_CODE;
9
+ exitCode = 1;
10
+ constructor(serverReply) {
11
+ super(formatAiSharingConsentHelp(serverReply));
12
+ this.name = 'AiSharingConsentRequiredError';
13
+ }
14
+ }
15
+ export function isAiSharingConsentRequiredError(err) {
16
+ return err instanceof AiSharingConsentRequiredError;
17
+ }
18
+ export function formatAiSharingConsentHelp(serverReply) {
19
+ const lead = (serverReply && serverReply.trim()) ||
20
+ 'Before Dayze Agent can answer, it needs your OK to share your message and related context with AI providers.';
21
+ return [
22
+ lead,
23
+ '',
24
+ 'Next step: open Settings → Privacy and allow AI sharing:',
25
+ ` ${AI_SHARING_PRIVACY_SETTINGS_URL}`,
26
+ '',
27
+ 'Then run your command again. Check status: dayze consent status',
28
+ ].join('\n');
29
+ }
30
+ export function payloadRequiresAiSharingConsent(payload) {
31
+ return (!!payload &&
32
+ typeof payload === 'object' &&
33
+ payload.code === AI_SHARING_CONSENT_REQUIRED_CODE);
34
+ }
35
+ export async function fetchAiSharingConsentStatus(creds) {
36
+ const header = authHeader(creds);
37
+ if (!header)
38
+ throw new Error('Not logged in. Run: dayze login');
39
+ const endpoint = creds.apiKey?.startsWith('dayze_k_') ? '/api/cli/ai-sharing-consent' : '/api/privacy/ai-sharing-consent';
40
+ const res = await fetch(`${creds.apiBase.replace(/\/$/, '')}${endpoint}`, {
41
+ headers: {
42
+ Authorization: header,
43
+ Accept: 'application/json',
44
+ 'User-Agent': 'dayze-cli/0.1',
45
+ },
46
+ });
47
+ if (!res.ok) {
48
+ const text = await res.text().catch(() => '');
49
+ throw new Error(`Failed to read AI sharing consent (${res.status}): ${text.slice(0, 200)}`);
50
+ }
51
+ const json = (await res.json());
52
+ return {
53
+ available: json.available === true,
54
+ granted: json.granted === true,
55
+ };
56
+ }
57
+ export async function runConsentCommand(creds, positional) {
58
+ const [head] = positional;
59
+ if (!head || head === 'status' || head === 'show') {
60
+ const status = await fetchAiSharingConsentStatus(creds);
61
+ if (!status.available) {
62
+ ui.err('AI sharing consent is unavailable on this API (try again after deploy).');
63
+ process.exitCode = 1;
64
+ return;
65
+ }
66
+ if (status.granted) {
67
+ ui.ok('AI sharing allowed — Dayze Agent can call AI providers for this account.');
68
+ }
69
+ else {
70
+ ui.err('AI sharing is off for this account.');
71
+ console.log('');
72
+ console.log(ui.c.dim('Allow it in Settings → Privacy:'));
73
+ console.log(` ${AI_SHARING_PRIVACY_SETTINGS_URL}`);
74
+ console.log('');
75
+ process.exitCode = 1;
76
+ }
77
+ return;
78
+ }
79
+ if (head === 'help' || head === '--help' || head === '-h') {
80
+ console.log(`
81
+ ${ui.c.brandBold('dayze consent')} ${ui.c.dim('— AI sharing consent (Settings → Privacy)')}
82
+
83
+ dayze consent
84
+ dayze consent status
85
+
86
+ Allow sharing in the app (CLI cannot flip this for you):
87
+ ${AI_SHARING_PRIVACY_SETTINGS_URL}
88
+ `.trimEnd());
89
+ return;
90
+ }
91
+ ui.err('Usage: dayze consent status');
92
+ process.exitCode = 1;
93
+ }
package/dist/args.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export declare function parseArgs(argv: string[]): {
2
+ cmd: string;
3
+ flags: Record<string, string | boolean>;
4
+ positional: string[];
5
+ };
package/dist/args.js ADDED
@@ -0,0 +1,127 @@
1
+ export function parseArgs(argv) {
2
+ const args = argv.slice(2);
3
+ const cmd = args[0] && !args[0].startsWith('-') ? args[0] : 'agent';
4
+ const start = args[0] && !args[0].startsWith('-') ? 1 : 0;
5
+ const adding = (cmd === 'people' || cmd === 'inventory')
6
+ && args.slice(start).find(arg => !['--json', '--quiet', '-q'].includes(arg)) === 'add';
7
+ const flags = {};
8
+ const positional = [];
9
+ for (let i = start; i < args.length; i++) {
10
+ const a = args[i];
11
+ if (adding
12
+ && a.startsWith('--') && !['--json', '--quiet', '--help'].includes(a)) {
13
+ // Create fields (especially --email) belong to the subcommand, not login.
14
+ positional.push(a);
15
+ }
16
+ else if (a === '--key-env' || a === '--client' || a === '--key' || a === '--email' || a === '--password' || a === '--api') {
17
+ flags[a.slice(2)] = args[++i] || '';
18
+ }
19
+ else if (a === '--quiet' || a === '-q') {
20
+ flags.quiet = true;
21
+ }
22
+ else if (a === '--help' || a === '-h') {
23
+ flags.help = true;
24
+ }
25
+ else if (cmd === 'people' &&
26
+ (a.startsWith('--letter') || a.startsWith('--sort'))) {
27
+ // Keep address-book flags for `dayze people list --sort=birthday`
28
+ positional.push(a);
29
+ if (a === '--letter' || a === '--sort') {
30
+ positional.push(args[++i] || '');
31
+ }
32
+ }
33
+ else if (cmd === 'inventory' &&
34
+ (a.startsWith('--category') || a.startsWith('--status') || a.startsWith('--sort'))) {
35
+ positional.push(a);
36
+ if (a === '--category' || a === '--status' || a === '--sort') {
37
+ positional.push(args[++i] || '');
38
+ }
39
+ }
40
+ else if (cmd === 'life' && (a.startsWith('--kind') || a.startsWith('--id'))) {
41
+ // Keep Life Schema flags for `dayze life show --kind=person --id=…`
42
+ positional.push(a);
43
+ if (a === '--kind' || a === '--id') {
44
+ positional.push(args[++i] || '');
45
+ }
46
+ }
47
+ else if (cmd === 'channel' && a.startsWith('--limit')) {
48
+ // Keep `dayze channel read NAME --limit=50`
49
+ positional.push(a);
50
+ if (a === '--limit') {
51
+ positional.push(args[++i] || '');
52
+ }
53
+ }
54
+ else if (cmd === 'projects' && a.startsWith('--') && a !== '--json') {
55
+ // Preserve project options (including unknown ones) for strict subcommand validation.
56
+ positional.push(a);
57
+ if (!a.includes('=') && args[i + 1] && !args[i + 1].startsWith('--')) {
58
+ positional.push(args[++i]);
59
+ }
60
+ }
61
+ else if (cmd === 'admin' &&
62
+ (a === '--q' ||
63
+ a.startsWith('--q=') ||
64
+ a === '--search' ||
65
+ a.startsWith('--search=') ||
66
+ a === '--page' ||
67
+ a.startsWith('--page=') ||
68
+ a === '--limit' ||
69
+ a.startsWith('--limit=') ||
70
+ a === '--days' ||
71
+ a.startsWith('--days=') ||
72
+ a === '--includeInternal' ||
73
+ a.startsWith('--includeInternal='))) {
74
+ // Keep admin read flags for `dayze admin users --q=…` / `cost --days=7`
75
+ positional.push(a);
76
+ if (a === '--q' ||
77
+ a === '--search' ||
78
+ a === '--page' ||
79
+ a === '--limit' ||
80
+ a === '--days' ||
81
+ a === '--includeInternal') {
82
+ // Boolean --includeInternal may stand alone; only consume next token when present and not a flag.
83
+ const next = args[i + 1];
84
+ if (a === '--includeInternal' && (next == null || next.startsWith('-'))) {
85
+ // flag-only
86
+ }
87
+ else {
88
+ positional.push(args[++i] || '');
89
+ }
90
+ }
91
+ }
92
+ else if (a.startsWith('--')) {
93
+ flags[a.slice(2)] = true;
94
+ }
95
+ else {
96
+ positional.push(a);
97
+ }
98
+ }
99
+ // `dayze "message"` → ask
100
+ if (cmd !== 'ask' &&
101
+ cmd !== 'agent' &&
102
+ cmd !== 'chat' &&
103
+ cmd !== 'login' &&
104
+ cmd !== 'logout' &&
105
+ cmd !== 'whoami' &&
106
+ cmd !== 'status' &&
107
+ cmd !== 'projects' &&
108
+ cmd !== 'people' &&
109
+ cmd !== 'me' &&
110
+ cmd !== 'profile' &&
111
+ cmd !== 'dossier' &&
112
+ cmd !== 'day' &&
113
+ cmd !== 'focus' &&
114
+ cmd !== 'inventory' &&
115
+ cmd !== 'life' &&
116
+ cmd !== 'channel' &&
117
+ cmd !== 'admin' &&
118
+ cmd !== 'mcp-agent' &&
119
+ cmd !== 'consent' &&
120
+ cmd !== 'doctor' &&
121
+ cmd !== 'help' &&
122
+ cmd !== '--help' &&
123
+ cmd !== '-h') {
124
+ return { cmd: 'ask', flags, positional: [cmd, ...positional] };
125
+ }
126
+ return { cmd, flags, positional };
127
+ }
package/dist/auth.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ import { type DayzeCredentials } from './config.js';
2
+ export type Bootstrap = {
3
+ apiBase: string;
4
+ supabaseUrl: string;
5
+ supabaseAnonKey: string;
6
+ agentStreamPath: string;
7
+ agentAccess: string;
8
+ tip?: string;
9
+ };
10
+ export declare function fetchBootstrap(apiBase: string): Promise<Bootstrap>;
11
+ export declare function loginWithApiKey(key: string, apiBase?: string): Promise<DayzeCredentials>;
12
+ export declare function loginInteractive(opts: {
13
+ apiBase?: string;
14
+ email?: string;
15
+ password?: string;
16
+ key?: string;
17
+ }): Promise<DayzeCredentials>;
18
+ export declare function ensureFreshSession(creds: DayzeCredentials): Promise<DayzeCredentials>;
19
+ export declare function logout(): void;
20
+ export declare function whoami(creds: DayzeCredentials): Promise<void>;
package/dist/auth.js ADDED
@@ -0,0 +1,198 @@
1
+ import { createClient } from '@supabase/supabase-js';
2
+ import readline from 'node:readline/promises';
3
+ import { stdin as input, stdout as output } from 'node:process';
4
+ import { loadCredentials, saveCredentials, clearCredentials, configPath, } from './config.js';
5
+ import * as ui from './ui.js';
6
+ import { CLI_USER_AGENT } from './version.js';
7
+ export async function fetchBootstrap(apiBase) {
8
+ const base = apiBase.replace(/\/$/, '');
9
+ try {
10
+ const res = await fetch(`${base}/api/cli/bootstrap`, {
11
+ headers: { Accept: 'application/json', 'User-Agent': CLI_USER_AGENT },
12
+ });
13
+ if (res.ok) {
14
+ return (await res.json());
15
+ }
16
+ }
17
+ catch {
18
+ // fall through to env / defaults
19
+ }
20
+ const supabaseUrl = process.env.DAYZE_SUPABASE_URL || process.env.NEXT_PUBLIC_SUPABASE_URL || '';
21
+ const supabaseAnonKey = process.env.DAYZE_SUPABASE_ANON_KEY ||
22
+ process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY ||
23
+ process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY ||
24
+ '';
25
+ if (!supabaseUrl || !supabaseAnonKey) {
26
+ throw new Error(`CLI bootstrap unavailable at ${base}/api/cli/bootstrap.\n` +
27
+ `For email login, set DAYZE_SUPABASE_URL + DAYZE_SUPABASE_ANON_KEY (same as NEXT_PUBLIC_*),\n` +
28
+ `or use: dayze login --key 'dayze_k_…' (Actions scope).`);
29
+ }
30
+ return {
31
+ apiBase: base,
32
+ supabaseUrl,
33
+ supabaseAnonKey,
34
+ agentStreamPath: '/api/polaris/stream',
35
+ agentAccess: `${base}/settings/agent-access`,
36
+ tip: 'Using env bootstrap (deploy /api/cli/bootstrap for zero-config).',
37
+ };
38
+ }
39
+ async function prompt(question, { secret = false } = {}) {
40
+ if (secret && input.isTTY) {
41
+ // mute echo for password / key
42
+ const rl = readline.createInterface({ input, output: undefined, terminal: false });
43
+ output.write(question);
44
+ const answer = await new Promise((resolve) => {
45
+ let buf = '';
46
+ const onData = (char) => {
47
+ const s = char.toString('utf8');
48
+ if (s === '\n' || s === '\r' || s === '\u0004') {
49
+ input.off('data', onData);
50
+ output.write('\n');
51
+ resolve(buf);
52
+ return;
53
+ }
54
+ if (s === '\u007f' || s === '\b') {
55
+ buf = buf.slice(0, -1);
56
+ return;
57
+ }
58
+ buf += s;
59
+ };
60
+ input.setRawMode?.(true);
61
+ input.resume();
62
+ input.on('data', onData);
63
+ });
64
+ input.setRawMode?.(false);
65
+ rl.close();
66
+ return answer.trim();
67
+ }
68
+ const rl = readline.createInterface({ input, output });
69
+ const answer = await rl.question(question);
70
+ rl.close();
71
+ return answer.trim();
72
+ }
73
+ function applySession(creds, session, email) {
74
+ return {
75
+ ...creds,
76
+ accessToken: session.access_token,
77
+ refreshToken: session.refresh_token,
78
+ userId: session.user.id,
79
+ email: email || session.user.email || creds.email,
80
+ apiKey: undefined,
81
+ };
82
+ }
83
+ export async function loginWithApiKey(key, apiBase) {
84
+ const trimmed = key.trim();
85
+ if (!trimmed.startsWith('dayze_k_')) {
86
+ throw new Error('API key must start with dayze_k_');
87
+ }
88
+ const base = (apiBase || loadCredentials().apiBase || 'https://dayze.com').replace(/\/$/, '');
89
+ let boot = null;
90
+ try {
91
+ boot = await fetchBootstrap(base);
92
+ }
93
+ catch {
94
+ // API key auth does not need Supabase bootstrap
95
+ }
96
+ const creds = {
97
+ apiBase: base,
98
+ supabaseUrl: boot?.supabaseUrl,
99
+ supabaseAnonKey: boot?.supabaseAnonKey,
100
+ apiKey: trimmed,
101
+ accessToken: undefined,
102
+ refreshToken: undefined,
103
+ };
104
+ saveCredentials(creds);
105
+ return creds;
106
+ }
107
+ export async function loginInteractive(opts) {
108
+ if (opts.key)
109
+ return loginWithApiKey(opts.key, opts.apiBase);
110
+ const existing = loadCredentials();
111
+ const base = (opts.apiBase || existing.apiBase || 'https://dayze.com').replace(/\/$/, '');
112
+ const boot = await fetchBootstrap(base);
113
+ console.log(`${ui.c.brandBold('◆ Dayze')} ${ui.c.dim('login')}`);
114
+ console.log(`${ui.c.dim('─'.repeat(40))}`);
115
+ console.log(` host ${base}`);
116
+ console.log(` keys ${boot.agentAccess}`);
117
+ console.log('');
118
+ const mode = opts.password || opts.email
119
+ ? 'email'
120
+ : (await prompt(`${ui.c.dim('method')} ${ui.c.bold('(k)')}ey ${ui.c.bold('(e)')}mail ${ui.c.bold('(o)')}tp › `)).toLowerCase();
121
+ if (mode === 'k' || mode === 'key') {
122
+ const key = await prompt('Paste dayze_k_… API key: ', { secret: true });
123
+ return loginWithApiKey(key, base);
124
+ }
125
+ const email = opts.email || (await prompt('Email: '));
126
+ const supabase = createClient(boot.supabaseUrl, boot.supabaseAnonKey, {
127
+ auth: { persistSession: false, autoRefreshToken: false },
128
+ });
129
+ if (mode === 'o' || mode === 'otp') {
130
+ const { error } = await supabase.auth.signInWithOtp({
131
+ email,
132
+ options: { shouldCreateUser: false },
133
+ });
134
+ if (error)
135
+ throw new Error(error.message);
136
+ console.log('Check your email for a 6–8 digit code (or magic link OTP).');
137
+ const token = await prompt('Enter OTP code: ');
138
+ const { data, error: verifyErr } = await supabase.auth.verifyOtp({
139
+ email,
140
+ token,
141
+ type: 'email',
142
+ });
143
+ if (verifyErr || !data.session)
144
+ throw new Error(verifyErr?.message || 'OTP verification failed');
145
+ const creds = applySession({
146
+ apiBase: base,
147
+ supabaseUrl: boot.supabaseUrl,
148
+ supabaseAnonKey: boot.supabaseAnonKey,
149
+ }, data.session, email);
150
+ saveCredentials(creds);
151
+ return creds;
152
+ }
153
+ const password = opts.password || (await prompt('Password: ', { secret: true }));
154
+ const { data, error } = await supabase.auth.signInWithPassword({ email, password });
155
+ if (error || !data.session)
156
+ throw new Error(error?.message || 'Login failed');
157
+ const creds = applySession({
158
+ apiBase: base,
159
+ supabaseUrl: boot.supabaseUrl,
160
+ supabaseAnonKey: boot.supabaseAnonKey,
161
+ }, data.session, email);
162
+ saveCredentials(creds);
163
+ return creds;
164
+ }
165
+ export async function ensureFreshSession(creds) {
166
+ if (creds.apiKey)
167
+ return creds;
168
+ if (!creds.refreshToken || !creds.supabaseUrl || !creds.supabaseAnonKey)
169
+ return creds;
170
+ const supabase = createClient(creds.supabaseUrl, creds.supabaseAnonKey, {
171
+ auth: { persistSession: false, autoRefreshToken: false },
172
+ });
173
+ const { data, error } = await supabase.auth.refreshSession({
174
+ refresh_token: creds.refreshToken,
175
+ });
176
+ if (error || !data.session) {
177
+ throw new Error(error?.message || 'Session expired. Run: dayze login');
178
+ }
179
+ const next = applySession(creds, data.session);
180
+ saveCredentials(next);
181
+ return next;
182
+ }
183
+ export function logout() {
184
+ clearCredentials();
185
+ }
186
+ export async function whoami(creds) {
187
+ if (creds.apiKey) {
188
+ console.log(`${ui.c.dim('auth')} api key`);
189
+ console.log(`${ui.c.dim('key')} ${creds.apiKey.slice(0, 16)}…`);
190
+ }
191
+ else {
192
+ console.log(`${ui.c.dim('auth')} session`);
193
+ console.log(`${ui.c.dim('email')} ${creds.email || '—'}`);
194
+ console.log(`${ui.c.dim('user')} ${creds.userId || '—'}`);
195
+ }
196
+ console.log(`${ui.c.dim('api')} ${creds.apiBase}`);
197
+ console.log(`${ui.c.dim('file')} ${configPath()}`);
198
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * CLI: dayze channel — IRC-style Dayze user channels (PHI-2102 first slice).
3
+ *
4
+ * Talks to /api/cli/channels stubs. Server work (membership, message store,
5
+ * realtime) is still incomplete; the flag DAYZE_CLI_CHANNELS_ENABLED defaults off.
6
+ */
7
+ import { type DayzeCredentials } from './config.js';
8
+ export type ChannelCommandOptions = {
9
+ json?: boolean;
10
+ };
11
+ export type ChannelCommand = {
12
+ kind: 'list';
13
+ } | {
14
+ kind: 'join';
15
+ name: string;
16
+ } | {
17
+ kind: 'leave';
18
+ name: string;
19
+ } | {
20
+ kind: 'send';
21
+ name: string;
22
+ text: string;
23
+ } | {
24
+ kind: 'read';
25
+ name: string;
26
+ limit?: number;
27
+ } | {
28
+ kind: 'help';
29
+ };
30
+ export declare function parseChannelArgs(positional: string[]): ChannelCommand;
31
+ export declare function printChannelHelp(): void;
32
+ export type ChannelApiBody = {
33
+ enabled?: boolean;
34
+ incomplete?: boolean;
35
+ code?: string;
36
+ error?: string;
37
+ action?: string;
38
+ channel?: string;
39
+ channels?: unknown[];
40
+ messages?: unknown[];
41
+ limit?: number;
42
+ text_length?: number;
43
+ };
44
+ /**
45
+ * 501 incomplete stubs are a normal PHI-2102 response shape (not a transport
46
+ * failure). 404 means the flag is off. Other non-2xx become CliError / Error.
47
+ */
48
+ export declare function fetchChannelApi(creds: DayzeCredentials, init: {
49
+ method?: 'GET' | 'POST';
50
+ query?: Record<string, string>;
51
+ body?: Record<string, unknown>;
52
+ }): Promise<ChannelApiBody>;
53
+ /** Map leftover HTTP failure strings (tests + non-501 paths). */
54
+ export declare function mapChannelHttpError(err: unknown): unknown;
55
+ export declare function runChannelCommand(creds: DayzeCredentials, positional: string[], options?: ChannelCommandOptions): Promise<void>;