diff --git a/src/cli/commands/help.ts b/src/cli/commands/help.ts index 138f05f..1cdb5c5 100644 --- a/src/cli/commands/help.ts +++ b/src/cli/commands/help.ts @@ -93,8 +93,7 @@ export function registerResourceHelpCommands(): void { lines.push(''); // Verbs - const idAutoFilled = - cliScope === 'group' && (res.plural === 'groups' || res.plural === 'destinations'); + const idAutoFilled = cliScope === 'group' && (res.plural === 'groups' || res.plural === 'destinations'); const idHint = idAutoFilled ? '' : ' '; const verbs: string[] = []; if (res.operations.list) verbs.push(`list [open]`); @@ -112,9 +111,8 @@ export function registerResourceHelpCommands(): void { lines.push(''); // Columns - const autoFilledFields = cliScope === 'group' - ? new Set(['id', 'agent_group_id', 'group']) - : new Set(); + const autoFilledFields = + cliScope === 'group' ? new Set(['id', 'agent_group_id', 'group']) : new Set(); lines.push('Fields:'); for (const col of res.columns) { const tags: string[] = []; diff --git a/src/cli/dispatch.test.ts b/src/cli/dispatch.test.ts index bb1afa0..b63d712 100644 --- a/src/cli/dispatch.test.ts +++ b/src/cli/dispatch.test.ts @@ -185,10 +185,7 @@ describe('CLI scope enforcement', () => { it('group: blocks cli_scope escalation', async () => { mockGetContainerConfig.mockReturnValue({ cli_scope: 'group' }); - const resp = await dispatch( - { id: '1', command: 'groups-test', args: { cli_scope: 'global' } }, - agentCtx(), - ); + const resp = await dispatch({ id: '1', command: 'groups-test', args: { cli_scope: 'global' } }, agentCtx()); expect(resp.ok).toBe(false); if (!resp.ok) { @@ -200,10 +197,7 @@ describe('CLI scope enforcement', () => { it('group: blocks cli-scope escalation (hyphenated)', async () => { mockGetContainerConfig.mockReturnValue({ cli_scope: 'group' }); - const resp = await dispatch( - { id: '1', command: 'groups-test', args: { 'cli-scope': 'global' } }, - agentCtx(), - ); + const resp = await dispatch({ id: '1', command: 'groups-test', args: { 'cli-scope': 'global' } }, agentCtx()); expect(resp.ok).toBe(false); if (!resp.ok) { diff --git a/src/cli/dispatch.ts b/src/cli/dispatch.ts index 3098daa..68db969 100644 --- a/src/cli/dispatch.ts +++ b/src/cli/dispatch.ts @@ -62,7 +62,11 @@ export async function dispatch(req: RequestFrame, ctx: CallerContext): Promise typeof row === 'object' && row !== null && (row as Record)[groupField] === ctx.agentGroupId, + (row) => + typeof row === 'object' && + row !== null && + (row as Record)[groupField] === ctx.agentGroupId, ); } else if (data && typeof data === 'object' && groupField in (data as Record)) { if ((data as Record)[groupField] !== ctx.agentGroupId) {