@teamlearners/clawops 0.37.0 → 0.38.0

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.
@@ -601,6 +601,14 @@ interface CallUpdateParams {
601
601
  status?: 'completed';
602
602
  }
603
603
 
604
+ /**
605
+ * 화자 식별자. **2026-08 이후 전사는 `speaker_0`·`speaker_1`… 형식**이고, 전환 통화처럼
606
+ * 참여자가 셋 이상이면 그만큼 늘어난다. 그 이전 전사에는 `AGENT`·`CUSTOMER` 가 그대로
607
+ * 남아 있으므로 **두 형식을 모두 받아야 한다.** 화자와 역할의 연결은 보장되지 않는다.
608
+ */
609
+ type TranscriptSpeaker = 'CUSTOMER' | 'AGENT' | (string & {});
610
+ /** 전사 실패 단계. `trigger` 는 시스템 실패라 재요청할 수 있다. */
611
+ type TranscriptStage = 'download' | 'runtime' | 'transcription' | 'trigger' | 'recover' | (string & {});
604
612
  /**
605
613
  * 통화 전사 상태. status 에 따라 채워지는 필드가 다름:
606
614
  * - "completed": callId, segmentCount, segments
@@ -613,69 +621,129 @@ declare const TranscriptStatusSchema: z.ZodObject<{
613
621
  callId: z.ZodOptional<z.ZodString>;
614
622
  segmentCount: z.ZodOptional<z.ZodNumber>;
615
623
  segments: z.ZodOptional<z.ZodArray<z.ZodObject<{
616
- speaker: z.ZodEnum<["CUSTOMER", "AGENT"]>;
624
+ /**
625
+ * ⛔ **닫힌 enum 으로 두지 않는다.** 서버는 이미 `speaker_0` 을 보내고 있고, 세그먼트
626
+ * 하나가 어긋나면 `segments` 배열 때문에 **전사 응답 전체**가 실패한다.
627
+ */
628
+ speaker: z.ZodType<TranscriptSpeaker>;
617
629
  start: z.ZodNumber;
618
630
  end: z.ZodNumber;
619
631
  text: z.ZodString;
620
632
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
621
- speaker: z.ZodEnum<["CUSTOMER", "AGENT"]>;
633
+ /**
634
+ * ⛔ **닫힌 enum 으로 두지 않는다.** 서버는 이미 `speaker_0` 을 보내고 있고, 세그먼트
635
+ * 하나가 어긋나면 `segments` 배열 때문에 **전사 응답 전체**가 실패한다.
636
+ */
637
+ speaker: z.ZodType<TranscriptSpeaker>;
622
638
  start: z.ZodNumber;
623
639
  end: z.ZodNumber;
624
640
  text: z.ZodString;
625
641
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
626
- speaker: z.ZodEnum<["CUSTOMER", "AGENT"]>;
642
+ /**
643
+ * ⛔ **닫힌 enum 으로 두지 않는다.** 서버는 이미 `speaker_0` 을 보내고 있고, 세그먼트
644
+ * 하나가 어긋나면 `segments` 배열 때문에 **전사 응답 전체**가 실패한다.
645
+ */
646
+ speaker: z.ZodType<TranscriptSpeaker>;
627
647
  start: z.ZodNumber;
628
648
  end: z.ZodNumber;
629
649
  text: z.ZodString;
630
650
  }, z.ZodTypeAny, "passthrough">>, "many">>;
631
651
  startedAt: z.ZodOptional<z.ZodString>;
632
- stage: z.ZodOptional<z.ZodNullable<z.ZodEnum<["download", "runtime", "trigger"]>>>;
652
+ /**
653
+ * ⛔ **실패 단계는 서버 코드가 만든다** — 전사 파이프라인이 `download`·`runtime`·
654
+ * `transcription`·`recover` 를 내보내고, 영구 실패는 예외 객체의 속성을 그대로 싣는다.
655
+ * 어휘가 열려 있어 스펙의 enum 조차 스냅샷일 뿐이다.
656
+ *
657
+ * ⚠️ 여기가 닫혀 있으면 **전사가 실패했을 때 그 이유를 물으면 던진다** — 고객이 가장
658
+ * 답을 필요로 하는 순간이다.
659
+ */
660
+ stage: z.ZodOptional<z.ZodNullable<z.ZodType<TranscriptStage, z.ZodTypeDef, TranscriptStage>>>;
633
661
  error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
634
662
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
635
663
  status: z.ZodEnum<["completed", "pending", "failed", "not_requested"]>;
636
664
  callId: z.ZodOptional<z.ZodString>;
637
665
  segmentCount: z.ZodOptional<z.ZodNumber>;
638
666
  segments: z.ZodOptional<z.ZodArray<z.ZodObject<{
639
- speaker: z.ZodEnum<["CUSTOMER", "AGENT"]>;
667
+ /**
668
+ * ⛔ **닫힌 enum 으로 두지 않는다.** 서버는 이미 `speaker_0` 을 보내고 있고, 세그먼트
669
+ * 하나가 어긋나면 `segments` 배열 때문에 **전사 응답 전체**가 실패한다.
670
+ */
671
+ speaker: z.ZodType<TranscriptSpeaker>;
640
672
  start: z.ZodNumber;
641
673
  end: z.ZodNumber;
642
674
  text: z.ZodString;
643
675
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
644
- speaker: z.ZodEnum<["CUSTOMER", "AGENT"]>;
676
+ /**
677
+ * ⛔ **닫힌 enum 으로 두지 않는다.** 서버는 이미 `speaker_0` 을 보내고 있고, 세그먼트
678
+ * 하나가 어긋나면 `segments` 배열 때문에 **전사 응답 전체**가 실패한다.
679
+ */
680
+ speaker: z.ZodType<TranscriptSpeaker>;
645
681
  start: z.ZodNumber;
646
682
  end: z.ZodNumber;
647
683
  text: z.ZodString;
648
684
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
649
- speaker: z.ZodEnum<["CUSTOMER", "AGENT"]>;
685
+ /**
686
+ * ⛔ **닫힌 enum 으로 두지 않는다.** 서버는 이미 `speaker_0` 을 보내고 있고, 세그먼트
687
+ * 하나가 어긋나면 `segments` 배열 때문에 **전사 응답 전체**가 실패한다.
688
+ */
689
+ speaker: z.ZodType<TranscriptSpeaker>;
650
690
  start: z.ZodNumber;
651
691
  end: z.ZodNumber;
652
692
  text: z.ZodString;
653
693
  }, z.ZodTypeAny, "passthrough">>, "many">>;
654
694
  startedAt: z.ZodOptional<z.ZodString>;
655
- stage: z.ZodOptional<z.ZodNullable<z.ZodEnum<["download", "runtime", "trigger"]>>>;
695
+ /**
696
+ * ⛔ **실패 단계는 서버 코드가 만든다** — 전사 파이프라인이 `download`·`runtime`·
697
+ * `transcription`·`recover` 를 내보내고, 영구 실패는 예외 객체의 속성을 그대로 싣는다.
698
+ * 어휘가 열려 있어 스펙의 enum 조차 스냅샷일 뿐이다.
699
+ *
700
+ * ⚠️ 여기가 닫혀 있으면 **전사가 실패했을 때 그 이유를 물으면 던진다** — 고객이 가장
701
+ * 답을 필요로 하는 순간이다.
702
+ */
703
+ stage: z.ZodOptional<z.ZodNullable<z.ZodType<TranscriptStage, z.ZodTypeDef, TranscriptStage>>>;
656
704
  error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
657
705
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
658
706
  status: z.ZodEnum<["completed", "pending", "failed", "not_requested"]>;
659
707
  callId: z.ZodOptional<z.ZodString>;
660
708
  segmentCount: z.ZodOptional<z.ZodNumber>;
661
709
  segments: z.ZodOptional<z.ZodArray<z.ZodObject<{
662
- speaker: z.ZodEnum<["CUSTOMER", "AGENT"]>;
710
+ /**
711
+ * ⛔ **닫힌 enum 으로 두지 않는다.** 서버는 이미 `speaker_0` 을 보내고 있고, 세그먼트
712
+ * 하나가 어긋나면 `segments` 배열 때문에 **전사 응답 전체**가 실패한다.
713
+ */
714
+ speaker: z.ZodType<TranscriptSpeaker>;
663
715
  start: z.ZodNumber;
664
716
  end: z.ZodNumber;
665
717
  text: z.ZodString;
666
718
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
667
- speaker: z.ZodEnum<["CUSTOMER", "AGENT"]>;
719
+ /**
720
+ * ⛔ **닫힌 enum 으로 두지 않는다.** 서버는 이미 `speaker_0` 을 보내고 있고, 세그먼트
721
+ * 하나가 어긋나면 `segments` 배열 때문에 **전사 응답 전체**가 실패한다.
722
+ */
723
+ speaker: z.ZodType<TranscriptSpeaker>;
668
724
  start: z.ZodNumber;
669
725
  end: z.ZodNumber;
670
726
  text: z.ZodString;
671
727
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
672
- speaker: z.ZodEnum<["CUSTOMER", "AGENT"]>;
728
+ /**
729
+ * ⛔ **닫힌 enum 으로 두지 않는다.** 서버는 이미 `speaker_0` 을 보내고 있고, 세그먼트
730
+ * 하나가 어긋나면 `segments` 배열 때문에 **전사 응답 전체**가 실패한다.
731
+ */
732
+ speaker: z.ZodType<TranscriptSpeaker>;
673
733
  start: z.ZodNumber;
674
734
  end: z.ZodNumber;
675
735
  text: z.ZodString;
676
736
  }, z.ZodTypeAny, "passthrough">>, "many">>;
677
737
  startedAt: z.ZodOptional<z.ZodString>;
678
- stage: z.ZodOptional<z.ZodNullable<z.ZodEnum<["download", "runtime", "trigger"]>>>;
738
+ /**
739
+ * ⛔ **실패 단계는 서버 코드가 만든다** — 전사 파이프라인이 `download`·`runtime`·
740
+ * `transcription`·`recover` 를 내보내고, 영구 실패는 예외 객체의 속성을 그대로 싣는다.
741
+ * 어휘가 열려 있어 스펙의 enum 조차 스냅샷일 뿐이다.
742
+ *
743
+ * ⚠️ 여기가 닫혀 있으면 **전사가 실패했을 때 그 이유를 물으면 던진다** — 고객이 가장
744
+ * 답을 필요로 하는 순간이다.
745
+ */
746
+ stage: z.ZodOptional<z.ZodNullable<z.ZodType<TranscriptStage, z.ZodTypeDef, TranscriptStage>>>;
679
747
  error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
680
748
  }, z.ZodTypeAny, "passthrough">>;
681
749
  type TranscriptStatus = z.infer<typeof TranscriptStatusSchema>;
@@ -1240,14 +1308,36 @@ declare class Kakao extends APIResource {
1240
1308
  channelCategories(options?: RequestOptions$1): Promise<KakaoChannelCategoryList>;
1241
1309
  }
1242
1310
 
1311
+ /**
1312
+ * 메시지 상태.
1313
+ *
1314
+ * ⚠️ 한때 여기 `'sending'` 이 있었는데 **서버가 한 번도 보낸 적 없는 값**이다 — 어휘를 손으로
1315
+ * 관리하면 없는 값이 들어오고 있는 값이 빠진다. 그래서 이 유니온은 자동완성용이고,
1316
+ * 검증은 하지 않는다.
1317
+ */
1318
+ type MessageStatus = 'queued' | 'sent' | 'failed' | 'received' | (string & {});
1319
+ /**
1320
+ * 메시지 유형. `KakaoChannelStatus` 와 같은 이유로 **열린 유니온**이다 — 서버가 어휘를
1321
+ * 소유하므로 값이 하나 늘어도 조회는 살아 있어야 하고, 낡는 것은 자동완성뿐이다.
1322
+ */
1323
+ type MessageType = 'sms' | 'lms' | 'mms'
1324
+ /** 카카오 알림톡. */
1325
+ | 'ata'
1326
+ /** 카카오 브랜드 메시지. */
1327
+ | 'bms' | (string & {});
1243
1328
  declare const MessageSchema: z.ZodObject<{
1244
1329
  messageId: z.ZodString;
1245
- status: z.ZodEnum<["queued", "sending", "sent", "failed", "received"]>;
1330
+ status: z.ZodType<MessageStatus>;
1246
1331
  /**
1247
- * `'ata'` 는 카카오 알림톡이다. `body` 에는 템플릿에 변수를 치환한 결과가 담기고,
1248
- * 버튼·아이템 리스트·강조 문구는 템플릿에 검수된 대로 발송되어 이 값에는 담기지 않는다.
1332
+ * `'ata'`(알림톡)·`'bms'`(브랜드 메시지)카카오로 나간다. `body` 에는 템플릿에 변수를
1333
+ * 치환한 결과가 담기고, 버튼·아이템 리스트·강조 문구는 템플릿에 담긴 대로 발송되어
1334
+ * 이 값에는 담기지 않는다.
1335
+ *
1336
+ * ⛔ **닫힌 enum 으로 두지 않는다.** 어휘는 서버가 소유하므로, 유형이 하나 늘면 닫힌
1337
+ * enum 은 **목록을 통째로** 실패시킨다(`list()` 는 페이지를 한 번에 파싱한다). 실제로
1338
+ * 두 번 그렇게 터졌다 — `'ata'` 가 나왔을 때, 그리고 `'bms'` 가 나왔을 때.
1249
1339
  */
1250
- type: z.ZodEnum<["sms", "lms", "mms", "rcs", "ata"]>;
1340
+ type: z.ZodType<MessageType>;
1251
1341
  to: z.ZodString;
1252
1342
  from: z.ZodString;
1253
1343
  body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1260,12 +1350,17 @@ declare const MessageSchema: z.ZodObject<{
1260
1350
  dateUpdated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1261
1351
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1262
1352
  messageId: z.ZodString;
1263
- status: z.ZodEnum<["queued", "sending", "sent", "failed", "received"]>;
1353
+ status: z.ZodType<MessageStatus>;
1264
1354
  /**
1265
- * `'ata'` 는 카카오 알림톡이다. `body` 에는 템플릿에 변수를 치환한 결과가 담기고,
1266
- * 버튼·아이템 리스트·강조 문구는 템플릿에 검수된 대로 발송되어 이 값에는 담기지 않는다.
1355
+ * `'ata'`(알림톡)·`'bms'`(브랜드 메시지)카카오로 나간다. `body` 에는 템플릿에 변수를
1356
+ * 치환한 결과가 담기고, 버튼·아이템 리스트·강조 문구는 템플릿에 담긴 대로 발송되어
1357
+ * 이 값에는 담기지 않는다.
1358
+ *
1359
+ * ⛔ **닫힌 enum 으로 두지 않는다.** 어휘는 서버가 소유하므로, 유형이 하나 늘면 닫힌
1360
+ * enum 은 **목록을 통째로** 실패시킨다(`list()` 는 페이지를 한 번에 파싱한다). 실제로
1361
+ * 두 번 그렇게 터졌다 — `'ata'` 가 나왔을 때, 그리고 `'bms'` 가 나왔을 때.
1267
1362
  */
1268
- type: z.ZodEnum<["sms", "lms", "mms", "rcs", "ata"]>;
1363
+ type: z.ZodType<MessageType>;
1269
1364
  to: z.ZodString;
1270
1365
  from: z.ZodString;
1271
1366
  body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1278,12 +1373,17 @@ declare const MessageSchema: z.ZodObject<{
1278
1373
  dateUpdated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1279
1374
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1280
1375
  messageId: z.ZodString;
1281
- status: z.ZodEnum<["queued", "sending", "sent", "failed", "received"]>;
1376
+ status: z.ZodType<MessageStatus>;
1282
1377
  /**
1283
- * `'ata'` 는 카카오 알림톡이다. `body` 에는 템플릿에 변수를 치환한 결과가 담기고,
1284
- * 버튼·아이템 리스트·강조 문구는 템플릿에 검수된 대로 발송되어 이 값에는 담기지 않는다.
1378
+ * `'ata'`(알림톡)·`'bms'`(브랜드 메시지)카카오로 나간다. `body` 에는 템플릿에 변수를
1379
+ * 치환한 결과가 담기고, 버튼·아이템 리스트·강조 문구는 템플릿에 담긴 대로 발송되어
1380
+ * 이 값에는 담기지 않는다.
1381
+ *
1382
+ * ⛔ **닫힌 enum 으로 두지 않는다.** 어휘는 서버가 소유하므로, 유형이 하나 늘면 닫힌
1383
+ * enum 은 **목록을 통째로** 실패시킨다(`list()` 는 페이지를 한 번에 파싱한다). 실제로
1384
+ * 두 번 그렇게 터졌다 — `'ata'` 가 나왔을 때, 그리고 `'bms'` 가 나왔을 때.
1285
1385
  */
1286
- type: z.ZodEnum<["sms", "lms", "mms", "rcs", "ata"]>;
1386
+ type: z.ZodType<MessageType>;
1287
1387
  to: z.ZodString;
1288
1388
  from: z.ZodString;
1289
1389
  body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
package/dist/index.cjs CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var chunkLLPMUDNE_cjs = require('./chunk-LLPMUDNE.cjs');
6
6
  var chunkIYSPOOKH_cjs = require('./chunk-IYSPOOKH.cjs');
7
- var chunkEYI3ULDU_cjs = require('./chunk-EYI3ULDU.cjs');
7
+ var chunkNXCYAYFT_cjs = require('./chunk-NXCYAYFT.cjs');
8
8
  var zod = require('zod');
9
9
  var crypto = require('crypto');
10
10
 
@@ -43,7 +43,7 @@ var APIClient = class {
43
43
  Authorization: `Bearer ${this._apiKey}`,
44
44
  "Content-Type": "application/json",
45
45
  Accept: "application/json",
46
- "User-Agent": `claw-ops-node/${chunkEYI3ULDU_cjs.VERSION}`,
46
+ "User-Agent": `claw-ops-node/${chunkNXCYAYFT_cjs.VERSION}`,
47
47
  ...this._defaultHeaders
48
48
  };
49
49
  if (extra) Object.assign(headers, extra);
@@ -490,7 +490,11 @@ var CallControlResponseSchema = zod.z.object({
490
490
  status: zod.z.string()
491
491
  }).passthrough();
492
492
  var TranscriptSegmentSchema = zod.z.object({
493
- speaker: zod.z.enum(["CUSTOMER", "AGENT"]),
493
+ /**
494
+ * ⛔ **닫힌 enum 으로 두지 않는다.** 서버는 이미 `speaker_0` 을 보내고 있고, 세그먼트
495
+ * 하나가 어긋나면 `segments` 배열 때문에 **전사 응답 전체**가 실패한다.
496
+ */
497
+ speaker: zod.z.string(),
494
498
  start: zod.z.number(),
495
499
  end: zod.z.number(),
496
500
  text: zod.z.string()
@@ -501,7 +505,15 @@ var TranscriptStatusSchema = zod.z.object({
501
505
  segmentCount: zod.z.number().optional(),
502
506
  segments: zod.z.array(TranscriptSegmentSchema).optional(),
503
507
  startedAt: zod.z.string().optional(),
504
- stage: zod.z.enum(["download", "runtime", "trigger"]).nullable().optional(),
508
+ /**
509
+ * ⛔ **실패 단계는 서버 코드가 만든다** — 전사 파이프라인이 `download`·`runtime`·
510
+ * `transcription`·`recover` 를 내보내고, 영구 실패는 예외 객체의 속성을 그대로 싣는다.
511
+ * 어휘가 열려 있어 스펙의 enum 조차 스냅샷일 뿐이다.
512
+ *
513
+ * ⚠️ 여기가 닫혀 있으면 **전사가 실패했을 때 그 이유를 물으면 던진다** — 고객이 가장
514
+ * 답을 필요로 하는 순간이다.
515
+ */
516
+ stage: zod.z.string().nullable().optional(),
505
517
  error: zod.z.string().nullable().optional()
506
518
  }).passthrough();
507
519
  var TranscriptRequestAcceptedSchema = zod.z.object({
@@ -849,12 +861,17 @@ var Kakao = class extends APIResource {
849
861
  };
850
862
  var MessageSchema = zod.z.object({
851
863
  messageId: zod.z.string(),
852
- status: zod.z.enum(["queued", "sending", "sent", "failed", "received"]),
864
+ status: zod.z.string(),
853
865
  /**
854
- * `'ata'` 는 카카오 알림톡이다. `body` 에는 템플릿에 변수를 치환한 결과가 담기고,
855
- * 버튼·아이템 리스트·강조 문구는 템플릿에 검수된 대로 발송되어 이 값에는 담기지 않는다.
866
+ * `'ata'`(알림톡)·`'bms'`(브랜드 메시지)카카오로 나간다. `body` 에는 템플릿에 변수를
867
+ * 치환한 결과가 담기고, 버튼·아이템 리스트·강조 문구는 템플릿에 담긴 대로 발송되어
868
+ * 이 값에는 담기지 않는다.
869
+ *
870
+ * ⛔ **닫힌 enum 으로 두지 않는다.** 어휘는 서버가 소유하므로, 유형이 하나 늘면 닫힌
871
+ * enum 은 **목록을 통째로** 실패시킨다(`list()` 는 페이지를 한 번에 파싱한다). 실제로
872
+ * 두 번 그렇게 터졌다 — `'ata'` 가 나왔을 때, 그리고 `'bms'` 가 나왔을 때.
856
873
  */
857
- type: zod.z.enum(["sms", "lms", "mms", "rcs", "ata"]),
874
+ type: zod.z.string(),
858
875
  to: zod.z.string(),
859
876
  from: zod.z.string(),
860
877
  body: zod.z.string().nullable().optional(),
@@ -1384,7 +1401,7 @@ Object.defineProperty(exports, "UnprocessableEntityError", {
1384
1401
  });
1385
1402
  Object.defineProperty(exports, "VERSION", {
1386
1403
  enumerable: true,
1387
- get: function () { return chunkEYI3ULDU_cjs.VERSION; }
1404
+ get: function () { return chunkNXCYAYFT_cjs.VERSION; }
1388
1405
  });
1389
1406
  exports.APIClient = APIClient;
1390
1407
  exports.AccountContext = AccountContext;