@opengeni/react 1.0.2-canary.37202341988001 → 1.1.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/dist/{chunk-IT4BJUGF.js → chunk-6TROCOEK.js} +20 -4
- package/dist/{chunk-IT4BJUGF.js.map → chunk-6TROCOEK.js.map} +1 -1
- package/dist/components/session-chrome.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/lib/host-theme.d.ts +7 -0
- package/dist/session-ui.js +1 -1
- package/package.json +3 -3
- package/src/components/session-chrome.tsx +21 -3
- package/src/lib/host-theme.ts +15 -2
|
@@ -91,6 +91,7 @@ export type SessionChromeProps = {
|
|
|
91
91
|
};
|
|
92
92
|
type GoalPillState = "pursuing" | "waiting" | "scheduled" | "session_failed" | "blocked" | "held" | "paused" | "invariant_broken" | "completed";
|
|
93
93
|
type GoalPillRecord = Pick<SessionGoal, "status" | "pausedReason"> & {
|
|
94
|
+
rationale?: SessionGoal["rationale"];
|
|
94
95
|
continuation?: SessionGoal["continuation"] | null | undefined;
|
|
95
96
|
};
|
|
96
97
|
/** Pill label, with the pause reason spelled out: "Paused · cap" / "Paused · manually". */
|
package/dist/index.js
CHANGED
package/dist/lib/host-theme.d.ts
CHANGED
|
@@ -38,6 +38,13 @@ export declare function hostBackground(element: Element): Rgba | null;
|
|
|
38
38
|
* reads; never consults `prefers-color-scheme` on its own.
|
|
39
39
|
*/
|
|
40
40
|
export declare function resolveHostTheme(element: Element): ResolvedHostTheme;
|
|
41
|
+
/**
|
|
42
|
+
* Canonical text for comparing a token value with the stock one. The
|
|
43
|
+
* published `compiled.css` is minified (`#333`, `oklch(.52 .16 22)`), so the
|
|
44
|
+
* same color must compare equal in short and long form; otherwise every stock
|
|
45
|
+
* token reads as a host customization and dark values leak into light themes.
|
|
46
|
+
*/
|
|
47
|
+
export declare function normalizeToken(value: string): string;
|
|
41
48
|
/**
|
|
42
49
|
* Tokens the host customized on an ancestor, by value. Setting our own
|
|
43
50
|
* `data-og-theme` would otherwise reset them to the theme's stock values.
|
package/dist/session-ui.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/react",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "React hooks and styled components for OpenGeni: live session streaming, chat composer, message timeline, session status, and fleet views — token-themed (CSS variables), dark-first, built on Tailwind v4 + Radix + Motion.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -153,8 +153,8 @@
|
|
|
153
153
|
"@dnd-kit/utilities": "3.2.2",
|
|
154
154
|
"@fontsource-variable/noto-sans-arabic": "5.2.10",
|
|
155
155
|
"@fontsource-variable/noto-sans-jp": "5.2.10",
|
|
156
|
-
"@opengeni/connect": "1.0
|
|
157
|
-
"@opengeni/sdk": "1.0
|
|
156
|
+
"@opengeni/connect": "1.1.0",
|
|
157
|
+
"@opengeni/sdk": "1.1.0",
|
|
158
158
|
"clsx": "^2.1.1",
|
|
159
159
|
"dequal": "2.0.3",
|
|
160
160
|
"lucide-react": "^1.8.0",
|
|
@@ -162,13 +162,20 @@ const GOAL_LABEL: Record<GoalPillState, string> = {
|
|
|
162
162
|
|
|
163
163
|
/**
|
|
164
164
|
* Short pill suffix per `pausedReason`. `max_auto_continuations` is pacing
|
|
165
|
-
* (new input resumes it); `limits` is
|
|
165
|
+
* (new input resumes it); `limits` is an unspecified legacy admission gate; `user_pause`/`api` is
|
|
166
166
|
* the human's own override; `agent` is the model declaring it is blocked on a
|
|
167
167
|
* human decision. Unknown or legacy reasons keep the bare "Paused".
|
|
168
168
|
*/
|
|
169
169
|
const GOAL_PAUSED_REASON_SUFFIX: Record<string, string> = {
|
|
170
170
|
max_auto_continuations: "cap",
|
|
171
|
-
limits: "
|
|
171
|
+
limits: "limits",
|
|
172
|
+
model_unavailable: "model",
|
|
173
|
+
model_policy: "policy",
|
|
174
|
+
credits: "credits",
|
|
175
|
+
budget: "budget",
|
|
176
|
+
usage_limit: "usage limit",
|
|
177
|
+
usage_policy: "limits",
|
|
178
|
+
allowance: "allowance",
|
|
172
179
|
user_pause: "manually",
|
|
173
180
|
api: "manually",
|
|
174
181
|
agent: "agent",
|
|
@@ -177,7 +184,15 @@ const GOAL_PAUSED_REASON_SUFFIX: Record<string, string> = {
|
|
|
177
184
|
const GOAL_PAUSED_REASON_EXPLANATION: Record<string, string> = {
|
|
178
185
|
max_auto_continuations:
|
|
179
186
|
"Paused at the automatic continuation cap. New input (a child result, an agent message, or your prompt) resumes it; you can also resume it here.",
|
|
180
|
-
limits: "Paused
|
|
187
|
+
limits: "Paused by an admission limit. Resume when the blocker is resolved.",
|
|
188
|
+
model_unavailable:
|
|
189
|
+
"The selected model is unavailable. Choose an available model before resuming.",
|
|
190
|
+
model_policy: "The selected model is blocked by policy. Choose an allowed model before resuming.",
|
|
191
|
+
credits: "Insufficient Opengeni credits. Add credits before resuming.",
|
|
192
|
+
budget: "Monthly model spending limit reached. Resume when the spending limit allows.",
|
|
193
|
+
usage_limit: "Monthly agent run limit reached. Resume when the run limit allows.",
|
|
194
|
+
usage_policy: "The application's usage policy blocks another run. Resume when it allows.",
|
|
195
|
+
allowance: "Opengeni usage allowance exhausted. Resume when your allowance is available.",
|
|
181
196
|
user_pause:
|
|
182
197
|
"Paused manually by a person or an API call. Resume to let the goal continue on its own.",
|
|
183
198
|
api: "Paused manually by a person or an API call. Resume to let the goal continue on its own.",
|
|
@@ -185,6 +200,7 @@ const GOAL_PAUSED_REASON_EXPLANATION: Record<string, string> = {
|
|
|
185
200
|
};
|
|
186
201
|
|
|
187
202
|
type GoalPillRecord = Pick<SessionGoal, "status" | "pausedReason"> & {
|
|
203
|
+
rationale?: SessionGoal["rationale"];
|
|
188
204
|
continuation?: SessionGoal["continuation"] | null | undefined;
|
|
189
205
|
};
|
|
190
206
|
|
|
@@ -212,6 +228,8 @@ export function sessionChromeGoalPillExplanation(
|
|
|
212
228
|
return "Resolve the session failure, then use Continue or send a message to continue this active goal.";
|
|
213
229
|
}
|
|
214
230
|
if (state === "paused") {
|
|
231
|
+
const rationale = record?.rationale?.trim();
|
|
232
|
+
if (rationale) return rationale;
|
|
215
233
|
return record?.pausedReason
|
|
216
234
|
? (GOAL_PAUSED_REASON_EXPLANATION[record.pausedReason] ?? null)
|
|
217
235
|
: null;
|
package/src/lib/host-theme.ts
CHANGED
|
@@ -310,8 +310,21 @@ export function resolveHostTheme(element: Element): ResolvedHostTheme {
|
|
|
310
310
|
return "light";
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
/**
|
|
314
|
+
* Canonical text for comparing a token value with the stock one. The
|
|
315
|
+
* published `compiled.css` is minified (`#333`, `oklch(.52 .16 22)`), so the
|
|
316
|
+
* same color must compare equal in short and long form; otherwise every stock
|
|
317
|
+
* token reads as a host customization and dark values leak into light themes.
|
|
318
|
+
*/
|
|
319
|
+
export function normalizeToken(value: string): string {
|
|
320
|
+
return value
|
|
321
|
+
.trim()
|
|
322
|
+
.toLowerCase()
|
|
323
|
+
.replace(/\s+/g, " ")
|
|
324
|
+
.replace(/#([\da-f])([\da-f])([\da-f])(?![\da-f])/g, "#$1$1$2$2$3$3")
|
|
325
|
+
.replace(/(^|[\s(,/])0+(\.\d)/g, "$1$2")
|
|
326
|
+
.replace(/(\.\d*?)0+(?=[\s),/%]|$)/g, "$1")
|
|
327
|
+
.replace(/\.(?=[\s),/%]|$)/g, "");
|
|
315
328
|
}
|
|
316
329
|
|
|
317
330
|
/**
|