@sayren/store-sdk 0.30.13 → 0.30.14

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.mts CHANGED
@@ -166,8 +166,8 @@ export declare const auditLogPageSchema: z.ZodObject<{
166
166
  export type AuditLogPage = z.infer<typeof auditLogPageSchema>;
167
167
  export declare const agentPolicyDecisionSchema: z.ZodEnum<{
168
168
  DENIED: "DENIED";
169
- APPROVAL_REQUIRED: "APPROVAL_REQUIRED";
170
169
  ALLOW: "ALLOW";
170
+ APPROVAL_REQUIRED: "APPROVAL_REQUIRED";
171
171
  }>;
172
172
  export type AgentPolicyDecision = z.infer<typeof agentPolicyDecisionSchema>;
173
173
  export declare const writePreviewSchema: z.ZodObject<{
@@ -192,8 +192,8 @@ export declare const writeDryRunResultSchema: z.ZodObject<{
192
192
  dryRun: z.ZodLiteral<true>;
193
193
  decision: z.ZodEnum<{
194
194
  DENIED: "DENIED";
195
- APPROVAL_REQUIRED: "APPROVAL_REQUIRED";
196
195
  ALLOW: "ALLOW";
196
+ APPROVAL_REQUIRED: "APPROVAL_REQUIRED";
197
197
  }>;
198
198
  reason: z.ZodNullable<z.ZodString>;
199
199
  preview: z.ZodObject<{
@@ -425,6 +425,809 @@ type TokenSource = string | null | undefined | (() => string | null | undefined)
425
425
  type Query = Record<string, string | number | boolean | undefined>;
426
426
  export declare function buildQuery(query?: Query): string;
427
427
  //#endregion
428
+ //#region src/schemas/ai.d.ts
429
+ /**
430
+ * 상점 플랫폼 AI 채팅(이슈 #124) — 대화·메시지·실행과 실행 이벤트 스트림의 계약.
431
+ *
432
+ * 상점 플랫폼 전용이다(`@ConsoleOnly`, 공개 OpenAPI 문서 제외). 메시지를 보내면 api가 실행(run)을 만들어 202로 `streamId`를 돌려주고,
433
+ * 응답은 별도 중계(`streamUrl`, SSE)로 받는다. 실행은 브라우저와 무관하게 서버에서 끝까지 돈다 — 다시 열면 진행 중 실행의 스트림에
434
+ * 처음부터 다시 붙거나(보관 1시간) 확정된 메시지를 읽는다.
435
+ */
436
+ /** 첨부 하나 — 업로드(`POST /v1/uploads`, 목적 `ai-attachment`)가 돌려준 공개 주소 */
437
+ export declare const aiAttachmentSchema: z.ZodObject<{
438
+ url: z.ZodString;
439
+ name: z.ZodString;
440
+ mediaType: z.ZodString;
441
+ }, z.core.$strip>;
442
+ export type AiAttachment = z.infer<typeof aiAttachmentSchema>;
443
+ export declare const AI_MESSAGE_MAX_CHARS = 8000;
444
+ export declare const AI_MESSAGE_MAX_ATTACHMENTS = 5;
445
+ /**
446
+ * 편집 미리보기에서 고른 요소(#65) — 미리보기 안 선택 스크립트가 만든 값이라 사이트 코드가 꾸밀 수 있다. api는 모델에 넘길 때 데이터로
447
+ * 감싼다. `source`는 그 컴포넌트를 **사용한** 위치다(작업 트리 상대 경로). React 개발 정보가 없으면 null이다
448
+ */
449
+ export declare const aiPreviewSelectionSchema: z.ZodObject<{
450
+ component: z.ZodNullable<z.ZodString>;
451
+ source: z.ZodNullable<z.ZodObject<{
452
+ path: z.ZodString;
453
+ line: z.ZodNumber;
454
+ column: z.ZodOptional<z.ZodNumber>;
455
+ }, z.core.$strip>>;
456
+ tag: z.ZodString;
457
+ text: z.ZodString;
458
+ pagePath: z.ZodString;
459
+ }, z.core.$strip>;
460
+ export type AiPreviewSelection = z.infer<typeof aiPreviewSelectionSchema>;
461
+ /** 실행 상태 — 끝난 상태는 `DONE`·`FAILED`·`CANCELLED`다 */
462
+ export declare const aiRunStatusSchema: z.ZodEnum<{
463
+ FAILED: "FAILED";
464
+ CANCEL_REQUESTED: "CANCEL_REQUESTED";
465
+ QUEUED: "QUEUED";
466
+ RUNNING: "RUNNING";
467
+ DONE: "DONE";
468
+ CANCELLED: "CANCELLED";
469
+ }>;
470
+ export type AiRunStatus = z.infer<typeof aiRunStatusSchema>;
471
+ export declare const AI_RUN_ACTIVE_STATUSES: readonly AiRunStatus[];
472
+ /** 진행 중 실행의 스트림 접속 정보. `streamToken`은 이 스트림 하나만 읽는 단기 자격(Bearer)이다 */
473
+ export declare const aiStreamAccessSchema: z.ZodObject<{
474
+ streamId: z.ZodString;
475
+ streamUrl: z.ZodString;
476
+ streamToken: z.ZodString;
477
+ }, z.core.$strip>;
478
+ export type AiStreamAccess = z.infer<typeof aiStreamAccessSchema>;
479
+ export declare const aiRunSchema: z.ZodObject<{
480
+ id: z.ZodString;
481
+ status: z.ZodEnum<{
482
+ FAILED: "FAILED";
483
+ CANCEL_REQUESTED: "CANCEL_REQUESTED";
484
+ QUEUED: "QUEUED";
485
+ RUNNING: "RUNNING";
486
+ DONE: "DONE";
487
+ CANCELLED: "CANCELLED";
488
+ }>;
489
+ errorCode: z.ZodNullable<z.ZodString>;
490
+ createdAt: z.ZodString;
491
+ finishedAt: z.ZodNullable<z.ZodString>;
492
+ }, z.core.$strip>;
493
+ export type AiRun = z.infer<typeof aiRunSchema>;
494
+ /**
495
+ * 화면에 그리는 메시지 조각. 모델 원문(tool_use 블록 등)은 api가 보관하고 화면에는 이 형태만 준다.
496
+ * - `text`: 글
497
+ * - `tool`: 도구 호출 한 번(이름은 사람이 읽는 라벨, 결과 요약·링크)
498
+ * - `choices`: 선택지 버튼(가장 최근 것만 누를 수 있다)
499
+ * - `attachment`: 사용자가 올린 첨부
500
+ * - `approval`: 승인 대기로 남은 쓰기
501
+ */
502
+ export declare const aiMessagePartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
503
+ type: z.ZodLiteral<"text">;
504
+ text: z.ZodString;
505
+ }, z.core.$strip>, z.ZodObject<{
506
+ type: z.ZodLiteral<"tool">;
507
+ toolCallId: z.ZodString;
508
+ name: z.ZodString;
509
+ label: z.ZodString;
510
+ status: z.ZodEnum<{
511
+ error: "error";
512
+ unknown: "unknown";
513
+ ok: "ok";
514
+ }>;
515
+ summary: z.ZodNullable<z.ZodString>;
516
+ }, z.core.$strip>, z.ZodObject<{
517
+ type: z.ZodLiteral<"choices">;
518
+ question: z.ZodString;
519
+ options: z.ZodArray<z.ZodObject<{
520
+ label: z.ZodString;
521
+ value: z.ZodString;
522
+ }, z.core.$strip>>;
523
+ }, z.core.$strip>, z.ZodObject<{
524
+ type: z.ZodLiteral<"attachment">;
525
+ attachment: z.ZodObject<{
526
+ url: z.ZodString;
527
+ name: z.ZodString;
528
+ mediaType: z.ZodString;
529
+ }, z.core.$strip>;
530
+ }, z.core.$strip>, z.ZodObject<{
531
+ type: z.ZodLiteral<"approval">;
532
+ approvalId: z.ZodString;
533
+ title: z.ZodString;
534
+ }, z.core.$strip>, z.ZodObject<{
535
+ type: z.ZodLiteral<"selection">;
536
+ selection: z.ZodObject<{
537
+ component: z.ZodNullable<z.ZodString>;
538
+ source: z.ZodNullable<z.ZodObject<{
539
+ path: z.ZodString;
540
+ line: z.ZodNumber;
541
+ column: z.ZodOptional<z.ZodNumber>;
542
+ }, z.core.$strip>>;
543
+ tag: z.ZodString;
544
+ text: z.ZodString;
545
+ pagePath: z.ZodString;
546
+ }, z.core.$strip>;
547
+ }, z.core.$strip>], "type">;
548
+ export type AiMessagePart = z.infer<typeof aiMessagePartSchema>;
549
+ export declare const aiMessageSchema: z.ZodObject<{
550
+ id: z.ZodString;
551
+ role: z.ZodEnum<{
552
+ user: "user";
553
+ assistant: "assistant";
554
+ }>;
555
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
556
+ type: z.ZodLiteral<"text">;
557
+ text: z.ZodString;
558
+ }, z.core.$strip>, z.ZodObject<{
559
+ type: z.ZodLiteral<"tool">;
560
+ toolCallId: z.ZodString;
561
+ name: z.ZodString;
562
+ label: z.ZodString;
563
+ status: z.ZodEnum<{
564
+ error: "error";
565
+ unknown: "unknown";
566
+ ok: "ok";
567
+ }>;
568
+ summary: z.ZodNullable<z.ZodString>;
569
+ }, z.core.$strip>, z.ZodObject<{
570
+ type: z.ZodLiteral<"choices">;
571
+ question: z.ZodString;
572
+ options: z.ZodArray<z.ZodObject<{
573
+ label: z.ZodString;
574
+ value: z.ZodString;
575
+ }, z.core.$strip>>;
576
+ }, z.core.$strip>, z.ZodObject<{
577
+ type: z.ZodLiteral<"attachment">;
578
+ attachment: z.ZodObject<{
579
+ url: z.ZodString;
580
+ name: z.ZodString;
581
+ mediaType: z.ZodString;
582
+ }, z.core.$strip>;
583
+ }, z.core.$strip>, z.ZodObject<{
584
+ type: z.ZodLiteral<"approval">;
585
+ approvalId: z.ZodString;
586
+ title: z.ZodString;
587
+ }, z.core.$strip>, z.ZodObject<{
588
+ type: z.ZodLiteral<"selection">;
589
+ selection: z.ZodObject<{
590
+ component: z.ZodNullable<z.ZodString>;
591
+ source: z.ZodNullable<z.ZodObject<{
592
+ path: z.ZodString;
593
+ line: z.ZodNumber;
594
+ column: z.ZodOptional<z.ZodNumber>;
595
+ }, z.core.$strip>>;
596
+ tag: z.ZodString;
597
+ text: z.ZodString;
598
+ pagePath: z.ZodString;
599
+ }, z.core.$strip>;
600
+ }, z.core.$strip>], "type">>;
601
+ runId: z.ZodNullable<z.ZodString>;
602
+ createdAt: z.ZodString;
603
+ }, z.core.$strip>;
604
+ export type AiMessage = z.infer<typeof aiMessageSchema>;
605
+ export declare const aiConversationSummarySchema: z.ZodObject<{
606
+ id: z.ZodString;
607
+ title: z.ZodNullable<z.ZodString>;
608
+ createdAt: z.ZodString;
609
+ updatedAt: z.ZodString;
610
+ }, z.core.$strip>;
611
+ export type AiConversationSummary = z.infer<typeof aiConversationSummarySchema>;
612
+ export declare const aiConversationSchema: z.ZodObject<{
613
+ id: z.ZodString;
614
+ title: z.ZodNullable<z.ZodString>;
615
+ createdAt: z.ZodString;
616
+ updatedAt: z.ZodString;
617
+ messages: z.ZodArray<z.ZodObject<{
618
+ id: z.ZodString;
619
+ role: z.ZodEnum<{
620
+ user: "user";
621
+ assistant: "assistant";
622
+ }>;
623
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
624
+ type: z.ZodLiteral<"text">;
625
+ text: z.ZodString;
626
+ }, z.core.$strip>, z.ZodObject<{
627
+ type: z.ZodLiteral<"tool">;
628
+ toolCallId: z.ZodString;
629
+ name: z.ZodString;
630
+ label: z.ZodString;
631
+ status: z.ZodEnum<{
632
+ error: "error";
633
+ unknown: "unknown";
634
+ ok: "ok";
635
+ }>;
636
+ summary: z.ZodNullable<z.ZodString>;
637
+ }, z.core.$strip>, z.ZodObject<{
638
+ type: z.ZodLiteral<"choices">;
639
+ question: z.ZodString;
640
+ options: z.ZodArray<z.ZodObject<{
641
+ label: z.ZodString;
642
+ value: z.ZodString;
643
+ }, z.core.$strip>>;
644
+ }, z.core.$strip>, z.ZodObject<{
645
+ type: z.ZodLiteral<"attachment">;
646
+ attachment: z.ZodObject<{
647
+ url: z.ZodString;
648
+ name: z.ZodString;
649
+ mediaType: z.ZodString;
650
+ }, z.core.$strip>;
651
+ }, z.core.$strip>, z.ZodObject<{
652
+ type: z.ZodLiteral<"approval">;
653
+ approvalId: z.ZodString;
654
+ title: z.ZodString;
655
+ }, z.core.$strip>, z.ZodObject<{
656
+ type: z.ZodLiteral<"selection">;
657
+ selection: z.ZodObject<{
658
+ component: z.ZodNullable<z.ZodString>;
659
+ source: z.ZodNullable<z.ZodObject<{
660
+ path: z.ZodString;
661
+ line: z.ZodNumber;
662
+ column: z.ZodOptional<z.ZodNumber>;
663
+ }, z.core.$strip>>;
664
+ tag: z.ZodString;
665
+ text: z.ZodString;
666
+ pagePath: z.ZodString;
667
+ }, z.core.$strip>;
668
+ }, z.core.$strip>], "type">>;
669
+ runId: z.ZodNullable<z.ZodString>;
670
+ createdAt: z.ZodString;
671
+ }, z.core.$strip>>;
672
+ activeRun: z.ZodNullable<z.ZodObject<{
673
+ id: z.ZodString;
674
+ status: z.ZodEnum<{
675
+ FAILED: "FAILED";
676
+ CANCEL_REQUESTED: "CANCEL_REQUESTED";
677
+ QUEUED: "QUEUED";
678
+ RUNNING: "RUNNING";
679
+ DONE: "DONE";
680
+ CANCELLED: "CANCELLED";
681
+ }>;
682
+ errorCode: z.ZodNullable<z.ZodString>;
683
+ createdAt: z.ZodString;
684
+ finishedAt: z.ZodNullable<z.ZodString>;
685
+ stream: z.ZodObject<{
686
+ streamId: z.ZodString;
687
+ streamUrl: z.ZodString;
688
+ streamToken: z.ZodString;
689
+ }, z.core.$strip>;
690
+ }, z.core.$strip>>;
691
+ lastRun: z.ZodNullable<z.ZodObject<{
692
+ id: z.ZodString;
693
+ status: z.ZodEnum<{
694
+ FAILED: "FAILED";
695
+ CANCEL_REQUESTED: "CANCEL_REQUESTED";
696
+ QUEUED: "QUEUED";
697
+ RUNNING: "RUNNING";
698
+ DONE: "DONE";
699
+ CANCELLED: "CANCELLED";
700
+ }>;
701
+ errorCode: z.ZodNullable<z.ZodString>;
702
+ createdAt: z.ZodString;
703
+ finishedAt: z.ZodNullable<z.ZodString>;
704
+ }, z.core.$strip>>;
705
+ }, z.core.$strip>;
706
+ export type AiConversation = z.infer<typeof aiConversationSchema>;
707
+ export declare const createAiConversationRequestSchema: z.ZodObject<{
708
+ draftId: z.ZodOptional<z.ZodString>;
709
+ }, z.core.$strip>;
710
+ export type CreateAiConversationRequest = z.infer<typeof createAiConversationRequestSchema>;
711
+ export declare const createAiConversationResponseSchema: z.ZodObject<{
712
+ conversation: z.ZodObject<{
713
+ id: z.ZodString;
714
+ title: z.ZodNullable<z.ZodString>;
715
+ createdAt: z.ZodString;
716
+ updatedAt: z.ZodString;
717
+ }, z.core.$strip>;
718
+ run: z.ZodNullable<z.ZodObject<{
719
+ streamId: z.ZodString;
720
+ streamUrl: z.ZodString;
721
+ streamToken: z.ZodString;
722
+ }, z.core.$strip>>;
723
+ }, z.core.$strip>;
724
+ export type CreateAiConversationResponse = z.infer<typeof createAiConversationResponseSchema>;
725
+ export declare const sendAiMessageRequestSchema: z.ZodObject<{
726
+ text: z.ZodString;
727
+ attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
728
+ url: z.ZodString;
729
+ name: z.ZodString;
730
+ mediaType: z.ZodString;
731
+ }, z.core.$strip>>>;
732
+ choice: z.ZodOptional<z.ZodString>;
733
+ selection: z.ZodOptional<z.ZodObject<{
734
+ component: z.ZodNullable<z.ZodString>;
735
+ source: z.ZodNullable<z.ZodObject<{
736
+ path: z.ZodString;
737
+ line: z.ZodNumber;
738
+ column: z.ZodOptional<z.ZodNumber>;
739
+ }, z.core.$strip>>;
740
+ tag: z.ZodString;
741
+ text: z.ZodString;
742
+ pagePath: z.ZodString;
743
+ }, z.core.$strip>>;
744
+ }, z.core.$strip>;
745
+ export type SendAiMessageRequest = z.input<typeof sendAiMessageRequestSchema>;
746
+ export declare const sendAiMessageResponseSchema: z.ZodObject<{
747
+ streamId: z.ZodString;
748
+ streamUrl: z.ZodString;
749
+ streamToken: z.ZodString;
750
+ messageId: z.ZodString;
751
+ }, z.core.$strip>;
752
+ export type SendAiMessageResponse = z.infer<typeof sendAiMessageResponseSchema>;
753
+ /**
754
+ * AI가 바꾸는 화면 영역 — 쓰기 도구가 시작되면 이벤트에 싣고, 패널이 그 화면으로 옮겨 반영된 데이터를 다시 읽는다(셀러가 AI가 하는 일을 같이 본다).
755
+ * 경로는 상점 플랫폼이 정한다(영역 → 라우트). `id`가 있으면 상세 화면이다
756
+ */
757
+ export declare const aiFocusAreaSchema: z.ZodEnum<{
758
+ shipping: "shipping";
759
+ products: "products";
760
+ addresses: "addresses";
761
+ webhooks: "webhooks";
762
+ categories: "categories";
763
+ collections: "collections";
764
+ option_sets: "option_sets";
765
+ coupons: "coupons";
766
+ points: "points";
767
+ orders: "orders";
768
+ claims: "claims";
769
+ customers: "customers";
770
+ inquiries: "inquiries";
771
+ customer_inquiries: "customer_inquiries";
772
+ store_settings: "store_settings";
773
+ payments: "payments";
774
+ login: "login";
775
+ members: "members";
776
+ order_flows: "order_flows";
777
+ storefront: "storefront";
778
+ }>;
779
+ export type AiFocusArea = z.infer<typeof aiFocusAreaSchema>;
780
+ export declare const aiFocusSchema: z.ZodObject<{
781
+ area: z.ZodEnum<{
782
+ shipping: "shipping";
783
+ products: "products";
784
+ addresses: "addresses";
785
+ webhooks: "webhooks";
786
+ categories: "categories";
787
+ collections: "collections";
788
+ option_sets: "option_sets";
789
+ coupons: "coupons";
790
+ points: "points";
791
+ orders: "orders";
792
+ claims: "claims";
793
+ customers: "customers";
794
+ inquiries: "inquiries";
795
+ customer_inquiries: "customer_inquiries";
796
+ store_settings: "store_settings";
797
+ payments: "payments";
798
+ login: "login";
799
+ members: "members";
800
+ order_flows: "order_flows";
801
+ storefront: "storefront";
802
+ }>;
803
+ id: z.ZodOptional<z.ZodString>;
804
+ }, z.core.$strip>;
805
+ export type AiFocus = z.infer<typeof aiFocusSchema>;
806
+ /** 변경 기록 보관 기간 — 지나면 내용을 비우고 되돌릴 수 없다(410 `AI_RUN_CHANGES_EXPIRED`) */
807
+ export declare const AI_RUN_FILE_CHANGES_RETENTION_DAYS = 7;
808
+ /**
809
+ * 실행 하나의 변경 상태
810
+ * - `APPLIED`: 되돌릴 수 있다(진행 중 실행이 없을 때)
811
+ * - `INCOMPLETE`: 결과를 모르는 쓰기·이전 내용이 너무 큰 경로가 있다(되돌릴 수 없다)
812
+ * - `REVERTING`·`REVERTED`·`REVERT_UNKNOWN`(되돌리기 결과를 모름 — 다시 하지 않는다)·`EXPIRED`
813
+ */
814
+ export declare const aiRunChangesStatusSchema: z.ZodEnum<{
815
+ EXPIRED: "EXPIRED";
816
+ APPLIED: "APPLIED";
817
+ INCOMPLETE: "INCOMPLETE";
818
+ REVERTING: "REVERTING";
819
+ REVERTED: "REVERTED";
820
+ REVERT_UNKNOWN: "REVERT_UNKNOWN";
821
+ }>;
822
+ export type AiRunChangesStatus = z.infer<typeof aiRunChangesStatusSchema>;
823
+ export declare const aiFileChangeKindSchema: z.ZodEnum<{
824
+ created: "created";
825
+ modified: "modified";
826
+ deleted: "deleted";
827
+ }>;
828
+ export type AiFileChangeKind = z.infer<typeof aiFileChangeKindSchema>;
829
+ export declare const aiRunChangesSchema: z.ZodObject<{
830
+ runId: z.ZodString;
831
+ status: z.ZodEnum<{
832
+ EXPIRED: "EXPIRED";
833
+ APPLIED: "APPLIED";
834
+ INCOMPLETE: "INCOMPLETE";
835
+ REVERTING: "REVERTING";
836
+ REVERTED: "REVERTED";
837
+ REVERT_UNKNOWN: "REVERT_UNKNOWN";
838
+ }>;
839
+ files: z.ZodArray<z.ZodObject<{
840
+ path: z.ZodString;
841
+ change: z.ZodEnum<{
842
+ created: "created";
843
+ modified: "modified";
844
+ deleted: "deleted";
845
+ }>;
846
+ }, z.core.$strip>>;
847
+ }, z.core.$strip>;
848
+ export type AiRunChanges = z.infer<typeof aiRunChangesSchema>;
849
+ /** `GET /v1/ai/conversations/{id}/file-changes` — 대화의 실행별 변경(실행 만든 순) */
850
+ export declare const aiConversationFileChangesSchema: z.ZodObject<{
851
+ runs: z.ZodArray<z.ZodObject<{
852
+ runId: z.ZodString;
853
+ status: z.ZodEnum<{
854
+ EXPIRED: "EXPIRED";
855
+ APPLIED: "APPLIED";
856
+ INCOMPLETE: "INCOMPLETE";
857
+ REVERTING: "REVERTING";
858
+ REVERTED: "REVERTED";
859
+ REVERT_UNKNOWN: "REVERT_UNKNOWN";
860
+ }>;
861
+ files: z.ZodArray<z.ZodObject<{
862
+ path: z.ZodString;
863
+ change: z.ZodEnum<{
864
+ created: "created";
865
+ modified: "modified";
866
+ deleted: "deleted";
867
+ }>;
868
+ }, z.core.$strip>>;
869
+ }, z.core.$strip>>;
870
+ }, z.core.$strip>;
871
+ export type AiConversationFileChanges = z.infer<typeof aiConversationFileChangesSchema>;
872
+ /** `GET /v1/ai/runs/{runId}/file-changes` — 변경 보기. 텍스트가 아닌 파일·보관이 끝난 내용은 null이다(diff는 화면이 계산한다) */
873
+ export declare const aiRunFileDiffSchema: z.ZodObject<{
874
+ runId: z.ZodString;
875
+ status: z.ZodEnum<{
876
+ EXPIRED: "EXPIRED";
877
+ APPLIED: "APPLIED";
878
+ INCOMPLETE: "INCOMPLETE";
879
+ REVERTING: "REVERTING";
880
+ REVERTED: "REVERTED";
881
+ REVERT_UNKNOWN: "REVERT_UNKNOWN";
882
+ }>;
883
+ files: z.ZodArray<z.ZodObject<{
884
+ path: z.ZodString;
885
+ change: z.ZodEnum<{
886
+ created: "created";
887
+ modified: "modified";
888
+ deleted: "deleted";
889
+ }>;
890
+ before: z.ZodNullable<z.ZodString>;
891
+ after: z.ZodNullable<z.ZodString>;
892
+ binary: z.ZodBoolean;
893
+ }, z.core.$strip>>;
894
+ }, z.core.$strip>;
895
+ export type AiRunFileDiff = z.infer<typeof aiRunFileDiffSchema>;
896
+ /**
897
+ * `POST /v1/ai/runs/{runId}/revert` — 실행이 바꾼 경로를 그 전 내용으로 한 번에 돌린다. 오류: 409 `AI_RUN_IN_PROGRESS`(대화에 진행 중 실행),
898
+ * 409 `AI_RUN_REVERT_CONFLICT`(`details.conflicts` — 그 뒤 바뀐 경로·결과를 모르는 쓰기), 409 `AI_RUN_ALREADY_REVERTED`,
899
+ * 410 `AI_RUN_CHANGES_EXPIRED`, 404 `AI_RUN_CHANGES_NOT_FOUND`, 502 `AI_RUN_REVERT_UNKNOWN`(결과를 모름 — 다시 하지 않는다)
900
+ */
901
+ export declare const aiRunRevertResultSchema: z.ZodObject<{
902
+ runId: z.ZodString;
903
+ status: z.ZodLiteral<"REVERTED">;
904
+ paths: z.ZodArray<z.ZodString>;
905
+ }, z.core.$strip>;
906
+ export type AiRunRevertResult = z.infer<typeof aiRunRevertResultSchema>;
907
+ /** 409 `AI_RUN_REVERT_CONFLICT`의 `error.details` */
908
+ export declare const aiRunRevertConflictDetailsSchema: z.ZodObject<{
909
+ conflicts: z.ZodArray<z.ZodObject<{
910
+ path: z.ZodString;
911
+ reason: z.ZodEnum<{
912
+ UNKNOWN: "UNKNOWN";
913
+ CHANGED: "CHANGED";
914
+ }>;
915
+ }, z.core.$strip>>;
916
+ }, z.core.$strip>;
917
+ export type AiRunRevertConflictDetails = z.infer<typeof aiRunRevertConflictDetailsSchema>;
918
+ export declare const aiStreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
919
+ type: z.ZodLiteral<"delta">;
920
+ messageId: z.ZodString;
921
+ text: z.ZodString;
922
+ }, z.core.$strip>, z.ZodObject<{
923
+ type: z.ZodLiteral<"tool_start">;
924
+ messageId: z.ZodString;
925
+ toolCallId: z.ZodString;
926
+ name: z.ZodString;
927
+ label: z.ZodString;
928
+ focus: z.ZodOptional<z.ZodObject<{
929
+ area: z.ZodEnum<{
930
+ shipping: "shipping";
931
+ products: "products";
932
+ addresses: "addresses";
933
+ webhooks: "webhooks";
934
+ categories: "categories";
935
+ collections: "collections";
936
+ option_sets: "option_sets";
937
+ coupons: "coupons";
938
+ points: "points";
939
+ orders: "orders";
940
+ claims: "claims";
941
+ customers: "customers";
942
+ inquiries: "inquiries";
943
+ customer_inquiries: "customer_inquiries";
944
+ store_settings: "store_settings";
945
+ payments: "payments";
946
+ login: "login";
947
+ members: "members";
948
+ order_flows: "order_flows";
949
+ storefront: "storefront";
950
+ }>;
951
+ id: z.ZodOptional<z.ZodString>;
952
+ }, z.core.$strip>>;
953
+ }, z.core.$strip>, z.ZodObject<{
954
+ type: z.ZodLiteral<"tool_result">;
955
+ messageId: z.ZodString;
956
+ toolCallId: z.ZodString;
957
+ status: z.ZodEnum<{
958
+ error: "error";
959
+ unknown: "unknown";
960
+ ok: "ok";
961
+ }>;
962
+ summary: z.ZodNullable<z.ZodString>;
963
+ }, z.core.$strip>, z.ZodObject<{
964
+ type: z.ZodLiteral<"choices">;
965
+ messageId: z.ZodString;
966
+ question: z.ZodString;
967
+ options: z.ZodArray<z.ZodObject<{
968
+ label: z.ZodString;
969
+ value: z.ZodString;
970
+ }, z.core.$strip>>;
971
+ }, z.core.$strip>, z.ZodObject<{
972
+ type: z.ZodLiteral<"approval">;
973
+ messageId: z.ZodString;
974
+ approvalId: z.ZodString;
975
+ title: z.ZodString;
976
+ }, z.core.$strip>, z.ZodObject<{
977
+ type: z.ZodLiteral<"message">;
978
+ message: z.ZodObject<{
979
+ id: z.ZodString;
980
+ role: z.ZodEnum<{
981
+ user: "user";
982
+ assistant: "assistant";
983
+ }>;
984
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
985
+ type: z.ZodLiteral<"text">;
986
+ text: z.ZodString;
987
+ }, z.core.$strip>, z.ZodObject<{
988
+ type: z.ZodLiteral<"tool">;
989
+ toolCallId: z.ZodString;
990
+ name: z.ZodString;
991
+ label: z.ZodString;
992
+ status: z.ZodEnum<{
993
+ error: "error";
994
+ unknown: "unknown";
995
+ ok: "ok";
996
+ }>;
997
+ summary: z.ZodNullable<z.ZodString>;
998
+ }, z.core.$strip>, z.ZodObject<{
999
+ type: z.ZodLiteral<"choices">;
1000
+ question: z.ZodString;
1001
+ options: z.ZodArray<z.ZodObject<{
1002
+ label: z.ZodString;
1003
+ value: z.ZodString;
1004
+ }, z.core.$strip>>;
1005
+ }, z.core.$strip>, z.ZodObject<{
1006
+ type: z.ZodLiteral<"attachment">;
1007
+ attachment: z.ZodObject<{
1008
+ url: z.ZodString;
1009
+ name: z.ZodString;
1010
+ mediaType: z.ZodString;
1011
+ }, z.core.$strip>;
1012
+ }, z.core.$strip>, z.ZodObject<{
1013
+ type: z.ZodLiteral<"approval">;
1014
+ approvalId: z.ZodString;
1015
+ title: z.ZodString;
1016
+ }, z.core.$strip>, z.ZodObject<{
1017
+ type: z.ZodLiteral<"selection">;
1018
+ selection: z.ZodObject<{
1019
+ component: z.ZodNullable<z.ZodString>;
1020
+ source: z.ZodNullable<z.ZodObject<{
1021
+ path: z.ZodString;
1022
+ line: z.ZodNumber;
1023
+ column: z.ZodOptional<z.ZodNumber>;
1024
+ }, z.core.$strip>>;
1025
+ tag: z.ZodString;
1026
+ text: z.ZodString;
1027
+ pagePath: z.ZodString;
1028
+ }, z.core.$strip>;
1029
+ }, z.core.$strip>], "type">>;
1030
+ runId: z.ZodNullable<z.ZodString>;
1031
+ createdAt: z.ZodString;
1032
+ }, z.core.$strip>;
1033
+ }, z.core.$strip>, z.ZodObject<{
1034
+ type: z.ZodLiteral<"error">;
1035
+ code: z.ZodString;
1036
+ message: z.ZodString;
1037
+ }, z.core.$strip>, z.ZodObject<{
1038
+ type: z.ZodLiteral<"done">;
1039
+ status: z.ZodEnum<{
1040
+ FAILED: "FAILED";
1041
+ CANCEL_REQUESTED: "CANCEL_REQUESTED";
1042
+ QUEUED: "QUEUED";
1043
+ RUNNING: "RUNNING";
1044
+ DONE: "DONE";
1045
+ CANCELLED: "CANCELLED";
1046
+ }>;
1047
+ }, z.core.$strip>], "type">;
1048
+ export type AiStreamEvent = z.infer<typeof aiStreamEventSchema>;
1049
+ /** 중계에 쌓이는 이벤트 한 건 — 실행기 → 중계 `POST /internal/streams/{id}/events` */
1050
+ export declare const aiStreamRecordSchema: z.ZodObject<{
1051
+ seq: z.ZodNumber;
1052
+ event: z.ZodDiscriminatedUnion<[z.ZodObject<{
1053
+ type: z.ZodLiteral<"delta">;
1054
+ messageId: z.ZodString;
1055
+ text: z.ZodString;
1056
+ }, z.core.$strip>, z.ZodObject<{
1057
+ type: z.ZodLiteral<"tool_start">;
1058
+ messageId: z.ZodString;
1059
+ toolCallId: z.ZodString;
1060
+ name: z.ZodString;
1061
+ label: z.ZodString;
1062
+ focus: z.ZodOptional<z.ZodObject<{
1063
+ area: z.ZodEnum<{
1064
+ shipping: "shipping";
1065
+ products: "products";
1066
+ addresses: "addresses";
1067
+ webhooks: "webhooks";
1068
+ categories: "categories";
1069
+ collections: "collections";
1070
+ option_sets: "option_sets";
1071
+ coupons: "coupons";
1072
+ points: "points";
1073
+ orders: "orders";
1074
+ claims: "claims";
1075
+ customers: "customers";
1076
+ inquiries: "inquiries";
1077
+ customer_inquiries: "customer_inquiries";
1078
+ store_settings: "store_settings";
1079
+ payments: "payments";
1080
+ login: "login";
1081
+ members: "members";
1082
+ order_flows: "order_flows";
1083
+ storefront: "storefront";
1084
+ }>;
1085
+ id: z.ZodOptional<z.ZodString>;
1086
+ }, z.core.$strip>>;
1087
+ }, z.core.$strip>, z.ZodObject<{
1088
+ type: z.ZodLiteral<"tool_result">;
1089
+ messageId: z.ZodString;
1090
+ toolCallId: z.ZodString;
1091
+ status: z.ZodEnum<{
1092
+ error: "error";
1093
+ unknown: "unknown";
1094
+ ok: "ok";
1095
+ }>;
1096
+ summary: z.ZodNullable<z.ZodString>;
1097
+ }, z.core.$strip>, z.ZodObject<{
1098
+ type: z.ZodLiteral<"choices">;
1099
+ messageId: z.ZodString;
1100
+ question: z.ZodString;
1101
+ options: z.ZodArray<z.ZodObject<{
1102
+ label: z.ZodString;
1103
+ value: z.ZodString;
1104
+ }, z.core.$strip>>;
1105
+ }, z.core.$strip>, z.ZodObject<{
1106
+ type: z.ZodLiteral<"approval">;
1107
+ messageId: z.ZodString;
1108
+ approvalId: z.ZodString;
1109
+ title: z.ZodString;
1110
+ }, z.core.$strip>, z.ZodObject<{
1111
+ type: z.ZodLiteral<"message">;
1112
+ message: z.ZodObject<{
1113
+ id: z.ZodString;
1114
+ role: z.ZodEnum<{
1115
+ user: "user";
1116
+ assistant: "assistant";
1117
+ }>;
1118
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1119
+ type: z.ZodLiteral<"text">;
1120
+ text: z.ZodString;
1121
+ }, z.core.$strip>, z.ZodObject<{
1122
+ type: z.ZodLiteral<"tool">;
1123
+ toolCallId: z.ZodString;
1124
+ name: z.ZodString;
1125
+ label: z.ZodString;
1126
+ status: z.ZodEnum<{
1127
+ error: "error";
1128
+ unknown: "unknown";
1129
+ ok: "ok";
1130
+ }>;
1131
+ summary: z.ZodNullable<z.ZodString>;
1132
+ }, z.core.$strip>, z.ZodObject<{
1133
+ type: z.ZodLiteral<"choices">;
1134
+ question: z.ZodString;
1135
+ options: z.ZodArray<z.ZodObject<{
1136
+ label: z.ZodString;
1137
+ value: z.ZodString;
1138
+ }, z.core.$strip>>;
1139
+ }, z.core.$strip>, z.ZodObject<{
1140
+ type: z.ZodLiteral<"attachment">;
1141
+ attachment: z.ZodObject<{
1142
+ url: z.ZodString;
1143
+ name: z.ZodString;
1144
+ mediaType: z.ZodString;
1145
+ }, z.core.$strip>;
1146
+ }, z.core.$strip>, z.ZodObject<{
1147
+ type: z.ZodLiteral<"approval">;
1148
+ approvalId: z.ZodString;
1149
+ title: z.ZodString;
1150
+ }, z.core.$strip>, z.ZodObject<{
1151
+ type: z.ZodLiteral<"selection">;
1152
+ selection: z.ZodObject<{
1153
+ component: z.ZodNullable<z.ZodString>;
1154
+ source: z.ZodNullable<z.ZodObject<{
1155
+ path: z.ZodString;
1156
+ line: z.ZodNumber;
1157
+ column: z.ZodOptional<z.ZodNumber>;
1158
+ }, z.core.$strip>>;
1159
+ tag: z.ZodString;
1160
+ text: z.ZodString;
1161
+ pagePath: z.ZodString;
1162
+ }, z.core.$strip>;
1163
+ }, z.core.$strip>], "type">>;
1164
+ runId: z.ZodNullable<z.ZodString>;
1165
+ createdAt: z.ZodString;
1166
+ }, z.core.$strip>;
1167
+ }, z.core.$strip>, z.ZodObject<{
1168
+ type: z.ZodLiteral<"error">;
1169
+ code: z.ZodString;
1170
+ message: z.ZodString;
1171
+ }, z.core.$strip>, z.ZodObject<{
1172
+ type: z.ZodLiteral<"done">;
1173
+ status: z.ZodEnum<{
1174
+ FAILED: "FAILED";
1175
+ CANCEL_REQUESTED: "CANCEL_REQUESTED";
1176
+ QUEUED: "QUEUED";
1177
+ RUNNING: "RUNNING";
1178
+ DONE: "DONE";
1179
+ CANCELLED: "CANCELLED";
1180
+ }>;
1181
+ }, z.core.$strip>], "type">;
1182
+ }, z.core.$strip>;
1183
+ export type AiStreamRecord = z.infer<typeof aiStreamRecordSchema>;
1184
+ export declare const STORE_DRAFT_MAX_ATTACHMENTS = 5;
1185
+ /** 초안 첨부 하나의 최대 크기(바이트) */
1186
+ export declare const STORE_DRAFT_ATTACHMENT_MAX_BYTES: number;
1187
+ /** 연결하지 않은 초안을 지우기까지 */
1188
+ export declare const STORE_DRAFT_RETENTION_DAYS = 7;
1189
+ export declare const createStoreDraftRequestSchema: z.ZodObject<{
1190
+ text: z.ZodString;
1191
+ attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
1192
+ filename: z.ZodString;
1193
+ size: z.ZodNumber;
1194
+ }, z.core.$strip>>>;
1195
+ }, z.core.$strip>;
1196
+ export type CreateStoreDraftRequest = z.input<typeof createStoreDraftRequestSchema>;
1197
+ export declare const createStoreDraftResponseSchema: z.ZodObject<{
1198
+ draftId: z.ZodString;
1199
+ uploads: z.ZodArray<z.ZodObject<{
1200
+ uploadUrl: z.ZodString;
1201
+ url: z.ZodString;
1202
+ }, z.core.$strip>>;
1203
+ continueUrl: z.ZodString;
1204
+ }, z.core.$strip>;
1205
+ export type CreateStoreDraftResponse = z.infer<typeof createStoreDraftResponseSchema>;
1206
+ export declare const storeDraftSchema: z.ZodObject<{
1207
+ id: z.ZodString;
1208
+ text: z.ZodString;
1209
+ attachments: z.ZodArray<z.ZodObject<{
1210
+ url: z.ZodString;
1211
+ name: z.ZodString;
1212
+ mediaType: z.ZodString;
1213
+ }, z.core.$strip>>;
1214
+ createdAt: z.ZodString;
1215
+ storeId: z.ZodNullable<z.ZodString>;
1216
+ }, z.core.$strip>;
1217
+ export type StoreDraft = z.infer<typeof storeDraftSchema>;
1218
+ /** 로그인 전 초안 미리보기(`GET /v1/public/store-drafts/{id}`) — 로그인 화면이 「저장한 설명」을 보인다. 첨부는 이름만 */
1219
+ export declare const storeDraftPreviewSchema: z.ZodObject<{
1220
+ id: z.ZodString;
1221
+ text: z.ZodString;
1222
+ attachments: z.ZodArray<z.ZodObject<{
1223
+ name: z.ZodString;
1224
+ mediaType: z.ZodString;
1225
+ }, z.core.$strip>>;
1226
+ expiresAt: z.ZodString;
1227
+ used: z.ZodBoolean;
1228
+ }, z.core.$strip>;
1229
+ export type StoreDraftPreview = z.infer<typeof storeDraftPreviewSchema>;
1230
+ //#endregion
428
1231
  //#region src/schemas/analytics.d.ts
429
1232
  export declare const analyticsRangeQuerySchema: z.ZodObject<{
430
1233
  from: z.ZodString;
@@ -2144,7 +2947,7 @@ export declare function parseWebhookEvent(body: unknown): ParsedWebhookEvent;
2144
2947
  //#endregion
2145
2948
  //#region src/schemas/app-manifest.d.ts
2146
2949
  /**
2147
- * 서드파티 앱 매니페스트 `sayren.app.json` (이슈 #22) — CLI(`sayren app`)·api(빌드 `VERIFY`·버전 판정·동의 화면 자료)·런타임이
2950
+ * 서드파티 앱 매니페스트 `manifest.json` (이슈 #22) — CLI(`sayren app`)·api(빌드 `VERIFY`·버전 판정·동의 화면 자료)·런타임이
2148
2951
  * 같은 원천을 쓴다. 매니페스트는 정적 JSON이고 빌드 없이 읽는다.
2149
2952
  *
2150
2953
  * 기능 하나는 **capability** 하나다(`APP_CAPABILITIES`). capability는 매니페스트 조각·동의 문단·넓어짐 판정(재동의 조건)을 한 곳에 둔다.
@@ -3142,8 +3945,8 @@ export declare const appBuildSchema: z.ZodObject<{
3142
3945
  status: z.ZodEnum<{
3143
3946
  FAILED: "FAILED";
3144
3947
  SUCCEEDED: "SUCCEEDED";
3145
- RUNNING: "RUNNING";
3146
3948
  QUEUED: "QUEUED";
3949
+ RUNNING: "RUNNING";
3147
3950
  TIMED_OUT: "TIMED_OUT";
3148
3951
  }>;
3149
3952
  stages: z.ZodArray<z.ZodObject<{
@@ -3188,8 +3991,8 @@ export declare const appVersionSchema: z.ZodObject<{
3188
3991
  status: z.ZodEnum<{
3189
3992
  FAILED: "FAILED";
3190
3993
  SUCCEEDED: "SUCCEEDED";
3191
- RUNNING: "RUNNING";
3192
3994
  QUEUED: "QUEUED";
3995
+ RUNNING: "RUNNING";
3193
3996
  TIMED_OUT: "TIMED_OUT";
3194
3997
  }>;
3195
3998
  stages: z.ZodArray<z.ZodObject<{
@@ -3339,8 +4142,8 @@ export declare const appReleaseResultSchema: z.ZodObject<{
3339
4142
  status: z.ZodEnum<{
3340
4143
  FAILED: "FAILED";
3341
4144
  SUCCEEDED: "SUCCEEDED";
3342
- RUNNING: "RUNNING";
3343
4145
  QUEUED: "QUEUED";
4146
+ RUNNING: "RUNNING";
3344
4147
  TIMED_OUT: "TIMED_OUT";
3345
4148
  }>;
3346
4149
  stages: z.ZodArray<z.ZodObject<{
@@ -3432,9 +4235,9 @@ export declare const appInvocationSchema: z.ZodObject<{
3432
4235
  kind: z.ZodEnum<{
3433
4236
  event: "event";
3434
4237
  flow: "flow";
4238
+ tool: "tool";
3435
4239
  http: "http";
3436
4240
  schedule: "schedule";
3437
- tool: "tool";
3438
4241
  }>;
3439
4242
  eventType: z.ZodNullable<z.ZodString>;
3440
4243
  outcome: z.ZodEnum<{
@@ -11081,8 +11884,8 @@ export type RunStorefrontCheckRequest = z.infer<typeof runStorefrontCheckRequest
11081
11884
  export declare const storefrontCheckStatusSchema: z.ZodEnum<{
11082
11885
  FAILED: "FAILED";
11083
11886
  UNKNOWN: "UNKNOWN";
11084
- RUNNING: "RUNNING";
11085
11887
  QUEUED: "QUEUED";
11888
+ RUNNING: "RUNNING";
11086
11889
  PASSED: "PASSED";
11087
11890
  TIMED_OUT: "TIMED_OUT";
11088
11891
  }>;
@@ -11095,8 +11898,8 @@ export declare const storefrontCheckSchema: z.ZodObject<{
11095
11898
  status: z.ZodEnum<{
11096
11899
  FAILED: "FAILED";
11097
11900
  UNKNOWN: "UNKNOWN";
11098
- RUNNING: "RUNNING";
11099
11901
  QUEUED: "QUEUED";
11902
+ RUNNING: "RUNNING";
11100
11903
  PASSED: "PASSED";
11101
11904
  TIMED_OUT: "TIMED_OUT";
11102
11905
  }>;
@@ -11180,8 +11983,8 @@ export type StorefrontVerifyReport = z.infer<typeof storefrontVerifyReportSchema
11180
11983
  export declare const storefrontBuildStatusSchema: z.ZodEnum<{
11181
11984
  FAILED: "FAILED";
11182
11985
  SUCCEEDED: "SUCCEEDED";
11183
- RUNNING: "RUNNING";
11184
11986
  QUEUED: "QUEUED";
11987
+ RUNNING: "RUNNING";
11185
11988
  TIMED_OUT: "TIMED_OUT";
11186
11989
  }>;
11187
11990
  export type StorefrontBuildStatus = z.infer<typeof storefrontBuildStatusSchema>;
@@ -11248,8 +12051,8 @@ export declare const storefrontBuildSchema: z.ZodObject<{
11248
12051
  status: z.ZodEnum<{
11249
12052
  FAILED: "FAILED";
11250
12053
  SUCCEEDED: "SUCCEEDED";
11251
- RUNNING: "RUNNING";
11252
12054
  QUEUED: "QUEUED";
12055
+ RUNNING: "RUNNING";
11253
12056
  TIMED_OUT: "TIMED_OUT";
11254
12057
  }>;
11255
12058
  failureStage: z.ZodNullable<z.ZodString>;
@@ -11377,8 +12180,8 @@ export declare const storefrontVersionCreatedSchema: z.ZodObject<{
11377
12180
  status: z.ZodEnum<{
11378
12181
  FAILED: "FAILED";
11379
12182
  SUCCEEDED: "SUCCEEDED";
11380
- RUNNING: "RUNNING";
11381
12183
  QUEUED: "QUEUED";
12184
+ RUNNING: "RUNNING";
11382
12185
  TIMED_OUT: "TIMED_OUT";
11383
12186
  }>;
11384
12187
  failureStage: z.ZodNullable<z.ZodString>;
@@ -11574,11 +12377,13 @@ export type StorefrontSourceReplaced = z.infer<typeof storefrontSourceReplacedSc
11574
12377
  * - `product-image`: 상품 목록·상세의 상품 이미지. 목록 썸네일로 쓰이므로 정지 이미지만 받는다.
11575
12378
  * - `description`: 상세설명 본문에 삽입하는 미디어. 동영상과 svg도 받는다.
11576
12379
  * - `flow-attachment`: 주문 흐름 행동의 첨부(시안 등, 이슈 #115). 구매자에게 보이므로 정지 이미지와 PDF만 받는다.
12380
+ * - `ai-attachment`: 상점 플랫폼 AI 채팅에 붙이는 자료(이슈 #124). 모델이 읽는 정지 이미지와 PDF만 받는다.
11577
12381
  */
11578
12382
  export declare const uploadPurposeSchema: z.ZodEnum<{
11579
12383
  "product-image": "product-image";
11580
12384
  description: "description";
11581
12385
  "flow-attachment": "flow-attachment";
12386
+ "ai-attachment": "ai-attachment";
11582
12387
  }>;
11583
12388
  export type UploadPurpose = z.infer<typeof uploadPurposeSchema>;
11584
12389
  export interface UploadPurposeLimit {
@@ -11619,6 +12424,7 @@ export declare const uploadRequestSchema: z.ZodObject<{
11619
12424
  "product-image": "product-image";
11620
12425
  description: "description";
11621
12426
  "flow-attachment": "flow-attachment";
12427
+ "ai-attachment": "ai-attachment";
11622
12428
  }>>;
11623
12429
  size: z.ZodOptional<z.ZodNumber>;
11624
12430
  }, z.core.$strip>;
@@ -17411,6 +18217,151 @@ export declare function createStoreClient(options: StoreClientOptions): {
17411
18217
  }>;
17412
18218
  remove: (locationId: string) => Promise<void>;
17413
18219
  };
18220
+ /**
18221
+ * 상점 플랫폼 AI 채팅 (이슈 #124) — 상점 플랫폼 전용(공개 문서 제외). 메시지는 202로 `streamId`를 돌려주고
18222
+ * 응답은 `streamUrl`(SSE, Bearer `streamToken`)로 받는다. 실행은 브라우저와 무관하게 서버에서 끝까지 돈다.
18223
+ */
18224
+ ai: {
18225
+ /** `GET /v1/ai/conversations` — 내 대화 목록(최근 순) */
18226
+ listConversations: () => Promise<{
18227
+ id: string;
18228
+ title: string | null;
18229
+ createdAt: string;
18230
+ updatedAt: string;
18231
+ }[]>;
18232
+ /** `POST /v1/ai/conversations` — 새 대화. `draftId`를 주면 그 초안을 첫 메시지로 실행을 시작한다 */
18233
+ createConversation: (body?: CreateAiConversationRequest) => Promise<{
18234
+ conversation: {
18235
+ id: string;
18236
+ title: string | null;
18237
+ createdAt: string;
18238
+ updatedAt: string;
18239
+ };
18240
+ run: {
18241
+ streamId: string;
18242
+ streamUrl: string;
18243
+ streamToken: string;
18244
+ } | null;
18245
+ }>;
18246
+ /** `GET /v1/ai/conversations/{id}` — 메시지와 진행 중 실행 */
18247
+ getConversation: (conversationId: string) => Promise<{
18248
+ id: string;
18249
+ title: string | null;
18250
+ createdAt: string;
18251
+ updatedAt: string;
18252
+ messages: {
18253
+ id: string;
18254
+ role: "user" | "assistant";
18255
+ parts: ({
18256
+ type: "text";
18257
+ text: string;
18258
+ } | {
18259
+ type: "tool";
18260
+ toolCallId: string;
18261
+ name: string;
18262
+ label: string;
18263
+ status: "error" | "unknown" | "ok";
18264
+ summary: string | null;
18265
+ } | {
18266
+ type: "choices";
18267
+ question: string;
18268
+ options: {
18269
+ label: string;
18270
+ value: string;
18271
+ }[];
18272
+ } | {
18273
+ type: "attachment";
18274
+ attachment: {
18275
+ url: string;
18276
+ name: string;
18277
+ mediaType: string;
18278
+ };
18279
+ } | {
18280
+ type: "approval";
18281
+ approvalId: string;
18282
+ title: string;
18283
+ } | {
18284
+ type: "selection";
18285
+ selection: {
18286
+ component: string | null;
18287
+ source: {
18288
+ path: string;
18289
+ line: number;
18290
+ column?: number | undefined;
18291
+ } | null;
18292
+ tag: string;
18293
+ text: string;
18294
+ pagePath: string;
18295
+ };
18296
+ })[];
18297
+ runId: string | null;
18298
+ createdAt: string;
18299
+ }[];
18300
+ activeRun: {
18301
+ id: string;
18302
+ status: "FAILED" | "CANCEL_REQUESTED" | "QUEUED" | "RUNNING" | "DONE" | "CANCELLED";
18303
+ errorCode: string | null;
18304
+ createdAt: string;
18305
+ finishedAt: string | null;
18306
+ stream: {
18307
+ streamId: string;
18308
+ streamUrl: string;
18309
+ streamToken: string;
18310
+ };
18311
+ } | null;
18312
+ lastRun: {
18313
+ id: string;
18314
+ status: "FAILED" | "CANCEL_REQUESTED" | "QUEUED" | "RUNNING" | "DONE" | "CANCELLED";
18315
+ errorCode: string | null;
18316
+ createdAt: string;
18317
+ finishedAt: string | null;
18318
+ } | null;
18319
+ }>;
18320
+ /** `POST /v1/ai/conversations/{id}/messages` (202) — 진행 중 실행이 있으면 409 `AI_RUN_IN_PROGRESS` */
18321
+ sendMessage: (conversationId: string, body: SendAiMessageRequest) => Promise<{
18322
+ streamId: string;
18323
+ streamUrl: string;
18324
+ streamToken: string;
18325
+ messageId: string;
18326
+ }>;
18327
+ /** `POST /v1/ai/runs/{id}/cancel` (202) — 실행기가 다음 단계 전에 멈춘다 */
18328
+ cancelRun: (runId: string) => Promise<{
18329
+ id: string;
18330
+ status: "FAILED" | "CANCEL_REQUESTED" | "QUEUED" | "RUNNING" | "DONE" | "CANCELLED";
18331
+ errorCode: string | null;
18332
+ createdAt: string;
18333
+ finishedAt: string | null;
18334
+ }>;
18335
+ /** `GET /v1/ai/conversations/{id}/file-changes` — 실행별 스토어프론트 작업 트리 변경(#65) */
18336
+ listFileChanges: (conversationId: string) => Promise<{
18337
+ runs: {
18338
+ runId: string;
18339
+ status: "EXPIRED" | "APPLIED" | "INCOMPLETE" | "REVERTING" | "REVERTED" | "REVERT_UNKNOWN";
18340
+ files: {
18341
+ path: string;
18342
+ change: "created" | "modified" | "deleted";
18343
+ }[];
18344
+ }[];
18345
+ }>;
18346
+ /** `GET /v1/ai/runs/{id}/file-changes` — 실행 하나의 변경 내용(이전·이후) */
18347
+ getRunFileDiff: (runId: string) => Promise<{
18348
+ runId: string;
18349
+ status: "EXPIRED" | "APPLIED" | "INCOMPLETE" | "REVERTING" | "REVERTED" | "REVERT_UNKNOWN";
18350
+ files: {
18351
+ path: string;
18352
+ change: "created" | "modified" | "deleted";
18353
+ before: string | null;
18354
+ after: string | null;
18355
+ binary: boolean;
18356
+ }[];
18357
+ }>;
18358
+ /** `POST /v1/ai/runs/{id}/revert` — 실행이 바꾼 파일을 한 번에 되돌린다(전부 아니면 전무) */
18359
+ revertRun: (runId: string) => Promise<{
18360
+ runId: string;
18361
+ status: "REVERTED";
18362
+ paths: string[];
18363
+ }>;
18364
+ };
17414
18365
  /**
17415
18366
  * 스토어프론트 호스팅 (이슈 #53) — 조회 `storefront:r`, 쓰기 `storefront:rw`(OWNER·ADMIN).
17416
18367
  * 쓰기 응답은 바뀐 사이트다. Cloudflare 반영은 커밋 뒤라 `provisioning.status`가 잠시 `PENDING`일 수 있다.
@@ -18199,7 +19150,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
18199
19150
  runCheck: (body: RunStorefrontCheckRequest) => Promise<{
18200
19151
  checkId: string;
18201
19152
  check: string;
18202
- status: "FAILED" | "UNKNOWN" | "RUNNING" | "QUEUED" | "PASSED" | "TIMED_OUT";
19153
+ status: "FAILED" | "UNKNOWN" | "QUEUED" | "RUNNING" | "PASSED" | "TIMED_OUT";
18203
19154
  exitCode: number | null;
18204
19155
  durationMs: number | null;
18205
19156
  outputTail: string | null;
@@ -18213,7 +19164,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
18213
19164
  getCheck: (checkId: string) => Promise<{
18214
19165
  checkId: string;
18215
19166
  check: string;
18216
- status: "FAILED" | "UNKNOWN" | "RUNNING" | "QUEUED" | "PASSED" | "TIMED_OUT";
19167
+ status: "FAILED" | "UNKNOWN" | "QUEUED" | "RUNNING" | "PASSED" | "TIMED_OUT";
18217
19168
  exitCode: number | null;
18218
19169
  durationMs: number | null;
18219
19170
  outputTail: string | null;
@@ -18280,7 +19231,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
18280
19231
  buildId: string;
18281
19232
  versionId: string;
18282
19233
  versionNumber: number;
18283
- status: "FAILED" | "SUCCEEDED" | "RUNNING" | "QUEUED" | "TIMED_OUT";
19234
+ status: "FAILED" | "SUCCEEDED" | "QUEUED" | "RUNNING" | "TIMED_OUT";
18284
19235
  failureStage: string | null;
18285
19236
  errorCode: string | null;
18286
19237
  logTail: string | null;
@@ -18361,7 +19312,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
18361
19312
  buildId: string;
18362
19313
  versionId: string;
18363
19314
  versionNumber: number;
18364
- status: "FAILED" | "SUCCEEDED" | "RUNNING" | "QUEUED" | "TIMED_OUT";
19315
+ status: "FAILED" | "SUCCEEDED" | "QUEUED" | "RUNNING" | "TIMED_OUT";
18365
19316
  failureStage: string | null;
18366
19317
  errorCode: string | null;
18367
19318
  logTail: string | null;
@@ -18439,7 +19390,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
18439
19390
  buildId: string;
18440
19391
  versionId: string;
18441
19392
  versionNumber: number;
18442
- status: "FAILED" | "SUCCEEDED" | "RUNNING" | "QUEUED" | "TIMED_OUT";
19393
+ status: "FAILED" | "SUCCEEDED" | "QUEUED" | "RUNNING" | "TIMED_OUT";
18443
19394
  failureStage: string | null;
18444
19395
  errorCode: string | null;
18445
19396
  logTail: string | null;
@@ -18584,7 +19535,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
18584
19535
  code: string;
18585
19536
  name: string;
18586
19537
  };
18587
- status: "ACTIVE" | "CANCELED" | "PAST_DUE" | "INCOMPLETE";
19538
+ status: "ACTIVE" | "CANCELED" | "INCOMPLETE" | "PAST_DUE";
18588
19539
  interval: "MONTH" | null;
18589
19540
  cancelAtPeriodEnd: boolean;
18590
19541
  period: {
@@ -19501,6 +20452,7 @@ export declare const storeScopeResourceSchema: z.ZodEnum<{
19501
20452
  category: "category";
19502
20453
  flow: "flow";
19503
20454
  analytics: "analytics";
20455
+ storefront: "storefront";
19504
20456
  product: "product";
19505
20457
  order: "order";
19506
20458
  claim: "claim";
@@ -19513,7 +20465,6 @@ export declare const storeScopeResourceSchema: z.ZodEnum<{
19513
20465
  customer: "customer";
19514
20466
  audit: "audit";
19515
20467
  promotion: "promotion";
19516
- storefront: "storefront";
19517
20468
  }>;
19518
20469
  /** 카탈로그상 존재하는 스코프 문자열인가 (예: `settlement:rw`는 false) */
19519
20470
  export declare function isStoreScope(scope: string): boolean;
@@ -19979,8 +20930,8 @@ export type ResponsePlanCode = PlanCode | (string & {});
19979
20930
  export declare const subscriptionStatusSchema: z.ZodEnum<{
19980
20931
  ACTIVE: "ACTIVE";
19981
20932
  CANCELED: "CANCELED";
19982
- PAST_DUE: "PAST_DUE";
19983
20933
  INCOMPLETE: "INCOMPLETE";
20934
+ PAST_DUE: "PAST_DUE";
19984
20935
  }>;
19985
20936
  export type SubscriptionStatus = z.infer<typeof subscriptionStatusSchema>;
19986
20937
  export declare const subscriptionLimitsSchema: z.ZodObject<{
@@ -20030,8 +20981,8 @@ export declare const storeSubscriptionSchema: z.ZodObject<{
20030
20981
  status: z.ZodEnum<{
20031
20982
  ACTIVE: "ACTIVE";
20032
20983
  CANCELED: "CANCELED";
20033
- PAST_DUE: "PAST_DUE";
20034
20984
  INCOMPLETE: "INCOMPLETE";
20985
+ PAST_DUE: "PAST_DUE";
20035
20986
  }>;
20036
20987
  interval: z.ZodNullable<z.ZodEnum<{
20037
20988
  MONTH: "MONTH";