@yadsh/dsh-qa-surface 0.7.0 → 0.7.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.
@@ -35,6 +35,16 @@ export type QaAdminRoute = {
35
35
  } | {
36
36
  readonly page: "audit";
37
37
  };
38
+ /** The console's own base path under the surface route. */
39
+ export declare function adminBasePath(routePath: string): string;
40
+ /**
41
+ * Whether a pathname addresses the console at all. Sections and entities each
42
+ * own a path under the base ({@link adminPath}), and the surface hosting the
43
+ * console must stay the console while any of them is open, so the test is by
44
+ * prefix. An equality test against the base alone unmounts the console on the
45
+ * first navigation inside it, and every deep link lands in the chat instead.
46
+ */
47
+ export declare function isAdminPath(pathname: string, routePath: string): boolean;
38
48
  /** Path segments after `/qa/admin`, without the leading slash. */
39
49
  export declare function adminSegments(pathname: string, routePath: string): string[];
40
50
  /**
@@ -1,3 +1,5 @@
1
1
  export type { QaUserSettingsSectionProps, QaUserSettingsSectionRegistration, QaUserSettingsSections, QaUserSettingsSectionsContext, QaUserSettingsSectionsSnapshot, } from "./contract.js";
2
2
  export { QaUserSettingsSectionRegistry } from "./registry.js";
3
+ export type { QaUserSession, QaUserSessionSnapshot, QaUserSessionStage, } from "./user-session.js";
4
+ export { QaUserSessionMirror } from "./user-session.js";
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,59 @@
1
+ import type { QaAccountsController } from "../QaAccountsController.js";
2
+ /**
3
+ * The signed-in QA account, as a client service.
4
+ *
5
+ * A QA panel plugin receives the account token through its panel props. A card
6
+ * mounted in the host's own settings (`settings.plugin.item`) has no panel to
7
+ * read it from, so this service is the one place such a surface asks whether a
8
+ * QA account is signed in and obtains the bearer credential the
9
+ * principal-scoped QA remotes authorize with.
10
+ *
11
+ * The credential is transport authentication only: a consumer must not persist
12
+ * it, log it, or place it in a URL, a tool argument, or any model-visible
13
+ * value.
14
+ */
15
+ /** How far the account got. `checking` is the boot state before the stored token has been answered for. */
16
+ export type QaUserSessionStage = "checking" | "anonymous" | "authed";
17
+ /** What a browser half outside the QA overlay needs to speak to QA remotes. */
18
+ export type QaUserSessionSnapshot = {
19
+ readonly stage: "checking";
20
+ readonly token: null;
21
+ } | {
22
+ readonly stage: "anonymous";
23
+ readonly token: null;
24
+ } | {
25
+ readonly stage: "authed";
26
+ /** Bearer credential for principal-scoped QA remotes. */
27
+ readonly token: string;
28
+ };
29
+ /** Read-only view of the current QA account, exposed as a client service. */
30
+ export interface QaUserSession {
31
+ readonly subscribe: (listener: () => void) => () => void;
32
+ readonly getSnapshot: () => QaUserSessionSnapshot;
33
+ }
34
+ declare module "@deepseek-ai/cordis" {
35
+ interface Context {
36
+ qaUserSession: QaUserSession;
37
+ }
38
+ }
39
+ /**
40
+ * Publishes the account state of the controller the QA overlay mounts. The
41
+ * service lives for the whole host page while the controller is rebuilt
42
+ * whenever the remote wiring re-injects, so {@link attach} swaps the source and
43
+ * republishes; an unattached mirror stays in `checking`, which is what a card
44
+ * that mounts before the accounts subsystem sees.
45
+ */
46
+ export declare class QaUserSessionMirror implements QaUserSession {
47
+ private controller;
48
+ private unsubscribeSource;
49
+ private snapshot;
50
+ private readonly listeners;
51
+ /** Bind the controller whose account state this view publishes. */
52
+ attach(controller: QaAccountsController | undefined): void;
53
+ dispose(): void;
54
+ readonly getSnapshot: () => QaUserSessionSnapshot;
55
+ readonly subscribe: (listener: () => void) => (() => void);
56
+ private publish;
57
+ private derive;
58
+ }
59
+ //# sourceMappingURL=user-session.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yadsh/dsh-qa-surface",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "A focused end-user QA surface backed by native DeepSeek Harness sessions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -174,8 +174,8 @@
174
174
  "tsdown": "^0.22.14",
175
175
  "typescript": "^7.0.2",
176
176
  "vitest": "^4.1.11",
177
- "@yadsh/dsh-config": "^0.0.0",
178
177
  "@yadsh/dsh-plugin-kit": "^0.1.0",
178
+ "@yadsh/dsh-config": "^0.0.0",
179
179
  "@yadsh/dsh-plugin-scripts": "^0.0.0"
180
180
  },
181
181
  "publishConfig": {