Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
183 lines
5.9 KiB
TypeScript
183 lines
5.9 KiB
TypeScript
import { readFileSync } from "node:fs";
|
|
import { resolve } from "node:path";
|
|
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
import {
|
|
agentGUIBuildEntries,
|
|
agentGUIDtsBuildEntries,
|
|
agentGUIDtsEntryGroups
|
|
} from "./build/agentGuiBuildEntries";
|
|
|
|
const packageManifest = JSON.parse(
|
|
readFileSync(resolve(process.cwd(), "package.json"), "utf8")
|
|
) as {
|
|
publishConfig: {
|
|
exports: Record<string, unknown>;
|
|
};
|
|
};
|
|
const packageRootSource = readFileSync(
|
|
resolve(process.cwd(), "index.ts"),
|
|
"utf8"
|
|
);
|
|
const declarationTsconfig = JSON.parse(
|
|
readFileSync(resolve(process.cwd(), "tsconfig.dts.json"), "utf8")
|
|
) as { files: string[] };
|
|
|
|
describe("Agent GUI declaration build", () => {
|
|
it("pre-emits every runtime entry exactly once", () => {
|
|
const declarationSources = declarationTsconfig.files;
|
|
const runtimeSources = Object.values(agentGUIBuildEntries).sort();
|
|
|
|
expect(new Set(declarationSources).size).toBe(declarationSources.length);
|
|
expect([...declarationSources].sort()).toEqual(runtimeSources);
|
|
expect(Object.keys(agentGUIDtsBuildEntries).sort()).toEqual(
|
|
Object.keys(agentGUIBuildEntries).sort()
|
|
);
|
|
});
|
|
|
|
it("rolls up every pre-emitted declaration exactly once", () => {
|
|
const groupedEntries = agentGUIDtsEntryGroups.flat();
|
|
|
|
expect(new Set(groupedEntries).size).toBe(groupedEntries.length);
|
|
expect([...groupedEntries].sort()).toEqual(
|
|
Object.keys(agentGUIDtsBuildEntries).sort()
|
|
);
|
|
});
|
|
|
|
it("publishes every declaration build entry", () => {
|
|
const publishedDeclarationEntries = Object.values(
|
|
packageManifest.publishConfig.exports
|
|
)
|
|
.flatMap((value) => {
|
|
if (!value || typeof value !== "object" || !("types" in value)) {
|
|
return [];
|
|
}
|
|
return [String(value.types)];
|
|
})
|
|
.map((path) => path.replace(/^\.\/dist\//, "").replace(/\.d\.ts$/, ""))
|
|
.sort();
|
|
|
|
expect(publishedDeclarationEntries).toEqual(
|
|
Object.keys(agentGUIBuildEntries).sort()
|
|
);
|
|
});
|
|
|
|
it("builds and publishes the workspace settings panel contract", () => {
|
|
expect(agentGUIBuildEntries["workspace-settings-panel"]).toBe(
|
|
"shared/workspaceSettingsPanel/workspaceSettingsPanelStore.ts"
|
|
);
|
|
expect(
|
|
packageManifest.publishConfig.exports["./workspace-settings-panel"]
|
|
).toEqual({
|
|
types: "./dist/workspace-settings-panel.d.ts",
|
|
import: "./dist/workspace-settings-panel.js"
|
|
});
|
|
});
|
|
|
|
it("builds and publishes the conversation rail runtime contract", () => {
|
|
expect(agentGUIBuildEntries["conversation-rail-runtime"]).toBe(
|
|
"agentConversationRailRuntime.ts"
|
|
);
|
|
expect(
|
|
packageManifest.publishConfig.exports["./conversation-rail-runtime"]
|
|
).toEqual({
|
|
types: "./dist/conversation-rail-runtime.d.ts",
|
|
import: "./dist/conversation-rail-runtime.js"
|
|
});
|
|
});
|
|
|
|
it("builds and publishes the headless conversation rail controller", () => {
|
|
expect(agentGUIBuildEntries["conversation-rail-controller"]).toBe(
|
|
"agentConversationRailController.ts"
|
|
);
|
|
expect(
|
|
packageManifest.publishConfig.exports["./conversation-rail-controller"]
|
|
).toEqual({
|
|
types: "./dist/conversation-rail-controller.d.ts",
|
|
import: "./dist/conversation-rail-controller.js"
|
|
});
|
|
});
|
|
|
|
it("builds and publishes the headless conversation message controller", () => {
|
|
expect(agentGUIBuildEntries["conversation-message-controller"]).toBe(
|
|
"agentConversationMessageController.ts"
|
|
);
|
|
expect(
|
|
packageManifest.publishConfig.exports["./conversation-message-controller"]
|
|
).toEqual({
|
|
types: "./dist/conversation-message-controller.d.ts",
|
|
import: "./dist/conversation-message-controller.js"
|
|
});
|
|
});
|
|
|
|
it("keeps conversation rail seams off the package root", () => {
|
|
expect(packageRootSource).not.toContain(
|
|
'from "./agentConversationRailController"'
|
|
);
|
|
expect(packageRootSource).not.toContain(
|
|
'from "./agentConversationRailRuntime"'
|
|
);
|
|
expect(packageRootSource).not.toContain(
|
|
'from "./agentConversationMessageController"'
|
|
);
|
|
});
|
|
|
|
it("keeps the workspace query cache package-internal", () => {
|
|
expect(agentGUIBuildEntries).not.toHaveProperty("workspace-query-cache");
|
|
expect(
|
|
packageManifest.publishConfig.exports["./workspace-query-cache"]
|
|
).toBeUndefined();
|
|
});
|
|
|
|
it("builds and publishes the DOM-free conversation rail projection", () => {
|
|
expect(agentGUIBuildEntries["conversation-rail-projection"]).toBe(
|
|
"conversationRailProjection.ts"
|
|
);
|
|
expect(
|
|
packageManifest.publishConfig.exports["./conversation-rail-projection"]
|
|
).toEqual({
|
|
types: "./dist/conversation-rail-projection.d.ts",
|
|
import: "./dist/conversation-rail-projection.js"
|
|
});
|
|
});
|
|
|
|
it("builds and publishes the DOM-free conversation projection", () => {
|
|
expect(agentGUIBuildEntries["conversation-projection"]).toBe(
|
|
"conversationProjection.ts"
|
|
);
|
|
expect(
|
|
packageManifest.publishConfig.exports["./conversation-projection"]
|
|
).toEqual({
|
|
types: "./dist/conversation-projection.d.ts",
|
|
import: "./dist/conversation-projection.js"
|
|
});
|
|
});
|
|
|
|
it("builds and publishes the DOM-free conversation activity projection", () => {
|
|
expect(agentGUIBuildEntries["conversation-activity-projection"]).toBe(
|
|
"conversation-activity-projection.ts"
|
|
);
|
|
expect(
|
|
packageManifest.publishConfig.exports[
|
|
"./conversation-activity-projection"
|
|
]
|
|
).toEqual({
|
|
types: "./dist/conversation-activity-projection.d.ts",
|
|
import: "./dist/conversation-activity-projection.js"
|
|
});
|
|
});
|
|
|
|
it("builds and publishes the DOM-free composer projection", () => {
|
|
expect(agentGUIBuildEntries["composer-projection"]).toBe(
|
|
"composerProjection.ts"
|
|
);
|
|
expect(
|
|
packageManifest.publishConfig.exports["./composer-projection"]
|
|
).toEqual({
|
|
types: "./dist/composer-projection.d.ts",
|
|
import: "./dist/composer-projection.js"
|
|
});
|
|
});
|
|
});
|