@omercnet/paseo-omp 1.0.1-next.173.1 → 1.0.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.
package/client/quota-popover.tsx
CHANGED
|
@@ -8,11 +8,11 @@ import { listOmpQuotas } from "../shared/quota";
|
|
|
8
8
|
import { ompStoreKey } from "./omp-store-state";
|
|
9
9
|
import {
|
|
10
10
|
type QuotaProviderGroup,
|
|
11
|
-
quotaDetailLabel,
|
|
12
11
|
quotaProviderFromSession,
|
|
13
12
|
quotaProviderGroups,
|
|
14
13
|
quotaProviderIconName,
|
|
15
14
|
quotaProviderLabel,
|
|
15
|
+
quotaResetLabel,
|
|
16
16
|
quotaSeverityFromFraction,
|
|
17
17
|
} from "./quota-state";
|
|
18
18
|
|
|
@@ -117,7 +117,7 @@ export function QuotaPopover(props: PluginButtonContentProps) {
|
|
|
117
117
|
color={severityColor(group.severity)}
|
|
118
118
|
/>
|
|
119
119
|
<Text style={styles.groupLabel}>{quotaProviderLabel(group.provider)}</Text>
|
|
120
|
-
<Text style={styles.badge}>
|
|
120
|
+
{current ? <Text style={styles.badge}>CURRENT</Text> : null}
|
|
121
121
|
</View>
|
|
122
122
|
{group.quotas.map((quota) => {
|
|
123
123
|
const severity = quotaSeverityFromFraction(quota.usedFraction);
|
|
@@ -139,7 +139,11 @@ export function QuotaPopover(props: PluginButtonContentProps) {
|
|
|
139
139
|
<View style={styles.track}>
|
|
140
140
|
<View style={{ height: "100%", width: `${pct}%`, backgroundColor: color }} />
|
|
141
141
|
</View>
|
|
142
|
-
<Text style={styles.detail}>
|
|
142
|
+
<Text style={styles.detail}>
|
|
143
|
+
{[quota.windowLabel, quotaResetLabel(quota.resetsAt)]
|
|
144
|
+
.filter(Boolean)
|
|
145
|
+
.join(" · ")}
|
|
146
|
+
</Text>
|
|
143
147
|
</View>
|
|
144
148
|
);
|
|
145
149
|
})}
|
package/client/quota-state.ts
CHANGED
|
@@ -138,23 +138,3 @@ export function quotaResetLabel(resetsAtMs: number | null, nowMs: number = Date.
|
|
|
138
138
|
const minutes = Math.floor((remainingMs % 3_600_000) / 60_000);
|
|
139
139
|
return hours > 0 ? `resets ${hours}h ${minutes}m` : `resets ${minutes}m`;
|
|
140
140
|
}
|
|
141
|
-
|
|
142
|
-
export function quotaRecordedLabel(recordedAtMs: number, nowMs: number = Date.now()): string {
|
|
143
|
-
const seconds = Math.max(0, Math.floor((nowMs - recordedAtMs) / 1_000));
|
|
144
|
-
if (seconds < 60) return "Recorded just now";
|
|
145
|
-
const minutes = Math.floor(seconds / 60);
|
|
146
|
-
if (minutes < 60) return `Recorded ${minutes}m ago`;
|
|
147
|
-
const hours = Math.floor(minutes / 60);
|
|
148
|
-
if (hours < 24) return `Recorded ${hours}h ago`;
|
|
149
|
-
return `Recorded ${Math.floor(hours / 24)}d ago`;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export function quotaDetailLabel(quota: OmpQuota, nowMs: number = Date.now()): string {
|
|
153
|
-
return [
|
|
154
|
-
quota.windowLabel,
|
|
155
|
-
quotaResetLabel(quota.resetsAt, nowMs),
|
|
156
|
-
quotaRecordedLabel(quota.recordedAt, nowMs),
|
|
157
|
-
]
|
|
158
|
-
.filter(Boolean)
|
|
159
|
-
.join(" · ");
|
|
160
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omercnet/paseo-omp",
|
|
3
|
-
"version": "1.0.1
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Paseo integration for OMP, including its direct provider and workspace tooling.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"@types/react": "^19.2.18",
|
|
69
69
|
"@vitest/coverage-v8": "^5.0.0",
|
|
70
70
|
"esbuild": "0.28.2",
|
|
71
|
-
"pino": "10.3.1",
|
|
72
71
|
"react": "19.1.0",
|
|
73
72
|
"react-native": "0.81.5",
|
|
73
|
+
"pino": "10.3.1",
|
|
74
74
|
"tsx": "^4.20.6",
|
|
75
75
|
"typescript": "^7.0.2",
|
|
76
76
|
"vitest": "^5.0.0",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Release Please keeps this bundle-safe constant aligned with package.json. */
|
|
2
|
-
export const PASEO_OMP_PACKAGE_VERSION = "1.0.1
|
|
2
|
+
export const PASEO_OMP_PACKAGE_VERSION = "1.0.1"; // x-release-please-version
|
|
@@ -395,7 +395,6 @@ export class OmpTimelineProjector {
|
|
|
395
395
|
private commandText = "";
|
|
396
396
|
private commandPublishedText = "";
|
|
397
397
|
private closed = false;
|
|
398
|
-
private lastTodoItems: ReadonlyArray<{ text: string; completed: boolean }> | null = null;
|
|
399
398
|
|
|
400
399
|
private readonly dataFilter: OmpPublicDataSerializer;
|
|
401
400
|
private browserAuthorizationIssuer: ((url: string) => string | undefined) | null = null;
|
|
@@ -640,17 +639,21 @@ export class OmpTimelineProjector {
|
|
|
640
639
|
if (this.closed) return;
|
|
641
640
|
if (event.type === "todo_reminder" || event.type === "todo_auto_clear") {
|
|
642
641
|
const todos = event.type === "todo_reminder" ? event.todos : [];
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
: todo.status === "
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
642
|
+
this.publish({
|
|
643
|
+
type: "todo",
|
|
644
|
+
id: "omp:todos",
|
|
645
|
+
items: todos.slice(0, MAX_TODOS).map((todo, index) => ({
|
|
646
|
+
id: todoPublicId(todo.id, index),
|
|
647
|
+
text: this.dataFilter.text(todo.content, 16_384),
|
|
648
|
+
completed: todo.status === "completed" || todo.status === "abandoned",
|
|
649
|
+
status:
|
|
650
|
+
todo.status === "completed" || todo.status === "abandoned"
|
|
651
|
+
? "completed"
|
|
652
|
+
: todo.status === "blocked"
|
|
653
|
+
? "pending"
|
|
654
|
+
: todo.status,
|
|
655
|
+
})),
|
|
656
|
+
});
|
|
654
657
|
return;
|
|
655
658
|
}
|
|
656
659
|
if (event.type === "goal_updated") {
|
|
@@ -1613,33 +1616,8 @@ export class OmpTimelineProjector {
|
|
|
1613
1616
|
});
|
|
1614
1617
|
}
|
|
1615
1618
|
}
|
|
1616
|
-
this.publishTodos(items);
|
|
1617
|
-
return true;
|
|
1618
|
-
}
|
|
1619
|
-
|
|
1620
|
-
private publishTodos(
|
|
1621
|
-
items: Array<{
|
|
1622
|
-
id: string;
|
|
1623
|
-
text: string;
|
|
1624
|
-
completed: boolean;
|
|
1625
|
-
status: "pending" | "in_progress" | "completed";
|
|
1626
|
-
activeForm?: string;
|
|
1627
|
-
}>,
|
|
1628
|
-
): void {
|
|
1629
|
-
const previous = this.lastTodoItems;
|
|
1630
|
-
if (
|
|
1631
|
-
previous?.length === items.length &&
|
|
1632
|
-
previous.every((previousItem, index) => {
|
|
1633
|
-
const nextItem = items[index];
|
|
1634
|
-
return (
|
|
1635
|
-
nextItem?.text === previousItem.text && nextItem.completed === previousItem.completed
|
|
1636
|
-
);
|
|
1637
|
-
})
|
|
1638
|
-
) {
|
|
1639
|
-
return;
|
|
1640
|
-
}
|
|
1641
|
-
this.lastTodoItems = items;
|
|
1642
1619
|
this.publish({ type: "todo", id: "omp:todos", items });
|
|
1620
|
+
return true;
|
|
1643
1621
|
}
|
|
1644
1622
|
|
|
1645
1623
|
private toolDetail(snapshot: ToolSnapshot): ProviderToolCallDetail {
|