Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,6 @@ jobs:
- name: Lint mtmharness package metadata
run: pnpm dlx publint run "${{ steps.pack.outputs.tarball }}" --strict

- name: Install DSH CLI for Web smoke
if: ${{ matrix.node == '22.19.0' }}
run: npm install --global @deepseek-ai/dsh@0.1.1-rc.2

- name: Verify isolated DSH Web profile and tool catalog
if: ${{ matrix.node == '22.19.0' }}
env:
DSH_SMOKE_TOOL_CATALOG: "1"
run: pnpm run smoke:mtmharness -- "${{ steps.pack.outputs.tarball }}"

- name: Verify mtmharness profile migration
if: ${{ matrix.node == '22.19.0' }}
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/release-mtmharness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,6 @@ jobs:
- name: Lint package metadata
run: pnpm dlx publint run "${{ steps.pack.outputs.tarball }}" --strict

- name: Install DSH CLI for Web smoke
run: npm install --global @deepseek-ai/dsh@0.1.1-rc.2

- name: Verify isolated DSH Web profile and tool catalog
env:
DSH_SMOKE_TOOL_CATALOG: "1"
run: pnpm run smoke:mtmharness -- "${{ steps.pack.outputs.tarball }}"

- name: Verify mtmharness profile migration
run: pnpm --filter mtmharness run profile:check -- "${{ steps.pack.outputs.tarball }}"
Expand Down
2 changes: 1 addition & 1 deletion packages/mtmharness/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mtmharness",
"version": "0.5.3",
"version": "0.5.4",
"description": "Unified DeepSeek Harness Web plugin with Connect, Canvas, Codebase Memory, Ponytail, and independent static/embed clients.",
"type": "module",
"engines": { "node": ">=22.19.0", "pnpm": ">=11.7.0" },
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// @vitest-environment jsdom

import { act } from "react";
import { createRoot } from "react-dom/client";
import { afterEach, describe, expect, it, vi } from "vitest";
import type { MtmHarnessRuntime, RuntimeSnapshot } from "@/runtime";
import { ConversationSurface } from "./conversation-surface";

(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;

const snapshot: RuntimeSnapshot = {
status: "auth-required",
messages: [],
registryStatus: "idle",
sandboxCatalogStatus: "idle",
sandboxes: [],
workspaces: [],
archivedSessionIds: [],
sessions: [],
};

function createRuntime(): MtmHarnessRuntime {
return {
getSnapshot: () => snapshot,
subscribe: vi.fn(() => () => undefined),
connect: vi.fn(async () => undefined),
prompt: vi.fn(async () => undefined),
} as unknown as MtmHarnessRuntime;
}

let container: HTMLDivElement | undefined;
let root: ReturnType<typeof createRoot> | undefined;

afterEach(() => {
act(() => root?.unmount());
container?.remove();
container = undefined;
root = undefined;
});

describe("ConversationSurface authentication gate", () => {
it("explains the anonymous path without presenting auth as transport failure", async () => {
container = document.createElement("div");
document.body.append(container);
root = createRoot(container);

await act(async () => {
root?.render(
<ConversationSurface
config={{ apiOrigin: "https://api.example.test", allowedParentOrigins: [], mode: "floating" }}
runtime={createRuntime()}
/>,
);
});

expect(container.querySelector('[role="status"]')?.textContent).toContain("Sign in above or continue anonymously on the sign-in page");
expect((container.querySelector("#mtmharness-prompt") as HTMLTextAreaElement).disabled).toBe(true);
expect((container.querySelector('button[aria-label="Send message"]') as HTMLButtonElement).disabled).toBe(true);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ function statusLabel(snapshot: RuntimeSnapshot): string {
}

function statusVariant(snapshot: RuntimeSnapshot): "default" | "secondary" | "destructive" | "outline" {
if (snapshot.status === "error" || snapshot.status === "auth-required") return "destructive";
if (snapshot.status === "loading" || snapshot.status === "streaming") return "secondary";
if (snapshot.status === "error") return "destructive";
if (snapshot.status === "loading" || snapshot.status === "streaming" || snapshot.status === "auth-required") return "secondary";
return "outline";
}

Expand Down Expand Up @@ -94,8 +94,8 @@ export function ConversationSurface({ config, runtime, compact = false, connectO
</>
) : null}
{snapshot.status === "auth-required" ? (
<div className="mx-4 mt-4 rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm" role="alert">
An OAuth access token is required. Configure the token-aware API and WebSocket transport before connecting.
<div className="mx-4 mt-4 rounded-lg border border-border bg-muted/40 px-3 py-2 text-sm" role="status">
Sign in above or continue anonymously on the sign-in page to start a conversation.
</div>
) : null}
{snapshot.status === "error" ? (
Expand Down
Loading