@omercnet/paseo-omp 1.0.1-next.176.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,11 +395,6 @@ export class OmpTimelineProjector {
|
|
|
395
395
|
private commandText = "";
|
|
396
396
|
private commandPublishedText = "";
|
|
397
397
|
private closed = false;
|
|
398
|
-
private lastTodoItems: ReadonlyArray<{
|
|
399
|
-
text: string;
|
|
400
|
-
completed: boolean;
|
|
401
|
-
status: "pending" | "in_progress" | "completed";
|
|
402
|
-
}> | null = null;
|
|
403
398
|
|
|
404
399
|
private readonly dataFilter: OmpPublicDataSerializer;
|
|
405
400
|
private browserAuthorizationIssuer: ((url: string) => string | undefined) | null = null;
|
|
@@ -644,17 +639,21 @@ export class OmpTimelineProjector {
|
|
|
644
639
|
if (this.closed) return;
|
|
645
640
|
if (event.type === "todo_reminder" || event.type === "todo_auto_clear") {
|
|
646
641
|
const todos = event.type === "todo_reminder" ? event.todos : [];
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
: todo.status === "
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
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
|
+
});
|
|
658
657
|
return;
|
|
659
658
|
}
|
|
660
659
|
if (event.type === "goal_updated") {
|
|
@@ -1617,35 +1616,8 @@ export class OmpTimelineProjector {
|
|
|
1617
1616
|
});
|
|
1618
1617
|
}
|
|
1619
1618
|
}
|
|
1620
|
-
this.publishTodos(items);
|
|
1621
|
-
return true;
|
|
1622
|
-
}
|
|
1623
|
-
|
|
1624
|
-
private publishTodos(
|
|
1625
|
-
items: Array<{
|
|
1626
|
-
id: string;
|
|
1627
|
-
text: string;
|
|
1628
|
-
completed: boolean;
|
|
1629
|
-
status: "pending" | "in_progress" | "completed";
|
|
1630
|
-
activeForm?: string;
|
|
1631
|
-
}>,
|
|
1632
|
-
): void {
|
|
1633
|
-
const previous = this.lastTodoItems;
|
|
1634
|
-
if (
|
|
1635
|
-
previous?.length === items.length &&
|
|
1636
|
-
previous.every((previousItem, index) => {
|
|
1637
|
-
const nextItem = items[index];
|
|
1638
|
-
return (
|
|
1639
|
-
nextItem?.text === previousItem.text &&
|
|
1640
|
-
nextItem.completed === previousItem.completed &&
|
|
1641
|
-
nextItem.status === previousItem.status
|
|
1642
|
-
);
|
|
1643
|
-
})
|
|
1644
|
-
) {
|
|
1645
|
-
return;
|
|
1646
|
-
}
|
|
1647
|
-
this.lastTodoItems = items;
|
|
1648
1619
|
this.publish({ type: "todo", id: "omp:todos", items });
|
|
1620
|
+
return true;
|
|
1649
1621
|
}
|
|
1650
1622
|
|
|
1651
1623
|
private toolDetail(snapshot: ToolSnapshot): ProviderToolCallDetail {
|