@omercnet/paseo-omp 5.4.0-next.391.1 → 5.4.0-next.393.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/OVERVIEW.md +1 -0
- package/client/rule-notice.tsx +22 -0
- package/client/sessions-popover.tsx +8 -8
- package/index.client.tsx +9 -0
- package/index.server.ts +3 -0
- package/package.json +1 -1
- package/server/package-version.ts +1 -1
- package/server/rule-notices.ts +137 -0
- package/server/sessions.ts +19 -52
- package/shared/rule-notices.ts +20 -0
- package/shared/sessions.ts +2 -7
package/OVERVIEW.md
CHANGED
|
@@ -14,6 +14,7 @@ OMP adds an agent provider for the OMP coding agent, plus an OMP sidebar and wor
|
|
|
14
14
|
- List the MCP servers OMP connects to, add, test, enable, disable or remove them, and authorize a remote server through your browser, from the **MCPs** tab.
|
|
15
15
|
- An **MCP** composer control runs OMP's MCP management in the current session, with authorization prompts shown in the chat.
|
|
16
16
|
- While OMP subagents run, a row under each `task` card in the conversation lets you steer one with a message or stop it after confirmation. It needs OMP 18.4.9 or newer.
|
|
17
|
+
- When an OMP rule fires during a turn of an agent on Paseo's bundled `omp` provider, a notice under that turn names the rule and the text it matched. The plugin reads this, best effort, from the end of the agent's OMP session file, which that provider does not report.
|
|
17
18
|
- OMP agents can call Paseo's orchestration tools with the optional `serverId` argument and `list_hosts` to delegate work to other connected Paseo hosts.
|
|
18
19
|
|
|
19
20
|
## Reads and sends
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PluginTimelineItemProps } from "@getpaseo/plugin/client";
|
|
2
|
+
import { Icon } from "@getpaseo/plugin/client/ui";
|
|
3
|
+
import { Text, View } from "react-native";
|
|
4
|
+
import type { OmpRuleNotice } from "../shared/rule-notices";
|
|
5
|
+
|
|
6
|
+
export function OmpRuleNoticeRow({ item, theme }: PluginTimelineItemProps<OmpRuleNotice>) {
|
|
7
|
+
const color = theme.colors.foregroundMuted;
|
|
8
|
+
return (
|
|
9
|
+
<View style={{ gap: 2, paddingVertical: 2 }}>
|
|
10
|
+
{item.data.rules.map((rule) => (
|
|
11
|
+
<View key={rule.name} style={{ flexDirection: "row", alignItems: "center", gap: 6 }}>
|
|
12
|
+
<Icon name="ShieldAlert" size={14} color={color} />
|
|
13
|
+
<Text style={{ color, fontSize: 13, flexShrink: 1 }} numberOfLines={2}>
|
|
14
|
+
{rule.matched === null
|
|
15
|
+
? `OMP rule ${rule.name} fired`
|
|
16
|
+
: `OMP rule ${rule.name} fired on “${rule.matched}”`}
|
|
17
|
+
</Text>
|
|
18
|
+
</View>
|
|
19
|
+
))}
|
|
20
|
+
</View>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -9,8 +9,8 @@ import { ompStoreKey } from "./omp-store-state";
|
|
|
9
9
|
const SESSIONS_POLL_MS = 20_000;
|
|
10
10
|
const PREVIEW_LIMIT = 20;
|
|
11
11
|
|
|
12
|
-
function age(
|
|
13
|
-
const seconds = Math.max(0, Math.floor(Date.now() / 1_000
|
|
12
|
+
function age(updatedAt: string): string {
|
|
13
|
+
const seconds = Math.max(0, Math.floor((Date.now() - Date.parse(updatedAt)) / 1_000));
|
|
14
14
|
if (seconds < 60) return `${seconds}s ago`;
|
|
15
15
|
const minutes = Math.floor(seconds / 60);
|
|
16
16
|
if (minutes < 60) return `${minutes}m ago`;
|
|
@@ -52,22 +52,22 @@ export function SessionsPopover(props: PluginButtonContentProps) {
|
|
|
52
52
|
[layout.compact, theme],
|
|
53
53
|
);
|
|
54
54
|
|
|
55
|
-
if (sessions.isLoading) return <Text style={styles.muted}>Loading
|
|
56
|
-
if (sessions.error) return <Text style={styles.error}>Could not read
|
|
55
|
+
if (sessions.isLoading) return <Text style={styles.muted}>Loading OMP sessions…</Text>;
|
|
56
|
+
if (sessions.error) return <Text style={styles.error}>Could not read OMP sessions.</Text>;
|
|
57
57
|
const items = sessions.data?.sessions ?? [];
|
|
58
58
|
if (items.length === 0)
|
|
59
|
-
return <Text style={styles.muted}>No
|
|
59
|
+
return <Text style={styles.muted}>No OMP sessions for this directory.</Text>;
|
|
60
60
|
|
|
61
61
|
return (
|
|
62
62
|
<ScrollView contentContainerStyle={styles.root}>
|
|
63
63
|
<Text style={styles.muted}>{storeLabel(store)}</Text>
|
|
64
64
|
{items.slice(0, PREVIEW_LIMIT).map((entry) => (
|
|
65
|
-
<View key={entry.
|
|
65
|
+
<View key={entry.sessionId} style={styles.row}>
|
|
66
66
|
{entry.title ? <Text style={styles.title}>{entry.title}</Text> : null}
|
|
67
67
|
<Text style={styles.prompt} numberOfLines={3}>
|
|
68
|
-
{
|
|
68
|
+
{entry.prompt}
|
|
69
69
|
</Text>
|
|
70
|
-
<Text style={styles.detail}>{age(entry.
|
|
70
|
+
{entry.updatedAt ? <Text style={styles.detail}>{age(entry.updatedAt)}</Text> : null}
|
|
71
71
|
</View>
|
|
72
72
|
))}
|
|
73
73
|
{items.length > PREVIEW_LIMIT ? (
|
package/index.client.tsx
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
quotaSeverityForProvider,
|
|
30
30
|
quotaSummaryForProvider,
|
|
31
31
|
} from "./client/quota-state";
|
|
32
|
+
import { OmpRuleNoticeRow } from "./client/rule-notice";
|
|
32
33
|
import { SessionsPopover } from "./client/sessions-popover";
|
|
33
34
|
import {
|
|
34
35
|
CONFIG_SCREEN_ID,
|
|
@@ -49,6 +50,7 @@ import { OMP_MCP_AUTH_TIMELINE_KIND, ompMcpAuthorizationTimelineSchema } from ".
|
|
|
49
50
|
import { type OmpStore, storeForProvider } from "./shared/omp-store";
|
|
50
51
|
import { ompImageTimelineSchema, transformOmpImageToolItem } from "./shared/provider-image";
|
|
51
52
|
import { listOmpQuotas } from "./shared/quota";
|
|
53
|
+
import { OMP_RULE_NOTICE_KIND, ompRuleNoticeSchema } from "./shared/rule-notices";
|
|
52
54
|
import { OMP_SUBAGENT_STRIP_KIND, ompSubagentStripSchema } from "./shared/subagents";
|
|
53
55
|
|
|
54
56
|
const PAGE_LIMIT = 200;
|
|
@@ -245,6 +247,12 @@ export default function contribute(client: PluginClientContext) {
|
|
|
245
247
|
schema: ompSubagentStripSchema,
|
|
246
248
|
Component: OmpSubagentStrip,
|
|
247
249
|
});
|
|
250
|
+
const removeRuleNoticeRenderer = client.addTimelineRenderer({
|
|
251
|
+
kind: OMP_RULE_NOTICE_KIND,
|
|
252
|
+
version: 1,
|
|
253
|
+
schema: ompRuleNoticeSchema,
|
|
254
|
+
Component: OmpRuleNoticeRow,
|
|
255
|
+
});
|
|
248
256
|
const removeImageTransformer = client.addTimelineTransformer({
|
|
249
257
|
id: "omp-images",
|
|
250
258
|
query: { itemType: "tool_call" },
|
|
@@ -553,6 +561,7 @@ export default function contribute(client: PluginClientContext) {
|
|
|
553
561
|
removeImageRenderer();
|
|
554
562
|
removeMcpAuthorizationRenderer();
|
|
555
563
|
removeSubagentStripRenderer();
|
|
564
|
+
removeRuleNoticeRenderer();
|
|
556
565
|
removeImageTransformer();
|
|
557
566
|
removeOpenConfig();
|
|
558
567
|
removeConfigEntry();
|
package/index.server.ts
CHANGED
|
@@ -31,6 +31,7 @@ import { OmpPublicError } from "./server/provider/security";
|
|
|
31
31
|
import { OmpSessionLimit } from "./server/provider/session-limit";
|
|
32
32
|
import { resolveGetOmpProviderHealth } from "./server/provider-diagnostics";
|
|
33
33
|
import { resolveListOmpQuotas } from "./server/quota";
|
|
34
|
+
import { registerOmpRuleNotices } from "./server/rule-notices";
|
|
34
35
|
import { resolveListOmpSessions } from "./server/sessions";
|
|
35
36
|
import {
|
|
36
37
|
OmpSubagentControlRegistry,
|
|
@@ -208,6 +209,7 @@ export default function contribute(server: PluginServerContext) {
|
|
|
208
209
|
server.handle(steerOmpSubagent, (input) =>
|
|
209
210
|
resolveSteerOmpSubagent(input, subagentControlRegistry),
|
|
210
211
|
);
|
|
212
|
+
const removeRuleNotices = registerOmpRuleNotices(server);
|
|
211
213
|
const removeSessionOpenHook = server.before("agent.session_open", ({ request }) => {
|
|
212
214
|
if (request.provider !== "omp-plugin" && !request.provider.startsWith("omp-plugin-")) return;
|
|
213
215
|
return withOmpSessionOpenEnv(request);
|
|
@@ -228,6 +230,7 @@ export default function contribute(server: PluginServerContext) {
|
|
|
228
230
|
mcps.stop();
|
|
229
231
|
removeSessionLimitListener();
|
|
230
232
|
subagentControlRegistry.clear();
|
|
233
|
+
removeRuleNotices();
|
|
231
234
|
removeSessionOpenHook();
|
|
232
235
|
};
|
|
233
236
|
}
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Release Please keeps this bundle-safe constant aligned with package.json. */
|
|
2
|
-
export const PASEO_OMP_PACKAGE_VERSION = "5.4.0-next.
|
|
2
|
+
export const PASEO_OMP_PACKAGE_VERSION = "5.4.0-next.393.1"; // x-release-please-version
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { constants } from "node:fs";
|
|
2
|
+
import { type FileHandle, open } from "node:fs/promises";
|
|
3
|
+
import { isAbsolute } from "node:path";
|
|
4
|
+
import type { PluginServerContext } from "@getpaseo/plugin/server";
|
|
5
|
+
import {
|
|
6
|
+
MAX_OMP_RULE_NOTICE_RULES,
|
|
7
|
+
OMP_RULE_MATCH_MAX_LENGTH,
|
|
8
|
+
OMP_RULE_NAME_MAX_LENGTH,
|
|
9
|
+
OMP_RULE_NOTICE_KIND,
|
|
10
|
+
type OmpRuleNotice,
|
|
11
|
+
} from "../shared/rule-notices";
|
|
12
|
+
|
|
13
|
+
/** Rule firings are read from the end of the session file; a turn rarely writes more. */
|
|
14
|
+
const TAIL_BYTES = 1024 * 1024;
|
|
15
|
+
|
|
16
|
+
function bounded(value: string, max: number): string {
|
|
17
|
+
return value.length > max ? `${value.slice(0, max - 1)}…` : value;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function stringArray(value: unknown): string[] {
|
|
21
|
+
return Array.isArray(value)
|
|
22
|
+
? value.filter((entry): entry is string => typeof entry === "string" && entry.length > 0)
|
|
23
|
+
: [];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function readTail(file: string): Promise<string | undefined> {
|
|
27
|
+
let handle: FileHandle;
|
|
28
|
+
try {
|
|
29
|
+
handle = await open(
|
|
30
|
+
file,
|
|
31
|
+
constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0),
|
|
32
|
+
);
|
|
33
|
+
} catch {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const stat = await handle.stat();
|
|
38
|
+
if (!stat.isFile()) return;
|
|
39
|
+
const start = Math.max(0, stat.size - TAIL_BYTES);
|
|
40
|
+
const buffer = Buffer.allocUnsafe(stat.size - start);
|
|
41
|
+
const { bytesRead } = await handle.read(buffer, 0, buffer.length, start);
|
|
42
|
+
const text = buffer.toString("utf8", 0, bytesRead);
|
|
43
|
+
return start === 0 ? text : text.slice(text.indexOf("\n") + 1);
|
|
44
|
+
} finally {
|
|
45
|
+
await handle.close().catch(() => undefined);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The OMP rules injected between `since` and `until` (epoch ms), from OMP's persisted
|
|
51
|
+
* `ttsr_injection` entries; `id` is the first injection entry's.
|
|
52
|
+
*/
|
|
53
|
+
export async function readOmpRuleNotice(
|
|
54
|
+
sessionFile: string,
|
|
55
|
+
since: number,
|
|
56
|
+
until: number,
|
|
57
|
+
): Promise<{ id: string; notice: OmpRuleNotice } | undefined> {
|
|
58
|
+
if (!isAbsolute(sessionFile) || !sessionFile.endsWith(".jsonl")) return;
|
|
59
|
+
const tail = await readTail(sessionFile);
|
|
60
|
+
if (!tail) return;
|
|
61
|
+
let id: string | undefined;
|
|
62
|
+
const names: string[] = [];
|
|
63
|
+
const matched = new Map<string, string>();
|
|
64
|
+
for (const line of tail.split("\n")) {
|
|
65
|
+
if (!line.includes("ttsr")) continue;
|
|
66
|
+
let entry: Record<string, unknown>;
|
|
67
|
+
try {
|
|
68
|
+
entry = JSON.parse(line);
|
|
69
|
+
} catch {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const at = typeof entry.timestamp === "string" ? Date.parse(entry.timestamp) : Number.NaN;
|
|
73
|
+
if (!(at >= since && at <= until)) continue;
|
|
74
|
+
if (entry.type === "ttsr_injection") {
|
|
75
|
+
id ??= typeof entry.id === "string" ? entry.id : undefined;
|
|
76
|
+
for (const name of stringArray(entry.injectedRules)) {
|
|
77
|
+
if (!names.includes(name)) names.push(name);
|
|
78
|
+
}
|
|
79
|
+
} else if (entry.type === "custom_message" && entry.customType === "ttsr-injection") {
|
|
80
|
+
const details = entry.details as { matched?: unknown } | undefined;
|
|
81
|
+
if (details?.matched && typeof details.matched === "object") {
|
|
82
|
+
for (const [name, text] of Object.entries(details.matched)) {
|
|
83
|
+
if (typeof text === "string") matched.set(name, text);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (!id || names.length === 0) return;
|
|
89
|
+
return {
|
|
90
|
+
id,
|
|
91
|
+
notice: {
|
|
92
|
+
rules: names.slice(0, MAX_OMP_RULE_NOTICE_RULES).map((name) => {
|
|
93
|
+
const text = matched.get(name);
|
|
94
|
+
return {
|
|
95
|
+
name: bounded(name, OMP_RULE_NAME_MAX_LENGTH),
|
|
96
|
+
matched: text === undefined ? null : bounded(text, OMP_RULE_MATCH_MAX_LENGTH),
|
|
97
|
+
};
|
|
98
|
+
}),
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Paseo's bundled `omp` provider drops OMP rule events, so surface them from its session file. */
|
|
104
|
+
export function registerOmpRuleNotices(server: Pick<PluginServerContext, "addHook">): () => void {
|
|
105
|
+
// One Paseo turn can report several native turn starts; keep the earliest. Hooks run
|
|
106
|
+
// concurrently, so state is read and cleared before the first await.
|
|
107
|
+
const turnStarts = new Map<string, number>();
|
|
108
|
+
const turnKey = (agentId: string, turnId: string | null) => `${agentId}\0${turnId ?? ""}`;
|
|
109
|
+
const removeBefore = server.addHook("agent.turn.before", async ({ agent, turnId }) => {
|
|
110
|
+
const key = turnKey(agent.id, turnId);
|
|
111
|
+
if (agent.provider === "omp" && !turnStarts.has(key)) turnStarts.set(key, Date.now());
|
|
112
|
+
});
|
|
113
|
+
const removeAfter = server.addHook("agent.turn.after", async ({ agent, turnId }, { paseo }) => {
|
|
114
|
+
const key = turnKey(agent.id, turnId);
|
|
115
|
+
const since = turnStarts.get(key);
|
|
116
|
+
const until = Date.now();
|
|
117
|
+
turnStarts.delete(key);
|
|
118
|
+
if (agent.provider !== "omp" || since === undefined) return;
|
|
119
|
+
const ref = paseo.agents.ref(agent.id);
|
|
120
|
+
const sessionFile = (await ref.refresh())?.agent.persistence?.nativeHandle;
|
|
121
|
+
if (!sessionFile) return;
|
|
122
|
+
const found = await readOmpRuleNotice(sessionFile, since, until);
|
|
123
|
+
if (!found) return;
|
|
124
|
+
await ref.timeline.append({
|
|
125
|
+
type: "plugin",
|
|
126
|
+
id: `rule-notice:${found.id}`,
|
|
127
|
+
kind: OMP_RULE_NOTICE_KIND,
|
|
128
|
+
version: 1,
|
|
129
|
+
data: found.notice,
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
return () => {
|
|
133
|
+
removeBefore();
|
|
134
|
+
removeAfter();
|
|
135
|
+
turnStarts.clear();
|
|
136
|
+
};
|
|
137
|
+
}
|
package/server/sessions.ts
CHANGED
|
@@ -1,58 +1,25 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
2
|
-
import { DatabaseSync } from "node:sqlite";
|
|
3
1
|
import type { RpcInput } from "@getpaseo/plugin";
|
|
4
|
-
import { z } from "zod";
|
|
5
2
|
import type { listOmpSessions, OmpSessionEntry } from "../shared/sessions";
|
|
6
|
-
import {
|
|
3
|
+
import { currentOmpEnvironment } from "./paths";
|
|
4
|
+
import { listOmpSessionDescriptors } from "./provider/session-descriptors";
|
|
7
5
|
|
|
8
|
-
const PROMPT_LIMIT = 400;
|
|
9
6
|
const ROW_LIMIT = 100;
|
|
10
7
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
LEFT JOIN session_titles t ON t.session_id = h.session_id
|
|
29
|
-
WHERE h.cwd = ?
|
|
30
|
-
ORDER BY h.created_at DESC, h.id DESC
|
|
31
|
-
LIMIT ?`,
|
|
32
|
-
)
|
|
33
|
-
.all(cwd, ROW_LIMIT);
|
|
34
|
-
return rows.flatMap((row) => {
|
|
35
|
-
const parsed = SessionRowSchema.safeParse(row);
|
|
36
|
-
if (!parsed.success) return [];
|
|
37
|
-
const truncated = parsed.data.prompt.length > PROMPT_LIMIT;
|
|
38
|
-
return [
|
|
39
|
-
{
|
|
40
|
-
...parsed.data,
|
|
41
|
-
prompt: truncated ? parsed.data.prompt.slice(0, PROMPT_LIMIT) : parsed.data.prompt,
|
|
42
|
-
truncated,
|
|
43
|
-
},
|
|
44
|
-
];
|
|
45
|
-
});
|
|
46
|
-
} finally {
|
|
47
|
-
database.close();
|
|
48
|
-
}
|
|
49
|
-
} catch {
|
|
50
|
-
return [];
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function resolveListOmpSessions({ cwd }: RpcInput<typeof listOmpSessions>): {
|
|
55
|
-
sessions: OmpSessionEntry[];
|
|
56
|
-
} {
|
|
57
|
-
return { sessions: listOmpSessionsFrom(join(ompDataDir(), "history.db"), cwd) };
|
|
8
|
+
// OMP records prompt-history rows only from its interactive editor, never in RPC mode, so
|
|
9
|
+
// Paseo-driven sessions are listed from their session files instead.
|
|
10
|
+
export async function resolveListOmpSessions({
|
|
11
|
+
cwd,
|
|
12
|
+
}: RpcInput<typeof listOmpSessions>): Promise<{ sessions: OmpSessionEntry[] }> {
|
|
13
|
+
const descriptors = await listOmpSessionDescriptors(
|
|
14
|
+
{ cwd, limit: ROW_LIMIT },
|
|
15
|
+
currentOmpEnvironment(),
|
|
16
|
+
);
|
|
17
|
+
return {
|
|
18
|
+
sessions: descriptors.map((descriptor) => ({
|
|
19
|
+
sessionId: descriptor.id,
|
|
20
|
+
title: descriptor.title ?? null,
|
|
21
|
+
prompt: descriptor.firstPromptPreview ?? descriptor.lastPromptPreview ?? "",
|
|
22
|
+
updatedAt: descriptor.updatedAt ?? null,
|
|
23
|
+
})),
|
|
24
|
+
};
|
|
58
25
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const OMP_RULE_NOTICE_KIND = "omp-rule-notice";
|
|
4
|
+
export const MAX_OMP_RULE_NOTICE_RULES = 32;
|
|
5
|
+
export const OMP_RULE_NAME_MAX_LENGTH = 256;
|
|
6
|
+
export const OMP_RULE_MATCH_MAX_LENGTH = 512;
|
|
7
|
+
|
|
8
|
+
/** OMP rules (TTSR) that fired during one turn, appended below that turn. */
|
|
9
|
+
export const ompRuleNoticeSchema = z.object({
|
|
10
|
+
rules: z
|
|
11
|
+
.array(
|
|
12
|
+
z.object({
|
|
13
|
+
name: z.string().min(1).max(OMP_RULE_NAME_MAX_LENGTH),
|
|
14
|
+
matched: z.string().max(OMP_RULE_MATCH_MAX_LENGTH).nullable(),
|
|
15
|
+
}),
|
|
16
|
+
)
|
|
17
|
+
.min(1)
|
|
18
|
+
.max(MAX_OMP_RULE_NOTICE_RULES),
|
|
19
|
+
});
|
|
20
|
+
export type OmpRuleNotice = z.infer<typeof ompRuleNoticeSchema>;
|
package/shared/sessions.ts
CHANGED
|
@@ -4,16 +4,11 @@ import { OmpStoreSchema } from "./omp-store";
|
|
|
4
4
|
|
|
5
5
|
const CwdSchema = z.string().min(1).max(4_096);
|
|
6
6
|
|
|
7
|
-
// omp's history.db stores created_at as epoch seconds (confirmed against live rows: 10-digit
|
|
8
|
-
// values), unlike agent.db's usage_history which stores milliseconds. Diff against
|
|
9
|
-
// Date.now() / 1_000, never Date.now() directly.
|
|
10
7
|
export const OmpSessionEntrySchema = z.object({
|
|
11
|
-
|
|
12
|
-
sessionId: z.string().nullable(),
|
|
8
|
+
sessionId: z.string(),
|
|
13
9
|
title: z.string().nullable(),
|
|
14
10
|
prompt: z.string(),
|
|
15
|
-
|
|
16
|
-
createdAt: z.number().int(),
|
|
11
|
+
updatedAt: z.string().nullable(),
|
|
17
12
|
});
|
|
18
13
|
export type OmpSessionEntry = z.infer<typeof OmpSessionEntrySchema>;
|
|
19
14
|
|