(packageDir: string)
| 2162 | // ── Package-info generation ────────────────────────────────────────────────── |
| 2163 | |
| 2164 | async function generateGeneratedPackageInfo(packageDir: string): Promise<void> { |
| 2165 | const lines: string[] = []; |
| 2166 | lines.push(COPYRIGHT); |
| 2167 | lines.push(""); |
| 2168 | lines.push(AUTO_GENERATED_HEADER); |
| 2169 | lines.push(GENERATED_FROM_SESSION_EVENTS); |
| 2170 | lines.push(""); |
| 2171 | lines.push(`/**`); |
| 2172 | lines.push(` * Auto-generated session event types for the GitHub Copilot SDK.`); |
| 2173 | lines.push(` *`); |
| 2174 | lines.push(` * <p>`); |
| 2175 | lines.push(` * This package contains Java classes generated from the Copilot CLI's`); |
| 2176 | lines.push(` * {@code session-events.schema.json}. Each event type corresponds to a`); |
| 2177 | lines.push(` * notification emitted during a {@link com.github.copilot.CopilotSession}`); |
| 2178 | lines.push(` * interaction.`); |
| 2179 | lines.push(` *`); |
| 2180 | lines.push(` * <h2>Key Classes</h2>`); |
| 2181 | lines.push(` * <ul>`); |
| 2182 | lines.push(` * <li>{@link com.github.copilot.generated.SessionEvent} - Abstract sealed base`); |
| 2183 | lines.push(` * class for all session events. Deserialized polymorphically via the`); |
| 2184 | lines.push(` * {@code type} discriminator.</li>`); |
| 2185 | lines.push(` * <li>{@link com.github.copilot.generated.UnknownSessionEvent} - Fallback for`); |
| 2186 | lines.push(` * event types not yet known to this SDK version, preserving forward`); |
| 2187 | lines.push(` * compatibility.</li>`); |
| 2188 | lines.push(` * </ul>`); |
| 2189 | lines.push(` *`); |
| 2190 | lines.push(` * <h2>Example Usage</h2>`); |
| 2191 | lines.push(` *`); |
| 2192 | lines.push(` * <pre>{@code`); |
| 2193 | lines.push(` * session.on(AssistantMessageEvent.class, msg -> {`); |
| 2194 | lines.push(` * System.out.println(msg.getData().content());`); |
| 2195 | lines.push(` * });`); |
| 2196 | lines.push(` * }</pre>`); |
| 2197 | lines.push(` *`); |
| 2198 | lines.push(` * <h2>Related Packages</h2>`); |
| 2199 | lines.push(` * <ul>`); |
| 2200 | lines.push(` * <li>{@link com.github.copilot} - Core SDK classes</li>`); |
| 2201 | lines.push(` * <li>{@link com.github.copilot.generated.rpc} - Auto-generated RPC`); |
| 2202 | lines.push(` * parameter and result types</li>`); |
| 2203 | lines.push(` * </ul>`); |
| 2204 | lines.push(` *`); |
| 2205 | lines.push(` * @see com.github.copilot.CopilotSession`); |
| 2206 | lines.push(` * @see com.github.copilot.generated.SessionEvent`); |
| 2207 | lines.push(` */`); |
| 2208 | lines.push(`package com.github.copilot.generated;`); |
| 2209 | lines.push(""); |
| 2210 | |
| 2211 | await writeGeneratedFile(`${packageDir}/package-info.java`, lines.join("\n")); |
| 2212 | } |
| 2213 | |
| 2214 | async function generateRpcPackageInfo(packageDir: string): Promise<void> { |
| 2215 | const lines: string[] = []; |
no test coverage detected
searching dependent graphs…