@tbox.cn/app-module-parking 0.10.3 → 0.10.4

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/AGENTS.md CHANGED
@@ -1,16 +1,14 @@
1
1
  # module-parking —— 集成指引(AI 助手用)
2
2
 
3
- 本模块为商圈业务模块,声明消费以下服务槽(Port 接口定义见 `src/server/ports/`):
4
-
5
- - 服务槽清单:见 `tbox.module.json` 的 `contributes.services`(demand 侧,含 title/description meta)。
3
+ 本模块为商圈业务模块(停车:车位查询、缴费与车辆管理)。服务槽、接口清单、接入依赖与可选降级见本包
4
+ `INTEGRATION.md`(真源);结构事实(槽位/必选性)见本包 `tbox.module.json`。
6
5
 
7
6
  ## 自定义 API 对接(AI 集成)
8
7
 
9
- 用户为本模块服务槽配置「自定义 API」后,adapter 实施落点 = `packages/provider-custom/`
10
- (停车:车位查询、缴费与车辆管理)。实施步骤与完成判据见 `packages/provider-custom/AGENTS.md`;
11
- 本模块 Port 接口为 adapter 的实现契约(输入 `ServiceAdapterInput`:config/instanceId/credentialRef)。
8
+ 见本包 `INTEGRATION.md`(接入语义真源);实施落点与流程见应用根 `INTEGRATION.md`
9
+ 与 `packages/provider-custom/INTEGRATION.md`。
12
10
 
13
11
  ## 真实厂商接入
14
12
 
15
- 官方 provider 包形态(manifest 槽声明 + 独立包发布)参照 `modules/provider-mock`(极简形态)/ `modules/provider-mocktest`(带 configSchema 形态)结构样例与
16
- docs/reference/providers.md;厂商中立措辞纪律见该参考(本文件受 vendor-neutrality 门禁扫描)。
13
+ 见本包 `INTEGRATION.md`;官方 provider 包形态用 `tbox-app new provider <name>` 骨架
14
+ (应用态 `packages/provider-<id>` local 形态 / 仓库态 `modules/provider-<id>` 发布形态)。
package/INTEGRATION.md ADDED
@@ -0,0 +1,18 @@
1
+ # INTEGRATION —— module-parking(停车)接入指引
2
+
3
+ > 结构事实以本包 `tbox.module.json` 为准(`declare.consumes`:槽位与必选性、`declare.owns`:
4
+ > 服务归属);接口签名以消费的契约包 Port 为准(`packages/contracts-mall/src/services/`);本文件只写二者推不出的接入语义。
5
+
6
+ ## 服务与依赖
7
+
8
+ - **三读一写全必选**:parking.query / parking.payment / parking.vehicle(`optional:false`);
9
+ `parking.snapshot` 聚合槽由底层槽派生,落声明时跳过。
10
+ - **身份与定位键**:查询上下文携带 `scope.mallId` + `subjectId`(登录态 userId,匿名可缺);
11
+ 车辆/记录类接口以 `plateNo`/`vehicleRef`/`recordRef` 为定位键——`recordRef`/`vehicleRef`
12
+ 由你的列表接口下发、详情/操作接口按其解析,**归属校验(当前用户)由后端负责**。
13
+ - **跨槽顺序**:缴费与详情依赖 query/payment 槽的记录列表(recordRef 先有后有);车辆
14
+ 绑定列表驱动 query 槽「我的车」语义(无 plateNo 线索时扫描绑定车队)。
15
+ - **可选能力**:`ParkingQueryPort.requiresMembership?` 可选(缺席照常查询);
16
+ `probeParkedVehicles?` 可选(缺席按未入场渲染)。
17
+ - **开票语义**:`getInvoiceSettings` 返回 `parkingInvoiceEnabled`——后端不支持线上开票时
18
+ 如实返回 false,工具层据此收口(不得编造开票能力)。
@@ -1591,7 +1591,7 @@ function createParkingActions(ctx) {
1591
1591
  };
1592
1592
  }
1593
1593
  },
1594
- /** 2. 支付结果回调(三步链 step3:uploadResult + reconcile 权威收口,F5;补签通道专用不渲染按钮) */
1594
+ /** 2. 支付结果回调(三步链 step3:uploadResult + reconcile 权威收口,补签通道专用不渲染按钮) */
1595
1595
  reportPaymentResult: {
1596
1596
  actionId: "parking.report-payment-result",
1597
1597
  moduleId: "parking",
@@ -1773,7 +1773,7 @@ function createParkingActions(ctx) {
1773
1773
  }
1774
1774
  }
1775
1775
  },
1776
- /** 4-6. 车辆三操作(LLM 直写归零,D5;车牌正则校验) */
1776
+ /** 4-6. 车辆三操作(LLM 直写归零,车牌正则校验) */
1777
1777
  bindVehicle: {
1778
1778
  actionId: "parking.bind-vehicle",
1779
1779
  moduleId: "parking",
@@ -1919,7 +1919,7 @@ function createParkingActions(ctx) {
1919
1919
  };
1920
1920
  }
1921
1921
  },
1922
- /** 支付状态刷新(reconcile 轮询兜底;显式交互 R4)——P0 原地更新被点击卡 */
1922
+ /** 支付状态刷新(reconcile 轮询兜底;显式交互)—— 原地更新被点击卡 */
1923
1923
  refreshPayment: {
1924
1924
  actionId: "parking.refresh-payment",
1925
1925
  moduleId: "parking",
@@ -2493,7 +2493,7 @@ function createParkingTools(opts) {
2493
2493
  return withCards(
2494
2494
  facts,
2495
2495
  "parking-payment-result",
2496
- // note 契约(W7):状态/金额前置(答话可直接转述,如「浙A12345 支付成功 · 12 元」)
2496
+ // note 契约:状态/金额前置(答话可直接转述,如「浙A12345 支付成功 · 12 元」)
2497
2497
  `${current.plateNo} ${status === "PAID" ? "\u652F\u4ED8\u6210\u529F" : status === "CANCELLED" ? "\u652F\u4ED8\u5DF2\u53D6\u6D88" : "\u786E\u8BA4\u4E2D"} \xB7 ${formatCents(current.payableCents)}`
2498
2498
  );
2499
2499
  }
@@ -2,7 +2,7 @@ import { CardComponent } from '@tbox.cn/app-contracts';
2
2
  import { ClientContext } from '@tbox.cn/app-agent-sdk-client';
3
3
 
4
4
  /**
5
- * module-parking 客户端入口(与服务端 serverModule 对称;015 S5:5 卡)。
5
+ * module-parking 客户端入口(与服务端 serverModule 对称;5 卡)。
6
6
  */
7
7
 
8
8
  declare const cards: {
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  resolveParkingQueryPort,
7
7
  resolveParkingVehiclePort,
8
8
  serverModule
9
- } from "./chunk-VH3J7FEI.js";
9
+ } from "./chunk-PGSDWF4M.js";
10
10
  import {
11
11
  cards,
12
12
  clientModule
@@ -107,9 +107,9 @@ declare const parkingCards: {
107
107
  membership: zod.ZodOptional<zod.ZodObject<{
108
108
  state: zod.ZodEnum<["unauthenticated", "unknown", "active", "not_enrolled", "closed", "unavailable"]>;
109
109
  }, "strip", zod.ZodTypeAny, {
110
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
110
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
111
111
  }, {
112
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
112
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
113
113
  }>>;
114
114
  }, "strip", zod.ZodTypeAny, {
115
115
  bound: {
@@ -119,7 +119,7 @@ declare const parkingCards: {
119
119
  }[];
120
120
  message?: string | undefined;
121
121
  membership?: {
122
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
122
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
123
123
  } | undefined;
124
124
  }, {
125
125
  bound: {
@@ -129,7 +129,7 @@ declare const parkingCards: {
129
129
  }[];
130
130
  message?: string | undefined;
131
131
  membership?: {
132
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
132
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
133
133
  } | undefined;
134
134
  }>>;
135
135
  readonly 'parking-info': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
@@ -169,11 +169,11 @@ declare const parkingCards: {
169
169
  name: zod.ZodString;
170
170
  amountText: zod.ZodString;
171
171
  }, "strip", zod.ZodTypeAny, {
172
- amountText: string;
173
172
  name: string;
174
- }, {
175
173
  amountText: string;
174
+ }, {
176
175
  name: string;
176
+ amountText: string;
177
177
  }>, "many">;
178
178
  totalText: zod.ZodString;
179
179
  discountText: zod.ZodOptional<zod.ZodString>;
@@ -182,10 +182,10 @@ declare const parkingCards: {
182
182
  state: zod.ZodEnum<["unauthenticated", "unknown", "active", "not_enrolled", "closed", "unavailable"]>;
183
183
  availablePoints: zod.ZodOptional<zod.ZodNumber>;
184
184
  }, "strip", zod.ZodTypeAny, {
185
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
185
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
186
186
  availablePoints?: number | undefined;
187
187
  }, {
188
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
188
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
189
189
  availablePoints?: number | undefined;
190
190
  }>>;
191
191
  paymentOptions: zod.ZodOptional<zod.ZodObject<{
@@ -284,7 +284,7 @@ declare const parkingCards: {
284
284
  benefitRef: string;
285
285
  autoSelected: boolean;
286
286
  description?: string | undefined;
287
- kind?: "points" | "discount" | "coupon" | "other" | undefined;
287
+ kind?: "other" | "points" | "discount" | "coupon" | undefined;
288
288
  discountText?: string | undefined;
289
289
  exclusiveWithKinds?: ("points" | "discount" | "coupon")[] | undefined;
290
290
  }, {
@@ -292,7 +292,7 @@ declare const parkingCards: {
292
292
  benefitRef: string;
293
293
  autoSelected: boolean;
294
294
  description?: string | undefined;
295
- kind?: "points" | "discount" | "coupon" | "other" | undefined;
295
+ kind?: "other" | "points" | "discount" | "coupon" | undefined;
296
296
  discountText?: string | undefined;
297
297
  exclusiveWithKinds?: ("points" | "discount" | "coupon")[] | undefined;
298
298
  }>, "many">;
@@ -335,7 +335,6 @@ declare const parkingCards: {
335
335
  orderNo: zod.ZodOptional<zod.ZodString>;
336
336
  }, "strip", zod.ZodTypeAny, {
337
337
  kind: "pay" | "unpaid";
338
- parkingStoreId?: string | undefined;
339
338
  orderInfo?: {
340
339
  orderType: number;
341
340
  parkingId: string;
@@ -347,10 +346,10 @@ declare const parkingCards: {
347
346
  entranceTime?: string | undefined;
348
347
  supportDiscount?: string | undefined;
349
348
  } | undefined;
349
+ parkingStoreId?: string | undefined;
350
350
  orderNo?: string | undefined;
351
351
  }, {
352
352
  kind: "pay" | "unpaid";
353
- parkingStoreId?: string | undefined;
354
353
  orderInfo?: {
355
354
  orderType: number;
356
355
  parkingId: string;
@@ -362,6 +361,7 @@ declare const parkingCards: {
362
361
  entranceTime?: string | undefined;
363
362
  supportDiscount?: string | undefined;
364
363
  } | undefined;
364
+ parkingStoreId?: string | undefined;
365
365
  orderNo?: string | undefined;
366
366
  }>>;
367
367
  settlement: zod.ZodOptional<zod.ZodObject<{
@@ -369,18 +369,19 @@ declare const parkingCards: {
369
369
  text: zod.ZodString;
370
370
  }, "strip", zod.ZodTypeAny, {
371
371
  text: string;
372
- state: "paying" | "paid" | "failed";
372
+ state: "failed" | "paying" | "paid";
373
373
  }, {
374
374
  text: string;
375
- state: "paying" | "paid" | "failed";
375
+ state: "failed" | "paying" | "paid";
376
376
  }>>;
377
377
  }, "strip", zod.ZodTypeAny, {
378
- plateNo: string;
378
+ revision: number;
379
379
  caveats: string[];
380
380
  quoteRef: string;
381
+ plateNo: string;
381
382
  feeItems: {
382
- amountText: string;
383
383
  name: string;
384
+ amountText: string;
384
385
  }[];
385
386
  totalText: string;
386
387
  payableText: string;
@@ -394,18 +395,17 @@ declare const parkingCards: {
394
395
  benefitRef: string;
395
396
  autoSelected: boolean;
396
397
  description?: string | undefined;
397
- kind?: "points" | "discount" | "coupon" | "other" | undefined;
398
+ kind?: "other" | "points" | "discount" | "coupon" | undefined;
398
399
  discountText?: string | undefined;
399
400
  exclusiveWithKinds?: ("points" | "discount" | "coupon")[] | undefined;
400
401
  }[];
401
- revision: number;
402
- membership?: {
403
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
404
- availablePoints?: number | undefined;
405
- } | undefined;
406
402
  entryAtText?: string | undefined;
407
403
  durationText?: string | undefined;
408
404
  discountText?: string | undefined;
405
+ membership?: {
406
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
407
+ availablePoints?: number | undefined;
408
+ } | undefined;
409
409
  paymentOptions?: {
410
410
  direct: {
411
411
  benefitRefs: string[];
@@ -424,7 +424,6 @@ declare const parkingCards: {
424
424
  } | undefined;
425
425
  payHandoff?: {
426
426
  kind: "pay" | "unpaid";
427
- parkingStoreId?: string | undefined;
428
427
  orderInfo?: {
429
428
  orderType: number;
430
429
  parkingId: string;
@@ -436,19 +435,21 @@ declare const parkingCards: {
436
435
  entranceTime?: string | undefined;
437
436
  supportDiscount?: string | undefined;
438
437
  } | undefined;
438
+ parkingStoreId?: string | undefined;
439
439
  orderNo?: string | undefined;
440
440
  } | undefined;
441
441
  settlement?: {
442
442
  text: string;
443
- state: "paying" | "paid" | "failed";
443
+ state: "failed" | "paying" | "paid";
444
444
  } | undefined;
445
445
  }, {
446
- plateNo: string;
446
+ revision: number;
447
447
  caveats: string[];
448
448
  quoteRef: string;
449
+ plateNo: string;
449
450
  feeItems: {
450
- amountText: string;
451
451
  name: string;
452
+ amountText: string;
452
453
  }[];
453
454
  totalText: string;
454
455
  payableText: string;
@@ -462,18 +463,17 @@ declare const parkingCards: {
462
463
  benefitRef: string;
463
464
  autoSelected: boolean;
464
465
  description?: string | undefined;
465
- kind?: "points" | "discount" | "coupon" | "other" | undefined;
466
+ kind?: "other" | "points" | "discount" | "coupon" | undefined;
466
467
  discountText?: string | undefined;
467
468
  exclusiveWithKinds?: ("points" | "discount" | "coupon")[] | undefined;
468
469
  }[];
469
- revision: number;
470
- membership?: {
471
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
472
- availablePoints?: number | undefined;
473
- } | undefined;
474
470
  entryAtText?: string | undefined;
475
471
  durationText?: string | undefined;
476
472
  discountText?: string | undefined;
473
+ membership?: {
474
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
475
+ availablePoints?: number | undefined;
476
+ } | undefined;
477
477
  paymentOptions?: {
478
478
  direct: {
479
479
  benefitRefs: string[];
@@ -492,7 +492,6 @@ declare const parkingCards: {
492
492
  } | undefined;
493
493
  payHandoff?: {
494
494
  kind: "pay" | "unpaid";
495
- parkingStoreId?: string | undefined;
496
495
  orderInfo?: {
497
496
  orderType: number;
498
497
  parkingId: string;
@@ -504,11 +503,12 @@ declare const parkingCards: {
504
503
  entranceTime?: string | undefined;
505
504
  supportDiscount?: string | undefined;
506
505
  } | undefined;
506
+ parkingStoreId?: string | undefined;
507
507
  orderNo?: string | undefined;
508
508
  } | undefined;
509
509
  settlement?: {
510
510
  text: string;
511
- state: "paying" | "paid" | "failed";
511
+ state: "failed" | "paying" | "paid";
512
512
  } | undefined;
513
513
  }>>;
514
514
  readonly 'parking-payment-result': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
@@ -531,28 +531,28 @@ declare const parkingCards: {
531
531
  }>, "many">>;
532
532
  }, "strip", zod.ZodTypeAny, {
533
533
  message: string;
534
- status: "PAID" | "UNKNOWN" | "CANCELLED";
535
- plateNo: string;
534
+ status: "UNKNOWN" | "PAID" | "CANCELLED";
536
535
  paymentRef: string;
536
+ plateNo: string;
537
537
  amountText?: string | undefined;
538
538
  retryable?: boolean | undefined;
539
+ leaveNotice?: string | undefined;
539
540
  details?: {
540
541
  value: string;
541
542
  label: string;
542
543
  }[] | undefined;
543
- leaveNotice?: string | undefined;
544
544
  }, {
545
545
  message: string;
546
- status: "PAID" | "UNKNOWN" | "CANCELLED";
547
- plateNo: string;
546
+ status: "UNKNOWN" | "PAID" | "CANCELLED";
548
547
  paymentRef: string;
548
+ plateNo: string;
549
549
  amountText?: string | undefined;
550
550
  retryable?: boolean | undefined;
551
+ leaveNotice?: string | undefined;
551
552
  details?: {
552
553
  value: string;
553
554
  label: string;
554
555
  }[] | undefined;
555
- leaveNotice?: string | undefined;
556
556
  }>>;
557
557
  readonly 'parking-payment-records': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
558
558
  items: zod.ZodArray<zod.ZodObject<{
@@ -571,30 +571,30 @@ declare const parkingCards: {
571
571
  invoiceEligible: zod.ZodOptional<zod.ZodBoolean>;
572
572
  invoiceIssued: zod.ZodOptional<zod.ZodBoolean>;
573
573
  }, "strip", zod.ZodTypeAny, {
574
- status: "PAID" | "REFUNDED" | "CLOSED" | "UNKNOWN";
574
+ status: "UNKNOWN" | "PAID" | "REFUNDED" | "CLOSED";
575
575
  plateNo: string;
576
576
  amountText: string;
577
577
  recordRef: string;
578
578
  paidAtText: string;
579
579
  statusText?: string | undefined;
580
+ entryAtText?: string | undefined;
580
581
  parkName?: string | undefined;
581
582
  plazaName?: string | undefined;
582
- entryAtText?: string | undefined;
583
583
  exitAtText?: string | undefined;
584
584
  payOrderNoMasked?: string | undefined;
585
585
  orderCompleted?: boolean | undefined;
586
586
  invoiceEligible?: boolean | undefined;
587
587
  invoiceIssued?: boolean | undefined;
588
588
  }, {
589
- status: "PAID" | "REFUNDED" | "CLOSED" | "UNKNOWN";
589
+ status: "UNKNOWN" | "PAID" | "REFUNDED" | "CLOSED";
590
590
  plateNo: string;
591
591
  amountText: string;
592
592
  recordRef: string;
593
593
  paidAtText: string;
594
594
  statusText?: string | undefined;
595
+ entryAtText?: string | undefined;
595
596
  parkName?: string | undefined;
596
597
  plazaName?: string | undefined;
597
- entryAtText?: string | undefined;
598
598
  exitAtText?: string | undefined;
599
599
  payOrderNoMasked?: string | undefined;
600
600
  orderCompleted?: boolean | undefined;
@@ -606,45 +606,45 @@ declare const parkingCards: {
606
606
  caveats: zod.ZodArray<zod.ZodString, "many">;
607
607
  message: zod.ZodOptional<zod.ZodString>;
608
608
  }, "strip", zod.ZodTypeAny, {
609
+ total: number;
610
+ hasMore: boolean;
609
611
  items: {
610
- status: "PAID" | "REFUNDED" | "CLOSED" | "UNKNOWN";
612
+ status: "UNKNOWN" | "PAID" | "REFUNDED" | "CLOSED";
611
613
  plateNo: string;
612
614
  amountText: string;
613
615
  recordRef: string;
614
616
  paidAtText: string;
615
617
  statusText?: string | undefined;
618
+ entryAtText?: string | undefined;
616
619
  parkName?: string | undefined;
617
620
  plazaName?: string | undefined;
618
- entryAtText?: string | undefined;
619
621
  exitAtText?: string | undefined;
620
622
  payOrderNoMasked?: string | undefined;
621
623
  orderCompleted?: boolean | undefined;
622
624
  invoiceEligible?: boolean | undefined;
623
625
  invoiceIssued?: boolean | undefined;
624
626
  }[];
625
- total: number;
626
- hasMore: boolean;
627
627
  caveats: string[];
628
628
  message?: string | undefined;
629
629
  }, {
630
+ total: number;
631
+ hasMore: boolean;
630
632
  items: {
631
- status: "PAID" | "REFUNDED" | "CLOSED" | "UNKNOWN";
633
+ status: "UNKNOWN" | "PAID" | "REFUNDED" | "CLOSED";
632
634
  plateNo: string;
633
635
  amountText: string;
634
636
  recordRef: string;
635
637
  paidAtText: string;
636
638
  statusText?: string | undefined;
639
+ entryAtText?: string | undefined;
637
640
  parkName?: string | undefined;
638
641
  plazaName?: string | undefined;
639
- entryAtText?: string | undefined;
640
642
  exitAtText?: string | undefined;
641
643
  payOrderNoMasked?: string | undefined;
642
644
  orderCompleted?: boolean | undefined;
643
645
  invoiceEligible?: boolean | undefined;
644
646
  invoiceIssued?: boolean | undefined;
645
647
  }[];
646
- total: number;
647
- hasMore: boolean;
648
648
  caveats: string[];
649
649
  message?: string | undefined;
650
650
  }>>;
@@ -665,11 +665,11 @@ declare const serverModule: {
665
665
  name: zod.ZodString;
666
666
  amountText: zod.ZodString;
667
667
  }, "strip", zod.ZodTypeAny, {
668
- amountText: string;
669
668
  name: string;
670
- }, {
671
669
  amountText: string;
670
+ }, {
672
671
  name: string;
672
+ amountText: string;
673
673
  }>, "many">;
674
674
  totalText: zod.ZodString;
675
675
  discountText: zod.ZodOptional<zod.ZodString>;
@@ -678,10 +678,10 @@ declare const serverModule: {
678
678
  state: zod.ZodEnum<["unauthenticated", "unknown", "active", "not_enrolled", "closed", "unavailable"]>;
679
679
  availablePoints: zod.ZodOptional<zod.ZodNumber>;
680
680
  }, "strip", zod.ZodTypeAny, {
681
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
681
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
682
682
  availablePoints?: number | undefined;
683
683
  }, {
684
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
684
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
685
685
  availablePoints?: number | undefined;
686
686
  }>>;
687
687
  paymentOptions: zod.ZodOptional<zod.ZodObject<{
@@ -780,7 +780,7 @@ declare const serverModule: {
780
780
  benefitRef: string;
781
781
  autoSelected: boolean;
782
782
  description?: string | undefined;
783
- kind?: "points" | "discount" | "coupon" | "other" | undefined;
783
+ kind?: "other" | "points" | "discount" | "coupon" | undefined;
784
784
  discountText?: string | undefined;
785
785
  exclusiveWithKinds?: ("points" | "discount" | "coupon")[] | undefined;
786
786
  }, {
@@ -788,7 +788,7 @@ declare const serverModule: {
788
788
  benefitRef: string;
789
789
  autoSelected: boolean;
790
790
  description?: string | undefined;
791
- kind?: "points" | "discount" | "coupon" | "other" | undefined;
791
+ kind?: "other" | "points" | "discount" | "coupon" | undefined;
792
792
  discountText?: string | undefined;
793
793
  exclusiveWithKinds?: ("points" | "discount" | "coupon")[] | undefined;
794
794
  }>, "many">;
@@ -831,7 +831,6 @@ declare const serverModule: {
831
831
  orderNo: zod.ZodOptional<zod.ZodString>;
832
832
  }, "strip", zod.ZodTypeAny, {
833
833
  kind: "pay" | "unpaid";
834
- parkingStoreId?: string | undefined;
835
834
  orderInfo?: {
836
835
  orderType: number;
837
836
  parkingId: string;
@@ -843,10 +842,10 @@ declare const serverModule: {
843
842
  entranceTime?: string | undefined;
844
843
  supportDiscount?: string | undefined;
845
844
  } | undefined;
845
+ parkingStoreId?: string | undefined;
846
846
  orderNo?: string | undefined;
847
847
  }, {
848
848
  kind: "pay" | "unpaid";
849
- parkingStoreId?: string | undefined;
850
849
  orderInfo?: {
851
850
  orderType: number;
852
851
  parkingId: string;
@@ -858,6 +857,7 @@ declare const serverModule: {
858
857
  entranceTime?: string | undefined;
859
858
  supportDiscount?: string | undefined;
860
859
  } | undefined;
860
+ parkingStoreId?: string | undefined;
861
861
  orderNo?: string | undefined;
862
862
  }>>;
863
863
  settlement: zod.ZodOptional<zod.ZodObject<{
@@ -865,18 +865,19 @@ declare const serverModule: {
865
865
  text: zod.ZodString;
866
866
  }, "strip", zod.ZodTypeAny, {
867
867
  text: string;
868
- state: "paying" | "paid" | "failed";
868
+ state: "failed" | "paying" | "paid";
869
869
  }, {
870
870
  text: string;
871
- state: "paying" | "paid" | "failed";
871
+ state: "failed" | "paying" | "paid";
872
872
  }>>;
873
873
  }, "strip", zod.ZodTypeAny, {
874
- plateNo: string;
874
+ revision: number;
875
875
  caveats: string[];
876
876
  quoteRef: string;
877
+ plateNo: string;
877
878
  feeItems: {
878
- amountText: string;
879
879
  name: string;
880
+ amountText: string;
880
881
  }[];
881
882
  totalText: string;
882
883
  payableText: string;
@@ -890,18 +891,17 @@ declare const serverModule: {
890
891
  benefitRef: string;
891
892
  autoSelected: boolean;
892
893
  description?: string | undefined;
893
- kind?: "points" | "discount" | "coupon" | "other" | undefined;
894
+ kind?: "other" | "points" | "discount" | "coupon" | undefined;
894
895
  discountText?: string | undefined;
895
896
  exclusiveWithKinds?: ("points" | "discount" | "coupon")[] | undefined;
896
897
  }[];
897
- revision: number;
898
- membership?: {
899
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
900
- availablePoints?: number | undefined;
901
- } | undefined;
902
898
  entryAtText?: string | undefined;
903
899
  durationText?: string | undefined;
904
900
  discountText?: string | undefined;
901
+ membership?: {
902
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
903
+ availablePoints?: number | undefined;
904
+ } | undefined;
905
905
  paymentOptions?: {
906
906
  direct: {
907
907
  benefitRefs: string[];
@@ -920,7 +920,6 @@ declare const serverModule: {
920
920
  } | undefined;
921
921
  payHandoff?: {
922
922
  kind: "pay" | "unpaid";
923
- parkingStoreId?: string | undefined;
924
923
  orderInfo?: {
925
924
  orderType: number;
926
925
  parkingId: string;
@@ -932,19 +931,21 @@ declare const serverModule: {
932
931
  entranceTime?: string | undefined;
933
932
  supportDiscount?: string | undefined;
934
933
  } | undefined;
934
+ parkingStoreId?: string | undefined;
935
935
  orderNo?: string | undefined;
936
936
  } | undefined;
937
937
  settlement?: {
938
938
  text: string;
939
- state: "paying" | "paid" | "failed";
939
+ state: "failed" | "paying" | "paid";
940
940
  } | undefined;
941
941
  }, {
942
- plateNo: string;
942
+ revision: number;
943
943
  caveats: string[];
944
944
  quoteRef: string;
945
+ plateNo: string;
945
946
  feeItems: {
946
- amountText: string;
947
947
  name: string;
948
+ amountText: string;
948
949
  }[];
949
950
  totalText: string;
950
951
  payableText: string;
@@ -958,18 +959,17 @@ declare const serverModule: {
958
959
  benefitRef: string;
959
960
  autoSelected: boolean;
960
961
  description?: string | undefined;
961
- kind?: "points" | "discount" | "coupon" | "other" | undefined;
962
+ kind?: "other" | "points" | "discount" | "coupon" | undefined;
962
963
  discountText?: string | undefined;
963
964
  exclusiveWithKinds?: ("points" | "discount" | "coupon")[] | undefined;
964
965
  }[];
965
- revision: number;
966
- membership?: {
967
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
968
- availablePoints?: number | undefined;
969
- } | undefined;
970
966
  entryAtText?: string | undefined;
971
967
  durationText?: string | undefined;
972
968
  discountText?: string | undefined;
969
+ membership?: {
970
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
971
+ availablePoints?: number | undefined;
972
+ } | undefined;
973
973
  paymentOptions?: {
974
974
  direct: {
975
975
  benefitRefs: string[];
@@ -988,7 +988,6 @@ declare const serverModule: {
988
988
  } | undefined;
989
989
  payHandoff?: {
990
990
  kind: "pay" | "unpaid";
991
- parkingStoreId?: string | undefined;
992
991
  orderInfo?: {
993
992
  orderType: number;
994
993
  parkingId: string;
@@ -1000,11 +999,12 @@ declare const serverModule: {
1000
999
  entranceTime?: string | undefined;
1001
1000
  supportDiscount?: string | undefined;
1002
1001
  } | undefined;
1002
+ parkingStoreId?: string | undefined;
1003
1003
  orderNo?: string | undefined;
1004
1004
  } | undefined;
1005
1005
  settlement?: {
1006
1006
  text: string;
1007
- state: "paying" | "paid" | "failed";
1007
+ state: "failed" | "paying" | "paid";
1008
1008
  } | undefined;
1009
1009
  }>>;
1010
1010
  readonly 'parking-payment-result': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
@@ -1027,28 +1027,28 @@ declare const serverModule: {
1027
1027
  }>, "many">>;
1028
1028
  }, "strip", zod.ZodTypeAny, {
1029
1029
  message: string;
1030
- status: "PAID" | "UNKNOWN" | "CANCELLED";
1031
- plateNo: string;
1030
+ status: "UNKNOWN" | "PAID" | "CANCELLED";
1032
1031
  paymentRef: string;
1032
+ plateNo: string;
1033
1033
  amountText?: string | undefined;
1034
1034
  retryable?: boolean | undefined;
1035
+ leaveNotice?: string | undefined;
1035
1036
  details?: {
1036
1037
  value: string;
1037
1038
  label: string;
1038
1039
  }[] | undefined;
1039
- leaveNotice?: string | undefined;
1040
1040
  }, {
1041
1041
  message: string;
1042
- status: "PAID" | "UNKNOWN" | "CANCELLED";
1043
- plateNo: string;
1042
+ status: "UNKNOWN" | "PAID" | "CANCELLED";
1044
1043
  paymentRef: string;
1044
+ plateNo: string;
1045
1045
  amountText?: string | undefined;
1046
1046
  retryable?: boolean | undefined;
1047
+ leaveNotice?: string | undefined;
1047
1048
  details?: {
1048
1049
  value: string;
1049
1050
  label: string;
1050
1051
  }[] | undefined;
1051
- leaveNotice?: string | undefined;
1052
1052
  }>>;
1053
1053
  readonly 'parking-payment-records': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
1054
1054
  items: zod.ZodArray<zod.ZodObject<{
@@ -1067,30 +1067,30 @@ declare const serverModule: {
1067
1067
  invoiceEligible: zod.ZodOptional<zod.ZodBoolean>;
1068
1068
  invoiceIssued: zod.ZodOptional<zod.ZodBoolean>;
1069
1069
  }, "strip", zod.ZodTypeAny, {
1070
- status: "PAID" | "REFUNDED" | "CLOSED" | "UNKNOWN";
1070
+ status: "UNKNOWN" | "PAID" | "REFUNDED" | "CLOSED";
1071
1071
  plateNo: string;
1072
1072
  amountText: string;
1073
1073
  recordRef: string;
1074
1074
  paidAtText: string;
1075
1075
  statusText?: string | undefined;
1076
+ entryAtText?: string | undefined;
1076
1077
  parkName?: string | undefined;
1077
1078
  plazaName?: string | undefined;
1078
- entryAtText?: string | undefined;
1079
1079
  exitAtText?: string | undefined;
1080
1080
  payOrderNoMasked?: string | undefined;
1081
1081
  orderCompleted?: boolean | undefined;
1082
1082
  invoiceEligible?: boolean | undefined;
1083
1083
  invoiceIssued?: boolean | undefined;
1084
1084
  }, {
1085
- status: "PAID" | "REFUNDED" | "CLOSED" | "UNKNOWN";
1085
+ status: "UNKNOWN" | "PAID" | "REFUNDED" | "CLOSED";
1086
1086
  plateNo: string;
1087
1087
  amountText: string;
1088
1088
  recordRef: string;
1089
1089
  paidAtText: string;
1090
1090
  statusText?: string | undefined;
1091
+ entryAtText?: string | undefined;
1091
1092
  parkName?: string | undefined;
1092
1093
  plazaName?: string | undefined;
1093
- entryAtText?: string | undefined;
1094
1094
  exitAtText?: string | undefined;
1095
1095
  payOrderNoMasked?: string | undefined;
1096
1096
  orderCompleted?: boolean | undefined;
@@ -1102,45 +1102,45 @@ declare const serverModule: {
1102
1102
  caveats: zod.ZodArray<zod.ZodString, "many">;
1103
1103
  message: zod.ZodOptional<zod.ZodString>;
1104
1104
  }, "strip", zod.ZodTypeAny, {
1105
+ total: number;
1106
+ hasMore: boolean;
1105
1107
  items: {
1106
- status: "PAID" | "REFUNDED" | "CLOSED" | "UNKNOWN";
1108
+ status: "UNKNOWN" | "PAID" | "REFUNDED" | "CLOSED";
1107
1109
  plateNo: string;
1108
1110
  amountText: string;
1109
1111
  recordRef: string;
1110
1112
  paidAtText: string;
1111
1113
  statusText?: string | undefined;
1114
+ entryAtText?: string | undefined;
1112
1115
  parkName?: string | undefined;
1113
1116
  plazaName?: string | undefined;
1114
- entryAtText?: string | undefined;
1115
1117
  exitAtText?: string | undefined;
1116
1118
  payOrderNoMasked?: string | undefined;
1117
1119
  orderCompleted?: boolean | undefined;
1118
1120
  invoiceEligible?: boolean | undefined;
1119
1121
  invoiceIssued?: boolean | undefined;
1120
1122
  }[];
1121
- total: number;
1122
- hasMore: boolean;
1123
1123
  caveats: string[];
1124
1124
  message?: string | undefined;
1125
1125
  }, {
1126
+ total: number;
1127
+ hasMore: boolean;
1126
1128
  items: {
1127
- status: "PAID" | "REFUNDED" | "CLOSED" | "UNKNOWN";
1129
+ status: "UNKNOWN" | "PAID" | "REFUNDED" | "CLOSED";
1128
1130
  plateNo: string;
1129
1131
  amountText: string;
1130
1132
  recordRef: string;
1131
1133
  paidAtText: string;
1132
1134
  statusText?: string | undefined;
1135
+ entryAtText?: string | undefined;
1133
1136
  parkName?: string | undefined;
1134
1137
  plazaName?: string | undefined;
1135
- entryAtText?: string | undefined;
1136
1138
  exitAtText?: string | undefined;
1137
1139
  payOrderNoMasked?: string | undefined;
1138
1140
  orderCompleted?: boolean | undefined;
1139
1141
  invoiceEligible?: boolean | undefined;
1140
1142
  invoiceIssued?: boolean | undefined;
1141
1143
  }[];
1142
- total: number;
1143
- hasMore: boolean;
1144
1144
  caveats: string[];
1145
1145
  message?: string | undefined;
1146
1146
  }>>;
@@ -1162,9 +1162,9 @@ declare const serverModule: {
1162
1162
  membership: zod.ZodOptional<zod.ZodObject<{
1163
1163
  state: zod.ZodEnum<["unauthenticated", "unknown", "active", "not_enrolled", "closed", "unavailable"]>;
1164
1164
  }, "strip", zod.ZodTypeAny, {
1165
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
1165
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
1166
1166
  }, {
1167
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
1167
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
1168
1168
  }>>;
1169
1169
  }, "strip", zod.ZodTypeAny, {
1170
1170
  bound: {
@@ -1174,7 +1174,7 @@ declare const serverModule: {
1174
1174
  }[];
1175
1175
  message?: string | undefined;
1176
1176
  membership?: {
1177
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
1177
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
1178
1178
  } | undefined;
1179
1179
  }, {
1180
1180
  bound: {
@@ -1184,7 +1184,7 @@ declare const serverModule: {
1184
1184
  }[];
1185
1185
  message?: string | undefined;
1186
1186
  membership?: {
1187
- state: "unknown" | "unauthenticated" | "active" | "not_enrolled" | "closed" | "unavailable";
1187
+ state: "unknown" | "unavailable" | "unauthenticated" | "active" | "not_enrolled" | "closed";
1188
1188
  } | undefined;
1189
1189
  }>>;
1190
1190
  readonly 'parking-info': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
@@ -6,7 +6,7 @@ import {
6
6
  resolveParkingQueryPort,
7
7
  resolveParkingVehiclePort,
8
8
  serverModule
9
- } from "../chunk-VH3J7FEI.js";
9
+ } from "../chunk-PGSDWF4M.js";
10
10
  export {
11
11
  InMemoryParkingService,
12
12
  inMemoryParking,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-module-parking",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "type": "module",
5
5
  "description": "商圈停车模块:计费支付、车辆寻车、缴费记录与开票(codegen 源)。",
6
6
  "exports": {
@@ -19,9 +19,9 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@tbox.cn/app-contracts": "0.12.3",
22
- "@tbox.cn/app-contracts-mall": "0.12.3",
23
- "@tbox.cn/app-agent-sdk-client": "0.1.3",
24
- "@tbox.cn/app-agent-sdk-server": "0.1.4"
22
+ "@tbox.cn/app-contracts-mall": "0.12.4",
23
+ "@tbox.cn/app-agent-sdk-client": "0.1.4",
24
+ "@tbox.cn/app-agent-sdk-server": "0.2.1"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "zod": "3.25.76",
@@ -49,7 +49,8 @@
49
49
  "README.md",
50
50
  "LICENSE",
51
51
  "skills",
52
- "AGENTS.md"
52
+ "AGENTS.md",
53
+ "INTEGRATION.md"
53
54
  ],
54
55
  "engines": {
55
56
  "node": ">=20.0.0"
@@ -1,5 +1,5 @@
1
1
  /**
2
- * module-parking 客户端卡片聚合(0.4.0 D6:一卡一目录)。
2
+ * module-parking 客户端卡片聚合(0.4.0 一卡一目录)。
3
3
  */
4
4
  export { default as ParkingPaymentCard } from './parking-payment';
5
5
  export { default as ParkingPaymentResultCard } from './parking-payment-result';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * parking-payment 富卡渲染器(0.4.0 D1/D6/D10 范式卡)。
2
+ * parking-payment 富卡渲染器(0.4.0// 范式卡)。
3
3
  * 视觉源:POC components/parking/src/client/cards/ParkingPaymentCard.tsx(结构对齐,字段按 B 契约)。
4
4
  * 自渲染动作(markSelfRendering):卡内勾选/重算/支付,SDK 默认按钮条跳过。
5
5
  * actionId 无版本后缀(B 架构,非 POC 的 @1)。
@@ -1,5 +1,5 @@
1
1
  /**
2
- * parking-payment-records 富卡(0.4.0 D6):前 5 条 + 展开收起 + 状态色。
2
+ * parking-payment-records 富卡(0.4.0):前 5 条 + 展开收起 + 状态色。
3
3
  * 点击任意记录行弹出底部半屏 Sheet 展示订单详情。
4
4
  */
5
5
  import { useEffect, useId, useRef, useState } from 'react';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * parking-payment-result 富卡(0.4.0 D6/D10):三态 + retryable 刷新。
2
+ * parking-payment-result 富卡(0.4.0/):三态 + retryable 刷新。
3
3
  */
4
4
  import { CheckCircle, Clock, WarningCircle } from '@phosphor-icons/react';
5
5
  import { sendCardAction, markSelfRendering } from '@tbox.cn/app-agent-sdk-client';
@@ -79,5 +79,5 @@ export function ParkingPaymentResultCard(props: {
79
79
  );
80
80
  }
81
81
 
82
- // 0.4.0 D10 评审补位:卡内"刷新支付状态"按钮(paymentRef 依赖卡数据)自持动作,跳过 SDK 默认按钮条
82
+ // 0.4.0 评审补位:卡内"刷新支付状态"按钮(paymentRef 依赖卡数据)自持动作,跳过 SDK 默认按钮条
83
83
  export default markSelfRendering(ParkingPaymentResultCard);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * parking 展示纯函数(0.4.0 D6:状态文案/色类/车牌排版,可单测)。
2
+ * parking 展示纯函数(0.4.0 状态文案/色类/车牌排版,可单测)。
3
3
  */
4
4
  import { PARKING_PLATE_PATTERN } from '@tbox.cn/app-contracts-mall';
5
5
 
@@ -1,7 +1,7 @@
1
1
  /**
2
- * module-parking 客户端入口(与服务端 serverModule 对称;015 S5:5 卡)。
2
+ * module-parking 客户端入口(与服务端 serverModule 对称;5 卡)。
3
3
  */
4
- import './styles/parking.css'; // 0.4.0 D1:模块自持 CSS(副作用 import,首行保证先行加载)
4
+ import './styles/parking.css'; // 0.4.0 模块自持 CSS(副作用 import,首行保证先行加载)
5
5
 
6
6
  import type { CardComponent } from '@tbox.cn/app-contracts';
7
7
  import type { ClientContext, ClientModule } from '@tbox.cn/app-agent-sdk-client';
@@ -1,2 +1,2 @@
1
- /** 0.4.0 D1:模块自持 CSS(经 tsup loader: { '.css': 'copy' } 出货,样式在应用侧生效) */
1
+ /** 0.4.0 模块自持 CSS(经 tsup loader: { '.css': 'copy' } 出货,样式在应用侧生效) */
2
2
  declare module '*.css';
@@ -1,10 +1,10 @@
1
1
  /**
2
- * parking 写动作(10 动作;LLM 直写归零 D5)。
2
+ * parking 写动作(10 动作;LLM 直写归零)。
3
3
  *
4
- * 支付三步链(R2):
4
+ * 支付三步链:
5
5
  * confirm-payment(建单+签名+PAYING 持久化 → payment effect)
6
6
  * → [client tradePay(SDK host-effect-runner)]
7
- * → report-payment-result(uploadResult + reconcile 权威收口 F5 → 结果卡)
7
+ * → report-payment-result(uploadResult + reconcile 权威收口 → 结果卡)
8
8
  *
9
9
  * 全部 singleUse + grant 闭环;cards key = meta.cardType。
10
10
  */
@@ -179,7 +179,7 @@ export function createParkingActions(
179
179
  return { text: '缴费失败:缺少会话上下文或报价引用' };
180
180
  }
181
181
 
182
- // revision CAS(旧卡重放/缓存过期拒绝——恒实时语义下用户重新查询即得新报价,W4)
182
+ // revision CAS(旧卡重放/缓存过期拒绝——恒实时语义下用户重新查询即得新报价)
183
183
  const expectedRevision = revision ? Number(revision) : undefined;
184
184
  let quote = expectedRevision
185
185
  ? await assertQuoteRevision(state, quoteRef, expectedRevision, owner)
@@ -367,7 +367,7 @@ export function createParkingActions(
367
367
 
368
368
  // PAYING 持久化(悬挂收口锚点,V2)
369
369
  // quoteProjection:报价投影随建单快照(对齐 entryAt 同模式——PAID 原卡翻转
370
- // 要重灌终态卡数据,而 W4 报价缓存仅 UNPAID 态可见、届时不可达)
370
+ // 要重灌终态卡数据,而 报价缓存仅 UNPAID 态可见、届时不可达)
371
371
  await persistPaymentOperation(state, {
372
372
  paymentRef,
373
373
  providerPaymentRef,
@@ -392,7 +392,7 @@ export function createParkingActions(
392
392
  },
393
393
  });
394
394
 
395
- // step2:payment effect(dispatcher 补签 → client tradePay,R1 orderInfo 内联)
395
+ // step2:payment effect(dispatcher 补签 → client tradePay, orderInfo 内联)
396
396
  // 同时原地终结缴费卡:token 已 singleUse 消费、revision 已锁定,这张报价单不能再提交。
397
397
  // 支付的最终成败经 report-payment-result 落在回执卡上——effect 回传无卡锚点
398
398
  // (chat-store sendModuleAction 恒 surfaceId:''),服务端无法二次原地更新本卡。
@@ -416,7 +416,7 @@ export function createParkingActions(
416
416
  },
417
417
  },
418
418
 
419
- /** 2. 支付结果回调(三步链 step3:uploadResult + reconcile 权威收口,F5;补签通道专用不渲染按钮) */
419
+ /** 2. 支付结果回调(三步链 step3:uploadResult + reconcile 权威收口,补签通道专用不渲染按钮) */
420
420
  reportPaymentResult: {
421
421
  actionId: 'parking.report-payment-result',
422
422
  moduleId: 'parking',
@@ -461,7 +461,7 @@ export function createParkingActions(
461
461
  );
462
462
  return undefined;
463
463
  });
464
- // F5:收口判定恒 reconcile 权威回查(客户端 status 仅上报)
464
+ // 收口判定恒 reconcile 权威回查(客户端 status 仅上报)
465
465
  const final = await s.service.reconcile(s.q, op.providerPaymentRef);
466
466
  const settled = await settlePaymentOperation(
467
467
  state,
@@ -475,7 +475,7 @@ export function createParkingActions(
475
475
  const current = settled ?? op;
476
476
 
477
477
  if (current.status === 'PAID') {
478
- // PAID 原卡翻转(host-effect-card-anchor D2 出/刷二分):经 dispatcher 签名锚定
478
+ // PAID 原卡翻转(host-effect-card-anchor 出/刷二分):经 dispatcher 签名锚定
479
479
  // 原地回写发起报价卡——成功回执新卡冗余(历史凭证由缴费记录卡兜底)。
480
480
  // 投影缺失(存量 PAYING 单、旧版本发起)降级出新回执卡,零回归。
481
481
  if (current.quoteProjection) {
@@ -638,7 +638,7 @@ export function createParkingActions(
638
638
  },
639
639
  },
640
640
 
641
- /** 4-6. 车辆三操作(LLM 直写归零,D5;车牌正则校验) */
641
+ /** 4-6. 车辆三操作(LLM 直写归零,车牌正则校验) */
642
642
  bindVehicle: {
643
643
  actionId: 'parking.bind-vehicle',
644
644
  moduleId: 'parking',
@@ -805,7 +805,7 @@ export function createParkingActions(
805
805
  },
806
806
  },
807
807
 
808
- /** 支付状态刷新(reconcile 轮询兜底;显式交互 R4)——P0 原地更新被点击卡 */
808
+ /** 支付状态刷新(reconcile 轮询兜底;显式交互)—— 原地更新被点击卡 */
809
809
  refreshPayment: {
810
810
  actionId: 'parking.refresh-payment',
811
811
  moduleId: 'parking',
@@ -1,4 +1,4 @@
1
- /** parking 卡 meta 聚合(015 S5:5 卡;key 约定 = meta.cardType;书序与 CardMeta.order 预览序位一致) */
1
+ /** parking 卡 meta 聚合(5 卡;key 约定 = meta.cardType;书序与 CardMeta.order 预览序位一致) */
2
2
  import parkingVehicleManagement from './parking-vehicle-management/meta';
3
3
  import parkingInfo from './parking-info/meta';
4
4
  import parkingPayment from './parking-payment/meta';
@@ -1,8 +1,8 @@
1
1
  /**
2
- * 停车域状态机与收口纯函数(015 S5)。
3
- * - 报价缓存:仅未支付态、TTL 5min(W4 前提一)
2
+ * 停车域状态机与收口纯函数。
3
+ * - 报价缓存:仅未支付态、TTL 5min(前提一)
4
4
  * - 支付操作:PAYING →(reconcile 权威)→ PAID/CANCELLED;UNKNOWN 悬挂(V2:下次交互收口)
5
- * - 收口规则(W4 前提三):查询命中已支付态 → 自动收口 PaymentOperation
5
+ * - 收口规则(前提三):查询命中已支付态 → 自动收口 PaymentOperation
6
6
  */
7
7
  import { createHash, randomUUID } from 'node:crypto';
8
8
  import type {
@@ -15,7 +15,7 @@ import type {
15
15
  export const PARKING_QUOTE_NAMESPACE = 'parking.quotes';
16
16
  export const PARKING_PAYMENT_NAMESPACE = 'parking.payment-operations';
17
17
  export const PARKING_LATEST_PAYMENT_NAMESPACE = 'parking.latest-payment';
18
- /** quoteRef → paymentRef 映射(W4 收口接线:queryFee 命中 PAID 时反查悬挂操作) */
18
+ /** quoteRef → paymentRef 映射(收口接线:queryFee 命中 PAID 时反查悬挂操作) */
19
19
  export const PARKING_QUOTE_PAYMENT_NAMESPACE = 'parking.quote-payment';
20
20
  export const QUOTE_TTL_MS = 5 * 60 * 1000;
21
21
  export const PAYMENT_OPERATION_TTL_MS = 24 * 60 * 60 * 1000;
@@ -54,7 +54,7 @@ type OwnedQuoteSnapshot = QuoteSnapshot & {
54
54
  readonly ownerMallId: string;
55
55
  };
56
56
 
57
- /** 报价缓存(W4:仅未支付态缓存;PAYING/PAID 直接穿透过厂商) */
57
+ /** 报价缓存(仅未支付态缓存;PAYING/PAID 直接穿透过厂商) */
58
58
  export async function cacheQuote(
59
59
  state: StoreLike,
60
60
  quote: QuoteSnapshot,
@@ -98,7 +98,7 @@ export async function assertQuoteRevision(
98
98
  return cached.revision === expectedRevision ? cached : null;
99
99
  }
100
100
 
101
- /** 支付操作持久化(建单成功 → PAYING;F5:收口判定恒 reconcile) */
101
+ /** 支付操作持久化(建单成功 → PAYING;收口判定恒 reconcile) */
102
102
  export async function persistPaymentOperation(
103
103
  state: StoreLike,
104
104
  op: PaymentOperation,
@@ -161,7 +161,7 @@ function paymentOwnerRef(subjectId: string, mallId: string): string {
161
161
  .digest('hex');
162
162
  }
163
163
 
164
- /** quoteRef → paymentRef 映射(confirm 建单时写入;W4 收口反查锚点) */
164
+ /** quoteRef → paymentRef 映射(confirm 建单时写入; 收口反查锚点) */
165
165
  export async function recordQuotePayment(
166
166
  state: StoreLike,
167
167
  quoteRef: string,
@@ -193,7 +193,7 @@ function quoteOwnerRef(quoteRef: string, owner: QuoteOwner): string {
193
193
  .digest('hex');
194
194
  }
195
195
 
196
- /** reconcile 收口(F5 唯一写 PAID 的路径) */
196
+ /** reconcile 收口(唯一写 PAID 的路径) */
197
197
  export async function settlePaymentOperation(
198
198
  state: StoreLike,
199
199
  paymentRef: string,
@@ -226,7 +226,7 @@ export async function settlePaymentOperation(
226
226
  }
227
227
 
228
228
  /**
229
- * W4 前提三:已支付态查询命中 → 自动收口悬挂 PAYING 操作。
229
+ * 前提三:已支付态查询命中 → 自动收口悬挂 PAYING 操作。
230
230
  * 工具每次查询(queryFee/records)后调用;paidSignal = 厂商侧已支付证据。
231
231
  */
232
232
  export async function autoSettleOnPaidEvidence(
@@ -8,7 +8,7 @@ import { toIntentQueryContext } from './intent-context';
8
8
  import { buildParkingPaymentFacts, parkingMembershipGate } from './tools';
9
9
  import type { StoreLike } from './domain';
10
10
 
11
- /** 停车缴费硬路由关键词(W3-3 自模板 intent-routes.ts 迁入——意图与处理器同处定义,011 D7):
11
+ /** 停车缴费硬路由关键词(自模板 intent-routes.ts 迁入——意图与处理器同处定义):
12
12
  * 整句全等命中(match:'exact',不入 BM25 词袋)绕过 LLM 工具选择;intent action 与
13
13
  * 显式路由 query-fee 分支同实现出报价卡。queryFee 无车牌时走扫描绑定车队逻辑(不追问车牌)。 */
14
14
  const PARKING_PAY_PHRASES = [
@@ -1,3 +1,9 @@
1
+ /**
2
+ * module-parking 服务端入口(双端自注册闭环——见模块 AGENTS.md 与 INTEGRATION.md)。
3
+ * 职责:停车查询/缴费/车辆三槽解析 + 费用/缴费/车辆工具族 + 停车卡族 + 缴费动作。
4
+ * 入口约定:register 只注册不解析(resolveService 仅 handle/事件回调内);cards map 的
5
+ * key = meta.cardType;卡片动作上下文唯一来源 = execute 第二参 reqCtx。
6
+ */
1
7
  import type {
2
8
  ServerContext,
3
9
  ServerModule,
@@ -38,7 +44,7 @@ const getCtx = (): ServerContext => {
38
44
  const tools = createParkingTools({ getCtx });
39
45
 
40
46
  /**
41
- * 停车费问句确定性预执行(W5 P0,2026-09-01):费用意图轮零 LLM 预执行出报价卡。
47
+ * 停车费问句确定性预执行(2026-09-01):费用意图轮零 LLM 预执行出报价卡。
42
48
  * - 零参 run:queryParkingFee 服务端自动扫描在场车(与「我的车」问词语义恰好匹配);
43
49
  * - 四门 decide 见 tools.ts decideParkingFeePreRun(纯函数单源,测试直测);
44
50
  * - silent:不发前端事件;结果 reminder 注入 + cards 经 capture 入本轮候选池;
@@ -98,7 +104,7 @@ export const serverModule = {
98
104
  // InMemory 单例恒注册(跨模块消费方 resolveService 兼容;真实供给经三槽 resolver(query/payment/vehicle)槽位轴)
99
105
  ctx.services.register('parking', inMemoryParking);
100
106
 
101
- // 停车快览工厂(parking.snapshot,W3-3):首页联单面板跨模块消费面
107
+ // 停车快览工厂(parking.snapshot):首页联单面板跨模块消费面
102
108
  // (绑定车辆列表 + 在场探测)。query 槽 Pick 子集——可选能力口(probeParkedVehicles)
103
109
  // 缺席性透传;工厂运行期执行(注册期纯净铁律)。
104
110
  ctx.services.register(
@@ -45,7 +45,7 @@ async function resolveParkingSlot<T>(
45
45
  })) as T;
46
46
  } catch (e) {
47
47
  if (isExpectedProviderAbsence(e)) return fallback; // 预期缺席 → InMemory 兜底
48
- throw e; // PROVIDER_NOT_IMPLEMENTED 等非预期缺席 → 上抛(配置即声明,F5 起无回退)
48
+ throw e; // PROVIDER_NOT_IMPLEMENTED 等非预期缺席 → 上抛(配置即声明, 起无回退)
49
49
  }
50
50
  }
51
51
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * InMemory 停车服务(015 S5:新三 Port 形状;演示/单测/未装配 provider 降级)。
2
+ * InMemory 停车服务(新三 Port 形状;演示/单测/未装配 provider 降级)。
3
3
  * mock 语义:
4
4
  * - queryFee 按 plateNo 生成报价(3 小时 15 元演示费率;已在场记忆)
5
5
  * - reprice 权益重选(member-95 折 / points-5 元抵扣 2 项演示权益),revision 递增
@@ -3,7 +3,7 @@
3
3
  * 出卡(v2 契约):出参 cards 字段声明 cardType,data 形状与 parkingCardDataSchemas 对齐;
4
4
  * found:false 等无价值结果分支不产 cards(不出卡语义)。
5
5
  * 上下文统一化:运行上下文 = 工具 execute 第二参(requireToolRequestContext 显式读取);
6
- * 查询恒实时(W4)。
6
+ * 查询恒实时。
7
7
  */
8
8
  import { createTool, coerceStringifiedFields, withCardEmissionHint } from '@tbox.cn/app-agent-sdk-server';
9
9
  import type { ServerContext, ToolExecContextLike } from '@tbox.cn/app-agent-sdk-server';
@@ -175,7 +175,7 @@ export async function buildParkingPaymentFacts(input: {
175
175
  quote: QuoteSnapshot;
176
176
  }) {
177
177
  const quote = input.quote;
178
- // W4:仅未支付态缓存(confirm revision CAS 依赖);已支付态命中 → 自动收口悬挂 PAYING
178
+ // 仅未支付态缓存(confirm revision CAS 依赖);已支付态命中 → 自动收口悬挂 PAYING
179
179
  const owner = paymentOwner(input.q);
180
180
  if (owner) await cacheQuote(input.state, quote, owner);
181
181
  const paidRef =
@@ -679,7 +679,7 @@ export function createParkingTools(opts: { getCtx: () => ServerContext }) {
679
679
  return withCards(
680
680
  facts,
681
681
  'parking-payment-result',
682
- // note 契约(W7):状态/金额前置(答话可直接转述,如「浙A12345 支付成功 · 12 元」)
682
+ // note 契约:状态/金额前置(答话可直接转述,如「浙A12345 支付成功 · 12 元」)
683
683
  `${current.plateNo} ${
684
684
  status === 'PAID' ? '支付成功' : status === 'CANCELLED' ? '支付已取消' : '确认中'
685
685
  } · ${formatCents(current.payableCents)}`,
@@ -736,7 +736,7 @@ export function createParkingTools(opts: { getCtx: () => ServerContext }) {
736
736
  },
737
737
  });
738
738
 
739
- // W2(2026-09-01):出卡工具创建点单点 wrap(description 追加预告知句)——
739
+ //(2026-09-01):出卡工具创建点单点 wrap(description 追加预告知句)——
740
740
  // 注册与 preTool 声明均使用 wrapped 实例;locateVehicle 无卡不 wrap。
741
741
  return {
742
742
  queryParkingFee: withCardEmissionHint(queryParkingFee, { actions: true }),
@@ -798,7 +798,7 @@ export type {
798
798
  ParkingVehiclePort,
799
799
  } from '@tbox.cn/app-contracts-mall';
800
800
 
801
- // ===== W5 P0(2026-09-01):停车费问句四门 decide(纯函数,index.ts preTool 接线) =====
801
+ // ===== (2026-09-01):停车费问句四门 decide(纯函数,index.ts preTool 接线) =====
802
802
 
803
803
  /** 费用意图(停车费/缴费/出场费/待支付/停车单) */
804
804
  export const PARKING_FEE_INTENT_RE = /停车费|停车缴|缴费|出场费|待支付|停车单/;