mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-25 08:48:08 +02:00
feat(connectors): generalize readiness and constraint handling (#212)
* feat(connectors): add postgres maxConnections * feat(connectors): add mysql maxConnections * feat(connectors): add sqlserver maxConnections * feat(connectors): rename snowflake pool config * docs: document connector maxConnections * feat(scan): add constraint discovery warning helper * feat(scan): carry structural warnings through reports * feat(postgres): soft-fail denied constraint discovery * feat(mysql): soft-fail denied constraint discovery * feat(sqlserver): soft-fail denied constraint discovery * feat(bigquery): soft-fail denied primary key discovery * feat(snowflake): report denied primary key discovery * test(scan): verify constraint discovery warnings * feat(historic-sql): use shared readiness probes * docs: document query history readiness probes * test(historic-sql): verify readiness probe registry * test(ingest): account for live database warnings artifact * Add skip option for agent setup
This commit is contained in:
parent
cfd1749ab9
commit
78b8a0c025
42 changed files with 2763 additions and 554 deletions
|
|
@ -418,6 +418,11 @@ describe('setup agents', () => {
|
|||
label: 'Ask data questions + manage KTX with CLI commands',
|
||||
hint: 'Adds an admin CLI skill so agents can run ktx status, sl, wiki, and setup commands.',
|
||||
},
|
||||
{
|
||||
value: 'skip',
|
||||
label: 'Skip agent setup for now',
|
||||
hint: 'Leaves agent integration incomplete. You can run ktx setup --agents later.',
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(prompts.multiselect).toHaveBeenCalledWith(
|
||||
|
|
@ -427,6 +432,58 @@ describe('setup agents', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('lets interactive setup skip agent integration from the connection mode prompt', async () => {
|
||||
const io = makeIo();
|
||||
const prompts = {
|
||||
select: vi.fn(async () => 'skip'),
|
||||
multiselect: vi.fn(async () => {
|
||||
throw new Error('target selection should not run');
|
||||
}),
|
||||
cancel: vi.fn(),
|
||||
};
|
||||
|
||||
await expect(
|
||||
runKtxSetupAgentsStep(
|
||||
{
|
||||
projectDir: tempDir,
|
||||
inputMode: 'auto',
|
||||
yes: false,
|
||||
agents: true,
|
||||
scope: 'project',
|
||||
mode: 'mcp',
|
||||
skipAgents: false,
|
||||
},
|
||||
io.io,
|
||||
{ prompts },
|
||||
),
|
||||
).resolves.toMatchObject({ status: 'skipped', projectDir: tempDir });
|
||||
|
||||
expect(prompts.select).toHaveBeenCalledWith({
|
||||
message: 'What should agents be allowed to do with this KTX project?',
|
||||
options: [
|
||||
{
|
||||
value: 'mcp',
|
||||
label: 'Ask data questions with KTX MCP',
|
||||
hint: 'Installs the MCP connection and analytics workflow skill. Best for normal use.',
|
||||
},
|
||||
{
|
||||
value: 'mcp-cli',
|
||||
label: 'Ask data questions + manage KTX with CLI commands',
|
||||
hint: 'Adds an admin CLI skill so agents can run ktx status, sl, wiki, and setup commands.',
|
||||
},
|
||||
{
|
||||
value: 'skip',
|
||||
label: 'Skip agent setup for now',
|
||||
hint: 'Leaves agent integration incomplete. You can run ktx setup --agents later.',
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(prompts.multiselect).not.toHaveBeenCalled();
|
||||
expect(io.stdout()).toContain('Agent integration skipped.');
|
||||
await expect(stat(join(tempDir, '.ktx/agents/install-manifest.json'))).rejects.toThrow();
|
||||
expect(await readKtxSetupState(tempDir)).toEqual({ completed_steps: [] });
|
||||
});
|
||||
|
||||
it('prompts for global scope when every selected target supports it', async () => {
|
||||
const home = await mkdtemp(join(tmpdir(), 'ktx-setup-agents-home-'));
|
||||
const previousHome = process.env.HOME;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue