@opengeni/react-native 5.5.2-canary.40656248492001 → 5.5.2-canary.40664751789001

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.
@@ -1,7 +1,7 @@
1
- import { NativeImageViewer } from './chunk-EAOQJWDD.js';
2
1
  import { secretInputTraits, defaultSecretFieldMessages, ThinkingOrb, humanInputAnswerLines, isSecretQuestion, initialSecretDraft, secretUsernameTraits, secretCanGenerate, SECRET_SAVE_TO_OPTIONS, secretSubmission, secretPatternMismatch } from './chunk-7CVE6ANT.js';
3
- import { useOpenNativeLink } from './chunk-6BMCWK7G.js';
4
2
  import { ActivityDisclosure, useNativeTimelineMessages, useReleaseFollow, ShimmerText, withAlpha, ReleaseFollowProvider, blendOver, NativeTimelineMessagesProvider, ROW_MIN_HEIGHT, PulseDot, BodyNote, PayloadBlock, TermBlock, Chip, RunningPreview } from './chunk-ZVECFJAA.js';
3
+ import { NativeImageViewer } from './chunk-EAOQJWDD.js';
4
+ import { useOpenNativeLink } from './chunk-6BMCWK7G.js';
5
5
  import { useNativeTimelineTheme, Icon, fontStyle, BAR_MAX_FONT_SCALE } from './chunk-NSSMTM2B.js';
6
6
  import { buildTimeline, groupTimeline, conversationTimeline, useSessionStart, personalMachineCopy, sessionAdmissionCopy } from '@opengeni/react/session';
7
7
  import { defaultHumanInputFormMessages, createTurnSummaryContext, resolveTurnSummaryFacets, selectTurnSummaryFacets, formatElapsed, turnSummaryFallbackLabel, rollingActivityItem, toolDisplayName, annotationHasNote, annotationDisplayOrdinal, ANNOTATION_MAX_NOTE_LENGTH, questionNavTarget, timelineGroupIndexAtSequence, QUESTION_NAV_MARGIN_PX, flattenActivityItems, timelineGroupContainsPresentedImage, durationBetween, isPreparingWork, readableWorkStatus, readableWorkShowsPreview, readableWorkDefaultOpen, compactedLandmarkCount, SESSION_STATUS_PRESENTATION, formatRelativeTime, isAgentWorkHumanInput, recordedWaitSummaryText, noticeTone, noticeIsResolvedApproval, noticeDisplayText, agentWorkHumanInputSummary, mergeHumanInputFormMessages, isActionableHumanInputRequest, humanInputHeading, initialDrafts, emptyDraft, SESSION_STATUS_BADGE, workerRowTitle, startupDuration, STARTUP_WAIT_TITLES, startupPhaseTitle, sandboxRowTitle, toolRowPresentation, presentsToolOutputPreview, GENIE_WAITING_PHRASES, GENIE_PREPARING_PHRASES, truncateAnnotationQuote, annotationNoteNeedsDisclosure, annotationFromSelection, notificationPlainText, pathDirname, pathBasename, formatClockTime, answersFromDrafts, parseNotificationText } from '@opengeni/react/timeline-model';
@@ -1819,7 +1819,7 @@ function ScopedConnectSetup({
1819
1819
  }) {
1820
1820
  const t = useOpenGeniText();
1821
1821
  const text = useText();
1822
- const flow = useConnectSetupFlow(controller, { onAuthorize });
1822
+ const flow = useConnectSetupFlow(controller, { onAuthorize, inChat: true });
1823
1823
  const { view, attempt } = flow;
1824
1824
  const values = useRef(/* @__PURE__ */ new Map());
1825
1825
  const clears = useRef(/* @__PURE__ */ new Map());
@@ -2108,7 +2108,7 @@ function NativeIntegrationCapabilityCard({
2108
2108
  NativeConnectSetup,
2109
2109
  {
2110
2110
  controller: flow.controller,
2111
- authorizeLabel: flow.signInClosed ? t("connectSetup.trySigningInAgain") : t("sessionIntegrationCapabilityCard.signIn"),
2111
+ authorizeLabel: flow.signInClosed || error ? t("connectSetup.trySigningInAgain") : t("sessionIntegrationCapabilityCard.signIn"),
2112
2112
  onAuthorize: flow.authorizeAttempt,
2113
2113
  options
2114
2114
  }
@@ -2121,7 +2121,7 @@ function NativeIntegrationCapabilityCard({
2121
2121
  onStop: flow.stopWaiting
2122
2122
  }
2123
2123
  ) : null,
2124
- !busy && !waiting && (flow.restartable || error || flow.signInClosed && !attempt) ? /* @__PURE__ */ jsx(
2124
+ !busy && !waiting && (flow.restartable || (error || flow.signInClosed) && !attempt) ? /* @__PURE__ */ jsx(
2125
2125
  Button,
2126
2126
  {
2127
2127
  icon: "rotate-ccw",
@@ -6215,6 +6215,16 @@ function HumanInputForm({
6215
6215
  ...secret.secretAnswers.length > 0 ? { secretAnswers: secret.secretAnswers } : {}
6216
6216
  });
6217
6217
  };
6218
+ const confirm = confirmDecision(questions);
6219
+ const [choice, setChoice] = useState(null);
6220
+ const decide = (optionId) => {
6221
+ if (!confirm) return;
6222
+ setChoice(optionId);
6223
+ void submit({
6224
+ outcome: "answered",
6225
+ answers: [{ questionId: confirm.question.id, values: [optionId] }]
6226
+ });
6227
+ };
6218
6228
  const clearError = (id) => setErrors((existing) => {
6219
6229
  if (!(id in existing)) return existing;
6220
6230
  const remaining = { ...existing };
@@ -6319,29 +6329,55 @@ function HumanInputForm({
6319
6329
  gap: 16
6320
6330
  },
6321
6331
  children: [
6322
- questions.map((question, index) => /* @__PURE__ */ jsx(View, { style: index === current ? null : { display: "none" }, children: /* @__PURE__ */ jsx(
6323
- QuestionControls,
6332
+ confirm ? confirm.options.map(
6333
+ (option) => option.description ? /* @__PURE__ */ jsxs(
6334
+ Text,
6335
+ {
6336
+ style: {
6337
+ ...fontStyle(theme),
6338
+ fontSize: theme.size.base,
6339
+ lineHeight: 20,
6340
+ color: c["fg-muted"]
6341
+ },
6342
+ children: [
6343
+ /* @__PURE__ */ jsx(Text, { style: { ...fontStyle(theme, 500), color: c.fg }, children: option.label }),
6344
+ " \xB7 ",
6345
+ option.description
6346
+ ]
6347
+ },
6348
+ option.id
6349
+ ) : null
6350
+ ) : null,
6351
+ questions.map((question, index) => /* @__PURE__ */ jsx(
6352
+ View,
6324
6353
  {
6325
- question,
6326
- draft: drafts[question.id] ?? emptyDraft(),
6327
- error: isSecretQuestion(question) ? void 0 : errors[question.id],
6328
- disabled: busy,
6329
- onChange: (change) => update(question.id, change),
6330
- children: isSecretQuestion(question) ? /* @__PURE__ */ jsx(
6331
- SecretQuestionField,
6354
+ style: index === current && !confirm ? null : { display: "none" },
6355
+ children: /* @__PURE__ */ jsx(
6356
+ QuestionControls,
6332
6357
  {
6333
6358
  question,
6334
- draft: secretDrafts[question.id] ?? initialSecretDraft(question.secret),
6335
- onDraft: (change) => updateSecret(question, change),
6336
- onValue: (value) => setSecretValue(question.id, value),
6337
- registerClear: registerSecretClear(question.id),
6338
- messages: secretMessages,
6339
- error: errors[question.id],
6340
- disabled: busy
6359
+ draft: drafts[question.id] ?? emptyDraft(),
6360
+ error: isSecretQuestion(question) ? void 0 : errors[question.id],
6361
+ disabled: busy,
6362
+ onChange: (change) => update(question.id, change),
6363
+ children: isSecretQuestion(question) ? /* @__PURE__ */ jsx(
6364
+ SecretQuestionField,
6365
+ {
6366
+ question,
6367
+ draft: secretDrafts[question.id] ?? initialSecretDraft(question.secret),
6368
+ onDraft: (change) => updateSecret(question, change),
6369
+ onValue: (value) => setSecretValue(question.id, value),
6370
+ registerClear: registerSecretClear(question.id),
6371
+ messages: secretMessages,
6372
+ error: errors[question.id],
6373
+ disabled: busy
6374
+ }
6375
+ ) : null
6341
6376
  }
6342
- ) : null
6343
- }
6344
- ) }, question.id)),
6377
+ )
6378
+ },
6379
+ question.id
6380
+ )),
6345
6381
  failure ? /* @__PURE__ */ jsx(
6346
6382
  Text,
6347
6383
  {
@@ -6358,7 +6394,16 @@ function HumanInputForm({
6358
6394
  /* @__PURE__ */ jsx(
6359
6395
  DecisionActions,
6360
6396
  {
6361
- primary: /* @__PURE__ */ jsx(
6397
+ primary: confirm ? /* @__PURE__ */ jsx(
6398
+ DecisionButton,
6399
+ {
6400
+ kind: "primary",
6401
+ label: confirm.accept.label,
6402
+ busy: busy && choice === confirm.accept.id,
6403
+ disabled: busy,
6404
+ onPress: () => decide(confirm.accept.id)
6405
+ }
6406
+ ) : /* @__PURE__ */ jsx(
6362
6407
  DecisionButton,
6363
6408
  {
6364
6409
  kind: "primary",
@@ -6368,7 +6413,15 @@ function HumanInputForm({
6368
6413
  onPress: last ? send : next
6369
6414
  }
6370
6415
  ),
6371
- secondary: current > 0 ? /* @__PURE__ */ jsx(
6416
+ secondary: confirm ? /* @__PURE__ */ jsx(
6417
+ DecisionButton,
6418
+ {
6419
+ label: confirm.decline.label,
6420
+ busy: busy && choice === confirm.decline.id,
6421
+ disabled: busy,
6422
+ onPress: () => decide(confirm.decline.id)
6423
+ }
6424
+ ) : current > 0 ? /* @__PURE__ */ jsx(
6372
6425
  DecisionButton,
6373
6426
  {
6374
6427
  label: t("humanInputForm.back"),
@@ -6393,6 +6446,17 @@ function HumanInputForm({
6393
6446
  )
6394
6447
  ] });
6395
6448
  }
6449
+ function confirmDecision(questions) {
6450
+ const question = questions.length === 1 ? questions[0] : null;
6451
+ if (!question || question.confirm !== true || question.kind !== "single_select" || question.skillReview || question.options.length !== 2)
6452
+ return null;
6453
+ return {
6454
+ question,
6455
+ options: question.options,
6456
+ accept: question.options[0],
6457
+ decline: question.options[1]
6458
+ };
6459
+ }
6396
6460
  function QuestionControls({
6397
6461
  question,
6398
6462
  draft,
@@ -6507,7 +6571,57 @@ function QuestionControls({
6507
6571
  children: option.label
6508
6572
  }
6509
6573
  ),
6510
- option.description ? /* @__PURE__ */ jsx(QuestionText, { text: option.description, tone: "muted", style: secondary }) : null
6574
+ option.recommended ? /* @__PURE__ */ jsx(
6575
+ View,
6576
+ {
6577
+ style: {
6578
+ alignSelf: "flex-start",
6579
+ marginTop: 2,
6580
+ paddingHorizontal: 8,
6581
+ paddingVertical: 1,
6582
+ borderRadius: 999,
6583
+ backgroundColor: c["accent-soft"]
6584
+ },
6585
+ children: /* @__PURE__ */ jsx(
6586
+ Text,
6587
+ {
6588
+ style: {
6589
+ ...fontStyle(theme, 500),
6590
+ fontSize: theme.size.sm,
6591
+ lineHeight: 18,
6592
+ color: c["accent-strong"]
6593
+ },
6594
+ children: t("humanInputForm.recommended")
6595
+ }
6596
+ )
6597
+ }
6598
+ ) : null,
6599
+ option.description ? /* @__PURE__ */ jsx(QuestionText, { text: option.description, tone: "muted", style: secondary }) : null,
6600
+ option.preview ? /* @__PURE__ */ jsx(
6601
+ ScrollView,
6602
+ {
6603
+ nestedScrollEnabled: true,
6604
+ style: {
6605
+ marginTop: 6,
6606
+ maxHeight: 160,
6607
+ borderRadius: theme.radius.md,
6608
+ backgroundColor: withAlpha(c.fg, 0.04)
6609
+ },
6610
+ contentContainerStyle: { paddingHorizontal: 10, paddingVertical: 8 },
6611
+ children: /* @__PURE__ */ jsx(
6612
+ Text,
6613
+ {
6614
+ style: {
6615
+ ...fontStyle(theme, 400, "mono"),
6616
+ fontSize: theme.size.sm,
6617
+ lineHeight: 18,
6618
+ color: c.fg
6619
+ },
6620
+ children: option.preview
6621
+ }
6622
+ )
6623
+ }
6624
+ ) : null
6511
6625
  ] })
6512
6626
  ]
6513
6627
  },
@@ -10362,5 +10476,5 @@ function NativeInboxList({
10362
10476
  }
10363
10477
 
10364
10478
  export { ActivityRail, ActivityRow, AnnotationsChip, AnnotationsSheet, ApprovalStrip, AttachmentChips, BottomSheet, Button, ComposerPill, FeedbackSheet, HumanInputCard, IconButton, MessageTimeline, ModelMark, ModelPickerSheet, NativeAuthNeededRow, NativeConnectSetup, NativeInboxList, NativeIntegrationCapabilityCard, NativeMcpCapabilityCard, NativeMessageAttachments, NativePreparedMcpSetupCard, NativeSessionScreen, PreparingState, PresentedToolRow, QueueDock, RollingActivity, SectionLabel, SecureValueInput, SessionActionsButton, SessionCommandsList, SessionComposer, SessionHeaderTitle, SessionRow, SessionRowList, SessionSignals, SessionStatusBadge, StatusDot, TurnFeedbackButtons, TurnRailFrame, TurnSummary, defaultApprovalStripMessages, isNeedsYouKind, nativeConnectWindowHost, nativeInboxAttentionCount, useNativeInChatConnect, useNativeInbox, useTurnRatings };
10365
- //# sourceMappingURL=chunk-WX6PNZQR.js.map
10366
- //# sourceMappingURL=chunk-WX6PNZQR.js.map
10479
+ //# sourceMappingURL=chunk-WJBWOQDD.js.map
10480
+ //# sourceMappingURL=chunk-WJBWOQDD.js.map