@rizom/site-rizom-ai 0.2.0-alpha.259 → 0.2.0-alpha.260

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/dist/index.d.ts CHANGED
@@ -515,6 +515,36 @@ declare const guestTurnSettlementSchema: Strict$1<{
515
515
  usage: typeof guestTurnUsageSchema;
516
516
  cost: typeof guestTurnCostSchema;
517
517
  }>;
518
+ /**
519
+ * What a guest turn screens a visitor's question against, passed in by the
520
+ * box's host beside its execution limits: the site's public topics as its
521
+ * scope, and the refusal a screened-out visitor reads, in the site's words.
522
+ */
523
+ declare const guestScreeningSchema: Strict$1<{
524
+ topics: z.ZodArray<z.ZodString>;
525
+ refusal: z.ZodOptional<z.ZodString>;
526
+ }>;
527
+ type GuestScreening = z.output<typeof guestScreeningSchema>;
528
+ /** The categories that refuse a question. */
529
+ declare const guestRefusalCategorySchema: z.ZodEnum<{
530
+ "off-topic": "off-topic";
531
+ abusive: "abusive";
532
+ injection: "injection";
533
+ harmful: "harmful";
534
+ }>;
535
+ /**
536
+ * What screening did with a guest turn: answered after an in-scope judgment,
537
+ * refused with the category it was judged, or answered unscreened because
538
+ * the judgment failed.
539
+ */
540
+ declare const guestScreeningOutcomeSchema: z.ZodDiscriminatedUnion<[Strict$1<{
541
+ outcome: z.ZodLiteral<"answered">;
542
+ }>, Strict$1<{
543
+ outcome: z.ZodLiteral<"refused">;
544
+ category: typeof guestRefusalCategorySchema;
545
+ }>, Strict$1<{
546
+ outcome: z.ZodLiteral<"unscreened">;
547
+ }>], "outcome">;
518
548
  //#endregion
519
549
  //#region ../../shared/contracts/src/agent-response.d.ts
520
550
  type PendingConfirmationSchema = z.ZodObject<{
@@ -646,6 +676,7 @@ type AgentResponseSchema = z.ZodObject<{
646
676
  pendingConfirmations: z.ZodOptional<z.ZodArray<PendingConfirmationSchema>>;
647
677
  usage: AgentResponseUsageSchema;
648
678
  guestSettlement: z.ZodOptional<typeof guestTurnSettlementSchema>;
679
+ guestScreening: z.ZodOptional<typeof guestScreeningOutcomeSchema>;
649
680
  }>;
650
681
  declare const AgentResponseSchema: AgentResponseSchema;
651
682
  type AgentResponse = z.output<typeof AgentResponseSchema>;
@@ -3639,6 +3670,8 @@ type ChatAttachment = TextChatAttachment | FileChatAttachment;
3639
3670
  interface ChatContext {
3640
3671
  /** Server-owned limits bound to the already-reserved guest execution. */
3641
3672
  guestExecution?: GuestExecutionPolicy;
3673
+ /** The site's scope and refusal copy a guest question is screened against. */
3674
+ guestScreening?: GuestScreening;
3642
3675
  userPermissionLevel?: UserPermissionLevel;
3643
3676
  /** Whether the authenticated caller is the brain's configured Anchor. */
3644
3677
  isAnchor?: boolean;
package/dist/index.js CHANGED
@@ -25144,7 +25144,8 @@ var askContentSchema = exports_external.object({
25144
25144
  topicsHeading: exports_external.string().trim().min(1).max(120).optional(),
25145
25145
  contactLabel: exports_external.string().trim().min(1).max(80).optional(),
25146
25146
  contactNote: exports_external.string().trim().min(1).max(240).optional(),
25147
- mapCaption: exports_external.string().trim().min(1).max(160).optional()
25147
+ mapCaption: exports_external.string().trim().min(1).max(160).optional(),
25148
+ refusal: exports_external.string().trim().min(1).max(500).optional()
25148
25149
  });
25149
25150
  var askContentFrontmatterSchema = askContentSchema.omit({ introduction: true });
25150
25151
  // ../../shared/utils/src/markdown-frontmatter.ts
@@ -25180,6 +25181,7 @@ var ASK_SHEET_MEDIA = "(max-width: 47.99rem)";
25180
25181
  var ASK_SHEET_ATTRIBUTE = "data-ask-sheet";
25181
25182
  var ASK_NAME_ATTRIBUTE = "data-ask-name";
25182
25183
  var ASK_PLACEHOLDER_ATTRIBUTE = "data-ask-placeholder";
25184
+ var ASK_COVER_STYLE = `body *:not([${ASK_SHEET_ATTRIBUTE}], [${ASK_SHEET_ATTRIBUTE}] *) { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }`;
25183
25185
  var ASK_DOCK_ATTRIBUTE = "data-ask-dock";
25184
25186
  // ../../shared/contracts/src/agent-action.ts
25185
25187
  var agentEventActionSchema = exports_external.object({
@@ -25229,6 +25231,20 @@ var guestTurnSettlementSchema = exports_external.strictObject({
25229
25231
  usage: guestTurnUsageSchema,
25230
25232
  cost: guestTurnCostSchema
25231
25233
  });
25234
+ var guestScreeningSchema = exports_external.strictObject({
25235
+ topics: exports_external.array(exports_external.string().trim().min(1).max(500)).max(20),
25236
+ refusal: exports_external.string().trim().min(1).max(500).optional()
25237
+ });
25238
+ var guestScreeningCategorySchema = exports_external.enum(["in-scope", "off-topic", "abusive", "injection", "harmful"]);
25239
+ var guestRefusalCategorySchema = guestScreeningCategorySchema.exclude(["in-scope"]);
25240
+ var guestScreeningOutcomeSchema = exports_external.discriminatedUnion("outcome", [
25241
+ exports_external.strictObject({ outcome: exports_external.literal("answered") }),
25242
+ exports_external.strictObject({
25243
+ outcome: exports_external.literal("refused"),
25244
+ category: guestRefusalCategorySchema
25245
+ }),
25246
+ exports_external.strictObject({ outcome: exports_external.literal("unscreened") })
25247
+ ]);
25232
25248
 
25233
25249
  // ../../shared/contracts/src/agent-response.ts
25234
25250
  var PendingConfirmationSchema = exports_external.object({
@@ -25351,7 +25367,8 @@ var AgentResponseSchema = exports_external.object({
25351
25367
  completionTokens: exports_external.number(),
25352
25368
  totalTokens: exports_external.number()
25353
25369
  }),
25354
- guestSettlement: guestTurnSettlementSchema.optional()
25370
+ guestSettlement: guestTurnSettlementSchema.optional(),
25371
+ guestScreening: guestScreeningOutcomeSchema.optional()
25355
25372
  });
25356
25373
  // ../../shared/contracts/src/agent-context.ts
25357
25374
  var agentContextPermissionLevelSchema = exports_external.enum(["admin", "trusted", "public"]);
@@ -27128,7 +27145,7 @@ var story_default = `/* The story pages: chapters beside one drawing, under the
27128
27145
  --strip: 1;
27129
27146
  grid-area: auto;
27130
27147
  grid-row: 1;
27131
- height: 42svh;
27148
+ height: var(--strip-h);
27132
27149
  z-index: 2;
27133
27150
  justify-content: center;
27134
27151
  padding: 0;
@@ -27145,7 +27162,7 @@ var story_default = `/* The story pages: chapters beside one drawing, under the
27145
27162
  .chapter {
27146
27163
  min-height: 64svh;
27147
27164
  padding: 2.5rem 0;
27148
- scroll-margin-top: calc(var(--bar-height, 4.6rem) + 42svh);
27165
+ scroll-margin-top: calc(var(--bar-height, 4.6rem) + var(--strip-h));
27149
27166
  }
27150
27167
  }
27151
27168
  @media (prefers-reduced-motion: reduce) {
@@ -27596,22 +27613,32 @@ var story_default = `/* The story pages: chapters beside one drawing, under the
27596
27613
  top: var(--bar-height, 4.6rem);
27597
27614
  left: 0;
27598
27615
  right: 0;
27599
- height: 42svh;
27616
+ height: var(--strip-h);
27600
27617
  width: auto;
27601
27618
  z-index: 1;
27602
27619
  background: linear-gradient(var(--color-bg) 82%, transparent);
27603
27620
  transition: opacity 0.6s ease;
27604
27621
  }
27605
27622
  .net-layer > * {
27606
- width: min(100%, 42svh);
27623
+ width: min(100%, var(--strip-h));
27607
27624
  }
27625
+ /* About a third of the screen for the strip, and the opening's type at
27626
+ phone sizes, so the box lands on the first screen under the title. */
27608
27627
  .story {
27609
27628
  --words: 34rem;
27629
+ --strip-h: 34svh;
27610
27630
  }
27611
27631
  .chapter.chapter--opening {
27612
27632
  min-height: auto;
27613
27633
  justify-content: flex-start;
27614
- padding-top: 1.5rem;
27634
+ padding-top: 1rem;
27635
+ }
27636
+ .chapter--opening h1 {
27637
+ font-size: clamp(2.3rem, 9.5vw, 3.6rem);
27638
+ }
27639
+ .chapter--opening .lede {
27640
+ font-size: 1.05rem;
27641
+ margin-top: 1rem;
27615
27642
  }
27616
27643
  .living-org[data-stage="0"] {
27617
27644
  background: none;
@@ -45232,4 +45259,4 @@ export {
45232
45259
  workSections
45233
45260
  };
45234
45261
 
45235
- //# debugId=779881F193C823F864756E2164756E21
45262
+ //# debugId=0425130C105EFBB564756E2164756E21