@omercnet/paseo-omp 1.0.3-next.189.1 → 1.0.3-next.190.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.190.1"; // x-release-please-version
|
|
@@ -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,
|