@pushwoosh/rpc-gateway-ai-assistant 0.1.157 → 0.1.158
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/data.js +106 -0
- package/package.json +1 -1
- package/pushwoosh_aigen_v1.d.ts +147 -0
package/data.js
CHANGED
|
@@ -1103,6 +1103,19 @@ export const data = {
|
|
|
1103
1103
|
"method": "post",
|
|
1104
1104
|
"path": "/api/v1/aigen/generate",
|
|
1105
1105
|
"serverStreaming": true
|
|
1106
|
+
},
|
|
1107
|
+
"RenderHtml": {
|
|
1108
|
+
"request": "pushwoosh.aigen.v1.AiGenHtmlRequest",
|
|
1109
|
+
"response": "pushwoosh.aigen.v1.AiGenHtmlEvent",
|
|
1110
|
+
"method": "post",
|
|
1111
|
+
"path": "/api/v1/aigen/html",
|
|
1112
|
+
"serverStreaming": true
|
|
1113
|
+
},
|
|
1114
|
+
"ExtractStyle": {
|
|
1115
|
+
"request": "pushwoosh.aigen.v1.AiGenExtractStyleRequest",
|
|
1116
|
+
"response": "pushwoosh.aigen.v1.AiGenExtractStyleResponse",
|
|
1117
|
+
"method": "post",
|
|
1118
|
+
"path": "/api/v1/aigen/extract-style"
|
|
1106
1119
|
}
|
|
1107
1120
|
}
|
|
1108
1121
|
},
|
|
@@ -1436,6 +1449,99 @@ export const data = {
|
|
|
1436
1449
|
}
|
|
1437
1450
|
}
|
|
1438
1451
|
},
|
|
1452
|
+
"pushwoosh.aigen.v1.AiGenHtmlRequest": {
|
|
1453
|
+
"type": "I",
|
|
1454
|
+
"fields": {
|
|
1455
|
+
"document": {
|
|
1456
|
+
"type": "pushwoosh.aibuilder.v1.AiBuilderDocument"
|
|
1457
|
+
},
|
|
1458
|
+
"mode": {
|
|
1459
|
+
"type": "pushwoosh.aigen.v1.AiGenMode"
|
|
1460
|
+
},
|
|
1461
|
+
"application": {
|
|
1462
|
+
"type": "string"
|
|
1463
|
+
},
|
|
1464
|
+
"referenceImages": {
|
|
1465
|
+
"type": "pushwoosh.aigen.v1.AiGenReferenceImage",
|
|
1466
|
+
"array": true
|
|
1467
|
+
},
|
|
1468
|
+
"llmProvider": {
|
|
1469
|
+
"type": "string",
|
|
1470
|
+
"optional": true
|
|
1471
|
+
},
|
|
1472
|
+
"llmModel": {
|
|
1473
|
+
"type": "string",
|
|
1474
|
+
"optional": true
|
|
1475
|
+
},
|
|
1476
|
+
"instructions": {
|
|
1477
|
+
"type": "string"
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
},
|
|
1481
|
+
"pushwoosh.aigen.v1.AiGenHtmlEvent": {
|
|
1482
|
+
"type": "I",
|
|
1483
|
+
"fields": {
|
|
1484
|
+
"progress": {
|
|
1485
|
+
"type": "string"
|
|
1486
|
+
},
|
|
1487
|
+
"htmlDelta": {
|
|
1488
|
+
"type": "string"
|
|
1489
|
+
},
|
|
1490
|
+
"done": {
|
|
1491
|
+
"type": "pushwoosh.aigen.v1.AiGenDoneEvent"
|
|
1492
|
+
},
|
|
1493
|
+
"fatal": {
|
|
1494
|
+
"type": "string"
|
|
1495
|
+
}
|
|
1496
|
+
},
|
|
1497
|
+
"oneofs": {
|
|
1498
|
+
"event": {
|
|
1499
|
+
"oneof": [
|
|
1500
|
+
"progress",
|
|
1501
|
+
"htmlDelta",
|
|
1502
|
+
"done",
|
|
1503
|
+
"fatal"
|
|
1504
|
+
]
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
},
|
|
1508
|
+
"pushwoosh.aigen.v1.AiGenExtractStyleRequest": {
|
|
1509
|
+
"type": "I",
|
|
1510
|
+
"fields": {
|
|
1511
|
+
"image": {
|
|
1512
|
+
"type": "pushwoosh.aigen.v1.AiGenReferenceImage"
|
|
1513
|
+
},
|
|
1514
|
+
"llmProvider": {
|
|
1515
|
+
"type": "string",
|
|
1516
|
+
"optional": true
|
|
1517
|
+
},
|
|
1518
|
+
"llmModel": {
|
|
1519
|
+
"type": "string",
|
|
1520
|
+
"optional": true
|
|
1521
|
+
},
|
|
1522
|
+
"application": {
|
|
1523
|
+
"type": "string"
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
},
|
|
1527
|
+
"pushwoosh.aigen.v1.AiGenExtractStyleResponse": {
|
|
1528
|
+
"type": "I",
|
|
1529
|
+
"fields": {
|
|
1530
|
+
"colorScheme": {
|
|
1531
|
+
"type": "pushwoosh.aibuilder.v1.ColorSchemeItem",
|
|
1532
|
+
"mapKeyType": "string"
|
|
1533
|
+
},
|
|
1534
|
+
"fontFamily": {
|
|
1535
|
+
"type": "string"
|
|
1536
|
+
},
|
|
1537
|
+
"headingFontFamily": {
|
|
1538
|
+
"type": "string"
|
|
1539
|
+
},
|
|
1540
|
+
"typographyNotes": {
|
|
1541
|
+
"type": "string"
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
},
|
|
1439
1545
|
"pushwoosh.accounts.assistant.v1.Role": {
|
|
1440
1546
|
"type": "E",
|
|
1441
1547
|
"values": [
|
package/package.json
CHANGED
package/pushwoosh_aigen_v1.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { RpcMethod } from './commonTypes';
|
|
1
2
|
import { AiBuilderDocument as pushwoosh_aibuilder_v1_AiBuilderDocument } from './pushwoosh_aibuilder_v1';
|
|
2
3
|
import { DocumentSettings as pushwoosh_aibuilder_v1_DocumentSettings } from './pushwoosh_aibuilder_v1';
|
|
3
4
|
import { TextVariantStyle as pushwoosh_aibuilder_v1_TextVariantStyle } from './pushwoosh_aibuilder_v1';
|
|
4
5
|
import { ColorSchemeItem as pushwoosh_aibuilder_v1_ColorSchemeItem } from './pushwoosh_aibuilder_v1';
|
|
5
6
|
import { AiBuilderBlock as pushwoosh_aibuilder_v1_AiBuilderBlock } from './pushwoosh_aibuilder_v1';
|
|
7
|
+
export type AiGenService_ExtractStyle = RpcMethod<AiGenExtractStyleRequest, AiGenExtractStyleResponse>;
|
|
6
8
|
/**
|
|
7
9
|
* AiGenService unifies document create / edit / per-block regeneration and
|
|
8
10
|
* targeted block insertion into a single streaming RPC. Dispatch rules:
|
|
@@ -27,6 +29,35 @@ export interface AiGenService {
|
|
|
27
29
|
Generate(request: AiGenRequest, options?: {
|
|
28
30
|
signal?: AbortSignal;
|
|
29
31
|
}): Promise<AsyncIterable<AiGenEvent>>;
|
|
32
|
+
/**
|
|
33
|
+
* RenderHtml renders an existing AiBuilderDocument into a finished,
|
|
34
|
+
* self-contained HTML document. The model writes the whole HTML — a
|
|
35
|
+
* full <!DOCTYPE html> page with embedded/inline CSS — from the
|
|
36
|
+
* document's content and styling, streamed back as ordered html_delta
|
|
37
|
+
* chunks the client concatenates.
|
|
38
|
+
*
|
|
39
|
+
* mode picks the flavour: EMAIL → email-safe markup (table-based
|
|
40
|
+
* layout, inline CSS, max client compatibility); WEB_POPUP → a modern
|
|
41
|
+
* responsive page (CSS in <head>, fl/grid). UNSPECIFIED and FULL are
|
|
42
|
+
* rejected like on Generate.
|
|
43
|
+
*
|
|
44
|
+
* An optional reference image conditions the visual style ("make it
|
|
45
|
+
* look like this design") — its palette, typography, spacing, and
|
|
46
|
+
* corner treatment are sampled by a vision-capable provider.
|
|
47
|
+
* llm_provider / llm_model are the same dev-only overrides as Generate.
|
|
48
|
+
*/
|
|
49
|
+
RenderHtml(request: AiGenHtmlRequest, options?: {
|
|
50
|
+
signal?: AbortSignal;
|
|
51
|
+
}): Promise<AsyncIterable<AiGenHtmlEvent>>;
|
|
52
|
+
/**
|
|
53
|
+
* ExtractStyle samples a visual style from a single image: a colour
|
|
54
|
+
* palette (keyed by semantic role) plus typography hints (body /
|
|
55
|
+
* heading font-family stacks and a free-text character note). It is a
|
|
56
|
+
* pure extractor — no document in, no document out — meant to seed a
|
|
57
|
+
* fresh AiBuilderDocument's color_scheme / fonts from a brand asset or
|
|
58
|
+
* design screenshot. Unary; the result is small.
|
|
59
|
+
*/
|
|
60
|
+
ExtractStyle: AiGenService_ExtractStyle;
|
|
30
61
|
}
|
|
31
62
|
export type AiGenBlockTypeHint = 'AI_GEN_BLOCK_TYPE_HINT_UNSPECIFIED' | 'AI_GEN_BLOCK_TYPE_HINT_CARD' | 'AI_GEN_BLOCK_TYPE_HINT_COLUMNS'
|
|
32
63
|
/** Top-level free-form Content block. Allowed in WEB_POPUP only. */
|
|
@@ -387,3 +418,119 @@ export type AiGenEvent_event = AiGenEvent_event_progress | AiGenEvent_event_stru
|
|
|
387
418
|
export type AiGenEvent = {
|
|
388
419
|
event: AiGenEvent_event;
|
|
389
420
|
};
|
|
421
|
+
export type AiGenHtmlRequest = {
|
|
422
|
+
/**
|
|
423
|
+
* The document to render to HTML. Required; must carry at least one
|
|
424
|
+
* page. All of its content and styling (blocks, text, buttons, image
|
|
425
|
+
* src/alt, color_scheme, settings) is fed to the model verbatim — the
|
|
426
|
+
* model only formats it, it does not rewrite the copy.
|
|
427
|
+
*/
|
|
428
|
+
document: pushwoosh_aibuilder_v1_AiBuilderDocument;
|
|
429
|
+
/**
|
|
430
|
+
* Document-domain profile for the output flavour. Required — the
|
|
431
|
+
* server rejects UNSPECIFIED and FULL like on Generate. EMAIL produces
|
|
432
|
+
* email-safe markup (table layout, inline CSS); WEB_POPUP produces a
|
|
433
|
+
* modern responsive page.
|
|
434
|
+
*/
|
|
435
|
+
mode: AiGenMode;
|
|
436
|
+
/**
|
|
437
|
+
* Application id, used for media-context / logging parity with
|
|
438
|
+
* Generate. Optional for rendering.
|
|
439
|
+
*/
|
|
440
|
+
application: string;
|
|
441
|
+
/**
|
|
442
|
+
* Optional reference images: "style it like this design". Fed to a
|
|
443
|
+
* vision-capable provider (Claude, or our multimodal Qwen/vLLM) as
|
|
444
|
+
* visual context for palette / typography / spacing. Empty = the
|
|
445
|
+
* style is derived from the document and instructions only. Sent
|
|
446
|
+
* inline as base64; reuses the same shape as Generate.
|
|
447
|
+
*/
|
|
448
|
+
referenceImages: AiGenReferenceImage[];
|
|
449
|
+
/**
|
|
450
|
+
* Dev-only override of the LLM. Empty = the server default
|
|
451
|
+
* (self-hosted Qwen/vLLM); "claude" routes through Anthropic. Same
|
|
452
|
+
* semantics and gating as AiGenRequest.llm_provider.
|
|
453
|
+
*/
|
|
454
|
+
llmProvider?: string;
|
|
455
|
+
/**
|
|
456
|
+
* Dev-only override of the concrete model name for the chosen
|
|
457
|
+
* provider. Empty = the provider's configured default.
|
|
458
|
+
*/
|
|
459
|
+
llmModel?: string;
|
|
460
|
+
/**
|
|
461
|
+
* Optional free-form extra guidance from the user layered on top of
|
|
462
|
+
* the document content ("dark theme", "more whitespace", "single
|
|
463
|
+
* column"). Empty = render faithfully with sensible defaults.
|
|
464
|
+
*/
|
|
465
|
+
instructions: string;
|
|
466
|
+
};
|
|
467
|
+
export type AiGenHtmlEvent_event_progress = {
|
|
468
|
+
type: 'progress';
|
|
469
|
+
data: string;
|
|
470
|
+
};
|
|
471
|
+
export type AiGenHtmlEvent_event_htmlDelta = {
|
|
472
|
+
type: 'htmlDelta';
|
|
473
|
+
data: string;
|
|
474
|
+
};
|
|
475
|
+
export type AiGenHtmlEvent_event_done = {
|
|
476
|
+
type: 'done';
|
|
477
|
+
data: AiGenDoneEvent;
|
|
478
|
+
};
|
|
479
|
+
export type AiGenHtmlEvent_event_fatal = {
|
|
480
|
+
type: 'fatal';
|
|
481
|
+
data: string;
|
|
482
|
+
};
|
|
483
|
+
export type AiGenHtmlEvent_event = AiGenHtmlEvent_event_progress | AiGenHtmlEvent_event_htmlDelta | AiGenHtmlEvent_event_done | AiGenHtmlEvent_event_fatal;
|
|
484
|
+
/** AiGenHtmlEvent is one frame of the RenderHtml stream. */
|
|
485
|
+
export type AiGenHtmlEvent = {
|
|
486
|
+
event: AiGenHtmlEvent_event;
|
|
487
|
+
};
|
|
488
|
+
export type AiGenExtractStyleRequest = {
|
|
489
|
+
/**
|
|
490
|
+
* The image to sample the style from. Required. Sent inline as base64,
|
|
491
|
+
* same shape as RenderHtml's reference images. Needs a vision-capable
|
|
492
|
+
* provider (Claude, or our multimodal Qwen/vLLM).
|
|
493
|
+
*/
|
|
494
|
+
image: AiGenReferenceImage;
|
|
495
|
+
/** Dev-only LLM override, same semantics as AiGenRequest.llm_provider. */
|
|
496
|
+
llmProvider?: string;
|
|
497
|
+
llmModel?: string;
|
|
498
|
+
/**
|
|
499
|
+
* Application code. Required by the server's application-scoping
|
|
500
|
+
* middleware (same as the other AiGen RPCs); the extractor itself does
|
|
501
|
+
* not use it yet — it samples style from the image alone — so today it
|
|
502
|
+
* only satisfies app/account scoping. Kept here so the wire contract is
|
|
503
|
+
* consistent and a future media-aware extension has it ready.
|
|
504
|
+
*/
|
|
505
|
+
application: string;
|
|
506
|
+
};
|
|
507
|
+
export type AiGenExtractStyleResponse = {
|
|
508
|
+
/**
|
|
509
|
+
* Palette sampled from the image, keyed by semantic role. The model
|
|
510
|
+
* returns ONLY the roles it can confidently derive — absent roles are
|
|
511
|
+
* the client's to fill from its own defaults. Preferred role keys
|
|
512
|
+
* (the model may add others when clearly present in the image):
|
|
513
|
+
* background, surface, border, text, text-secondary, text-disabled,
|
|
514
|
+
* text-on-accent, accent, accent-hover, link, success, warning, error.
|
|
515
|
+
* Values are the proto ColorSchemeItem (hex + human-readable label).
|
|
516
|
+
*/
|
|
517
|
+
colorScheme: Record<string, pushwoosh_aibuilder_v1_ColorSchemeItem>;
|
|
518
|
+
/**
|
|
519
|
+
* CSS font-family chain for body text inferred from the image's
|
|
520
|
+
* typographic feel (e.g. "Inter, system-ui, sans-serif"). Empty when
|
|
521
|
+
* the image gives no clear signal. The exact face can't be identified
|
|
522
|
+
* from an image — this is a best-effort closest stack.
|
|
523
|
+
*/
|
|
524
|
+
fontFamily: string;
|
|
525
|
+
/**
|
|
526
|
+
* CSS font-family chain for headings. Empty when no clear signal or
|
|
527
|
+
* when it matches font_family.
|
|
528
|
+
*/
|
|
529
|
+
headingFontFamily: string;
|
|
530
|
+
/**
|
|
531
|
+
* Short free-text description of the typographic character (e.g.
|
|
532
|
+
* "geometric sans, heavy display headings, generous tracking") for
|
|
533
|
+
* downstream use such as RenderHtml. Empty when not determinable.
|
|
534
|
+
*/
|
|
535
|
+
typographyNotes: string;
|
|
536
|
+
};
|