@omg-dev/admin 0.4.27 → 0.4.28
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/dist/index.mjs +2 -2
- package/dist/{react-COCR3YSL.mjs → react-BNHn5Pe0.mjs} +998 -14
- package/dist/server.mjs +2 -1
- package/dist/standalone.mjs +1 -1
- package/package.json +1 -1
- package/src/client.ts +77 -0
- package/src/index.ts +4 -0
- package/src/react.tsx +658 -18
- package/src/safe-url.ts +11 -0
- package/src/server.ts +1 -1
- package/src/styles.ts +252 -0
package/dist/server.mjs
CHANGED
package/dist/standalone.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as AdminClient, t as AdminConsole } from "./react-BNHn5Pe0.mjs";
|
|
2
2
|
import { createElement } from "react";
|
|
3
3
|
import { createRoot } from "react-dom/client";
|
|
4
4
|
//#region src/standalone.tsx
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -126,6 +126,24 @@ export class AdminClient {
|
|
|
126
126
|
removeReport(id: string) {
|
|
127
127
|
return this.rpc<{ ok: boolean }>("bugReports", "removeReport", { id })
|
|
128
128
|
}
|
|
129
|
+
|
|
130
|
+
// ── iMessage Brain (read-only routing ledger) ─────────────────────────────
|
|
131
|
+
// `steps: true` also returns the per-turn step log (rules evaluated, prompt
|
|
132
|
+
// blocks, tool calls with arguments, tool results, effects) — the waterfall.
|
|
133
|
+
// Opt-in because a page of prompt snapshots is far larger than the trace rows,
|
|
134
|
+
// and a lightweight poll only needs the verdicts.
|
|
135
|
+
listImessageBrainRouting(args?: { userId?: string; limit?: number; steps?: boolean }) {
|
|
136
|
+
return this.rpc<{ traces: ImessageBrainTrace[]; steps?: ImessageBrainTraceStep[]; capture: ImessageBrainCapture }>(
|
|
137
|
+
"imessageDebug",
|
|
138
|
+
"listBrainRouting",
|
|
139
|
+
args ?? {},
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
// Full conversation transcript (both directions) for one user — the
|
|
143
|
+
// "Conversation" (user view) in the Chat Brain panel.
|
|
144
|
+
listImessageBrainTranscript(args: { userId: string; limit?: number; before?: number | null }) {
|
|
145
|
+
return this.rpc<{ messages: ImessageBrainMessage[]; hasMore: boolean }>("imessageDebug", "listBrainTranscript", args)
|
|
146
|
+
}
|
|
129
147
|
}
|
|
130
148
|
|
|
131
149
|
// ── shared types (mirror control-plane function returns) ──────────────────────
|
|
@@ -221,6 +239,65 @@ export interface UserBalance {
|
|
|
221
239
|
appCreditsUsd: number
|
|
222
240
|
}
|
|
223
241
|
|
|
242
|
+
export interface ImessageBrainTrace {
|
|
243
|
+
id: string
|
|
244
|
+
threadId: number
|
|
245
|
+
userId: string
|
|
246
|
+
phone: string
|
|
247
|
+
inboundMessageId: string | null
|
|
248
|
+
replyToMessageId: string | null
|
|
249
|
+
text: string
|
|
250
|
+
generation: number
|
|
251
|
+
activeSessionBefore: string | null
|
|
252
|
+
decision: string
|
|
253
|
+
reason: string | null
|
|
254
|
+
routeVia: string | null
|
|
255
|
+
targetBindingId: string | null
|
|
256
|
+
targetSessionId: string | null
|
|
257
|
+
targetSessionUrl: string | null
|
|
258
|
+
activeSessionAfter: string | null
|
|
259
|
+
outcome: "running" | "completed" | "failed"
|
|
260
|
+
error: string | null
|
|
261
|
+
fleetMs: number | null
|
|
262
|
+
llmMs: number | null
|
|
263
|
+
createdAt: number
|
|
264
|
+
completedAt: number | null
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* One recorded step inside a routing turn. The trace says WHAT was decided;
|
|
269
|
+
* these say how — including the deterministic rules that were evaluated and
|
|
270
|
+
* declined, which is usually the answer to "why didn't it do what I expected?"
|
|
271
|
+
*/
|
|
272
|
+
export interface ImessageBrainTraceStep {
|
|
273
|
+
id: number
|
|
274
|
+
traceId: string
|
|
275
|
+
seq: number
|
|
276
|
+
kind: "rule" | "context" | "prompt" | "llm-text" | "tool-call" | "tool-result" | "effect"
|
|
277
|
+
/** Rule or tool name; for a rule, prefixed ✓ (fired) or · (declined). */
|
|
278
|
+
name: string | null
|
|
279
|
+
/** The payload: rule rationale, prompt block, tool arguments, tool output. */
|
|
280
|
+
detail: string | null
|
|
281
|
+
at: number
|
|
282
|
+
durationMs: number | null
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export interface ImessageBrainCapture {
|
|
286
|
+
gatewayStartedAt: number | null
|
|
287
|
+
lastInboundAt: number | null
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface ImessageBrainMessage {
|
|
291
|
+
id: number
|
|
292
|
+
threadId: number
|
|
293
|
+
direction: "in" | "out"
|
|
294
|
+
text: string
|
|
295
|
+
providerMessageId: string | null
|
|
296
|
+
/** Public attachment URLs (image/video) the message carried; empty otherwise. */
|
|
297
|
+
media?: string[]
|
|
298
|
+
at: number
|
|
299
|
+
}
|
|
300
|
+
|
|
224
301
|
// ── bug reports ───────────────────────────────────────────────────────────────
|
|
225
302
|
|
|
226
303
|
export type BugStatus = "open" | "triaged" | "in_progress" | "resolved" | "wont_fix"
|
package/src/index.ts
CHANGED
|
@@ -15,6 +15,7 @@ export {
|
|
|
15
15
|
PricingPanel,
|
|
16
16
|
ReportsPanel,
|
|
17
17
|
UsersPanel,
|
|
18
|
+
BrainRoutingPanel,
|
|
18
19
|
AdminClient,
|
|
19
20
|
type AdminConsoleProps,
|
|
20
21
|
type AdminClientConfig,
|
|
@@ -32,6 +33,9 @@ export {
|
|
|
32
33
|
type UserHit,
|
|
33
34
|
type AdminUser,
|
|
34
35
|
type AdminUserList,
|
|
36
|
+
type ImessageBrainCapture,
|
|
37
|
+
type ImessageBrainTrace,
|
|
38
|
+
type ImessageBrainMessage,
|
|
35
39
|
type ValueType,
|
|
36
40
|
type BugStatus,
|
|
37
41
|
type BugSeverity,
|