Merge upstream v0.4.0 into Gitea fork

This commit is contained in:
2026-10-31 13:45:06 +03:00
286 changed files with 24403 additions and 2546 deletions
+1
View File
@@ -35,6 +35,7 @@ async function fixture(options: { login?: (id: string, interaction: ProviderAuth
test("main loader resolves Pi's import-only PUBLIC package exports and native OAuth without a CLI or network", async () => {
const sdk = await loadSubscriptionSDK(path.resolve(import.meta.dirname, ".."));
assert.equal(typeof sdk.createModels, "function");
assert.throws(() => require("@earendil-works/pi-ai"), { code: "ERR_PACKAGE_PATH_NOT_EXPORTED" }, "the temporary import resolver must not alter later CommonJS resolution");
for (const [id, factory] of [["github-copilot", sdk.githubCopilotProvider], ["xai", sdk.xaiProvider]] as const) {
const provider = factory(), store = new sdk.InMemoryCredentialStore(); await store.modify(id, () => credential(id));
const models = sdk.createModels({ credentials: store }); models.setProvider({ ...provider, auth: { oauth: provider.auth.oauth } });