@omercnet/paseo-omp 1.0.3-next.189.1 → 1.0.3-next.192.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/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 = "1.0.3-next.
|
|
2
|
+
export const PASEO_OMP_PACKAGE_VERSION = "1.0.3-next.192.1"; // x-release-please-version
|
|
@@ -33,6 +33,8 @@ export interface OmpStartOptions {
|
|
|
33
33
|
requestTimeoutMs?: number;
|
|
34
34
|
/** Resume this exact native OMP session; never use this to start a new conversation. */
|
|
35
35
|
resumeSessionId?: string;
|
|
36
|
+
/** Authorized transcript of `resumeSessionId`; when set, OMP resumes this file directly. */
|
|
37
|
+
resumeSessionFile?: string;
|
|
36
38
|
noSession?: boolean;
|
|
37
39
|
signal?: AbortSignal;
|
|
38
40
|
}
|
|
@@ -340,7 +342,12 @@ export function buildOmpSpawnRequest(
|
|
|
340
342
|
validateBoundedText(options.sessionDir, "session directory", MAX_PATH_LENGTH),
|
|
341
343
|
);
|
|
342
344
|
}
|
|
343
|
-
if (options.
|
|
345
|
+
if (options.resumeSessionFile !== undefined) {
|
|
346
|
+
// OMP opens an absolute .jsonl directly, skipping its id lookup and global fallback.
|
|
347
|
+
const file = validateBoundedText(options.resumeSessionFile, "session file", MAX_PATH_LENGTH);
|
|
348
|
+
if (!isAbsolute(file) || !file.endsWith(".jsonl")) throw new Error("Invalid OMP session file");
|
|
349
|
+
args.push("--resume", file);
|
|
350
|
+
} else if (options.resumeSessionId !== undefined) {
|
|
344
351
|
args.push("--resume", validateNativeSessionId(options.resumeSessionId));
|
|
345
352
|
}
|
|
346
353
|
if (options.noSession) args.push("--no-session");
|
|
@@ -159,6 +159,13 @@ export interface OmpRpcRuntimeOptions {
|
|
|
159
159
|
) => OmpSessionDescriptor[] | Promise<OmpSessionDescriptor[]>;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
// OMP accepts an empty message when images carry the prompt.
|
|
163
|
+
function promptText(message: string, images: readonly OmpImage[], field: string): string {
|
|
164
|
+
return message === "" && images.length > 0
|
|
165
|
+
? message
|
|
166
|
+
: validateBoundedText(message, field, MAX_TEXT_LENGTH);
|
|
167
|
+
}
|
|
168
|
+
|
|
162
169
|
class OmpRpcSession implements OmpRuntimeSession {
|
|
163
170
|
get maxHostToolFrameBytes(): number {
|
|
164
171
|
return this.process.outboundFrameLimit;
|
|
@@ -495,7 +502,7 @@ class OmpRpcSession implements OmpRuntimeSession {
|
|
|
495
502
|
onAccepted?: () => void,
|
|
496
503
|
onRequested?: (requestId: string) => void,
|
|
497
504
|
): Promise<{ requestId: string; agentInvoked?: boolean }> {
|
|
498
|
-
const safeMessage =
|
|
505
|
+
const safeMessage = promptText(message, images, "prompt");
|
|
499
506
|
let acknowledgement: z.infer<typeof OmpPromptAckSchema> | undefined;
|
|
500
507
|
const request = this.process.startRequest(
|
|
501
508
|
buildOmpPromptRequest(safeMessage, images),
|
|
@@ -511,7 +518,7 @@ class OmpRpcSession implements OmpRuntimeSession {
|
|
|
511
518
|
}
|
|
512
519
|
|
|
513
520
|
async steer(message: string, images: readonly OmpImage[] = []): Promise<void> {
|
|
514
|
-
const safeMessage =
|
|
521
|
+
const safeMessage = promptText(message, images, "steer");
|
|
515
522
|
await this.process.request({
|
|
516
523
|
type: "steer",
|
|
517
524
|
message: safeMessage,
|
|
@@ -519,7 +526,7 @@ class OmpRpcSession implements OmpRuntimeSession {
|
|
|
519
526
|
});
|
|
520
527
|
}
|
|
521
528
|
async followUp(message: string, images: readonly OmpImage[] = []): Promise<void> {
|
|
522
|
-
const safeMessage =
|
|
529
|
+
const safeMessage = promptText(message, images, "follow-up");
|
|
523
530
|
await this.process.request({
|
|
524
531
|
type: "follow_up",
|
|
525
532
|
message: safeMessage,
|
|
@@ -490,7 +490,13 @@ export class OmpProviderSession {
|
|
|
490
490
|
...normalizedConfig,
|
|
491
491
|
// Thinking is authorized only after this runtime reports its exact model catalog.
|
|
492
492
|
thinkingOption: undefined,
|
|
493
|
-
...(resumeSessionId
|
|
493
|
+
...(resumeSessionId
|
|
494
|
+
? {
|
|
495
|
+
systemPrompt: undefined,
|
|
496
|
+
resumeSessionId,
|
|
497
|
+
resumeSessionFile: persistedDescriptor?.transcriptFile,
|
|
498
|
+
}
|
|
499
|
+
: {}),
|
|
494
500
|
signal,
|
|
495
501
|
environment,
|
|
496
502
|
};
|
|
@@ -1990,7 +1996,9 @@ export class OmpProviderSession {
|
|
|
1990
1996
|
recovered = await this.runtimeFactory.startSession({
|
|
1991
1997
|
...this.recoveryOptions,
|
|
1992
1998
|
...(recoverFromNativeConfig ? { model: undefined, thinkingOption: undefined } : {}),
|
|
1993
|
-
...(expectedSessionId
|
|
1999
|
+
...(expectedSessionId
|
|
2000
|
+
? { resumeSessionId: expectedSessionId, resumeSessionFile: this.nativeSessionFile }
|
|
2001
|
+
: {}),
|
|
1994
2002
|
signal: this.lifetime.signal,
|
|
1995
2003
|
});
|
|
1996
2004
|
} catch (error) {
|