@webx-ui/module-auth 0.7.3 → 0.8.0
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.
- package/README.md +21 -0
- package/dist/AdminList.d.ts +1 -1
- package/dist/AdminPicker.d.ts +2 -2
- package/dist/AdminsPage.d.ts +22 -6
- package/dist/CallList.d.ts +6 -0
- package/dist/ConnectPage.d.ts +2 -0
- package/dist/ConnectionList.d.ts +28 -0
- package/dist/admins.d.ts +3 -1
- package/dist/connections.d.ts +17 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +1695 -630
- package/dist/index.js.map +1 -1
- package/dist/module.d.ts +18 -0
- package/dist/session.d.ts +9 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +81 -0
- package/package.json +3 -3
package/dist/module.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export interface AdminsOptions {
|
|
|
13
13
|
/** Turns an avatar key into an address. Omitted, rows and forms show initials. */
|
|
14
14
|
resolveAvatar?: (key: string) => Promise<string | null>;
|
|
15
15
|
}
|
|
16
|
+
/** Which of the three views of the administrators section a route opens. */
|
|
17
|
+
export type AdminsView = 'admins' | 'calls' | 'connections';
|
|
16
18
|
/**
|
|
17
19
|
* The administrators, as a section of the panel.
|
|
18
20
|
*
|
|
@@ -20,3 +22,19 @@ export interface AdminsOptions {
|
|
|
20
22
|
* navigation: a section shows up when both halves are installed.
|
|
21
23
|
*/
|
|
22
24
|
export declare function admins(options?: AdminsOptions): AdminModule;
|
|
25
|
+
export interface ConnectOptions {
|
|
26
|
+
/** Where the page lives inside the panel. */
|
|
27
|
+
path?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The page that tells a person how to connect their own agent.
|
|
31
|
+
*
|
|
32
|
+
* A section of its own rather than a corner of the profile dialog, because it is the page
|
|
33
|
+
* somebody is sent a link to — a client who has never opened this panel, on a call, with
|
|
34
|
+
* somebody reading the steps out. The server reports it only where there is a door to connect
|
|
35
|
+
* to, so a panel with the agent server switched off simply has no such entry.
|
|
36
|
+
*
|
|
37
|
+
* It carries no permission: whoever got into the panel may connect an agent, and the agent
|
|
38
|
+
* will not be able to do anything they cannot.
|
|
39
|
+
*/
|
|
40
|
+
export declare function connect(options?: ConnectOptions): AdminModule;
|
package/dist/session.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { App, Component, InjectionKey } from 'vue';
|
|
2
|
-
import { AdminContext, AdminUser } from '@webx-ui/module-admin';
|
|
2
|
+
import { AdminContext, AdminUser, ThemePreference } from '@webx-ui/module-admin';
|
|
3
3
|
export interface Credentials {
|
|
4
4
|
email: string;
|
|
5
5
|
password: string;
|
|
@@ -19,6 +19,14 @@ export interface AuthSession {
|
|
|
19
19
|
* the label above it.
|
|
20
20
|
*/
|
|
21
21
|
setLocale(code: string): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Write down which theme this administrator reads the panel in.
|
|
24
|
+
*
|
|
25
|
+
* Only writes it down: the screen has already changed by the time this is called. Painting
|
|
26
|
+
* is instant and local, and an account that has not caught up yet costs nobody anything —
|
|
27
|
+
* whereas a panel that waits for the network before it changes colour looks broken.
|
|
28
|
+
*/
|
|
29
|
+
setTheme(preference: ThemePreference): Promise<void>;
|
|
22
30
|
/**
|
|
23
31
|
* Change what is yours to change about yourself: your name, your photograph, your password.
|
|
24
32
|
*
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.wx-login[data-v-3c206e31]{width:100%;max-width:26rem}.wx-login__message[data-v-3c206e31]{margin-block-end:var(--wx-space-4)}.wx-login__remember[data-v-3c206e31]{margin-block-start:calc(-1 * var(--wx-space-12))}.wx-login__reveal[data-v-3c206e31]{display:inline-flex;align-items:center;padding:0;font:inherit;color:var(--wx-text-muted);background:none;border:0;cursor:pointer}.wx-login__reveal[data-v-3c206e31]:hover,.wx-login__reveal[aria-pressed=true][data-v-3c206e31]{color:var(--wx-text-default)}.wx-admin-form{container-type:inline-size}.wx-admin-form__grid{display:grid;grid-template-columns:200px minmax(0,1fr);gap:var(--wx-space-24)}.wx-admin-form__fields{display:flex;flex-direction:column;gap:var(--wx-space-12);min-width:0}@container (max-width: 520px){.wx-admin-form__grid{grid-template-columns:minmax(0,1fr)}.wx-admin-form__aside{max-width:200px}}.wx-admin-list{min-width:0}.wx-profile-host[data-v-9583a67a]{container-type:inline-size}.wx-profile[data-v-9583a67a]{display:flex;gap:var(--wx-space-16)}.wx-profile__aside[data-v-9583a67a]{flex:0 0 180px}.wx-profile__fields[data-v-9583a67a]{display:flex;flex-direction:column;gap:var(--wx-space-12);flex:1 1 auto;min-width:0}@container (max-width: 480px){.wx-profile[data-v-9583a67a]{flex-direction:column}.wx-profile__aside[data-v-9583a67a]{flex:none}}.wx-user-menu__trigger[data-v-
|
|
1
|
+
.wx-login[data-v-3c206e31]{width:100%;max-width:26rem}.wx-login__message[data-v-3c206e31]{margin-block-end:var(--wx-space-4)}.wx-login__remember[data-v-3c206e31]{margin-block-start:calc(-1 * var(--wx-space-12))}.wx-login__reveal[data-v-3c206e31]{display:inline-flex;align-items:center;padding:0;font:inherit;color:var(--wx-text-muted);background:none;border:0;cursor:pointer}.wx-login__reveal[data-v-3c206e31]:hover,.wx-login__reveal[aria-pressed=true][data-v-3c206e31]{color:var(--wx-text-default)}.wx-admin-form{container-type:inline-size}.wx-admin-form__grid{display:grid;grid-template-columns:200px minmax(0,1fr);gap:var(--wx-space-24)}.wx-admin-form__fields{display:flex;flex-direction:column;gap:var(--wx-space-12);min-width:0}@container (max-width: 520px){.wx-admin-form__grid{grid-template-columns:minmax(0,1fr)}.wx-admin-form__aside{max-width:200px}}.wx-admin-list,.wx-call-list{min-width:0}.wx-call-list__details{display:flex;flex-direction:column;gap:var(--wx-space-8);padding:var(--wx-space-8) var(--wx-space-16)}.wx-call-list__card-details{margin-top:var(--wx-space-8)}.wx-call-list__glyph{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--wx-text-muted);background:var(--wx-bg-subtle)}.wx-call-list__arguments{margin:0;padding:var(--wx-space-8) var(--wx-space-12);max-height:320px;overflow:auto;border-radius:var(--wx-radius-sm);background:var(--wx-bg-subtle);color:var(--wx-text-default);font-family:var(--wx-font-family-mono);font-size:var(--wx-font-size-xs);line-height:var(--wx-font-line-height-relaxed);white-space:pre-wrap;word-break:break-word}.wx-connection-list{min-width:0}.wx-connection-list__glyph{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--wx-text-muted);background:var(--wx-bg-subtle)}.wx-connection-list .wx-table__row.is-ended,.wx-connection-list .wx-table__card.is-ended{opacity:.6}.wx-connect[data-v-92d62c98]{display:flex;flex-direction:column;gap:var(--wx-space-24);min-width:0}.wx-connect__lead[data-v-92d62c98]{max-width:68ch}.wx-connect__label[data-v-92d62c98]{display:block;margin-bottom:var(--wx-space-8)}.wx-connect__row[data-v-92d62c98]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--wx-space-12)}.wx-connect__url[data-v-92d62c98]{flex:1 1 260px;min-width:0;padding:var(--wx-space-10) var(--wx-space-12);border-radius:var(--wx-radius-sm);background:var(--wx-bg-subtle);color:var(--wx-text-default);font-family:var(--wx-font-family-mono);font-size:var(--wx-font-size-md);word-break:break-all}.wx-connect__section[data-v-92d62c98]{display:flex;flex-direction:column;gap:var(--wx-space-12);min-width:0}.wx-connect__steps[data-v-92d62c98]{display:flex;flex-direction:column;gap:var(--wx-space-8);margin:0;padding-left:var(--wx-space-24);color:var(--wx-text-default);font-size:var(--wx-font-size-sm);line-height:var(--wx-font-line-height-relaxed)}.wx-connect__snippet[data-v-92d62c98]{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:var(--wx-space-8);padding:var(--wx-space-12);border-radius:var(--wx-radius-sm);background:var(--wx-bg-subtle)}.wx-connect__snippet pre[data-v-92d62c98]{flex:1 1 240px;margin:0;min-width:0;color:var(--wx-text-default);font-family:var(--wx-font-family-mono);font-size:var(--wx-font-size-xs);line-height:var(--wx-font-line-height-relaxed);white-space:pre-wrap;word-break:break-all}.wx-connect__links[data-v-92d62c98]{display:flex;flex-wrap:wrap;gap:var(--wx-space-12)}.wx-profile-host[data-v-9583a67a]{container-type:inline-size}.wx-profile[data-v-9583a67a]{display:flex;gap:var(--wx-space-16)}.wx-profile__aside[data-v-9583a67a]{flex:0 0 180px}.wx-profile__fields[data-v-9583a67a]{display:flex;flex-direction:column;gap:var(--wx-space-12);flex:1 1 auto;min-width:0}@container (max-width: 480px){.wx-profile[data-v-9583a67a]{flex-direction:column}.wx-profile__aside[data-v-9583a67a]{flex:none}}.wx-user-menu__theme[data-v-4dbd81da]{padding:var(--wx-space-2) var(--wx-space-8) var(--wx-space-6)}.wx-user-menu__trigger[data-v-4dbd81da]{display:inline-flex;padding:0;border:none;border-radius:var(--wx-radius-full);background:transparent;cursor:pointer;transition:opacity var(--wx-duration-fast) var(--wx-easing-standard)}.wx-user-menu__trigger[data-v-4dbd81da]:hover{opacity:.85}.wx-user-menu__trigger[data-v-4dbd81da]:focus-visible{outline:2px solid var(--wx-border-focus);outline-offset:2px}.wx-user-menu__trigger--named[data-v-4dbd81da]{align-items:center;gap:var(--wx-space-8);width:100%;min-width:0;padding:var(--wx-space-4);border-radius:var(--wx-radius-control);text-align:start}.wx-user-menu__trigger--named[data-v-4dbd81da]:hover{opacity:1;background:var(--wx-bg-subtle)}.wx-user-menu__name[data-v-4dbd81da]{flex:1 1 auto;min-width:0;overflow:hidden;color:var(--wx-text-default);font-family:var(--wx-font-family-sans);font-size:var(--wx-font-size-sm);font-weight:var(--wx-font-weight-medium);text-overflow:ellipsis;white-space:nowrap}
|
package/dist/types.d.ts
CHANGED
|
@@ -57,6 +57,57 @@ export interface AdminPage {
|
|
|
57
57
|
from: number | null;
|
|
58
58
|
to: number | null;
|
|
59
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* One tool call an agent made, as `GET /api/cms/auth/mcp-calls` answers it.
|
|
62
|
+
*
|
|
63
|
+
* `user` is null for a call on the stdio server, where there was nobody to act as; a user with
|
|
64
|
+
* no `name` was deleted since. `arguments` is the JSON as the server kept it — secrets blanked,
|
|
65
|
+
* cut to a length — and so is text to show, not an object to read.
|
|
66
|
+
*/
|
|
67
|
+
export interface AgentCall {
|
|
68
|
+
id: number;
|
|
69
|
+
at: string | null;
|
|
70
|
+
user: {
|
|
71
|
+
id: number;
|
|
72
|
+
name: string | null;
|
|
73
|
+
} | null;
|
|
74
|
+
/** What the client called itself on the consent screen; null off a connection. */
|
|
75
|
+
client: string | null;
|
|
76
|
+
tool: string;
|
|
77
|
+
arguments: string | null;
|
|
78
|
+
dry_run: boolean;
|
|
79
|
+
ok: boolean;
|
|
80
|
+
error: string | null;
|
|
81
|
+
duration_ms: number;
|
|
82
|
+
[key: string]: unknown;
|
|
83
|
+
}
|
|
84
|
+
export type AgentCallOutcome = 'ok' | 'failed' | 'dry';
|
|
85
|
+
export interface AgentCallQuery {
|
|
86
|
+
/** An administrator's id, or `none` for the stdio server. */
|
|
87
|
+
user?: string | null;
|
|
88
|
+
tool?: string | null;
|
|
89
|
+
outcome?: AgentCallOutcome | null;
|
|
90
|
+
page?: number;
|
|
91
|
+
per_page?: number;
|
|
92
|
+
}
|
|
93
|
+
/** What the log can be narrowed by: the people and the tools that actually appear in it. */
|
|
94
|
+
export interface AgentCallFilters {
|
|
95
|
+
users: {
|
|
96
|
+
id: number | null;
|
|
97
|
+
name: string | null;
|
|
98
|
+
}[];
|
|
99
|
+
tools: string[];
|
|
100
|
+
}
|
|
101
|
+
export interface AgentCallPage {
|
|
102
|
+
data: AgentCall[];
|
|
103
|
+
current_page: number;
|
|
104
|
+
last_page: number;
|
|
105
|
+
per_page: number;
|
|
106
|
+
total: number;
|
|
107
|
+
from: number | null;
|
|
108
|
+
to: number | null;
|
|
109
|
+
filters: AgentCallFilters;
|
|
110
|
+
}
|
|
60
111
|
/** What a form sends. `password` left out is a password left alone. */
|
|
61
112
|
export interface AdminInput {
|
|
62
113
|
name: string;
|
|
@@ -68,3 +119,33 @@ export interface AdminInput {
|
|
|
68
119
|
locale?: string | null;
|
|
69
120
|
roles?: number[];
|
|
70
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* One agent somebody let into the panel, as `GET /api/cms/auth/connections` answers it.
|
|
124
|
+
*
|
|
125
|
+
* `client` is the name the client chose for itself on the consent screen and `host` is where
|
|
126
|
+
* the code was sent — both, always, because only the second is evidence. `revoked_at` is set
|
|
127
|
+
* on a connection that was ended: the row is kept, since it is what the call log points at.
|
|
128
|
+
*/
|
|
129
|
+
export interface Connection {
|
|
130
|
+
id: number;
|
|
131
|
+
client: string;
|
|
132
|
+
host: string;
|
|
133
|
+
read_only: boolean;
|
|
134
|
+
user: {
|
|
135
|
+
id: number;
|
|
136
|
+
name: string | null;
|
|
137
|
+
};
|
|
138
|
+
connected_at: string | null;
|
|
139
|
+
last_used_at: string | null;
|
|
140
|
+
revoked_at: string | null;
|
|
141
|
+
[key: string]: unknown;
|
|
142
|
+
}
|
|
143
|
+
/** The list, with what the reader may ask for next. */
|
|
144
|
+
export interface Connections {
|
|
145
|
+
data: Connection[];
|
|
146
|
+
/** Which list this is: only this person's, or everybody's. */
|
|
147
|
+
scope: ConnectionScope;
|
|
148
|
+
/** Whether everybody's is a list this reader would be allowed. */
|
|
149
|
+
canSeeEverybody: boolean;
|
|
150
|
+
}
|
|
151
|
+
export type ConnectionScope = 'mine' | 'all';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webx-ui/module-auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Signing in to a WebX UI admin panel: the screen, the session and the router guard. Pairs with webx-ui/module-auth on the server.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"vue-router": "^4.5.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@webx-ui/module-admin": "^0.
|
|
48
|
-
"@webx-ui/core": "^0.
|
|
47
|
+
"@webx-ui/module-admin": "^0.13.0",
|
|
48
|
+
"@webx-ui/core": "^0.30.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^24.10.1",
|