swallowkit 1.0.0-beta.9 → 1.0.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.
- package/README.ja.md +87 -181
- package/README.md +87 -238
- package/dist/__tests__/fixtures.d.ts +12 -0
- package/dist/__tests__/fixtures.d.ts.map +1 -1
- package/dist/__tests__/fixtures.js +101 -0
- package/dist/__tests__/fixtures.js.map +1 -1
- package/dist/cli/commands/add-auth.d.ts +15 -0
- package/dist/cli/commands/add-auth.d.ts.map +1 -0
- package/dist/cli/commands/add-auth.js +790 -0
- package/dist/cli/commands/add-auth.js.map +1 -0
- package/dist/cli/commands/add-connector.d.ts +20 -0
- package/dist/cli/commands/add-connector.d.ts.map +1 -0
- package/dist/cli/commands/add-connector.js +164 -0
- package/dist/cli/commands/add-connector.js.map +1 -0
- package/dist/cli/commands/cosmos-worktree-isolation.d.ts +25 -0
- package/dist/cli/commands/cosmos-worktree-isolation.d.ts.map +1 -0
- package/dist/cli/commands/cosmos-worktree-isolation.js +124 -0
- package/dist/cli/commands/cosmos-worktree-isolation.js.map +1 -0
- package/dist/cli/commands/create-model.d.ts +1 -4
- package/dist/cli/commands/create-model.d.ts.map +1 -1
- package/dist/cli/commands/create-model.js +20 -82
- package/dist/cli/commands/create-model.js.map +1 -1
- package/dist/cli/commands/dev-seeds.d.ts +27 -0
- package/dist/cli/commands/dev-seeds.d.ts.map +1 -1
- package/dist/cli/commands/dev-seeds.js +188 -6
- package/dist/cli/commands/dev-seeds.js.map +1 -1
- package/dist/cli/commands/dev.d.ts +30 -0
- package/dist/cli/commands/dev.d.ts.map +1 -1
- package/dist/cli/commands/dev.js +495 -129
- package/dist/cli/commands/dev.js.map +1 -1
- package/dist/cli/commands/init.d.ts +69 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +788 -766
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/scaffold.d.ts +24 -3
- package/dist/cli/commands/scaffold.d.ts.map +1 -1
- package/dist/cli/commands/scaffold.js +408 -189
- package/dist/cli/commands/scaffold.js.map +1 -1
- package/dist/cli/index.d.ts +5 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +335 -58
- package/dist/cli/index.js.map +1 -1
- package/dist/core/config.d.ts +13 -3
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +151 -8
- package/dist/core/config.js.map +1 -1
- package/dist/core/mock/connector-mock-server.d.ts +101 -0
- package/dist/core/mock/connector-mock-server.d.ts.map +1 -0
- package/dist/core/mock/connector-mock-server.js +480 -0
- package/dist/core/mock/connector-mock-server.js.map +1 -0
- package/dist/core/mock/zod-mock-generator.d.ts +14 -0
- package/dist/core/mock/zod-mock-generator.d.ts.map +1 -0
- package/dist/core/mock/zod-mock-generator.js +163 -0
- package/dist/core/mock/zod-mock-generator.js.map +1 -0
- package/dist/core/operations/auth-operations.d.ts +61 -0
- package/dist/core/operations/auth-operations.d.ts.map +1 -0
- package/dist/core/operations/auth-operations.js +272 -0
- package/dist/core/operations/auth-operations.js.map +1 -0
- package/dist/core/operations/create-model.d.ts +15 -0
- package/dist/core/operations/create-model.d.ts.map +1 -0
- package/dist/core/operations/create-model.js +185 -0
- package/dist/core/operations/create-model.js.map +1 -0
- package/dist/core/operations/file-session.d.ts +56 -0
- package/dist/core/operations/file-session.d.ts.map +1 -0
- package/dist/core/operations/file-session.js +203 -0
- package/dist/core/operations/file-session.js.map +1 -0
- package/dist/core/operations/provision-operations.d.ts +52 -0
- package/dist/core/operations/provision-operations.d.ts.map +1 -0
- package/dist/core/operations/provision-operations.js +211 -0
- package/dist/core/operations/provision-operations.js.map +1 -0
- package/dist/core/operations/runtime.d.ts +37 -0
- package/dist/core/operations/runtime.d.ts.map +1 -0
- package/dist/core/operations/runtime.js +248 -0
- package/dist/core/operations/runtime.js.map +1 -0
- package/dist/core/operations/scaffold-apply.d.ts +21 -0
- package/dist/core/operations/scaffold-apply.d.ts.map +1 -0
- package/dist/core/operations/scaffold-apply.js +57 -0
- package/dist/core/operations/scaffold-apply.js.map +1 -0
- package/dist/core/operations/scaffold-machine.d.ts +16 -0
- package/dist/core/operations/scaffold-machine.d.ts.map +1 -0
- package/dist/core/operations/scaffold-machine.js +51 -0
- package/dist/core/operations/scaffold-machine.js.map +1 -0
- package/dist/core/operations/scaffold-plan.d.ts +43 -0
- package/dist/core/operations/scaffold-plan.d.ts.map +1 -0
- package/dist/core/operations/scaffold-plan.js +187 -0
- package/dist/core/operations/scaffold-plan.js.map +1 -0
- package/dist/core/project/agent-instructions.d.ts +29 -0
- package/dist/core/project/agent-instructions.d.ts.map +1 -0
- package/dist/core/project/agent-instructions.js +160 -0
- package/dist/core/project/agent-instructions.js.map +1 -0
- package/dist/core/project/artifacts.d.ts +58 -0
- package/dist/core/project/artifacts.d.ts.map +1 -0
- package/dist/core/project/artifacts.js +179 -0
- package/dist/core/project/artifacts.js.map +1 -0
- package/dist/core/project/boundaries.d.ts +50 -0
- package/dist/core/project/boundaries.d.ts.map +1 -0
- package/dist/core/project/boundaries.js +117 -0
- package/dist/core/project/boundaries.js.map +1 -0
- package/dist/core/project/capabilities.d.ts +58 -0
- package/dist/core/project/capabilities.d.ts.map +1 -0
- package/dist/core/project/capabilities.js +135 -0
- package/dist/core/project/capabilities.js.map +1 -0
- package/dist/core/project/drift.d.ts +29 -0
- package/dist/core/project/drift.d.ts.map +1 -0
- package/dist/core/project/drift.js +190 -0
- package/dist/core/project/drift.js.map +1 -0
- package/dist/core/project/infra.d.ts +49 -0
- package/dist/core/project/infra.d.ts.map +1 -0
- package/dist/core/project/infra.js +167 -0
- package/dist/core/project/infra.js.map +1 -0
- package/dist/core/project/manifest.d.ts +92 -0
- package/dist/core/project/manifest.d.ts.map +1 -0
- package/dist/core/project/manifest.js +321 -0
- package/dist/core/project/manifest.js.map +1 -0
- package/dist/core/project/state.d.ts +15 -0
- package/dist/core/project/state.d.ts.map +1 -0
- package/dist/core/project/state.js +106 -0
- package/dist/core/project/state.js.map +1 -0
- package/dist/core/project/validation.d.ts +20 -0
- package/dist/core/project/validation.d.ts.map +1 -0
- package/dist/core/project/validation.js +274 -0
- package/dist/core/project/validation.js.map +1 -0
- package/dist/core/project/workflows.d.ts +43 -0
- package/dist/core/project/workflows.d.ts.map +1 -0
- package/dist/core/project/workflows.js +299 -0
- package/dist/core/project/workflows.js.map +1 -0
- package/dist/core/scaffold/auth-generator.d.ts +63 -0
- package/dist/core/scaffold/auth-generator.d.ts.map +1 -0
- package/dist/core/scaffold/auth-generator.js +1774 -0
- package/dist/core/scaffold/auth-generator.js.map +1 -0
- package/dist/core/scaffold/connector-functions-generator.d.ts +41 -0
- package/dist/core/scaffold/connector-functions-generator.d.ts.map +1 -0
- package/dist/core/scaffold/connector-functions-generator.js +1029 -0
- package/dist/core/scaffold/connector-functions-generator.js.map +1 -0
- package/dist/core/scaffold/functions-generator.d.ts +4 -3
- package/dist/core/scaffold/functions-generator.d.ts.map +1 -1
- package/dist/core/scaffold/functions-generator.js +405 -134
- package/dist/core/scaffold/functions-generator.js.map +1 -1
- package/dist/core/scaffold/model-parser.d.ts +20 -0
- package/dist/core/scaffold/model-parser.d.ts.map +1 -1
- package/dist/core/scaffold/model-parser.js +229 -78
- package/dist/core/scaffold/model-parser.js.map +1 -1
- package/dist/core/scaffold/native-schema-generator.d.ts +19 -0
- package/dist/core/scaffold/native-schema-generator.d.ts.map +1 -0
- package/dist/core/scaffold/native-schema-generator.js +753 -0
- package/dist/core/scaffold/native-schema-generator.js.map +1 -0
- package/dist/core/scaffold/nextjs-generator.d.ts +8 -0
- package/dist/core/scaffold/nextjs-generator.d.ts.map +1 -1
- package/dist/core/scaffold/nextjs-generator.js +152 -8
- package/dist/core/scaffold/nextjs-generator.js.map +1 -1
- package/dist/core/scaffold/ui-generator.d.ts +17 -4
- package/dist/core/scaffold/ui-generator.d.ts.map +1 -1
- package/dist/core/scaffold/ui-generator.js +174 -34
- package/dist/core/scaffold/ui-generator.js.map +1 -1
- package/dist/core/verify/index.d.ts +69 -0
- package/dist/core/verify/index.d.ts.map +1 -0
- package/dist/core/verify/index.js +412 -0
- package/dist/core/verify/index.js.map +1 -0
- package/dist/machine/contracts.d.ts +24 -0
- package/dist/machine/contracts.d.ts.map +1 -0
- package/dist/machine/contracts.js +3 -0
- package/dist/machine/contracts.js.map +1 -0
- package/dist/machine/errors.d.ts +14 -0
- package/dist/machine/errors.d.ts.map +1 -0
- package/dist/machine/errors.js +42 -0
- package/dist/machine/errors.js.map +1 -0
- package/dist/machine/index.d.ts +3 -0
- package/dist/machine/index.d.ts.map +1 -0
- package/dist/machine/index.js +566 -0
- package/dist/machine/index.js.map +1 -0
- package/dist/mcp/index.d.ts +25 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +425 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/types/index.d.ts +105 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/package-manager.d.ts +7 -11
- package/dist/utils/package-manager.d.ts.map +1 -1
- package/dist/utils/package-manager.js +42 -17
- package/dist/utils/package-manager.js.map +1 -1
- package/dist/utils/python-uv.d.ts +21 -0
- package/dist/utils/python-uv.d.ts.map +1 -0
- package/dist/utils/python-uv.js +111 -0
- package/dist/utils/python-uv.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +49 -0
- package/dist/version.js.map +1 -0
- package/package.json +15 -17
- package/src/__tests__/__snapshots__/functions-generator.test.ts.snap +716 -22
- package/src/__tests__/__snapshots__/nextjs-generator.test.ts.snap +19 -7
- package/src/__tests__/__snapshots__/ui-generator.test.ts.snap +20 -12
- package/src/__tests__/agent-instructions.test.ts +237 -0
- package/src/__tests__/agent-loop-phase34.test.ts +619 -0
- package/src/__tests__/auth.test.ts +770 -0
- package/src/__tests__/bff-swa-auth.test.ts +275 -0
- package/src/__tests__/config.test.ts +176 -3
- package/src/__tests__/connector-functions-generator.test.ts +288 -0
- package/src/__tests__/connector-mock-server.test.ts +459 -0
- package/src/__tests__/connector-model-bff.test.ts +162 -0
- package/src/__tests__/cosmos-worktree-isolation.test.ts +149 -0
- package/src/__tests__/dev-seeds.test.ts +124 -0
- package/src/__tests__/dev.test.ts +254 -0
- package/src/__tests__/file-session.test.ts +98 -0
- package/src/__tests__/fixtures.ts +101 -0
- package/src/__tests__/functions-generator.test.ts +137 -1
- package/src/__tests__/init.test.ts +366 -2
- package/src/__tests__/jest-globals.d.ts +8 -0
- package/src/__tests__/machine.test.ts +371 -0
- package/src/__tests__/mcp.test.ts +253 -0
- package/src/__tests__/model-parser.test.ts +142 -0
- package/src/__tests__/multi-auth.test.ts +160 -0
- package/src/__tests__/nextjs-generator.test.ts +8 -0
- package/src/__tests__/package-manager.test.ts +59 -4
- package/src/__tests__/plan-apply.test.ts +499 -0
- package/src/__tests__/python-uv.test.ts +48 -0
- package/src/__tests__/scaffold.test.ts +287 -24
- package/src/__tests__/tsconfig.json +15 -0
- package/src/__tests__/ui-generator.test.ts +104 -0
- package/src/__tests__/zod-mock-generator.test.ts +132 -0
- package/src/cli/commands/add-auth.ts +853 -0
- package/src/cli/commands/add-connector.ts +159 -0
- package/src/cli/commands/cosmos-worktree-isolation.ts +130 -0
- package/src/cli/commands/create-model.ts +21 -100
- package/src/cli/commands/dev-seeds.ts +278 -7
- package/src/cli/commands/dev.ts +607 -160
- package/src/cli/commands/init.ts +851 -786
- package/src/cli/commands/scaffold.ts +531 -236
- package/src/cli/index.ts +338 -60
- package/src/core/config.ts +145 -9
- package/src/core/mock/connector-mock-server.ts +555 -0
- package/src/core/mock/zod-mock-generator.ts +205 -0
- package/src/core/operations/auth-operations.ts +360 -0
- package/src/core/operations/create-model.ts +191 -0
- package/src/core/operations/file-session.ts +222 -0
- package/src/core/operations/provision-operations.ts +297 -0
- package/src/core/operations/runtime.ts +258 -0
- package/src/core/operations/scaffold-apply.ts +106 -0
- package/src/core/operations/scaffold-machine.ts +77 -0
- package/src/core/operations/scaffold-plan.ts +215 -0
- package/src/core/project/agent-instructions.ts +167 -0
- package/src/core/project/agent-templates/AGENTS.md +504 -0
- package/src/core/project/agent-templates/CLAUDE.md +31 -0
- package/src/core/project/agent-templates/azure-functions.instructions.md +22 -0
- package/src/core/project/agent-templates/bff-routes.instructions.md +18 -0
- package/src/core/project/agent-templates/copilot-instructions.md +27 -0
- package/src/core/project/agent-templates/shared-models.instructions.md +72 -0
- package/src/core/project/artifacts.ts +205 -0
- package/src/core/project/boundaries.ts +170 -0
- package/src/core/project/capabilities.ts +193 -0
- package/src/core/project/drift.ts +203 -0
- package/src/core/project/infra.ts +196 -0
- package/src/core/project/manifest.ts +402 -0
- package/src/core/project/state.ts +77 -0
- package/src/core/project/validation.ts +295 -0
- package/src/core/project/workflows.ts +295 -0
- package/src/core/scaffold/auth-generator.ts +1824 -0
- package/src/core/scaffold/connector-functions-generator.ts +1133 -0
- package/src/core/scaffold/functions-generator.ts +432 -134
- package/src/core/scaffold/model-parser.ts +244 -90
- package/src/core/scaffold/native-schema-generator.ts +904 -0
- package/src/core/scaffold/nextjs-generator.ts +174 -9
- package/src/core/scaffold/ui-generator.ts +191 -36
- package/src/core/verify/index.ts +468 -0
- package/src/machine/contracts.ts +33 -0
- package/src/machine/errors.ts +45 -0
- package/src/machine/index.ts +690 -0
- package/src/mcp/index.ts +423 -0
- package/src/types/index.ts +137 -0
- package/src/utils/package-manager.ts +41 -19
- package/src/utils/python-uv.ts +96 -0
- package/src/version.ts +13 -0
package/src/mcp/index.ts
ADDED
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
|
+
import * as z from "zod/v4";
|
|
7
|
+
import type { MachineNextAction, MachineOperationStatus, MachineResponse } from "../machine/contracts";
|
|
8
|
+
import { getSwallowKitVersion } from "../version";
|
|
9
|
+
|
|
10
|
+
interface MachineSuccessPayload<TData> {
|
|
11
|
+
ok: true;
|
|
12
|
+
command: string;
|
|
13
|
+
status?: MachineOperationStatus;
|
|
14
|
+
nextActions?: MachineNextAction[];
|
|
15
|
+
data: TData;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type MachineCliRunner = (args: string[]) => Promise<{ stdout: string; stderr: string; exitCode: number }>;
|
|
19
|
+
type ToolContentResult = { content: Array<{ type: "text"; text: string }> };
|
|
20
|
+
type ToolDefinition = {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
inputSchema: z.ZodTypeAny;
|
|
24
|
+
handler: (input: any) => Promise<ToolContentResult>;
|
|
25
|
+
};
|
|
26
|
+
type ExecaModule = typeof import("execa");
|
|
27
|
+
|
|
28
|
+
// Keep this as a runtime dynamic import so CommonJS builds do not rewrite it to require().
|
|
29
|
+
const importModule = new Function("specifier", "return import(specifier);") as (
|
|
30
|
+
specifier: string
|
|
31
|
+
) => Promise<ExecaModule>;
|
|
32
|
+
|
|
33
|
+
function resolveMachineCliEntrypoint(): string {
|
|
34
|
+
return path.resolve(__dirname, "..", "cli", "index.js");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async function defaultMachineCliRunner(args: string[]): Promise<{ stdout: string; stderr: string; exitCode: number }> {
|
|
38
|
+
const { execa } = await importModule("execa");
|
|
39
|
+
const result = await execa(process.execPath, [resolveMachineCliEntrypoint(), "machine", ...args], {
|
|
40
|
+
reject: false,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
stdout: result.stdout,
|
|
45
|
+
stderr: result.stderr,
|
|
46
|
+
exitCode: result.exitCode ?? 0,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function executeMachineCommand<TData>(
|
|
51
|
+
args: string[],
|
|
52
|
+
runMachineCli: MachineCliRunner
|
|
53
|
+
): Promise<MachineSuccessPayload<TData>> {
|
|
54
|
+
const result = await runMachineCli(args);
|
|
55
|
+
|
|
56
|
+
let parsed: MachineResponse<TData>;
|
|
57
|
+
try {
|
|
58
|
+
parsed = JSON.parse(result.stdout) as MachineResponse<TData>;
|
|
59
|
+
} catch {
|
|
60
|
+
throw new Error(result.stderr || result.stdout || "Machine CLI returned invalid JSON.");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (!parsed.ok) {
|
|
64
|
+
const detailsSuffix =
|
|
65
|
+
parsed.error.details !== undefined ? `\ndetails: ${JSON.stringify(parsed.error.details)}` : "";
|
|
66
|
+
const statusSuffix = parsed.status ? ` (status: ${parsed.status})` : "";
|
|
67
|
+
throw new Error(`[${parsed.error.code}] ${parsed.error.message}${statusSuffix}${detailsSuffix}`);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return parsed;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function withOperationStatus<TData>(response: MachineSuccessPayload<TData>): Record<string, unknown> {
|
|
74
|
+
const data = response.data && typeof response.data === "object"
|
|
75
|
+
? (response.data as Record<string, unknown>)
|
|
76
|
+
: { data: response.data };
|
|
77
|
+
return {
|
|
78
|
+
status: response.status ?? "complete",
|
|
79
|
+
...(response.nextActions && response.nextActions.length > 0 ? { nextActions: response.nextActions } : {}),
|
|
80
|
+
...data,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function jsonTextContent(value: unknown): { content: Array<{ type: "text"; text: string }> } {
|
|
85
|
+
return {
|
|
86
|
+
content: [
|
|
87
|
+
{
|
|
88
|
+
type: "text",
|
|
89
|
+
text: JSON.stringify(value, null, 2),
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function withSwallowKitMetadata<TData>(data: TData): TData & { metadata: Record<string, unknown> } {
|
|
96
|
+
const value = data && typeof data === "object" ? data as Record<string, unknown> : { data };
|
|
97
|
+
const metadata = value.metadata && typeof value.metadata === "object"
|
|
98
|
+
? value.metadata as Record<string, unknown>
|
|
99
|
+
: {};
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
...value,
|
|
103
|
+
metadata: {
|
|
104
|
+
...metadata,
|
|
105
|
+
swallowkitVersion: getSwallowKitVersion(),
|
|
106
|
+
},
|
|
107
|
+
} as TData & { metadata: Record<string, unknown> };
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function buildSwallowKitToolDefinitions(
|
|
111
|
+
runMachineCli: MachineCliRunner = defaultMachineCliRunner
|
|
112
|
+
): ToolDefinition[] {
|
|
113
|
+
return [
|
|
114
|
+
{
|
|
115
|
+
name: "swallowkit_inspect_project",
|
|
116
|
+
description: "Return framework-owned SwallowKit project metadata.",
|
|
117
|
+
inputSchema: z.object({}),
|
|
118
|
+
handler: async () => {
|
|
119
|
+
const response = await executeMachineCommand(["inspect", "project"], runMachineCli);
|
|
120
|
+
return jsonTextContent(withSwallowKitMetadata(response.data));
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: "swallowkit_inspect_entities",
|
|
125
|
+
description: "Return SwallowKit entities, schema metadata, and connector/auth annotations.",
|
|
126
|
+
inputSchema: z.object({}),
|
|
127
|
+
handler: async () => {
|
|
128
|
+
const response = await executeMachineCommand(["inspect", "entities"], runMachineCli);
|
|
129
|
+
return jsonTextContent(response.data);
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "swallowkit_inspect_routes",
|
|
134
|
+
description: "Return BFF and Functions route metadata understood by SwallowKit.",
|
|
135
|
+
inputSchema: z.object({}),
|
|
136
|
+
handler: async () => {
|
|
137
|
+
const response = await executeMachineCommand(["inspect", "routes"], runMachineCli);
|
|
138
|
+
return jsonTextContent(response.data);
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "swallowkit_validate_project",
|
|
143
|
+
description: "Validate project metadata, generated artifacts, and framework conventions.",
|
|
144
|
+
inputSchema: z.object({}),
|
|
145
|
+
handler: async () => {
|
|
146
|
+
const response = await executeMachineCommand(["validate", "project"], runMachineCli);
|
|
147
|
+
return jsonTextContent(withSwallowKitMetadata(response.data));
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "swallowkit_generate_model",
|
|
152
|
+
description: "Generate SwallowKit model templates through the official generator.",
|
|
153
|
+
inputSchema: z.object({
|
|
154
|
+
names: z.array(z.string()).min(1),
|
|
155
|
+
modelsDir: z.string().optional(),
|
|
156
|
+
connector: z.string().optional(),
|
|
157
|
+
overwrite: z.enum(["always", "never"]).optional(),
|
|
158
|
+
}),
|
|
159
|
+
handler: async ({ names, modelsDir, connector, overwrite }: { names: string[]; modelsDir?: string; connector?: string; overwrite?: "always" | "never" }) => {
|
|
160
|
+
const response = await executeMachineCommand(["generate", "model", ...names, ...(modelsDir ? ["--models-dir", modelsDir] : []), ...(connector ? ["--connector", connector] : []), "--overwrite", overwrite || "never"], runMachineCli);
|
|
161
|
+
return jsonTextContent(response.data);
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: "swallowkit_scaffold_model",
|
|
166
|
+
description: "Generate SwallowKit scaffold artifacts through the official generator.",
|
|
167
|
+
inputSchema: z.object({
|
|
168
|
+
model: z.string(),
|
|
169
|
+
functionsDir: z.string().optional(),
|
|
170
|
+
apiDir: z.string().optional(),
|
|
171
|
+
apiOnly: z.boolean().optional(),
|
|
172
|
+
}),
|
|
173
|
+
handler: async ({ model, functionsDir, apiDir, apiOnly }: { model: string; functionsDir?: string; apiDir?: string; apiOnly?: boolean }) => {
|
|
174
|
+
const args = ["generate", "scaffold", model];
|
|
175
|
+
if (functionsDir) {
|
|
176
|
+
args.push("--functions-dir", functionsDir);
|
|
177
|
+
}
|
|
178
|
+
if (apiDir) {
|
|
179
|
+
args.push("--api-dir", apiDir);
|
|
180
|
+
}
|
|
181
|
+
if (apiOnly) {
|
|
182
|
+
args.push("--api-only");
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const response = await executeMachineCommand(args, runMachineCli);
|
|
186
|
+
return jsonTextContent(response.data);
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: "swallowkit_plan_scaffold",
|
|
191
|
+
description: "Compute the scaffold change plan (files to create/update/overwrite, conflicts, warnings) without writing any files. Accepts one or more models; returns a planId per model usable with swallowkit_apply_scaffold.",
|
|
192
|
+
inputSchema: z.object({
|
|
193
|
+
model: z.string().optional(),
|
|
194
|
+
models: z.array(z.string()).optional(),
|
|
195
|
+
functionsDir: z.string().optional(),
|
|
196
|
+
apiDir: z.string().optional(),
|
|
197
|
+
apiOnly: z.boolean().optional(),
|
|
198
|
+
}),
|
|
199
|
+
handler: async ({ model, models, functionsDir, apiDir, apiOnly }: { model?: string; models?: string[]; functionsDir?: string; apiDir?: string; apiOnly?: boolean }) => {
|
|
200
|
+
const targets = models && models.length > 0 ? models : model ? [model] : [];
|
|
201
|
+
if (targets.length === 0) throw new Error("Provide model or models.");
|
|
202
|
+
const args = ["plan", "scaffold", ...targets];
|
|
203
|
+
if (functionsDir) args.push("--functions-dir", functionsDir);
|
|
204
|
+
if (apiDir) args.push("--api-dir", apiDir);
|
|
205
|
+
if (apiOnly) args.push("--api-only");
|
|
206
|
+
|
|
207
|
+
const response = await executeMachineCommand(args, runMachineCli);
|
|
208
|
+
return jsonTextContent(withOperationStatus(response));
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "swallowkit_apply_scaffold",
|
|
213
|
+
description: "Apply scaffold changes. Rejects stale plans (files changed after planning) and requires approve=true when user-modified files would be overwritten.",
|
|
214
|
+
inputSchema: z.object({
|
|
215
|
+
model: z.string().optional(),
|
|
216
|
+
planId: z.string().optional(),
|
|
217
|
+
approve: z.boolean().optional(),
|
|
218
|
+
functionsDir: z.string().optional(),
|
|
219
|
+
apiDir: z.string().optional(),
|
|
220
|
+
apiOnly: z.boolean().optional(),
|
|
221
|
+
}),
|
|
222
|
+
handler: async ({ model, planId, approve, functionsDir, apiDir, apiOnly }: { model?: string; planId?: string; approve?: boolean; functionsDir?: string; apiDir?: string; apiOnly?: boolean }) => {
|
|
223
|
+
const args = ["apply", "scaffold"];
|
|
224
|
+
if (model) args.push(model);
|
|
225
|
+
if (planId) args.push("--plan", planId);
|
|
226
|
+
if (approve) args.push("--approve");
|
|
227
|
+
if (functionsDir) args.push("--functions-dir", functionsDir);
|
|
228
|
+
if (apiDir) args.push("--api-dir", apiDir);
|
|
229
|
+
if (apiOnly) args.push("--api-only");
|
|
230
|
+
|
|
231
|
+
const response = await executeMachineCommand(args, runMachineCli);
|
|
232
|
+
return jsonTextContent(withOperationStatus(response));
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: "swallowkit_inspect_artifacts",
|
|
237
|
+
description: "Return the generated-artifact ledger with ownership, source model, and modified/missing flags.",
|
|
238
|
+
inputSchema: z.object({}),
|
|
239
|
+
handler: async () => {
|
|
240
|
+
const response = await executeMachineCommand(["inspect", "artifacts"], runMachineCli);
|
|
241
|
+
return jsonTextContent(withSwallowKitMetadata(response.data));
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: "swallowkit_inspect_drift",
|
|
246
|
+
description: "Detect drift between generated artifacts and the current project state (schema changes, manual edits, missing files, manifest mismatch). Each finding includes a repairAction.",
|
|
247
|
+
inputSchema: z.object({}),
|
|
248
|
+
handler: async () => {
|
|
249
|
+
const response = await executeMachineCommand(["inspect", "drift"], runMachineCli);
|
|
250
|
+
return jsonTextContent(withOperationStatus(response));
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
name: "swallowkit_verify_project",
|
|
255
|
+
description: "Run verification checks (structure, drift, typecheck by default; build, lint, test and custom checks from swallowkit.config verify.checks are also available) and return machine-readable evidence. summary.done=true means the project passed all checks. Set compact=true to suppress info-severity findings and keep the output small.",
|
|
256
|
+
inputSchema: z.object({
|
|
257
|
+
checks: z.array(z.string()).optional(),
|
|
258
|
+
compact: z.boolean().optional(),
|
|
259
|
+
}),
|
|
260
|
+
handler: async ({ checks, compact }: { checks?: string[]; compact?: boolean }) => {
|
|
261
|
+
const args = ["verify", "project"];
|
|
262
|
+
if (checks && checks.length > 0) {
|
|
263
|
+
args.push("--checks", checks.join(","));
|
|
264
|
+
}
|
|
265
|
+
if (compact) args.push("--compact");
|
|
266
|
+
|
|
267
|
+
const response = await executeMachineCommand(args, runMachineCli);
|
|
268
|
+
return jsonTextContent(withOperationStatus(response));
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: "swallowkit_explain_failure",
|
|
273
|
+
description: "Explain failures from the most recent swallowkit_verify_project run, including evidence and suggested actions.",
|
|
274
|
+
inputSchema: z.object({
|
|
275
|
+
check: z.string().optional(),
|
|
276
|
+
}),
|
|
277
|
+
handler: async ({ check }: { check?: string }) => {
|
|
278
|
+
const args = ["explain", "failure"];
|
|
279
|
+
if (check) {
|
|
280
|
+
args.push("--check", check);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const response = await executeMachineCommand(args, runMachineCli);
|
|
284
|
+
return jsonTextContent(withOperationStatus(response));
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
name: "swallowkit_inspect_boundaries",
|
|
289
|
+
description: "Return the responsibility boundary contract: which paths are deterministic (regenerate via plan/apply), which are AI/human-authored (free edit), and which are shared extension points.",
|
|
290
|
+
inputSchema: z.object({}),
|
|
291
|
+
handler: async () => {
|
|
292
|
+
const response = await executeMachineCommand(["inspect", "boundaries"], runMachineCli);
|
|
293
|
+
return jsonTextContent(withSwallowKitMetadata(response.data));
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
name: "swallowkit_inspect_capabilities",
|
|
298
|
+
description: "Return SwallowKit's capability contract: which declarations models support (partitionKey, authPolicy, displayName, connectorConfig, with format examples), the correct auth-introduction workflow, what generated CRUD does and does NOT guarantee (no owner scoping), how dev seeds are applied, and every machine command. Consult this before assuming SwallowKit can or cannot do something.",
|
|
299
|
+
inputSchema: z.object({}),
|
|
300
|
+
handler: async () => {
|
|
301
|
+
const response = await executeMachineCommand(["inspect", "capabilities"], runMachineCli);
|
|
302
|
+
return jsonTextContent(withSwallowKitMetadata(response.data));
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: "swallowkit_plan_auth",
|
|
307
|
+
description: "Compute the add-auth change plan (files to create/update/overwrite, conflicts, warnings) without writing any files. Returns a planId usable with swallowkit_apply_auth. Never hand-write auth.schemes in swallowkit.config; this operation owns them.",
|
|
308
|
+
inputSchema: z.object({
|
|
309
|
+
provider: z.enum(["custom-jwt", "swa", "external-token", "none"]),
|
|
310
|
+
scheme: z.string().optional(),
|
|
311
|
+
allowedProviders: z.array(z.string()).optional(),
|
|
312
|
+
}),
|
|
313
|
+
handler: async ({ provider, scheme, allowedProviders }: { provider: string; scheme?: string; allowedProviders?: string[] }) => {
|
|
314
|
+
const args = ["plan", "auth", "--provider", provider];
|
|
315
|
+
if (scheme) args.push("--scheme", scheme);
|
|
316
|
+
if (allowedProviders && allowedProviders.length > 0) args.push("--allowed-providers", allowedProviders.join(","));
|
|
317
|
+
|
|
318
|
+
const response = await executeMachineCommand(args, runMachineCli);
|
|
319
|
+
return jsonTextContent(withOperationStatus(response));
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
name: "swallowkit_apply_auth",
|
|
324
|
+
description: "Apply add-auth changes. Rejects stale plans and requires approve=true when user-modified files would be overwritten. Follow the returned nextActions: policies and swa.allowedProviders are hand-edited afterwards, and external-token verifier stubs must be implemented.",
|
|
325
|
+
inputSchema: z.object({
|
|
326
|
+
provider: z.enum(["custom-jwt", "swa", "external-token", "none"]).optional(),
|
|
327
|
+
scheme: z.string().optional(),
|
|
328
|
+
allowedProviders: z.array(z.string()).optional(),
|
|
329
|
+
planId: z.string().optional(),
|
|
330
|
+
approve: z.boolean().optional(),
|
|
331
|
+
}),
|
|
332
|
+
handler: async ({ provider, scheme, allowedProviders, planId, approve }: { provider?: string; scheme?: string; allowedProviders?: string[]; planId?: string; approve?: boolean }) => {
|
|
333
|
+
const args = ["apply", "auth"];
|
|
334
|
+
if (planId) args.push("--plan", planId);
|
|
335
|
+
if (provider) args.push("--provider", provider);
|
|
336
|
+
if (scheme) args.push("--scheme", scheme);
|
|
337
|
+
if (allowedProviders && allowedProviders.length > 0) args.push("--allowed-providers", allowedProviders.join(","));
|
|
338
|
+
if (approve) args.push("--approve");
|
|
339
|
+
|
|
340
|
+
const response = await executeMachineCommand(args, runMachineCli);
|
|
341
|
+
return jsonTextContent(withOperationStatus(response));
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
name: "swallowkit_inspect_infra",
|
|
346
|
+
description: "Inspect Bicep infrastructure assets deterministically (params, modules, outputs, container wiring). Does not call Azure.",
|
|
347
|
+
inputSchema: z.object({}),
|
|
348
|
+
handler: async () => {
|
|
349
|
+
const response = await executeMachineCommand(["inspect", "infra"], runMachineCli);
|
|
350
|
+
return jsonTextContent(withSwallowKitMetadata(response.data));
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
name: "swallowkit_plan_provision",
|
|
355
|
+
description: "Preflight Azure provisioning locally (Bicep analysis, az CLI availability, command preview). Never deploys. Set whatIf=true to run az what-if (requires az login). The returned plan always requires human approval.",
|
|
356
|
+
inputSchema: z.object({
|
|
357
|
+
resourceGroup: z.string(),
|
|
358
|
+
location: z.string(),
|
|
359
|
+
swaLocation: z.string(),
|
|
360
|
+
subscription: z.string().optional(),
|
|
361
|
+
whatIf: z.boolean().optional(),
|
|
362
|
+
}),
|
|
363
|
+
handler: async ({ resourceGroup, location, swaLocation, subscription, whatIf }: { resourceGroup: string; location: string; swaLocation: string; subscription?: string; whatIf?: boolean }) => {
|
|
364
|
+
const args = ["plan", "provision", "--resource-group", resourceGroup, "--location", location, "--swa-location", swaLocation];
|
|
365
|
+
if (subscription) args.push("--subscription", subscription);
|
|
366
|
+
if (whatIf) args.push("--what-if");
|
|
367
|
+
|
|
368
|
+
const response = await executeMachineCommand(args, runMachineCli);
|
|
369
|
+
return jsonTextContent(withOperationStatus(response));
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
name: "swallowkit_apply_provision",
|
|
374
|
+
description: "Apply an approved provisioning plan. Creates billable Azure resources; approve=true is always required and must reflect explicit human consent.",
|
|
375
|
+
inputSchema: z.object({
|
|
376
|
+
planId: z.string(),
|
|
377
|
+
approve: z.boolean().optional(),
|
|
378
|
+
}),
|
|
379
|
+
handler: async ({ planId, approve }: { planId: string; approve?: boolean }) => {
|
|
380
|
+
const args = ["apply", "provision", "--plan", planId];
|
|
381
|
+
if (approve) args.push("--approve");
|
|
382
|
+
|
|
383
|
+
const response = await executeMachineCommand(args, runMachineCli);
|
|
384
|
+
return jsonTextContent(withOperationStatus(response));
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
];
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export function createSwallowKitMcpServer(runMachineCli: MachineCliRunner = defaultMachineCliRunner): McpServer {
|
|
391
|
+
const version = getSwallowKitVersion();
|
|
392
|
+
const server = new McpServer({
|
|
393
|
+
name: "swallowkit-mcp",
|
|
394
|
+
version,
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
for (const tool of buildSwallowKitToolDefinitions(runMachineCli)) {
|
|
398
|
+
server.registerTool(
|
|
399
|
+
tool.name,
|
|
400
|
+
{
|
|
401
|
+
description: tool.description,
|
|
402
|
+
inputSchema: tool.inputSchema,
|
|
403
|
+
},
|
|
404
|
+
tool.handler
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
return server;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export async function runMcpServer(): Promise<void> {
|
|
412
|
+
console.error(`[swallowkit-mcp] version: ${getSwallowKitVersion()}`);
|
|
413
|
+
const server = createSwallowKitMcpServer();
|
|
414
|
+
const transport = new StdioServerTransport();
|
|
415
|
+
await server.connect(transport);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
if (require.main === module) {
|
|
419
|
+
void runMcpServer().catch((error) => {
|
|
420
|
+
console.error(error);
|
|
421
|
+
process.exitCode = 1;
|
|
422
|
+
});
|
|
423
|
+
}
|
package/src/types/index.ts
CHANGED
|
@@ -26,6 +26,124 @@ export interface UseServerFnResult<TResult> {
|
|
|
26
26
|
refetch: () => void;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
// コネクタの操作種別
|
|
30
|
+
export type ConnectorOperation = "getAll" | "getById" | "create" | "update" | "delete";
|
|
31
|
+
|
|
32
|
+
// RDB コネクタ設定
|
|
33
|
+
export interface RdbConnectorConfig {
|
|
34
|
+
type: "rdb";
|
|
35
|
+
provider: "mysql" | "postgres" | "sqlserver";
|
|
36
|
+
connectionEnvVar: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// API コネクタの認証設定
|
|
40
|
+
export interface ApiConnectorAuth {
|
|
41
|
+
type: "apiKey" | "bearer" | "oauth2";
|
|
42
|
+
envVar: string;
|
|
43
|
+
placement?: "query" | "header";
|
|
44
|
+
paramName?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// API コネクタ設定
|
|
48
|
+
export interface ApiConnectorConfig {
|
|
49
|
+
type: "api";
|
|
50
|
+
baseUrlEnvVar: string;
|
|
51
|
+
auth?: ApiConnectorAuth;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// コネクタ設定の共用型
|
|
55
|
+
export type ConnectorDefinition = RdbConnectorConfig | ApiConnectorConfig;
|
|
56
|
+
|
|
57
|
+
// モデルに付与するコネクタメタデータ(RDB用)
|
|
58
|
+
export interface RdbModelConnectorConfig {
|
|
59
|
+
connector: string;
|
|
60
|
+
operations: readonly ConnectorOperation[];
|
|
61
|
+
table: string;
|
|
62
|
+
idColumn?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// モデルに付与するコネクタメタデータ(API用)
|
|
66
|
+
export interface ApiModelConnectorConfig {
|
|
67
|
+
connector: string;
|
|
68
|
+
operations: readonly ConnectorOperation[];
|
|
69
|
+
endpoints?: Partial<Record<ConnectorOperation, string>>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// モデルに付与するコネクタメタデータの共用型
|
|
73
|
+
export type ModelConnectorConfig = RdbModelConnectorConfig | ApiModelConnectorConfig;
|
|
74
|
+
|
|
75
|
+
// 認証プロバイダー種別
|
|
76
|
+
export type AuthProvider = "custom-jwt" | "swa" | "external-token" | "swa-custom" | "none";
|
|
77
|
+
|
|
78
|
+
// custom-jwt プロバイダー設定
|
|
79
|
+
export interface CustomJwtConfig {
|
|
80
|
+
userConnector: string;
|
|
81
|
+
userTable: string;
|
|
82
|
+
loginIdColumn: string;
|
|
83
|
+
passwordHashColumn: string;
|
|
84
|
+
rolesColumn: string;
|
|
85
|
+
jwtSecretEnv?: string;
|
|
86
|
+
tokenExpiry?: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// SWA 認証設定(将来用)
|
|
90
|
+
export interface SwaAuthConfig {
|
|
91
|
+
allowedProviders?: string[];
|
|
92
|
+
roleSource?: "swa-roles" | "connector";
|
|
93
|
+
roleConnector?: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// 認可設定
|
|
97
|
+
export interface AuthorizationConfig {
|
|
98
|
+
defaultPolicy?: "authenticated" | "anonymous" | "public" | string;
|
|
99
|
+
policies?: Record<string, AuthorizationPolicy>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface AuthorizationPolicy {
|
|
103
|
+
schemes: string[];
|
|
104
|
+
roles?: string[];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface AuthSchemeConfig {
|
|
108
|
+
provider: AuthProvider;
|
|
109
|
+
customJwt?: CustomJwtConfig;
|
|
110
|
+
swa?: SwaAuthConfig;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// 認証設定
|
|
114
|
+
export interface AuthConfig {
|
|
115
|
+
provider?: AuthProvider;
|
|
116
|
+
schemes?: Record<string, AuthSchemeConfig>;
|
|
117
|
+
customJwt?: CustomJwtConfig;
|
|
118
|
+
swa?: SwaAuthConfig;
|
|
119
|
+
authorization?: AuthorizationConfig;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// モデルに付与する認可ポリシー
|
|
123
|
+
export interface ModelAuthPolicy {
|
|
124
|
+
roles?: string[];
|
|
125
|
+
read?: string[] | string;
|
|
126
|
+
write?: string[] | string;
|
|
127
|
+
policy?: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface NormalizedAuthConfig extends Omit<AuthConfig, "schemes" | "authorization"> {
|
|
131
|
+
schemes: Record<string, AuthSchemeConfig>;
|
|
132
|
+
authorization: AuthorizationConfig & { defaultPolicy: string; policies: Record<string, AuthorizationPolicy> };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface AuthPrincipal {
|
|
136
|
+
subject: string;
|
|
137
|
+
scheme: string;
|
|
138
|
+
issuer: string;
|
|
139
|
+
roles: string[];
|
|
140
|
+
claims: Record<string, unknown>;
|
|
141
|
+
/** @deprecated Use subject. */
|
|
142
|
+
userId?: string;
|
|
143
|
+
/** @deprecated Read provider data from claims. */
|
|
144
|
+
userDetails?: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
29
147
|
// CLI設定の型
|
|
30
148
|
export interface SwallowKitConfig {
|
|
31
149
|
database?: {
|
|
@@ -42,4 +160,23 @@ export interface SwallowKitConfig {
|
|
|
42
160
|
credentials?: boolean;
|
|
43
161
|
};
|
|
44
162
|
};
|
|
163
|
+
connectors?: Record<string, ConnectorDefinition>;
|
|
164
|
+
auth?: AuthConfig;
|
|
165
|
+
verify?: VerifySettings;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// verify コマンドのプロジェクト固有設定
|
|
169
|
+
export interface CustomVerifyCheck {
|
|
170
|
+
/** チェック ID (built-in と重複不可)。 */
|
|
171
|
+
id: string;
|
|
172
|
+
title?: string;
|
|
173
|
+
/** プロジェクトルートで実行するシェルコマンド。exit 0 = pass。 */
|
|
174
|
+
command: string;
|
|
175
|
+
/** タイムアウト (ms)。既定 5 分。 */
|
|
176
|
+
timeoutMs?: number;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface VerifySettings {
|
|
180
|
+
/** プロジェクト固有の追加チェック。デフォルト実行セットに含まれる。 */
|
|
181
|
+
checks?: CustomVerifyCheck[];
|
|
45
182
|
}
|