@laplace.live/internal 1.3.39 → 1.3.41

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@laplace.live/internal",
3
- "version": "1.3.39",
3
+ "version": "1.3.41",
4
4
  "module": "src/index.d.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1250,8 +1250,8 @@ export declare namespace LaplaceInternal {
1250
1250
  // ============================================
1251
1251
 
1252
1252
  /**
1253
- * AI review session lifecycle on our side.
1254
- * - `running` — Browser Use session dispatched, waiting for terminal status
1253
+ * AI review lifecycle on our side.
1254
+ * - `running` — Browser Use run dispatched, waiting for terminal status
1255
1255
  * - `done` — verdict landed (see aiVerdict)
1256
1256
  * - `errored` — Browser Use failed or returned non-conforming output
1257
1257
  * - `skipped` — source URL was off-list (e.g. not a Bilibili page); never dispatched
@@ -1300,6 +1300,12 @@ export declare namespace LaplaceInternal {
1300
1300
  extractedPeriodStartDate: string | null
1301
1301
  /** YYYY-MM-DD in Asia/Shanghai; the post's publish date (auxiliary). */
1302
1302
  postedAt: string | null
1303
+ /**
1304
+ * HH:mm (24h) in Asia/Shanghai; the post's publish time. Null when the page shows no exact time.
1305
+ *
1306
+ * @since Oct 25, 2026
1307
+ */
1308
+ postedAtTime?: string | null
1303
1309
  contentMentionsPeriod: boolean
1304
1310
  evidenceQuote: string | null
1305
1311
  pageType: 'video' | 'dynamic' | 'livestream_replay' | 'space' | 'unknown'
@@ -1312,8 +1318,12 @@ export declare namespace LaplaceInternal {
1312
1318
  * Used both by the workers and by Drizzle via $type<>().
1313
1319
  */
1314
1320
  export interface FertilityAiData {
1321
+ /** Browser Use session holding the run; empty when skipped. */
1315
1322
  sessionId: string
1323
+ /** Browser Use v4 run polled for the verdict. Absent on skipped checks and rows predating API v4. */
1324
+ runId?: string
1316
1325
  model: string
1326
+ /** Live view of the agent's browser; backfilled once the browser starts, dead once it stops. */
1317
1327
  liveUrl?: string
1318
1328
  /** What kicked off the check. Undefined on rows predating the auto-check; treat as `admin`. */
1319
1329
  trigger?: FertilityAiTrigger
@@ -1321,10 +1331,18 @@ export declare namespace LaplaceInternal {
1321
1331
  startedAt: string
1322
1332
  /** ISO 8601, set when status leaves 'running' */
1323
1333
  checkedAt?: string
1334
+ /** USD. Since API v4, the run's LLM cost only; browser time and proxy traffic are billed per session. */
1324
1335
  costUsd?: string
1325
1336
  confidence?: number
1326
1337
  evidence?: FertilityAiEvidence
1327
1338
  autoActionResult?: FertilityAiAutoActionResult
1339
+ /**
1340
+ * Set when the check moved the contribution's periodStart (unix ms) to the AI's date before auto-approving,
1341
+ * because the contributor had entered the publish date of a "昨天" / "第N天" post.
1342
+ *
1343
+ * @since Oct 25, 2026
1344
+ */
1345
+ periodStartCorrection?: { from: number; to: number }
1328
1346
  errorMessage?: string
1329
1347
  }
1330
1348
 
@@ -1405,7 +1423,7 @@ export declare namespace LaplaceInternal {
1405
1423
  uid: number
1406
1424
  content: string
1407
1425
  note?: string
1408
- /** Existing tag IDs to suggest for this meme (max 10) */
1426
+ /** Existing tag IDs to suggest for this meme (max 10); the AI check replaces them with its own picks */
1409
1427
  tags?: number[]
1410
1428
  turnstileToken: string
1411
1429
  }
@@ -1429,6 +1447,24 @@ export declare namespace LaplaceInternal {
1429
1447
  createdAt: string
1430
1448
  reviewedAt?: string
1431
1449
  rejectReason?: string
1450
+ /**
1451
+ * AI review state (see MemeAiStatus). Null when never checked.
1452
+ *
1453
+ * @since Oct 26, 2026
1454
+ */
1455
+ aiStatus?: MemeAiStatus | null
1456
+ /**
1457
+ * AI review verdict (see MemeAiVerdict). Null while running or when errored.
1458
+ *
1459
+ * @since Oct 26, 2026
1460
+ */
1461
+ aiVerdict?: MemeAiVerdict | null
1462
+ /**
1463
+ * AI review payload (see MemeAiData). Null when never checked.
1464
+ *
1465
+ * @since Oct 26, 2026
1466
+ */
1467
+ aiData?: MemeAiData | null
1432
1468
  }
1433
1469
 
1434
1470
  /** Query params for GET /laplace/meme-contributions */
@@ -1491,6 +1527,77 @@ export declare namespace LaplaceInternal {
1491
1527
  copyCount: number
1492
1528
  }
1493
1529
 
1530
+ // ============================================
1531
+ // Meme AI Check Types
1532
+ // ============================================
1533
+
1534
+ /**
1535
+ * AI review lifecycle on our side.
1536
+ * - `running` — model call in flight
1537
+ * - `done` — verdict landed (see aiVerdict)
1538
+ * - `errored` — the call failed, was refused, or returned unusable output; row stays pending
1539
+ */
1540
+ export type MemeAiStatus = 'running' | 'done' | 'errored'
1541
+
1542
+ /** `flagged` when any {@link MemeAiFlag} applies; flagged memes always wait for a human. */
1543
+ export type MemeAiVerdict = 'clean' | 'flagged'
1544
+
1545
+ /**
1546
+ * Why a meme needs human review.
1547
+ * - `curse` — profanity, slurs or abusive insults, including pinyin initials and homophones
1548
+ * - `doxxing` — reveals the real identity behind a streamer or anyone else (开盒, 中之人, 前世)
1549
+ * - `personal_info` — contact or identifying details such as a phone, QQ/WeChat, ID card or bank number
1550
+ */
1551
+ export type MemeAiFlag = 'curse' | 'doxxing' | 'personal_info'
1552
+
1553
+ /** What kicked off the check; same values as {@link FertilityAiTrigger}. */
1554
+ export type MemeAiTrigger = 'admin' | 'submit'
1555
+
1556
+ /**
1557
+ * What the system did automatically based on the verdict.
1558
+ * - `approved` — clean; the contribution was approved with the AI's tags
1559
+ * - `flagged` — flagged, or auto-approve is off; row stays pending for admin review
1560
+ * - `approve_failed_duplicate` — clean, but the streamer already has a meme with identical content
1561
+ */
1562
+ export type MemeAiAutoActionResult = 'approved' | 'flagged' | 'approve_failed_duplicate'
1563
+
1564
+ /** Payload stored in bilibili_meme_contributions.ai_data (jsonb). */
1565
+ export interface MemeAiData {
1566
+ /** OpenRouter model slug; once checked, the model that answered (a router such as Jev picks one per call) */
1567
+ model: string
1568
+ trigger: MemeAiTrigger
1569
+ /** ISO 8601 */
1570
+ startedAt: string
1571
+ /** ISO 8601, set when status leaves 'running' */
1572
+ checkedAt?: string
1573
+ /** USD that OpenRouter billed for the call */
1574
+ costUsd?: number
1575
+ flags?: MemeAiFlag[]
1576
+ /** Simplified Chinese, quoting the flagged text; null when clean */
1577
+ reason?: string | null
1578
+ /** Tag IDs the AI picked; they replace the contribution's `tags` */
1579
+ tags?: number[]
1580
+ /** The contributor's own picks, kept because the AI's replace them */
1581
+ contributorTags?: number[]
1582
+ /** Absent when the row was reviewed by an admin before the check finished */
1583
+ autoActionResult?: MemeAiAutoActionResult
1584
+ /** `api_error`, `refusal`, `invalid_output` or `internal_error` */
1585
+ errorMessage?: string
1586
+ }
1587
+
1588
+ /** Response for POST and GET /laplace/meme-contribution-ai-check/:id */
1589
+ export interface MemeAiCheckResponse {
1590
+ id: number
1591
+ contributionStatus: ContributionStatus
1592
+ ai: {
1593
+ status: MemeAiStatus | null
1594
+ verdict: MemeAiVerdict | null
1595
+ data: MemeAiData | null
1596
+ }
1597
+ /** POST only: true when a check already in flight was returned instead of running a new one */
1598
+ reusedExisting?: boolean
1599
+ }
1600
+
1494
1601
  // ============================================
1495
1602
  // Guild History Types
1496
1603
  // ============================================