@harrylabsj/kiwi 0.10.0 → 0.12.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.
- package/README.md +4 -1
- package/contracts/card-publication/0.1.2/request.schema.json +78 -0
- package/contracts/kiwi-contracts.lock.json +2 -2
- package/contracts/manifest.json +127 -1
- package/contracts/merchant-management/1.0/README.md +109 -0
- package/contracts/merchant-management/1.0/approval-decision.schema.json +16 -0
- package/contracts/merchant-management/1.0/approval-preview.schema.json +26 -0
- package/contracts/merchant-management/1.0/connector-delivery-manifest.schema.json +78 -0
- package/contracts/merchant-management/1.0/management-error.schema.json +30 -0
- package/contracts/merchant-management/1.0/operation-receipt.schema.json +28 -0
- package/contracts/merchant-management/1.0/runtime-management-descriptor.schema.json +33 -0
- package/contracts/merchant-management/1.0/runtime-status.schema.json +42 -0
- package/contracts/merchant-rfq/0.1.0/delivery-record.schema.json +206 -0
- package/contracts/merchant-rfq/0.1.0/fact-snapshot.schema.json +118 -0
- package/contracts/merchant-rfq/0.1.0/handoff-record.schema.json +251 -0
- package/contracts/merchant-rfq/0.1.0/pricing-input.schema.json +139 -0
- package/contracts/merchant-rfq/0.1.0/quote-revision.schema.json +153 -0
- package/contracts/merchant-rfq/0.1.0/release-request.schema.json +121 -0
- package/contracts/merchant-rfq/0.1.0/rfq-case.schema.json +357 -0
- package/contracts/merchant-rfq/0.1.0/source-record.schema.json +162 -0
- package/contracts/merchant-workbench/1.0/README.md +6 -0
- package/contracts/merchant-workbench/1.0/money.schema.json +19 -0
- package/contracts/merchant-workbench/1.0/problem.schema.json +73 -0
- package/contracts/runtime-binding/0.1.2/binding-request.schema.json +73 -0
- package/contracts/runtime-binding/0.1.2/claims.schema.json +100 -0
- package/contracts/runtime-binding/0.1.2/document.schema.json +163 -0
- package/contracts/vectors/binding-thumbprint.json +15 -0
- package/dist/a2a/node.d.ts +98 -2
- package/dist/a2a/node.js +252 -100
- package/dist/a2a/node.js.map +1 -1
- package/dist/a2a/server/errors.d.ts +8 -0
- package/dist/a2a/server/errors.js +8 -0
- package/dist/a2a/server/errors.js.map +1 -1
- package/dist/a2a/server/merchant-handler.d.ts +13 -0
- package/dist/a2a/server/merchant-handler.js +294 -47
- package/dist/a2a/server/merchant-handler.js.map +1 -1
- package/dist/a2a/server/pipeline.d.ts +15 -10
- package/dist/a2a/server/pipeline.js +49 -18
- package/dist/a2a/server/pipeline.js.map +1 -1
- package/dist/a2a/server/server.d.ts +20 -1
- package/dist/a2a/server/server.js +87 -13
- package/dist/a2a/server/server.js.map +1 -1
- package/dist/a2a/server/task-registry.d.ts +31 -11
- package/dist/a2a/server/task-registry.js +65 -20
- package/dist/a2a/server/task-registry.js.map +1 -1
- package/dist/a2a/server/types.d.ts +24 -0
- package/dist/a2a/signing-key.d.ts +6 -0
- package/dist/a2a/signing-key.js +12 -0
- package/dist/a2a/signing-key.js.map +1 -1
- package/dist/agent/buyer/buyer-tools.d.ts +2 -2
- package/dist/agent/buyer/buyer-tools.js +1 -1
- package/dist/agent/buyer/buyer-tools.js.map +1 -1
- package/dist/agent/chat-tools.d.ts +2 -11
- package/dist/agent/chat-tools.js.map +1 -1
- package/dist/agent/fake-chat-model.d.ts +3 -3
- package/dist/agent/fake-chat-model.js +3 -5
- package/dist/agent/fake-chat-model.js.map +1 -1
- package/dist/agent/host/web-renderer.d.ts +5 -0
- package/dist/agent/host/web-renderer.js +25 -6
- package/dist/agent/host/web-renderer.js.map +1 -1
- package/dist/agent/kernel-builder.js +4 -4
- package/dist/agent/kernel-builder.js.map +1 -1
- package/dist/agent/kernel.d.ts +15 -5
- package/dist/agent/kernel.js +149 -73
- package/dist/agent/kernel.js.map +1 -1
- package/dist/agent/kiwi-tool.d.ts +33 -0
- package/dist/agent/kiwi-tool.js +17 -0
- package/dist/agent/kiwi-tool.js.map +1 -0
- package/dist/agent/memory/schema.d.ts +1 -1
- package/dist/agent/memory/schema.js +190 -1
- package/dist/agent/memory/schema.js.map +1 -1
- package/dist/agent/memory/store.js +3 -1
- package/dist/agent/memory/store.js.map +1 -1
- package/dist/agent/merchant/action-candidate.d.ts +1 -0
- package/dist/agent/merchant/action-candidate.js +42 -24
- package/dist/agent/merchant/action-candidate.js.map +1 -1
- package/dist/agent/merchant/fake-merchant-client.d.ts +30 -1
- package/dist/agent/merchant/fake-merchant-client.js +151 -2
- package/dist/agent/merchant/fake-merchant-client.js.map +1 -1
- package/dist/agent/merchant/intelligence/default-backend.js +2 -2
- package/dist/agent/merchant/intelligence/default-backend.js.map +1 -1
- package/dist/agent/merchant/merchant-client.d.ts +38 -5
- package/dist/agent/merchant/merchant-client.js +103 -8
- package/dist/agent/merchant/merchant-client.js.map +1 -1
- package/dist/agent/merchant/merchant-tools.d.ts +2 -17
- package/dist/agent/merchant/merchant-tools.js.map +1 -1
- package/dist/agent/merchant/types.d.ts +107 -0
- package/dist/agent/merchant/types.js +69 -0
- package/dist/agent/merchant/types.js.map +1 -1
- package/dist/agent/negotiation-chat.d.ts +3 -2
- package/dist/agent/negotiation-chat.js.map +1 -1
- package/dist/agent/session.d.ts +15 -3
- package/dist/agent/session.js +114 -122
- package/dist/agent/session.js.map +1 -1
- package/dist/agent/skills/tools.d.ts +2 -2
- package/dist/agent/skills/tools.js.map +1 -1
- package/dist/alerts/external-delivery.d.ts +78 -0
- package/dist/alerts/external-delivery.js +256 -0
- package/dist/alerts/external-delivery.js.map +1 -0
- package/dist/auth/app-oauth-callback.d.ts +38 -0
- package/dist/auth/app-oauth-callback.js +119 -0
- package/dist/auth/app-oauth-callback.js.map +1 -0
- package/dist/auth/merchant-oauth.js +15 -41
- package/dist/auth/merchant-oauth.js.map +1 -1
- package/dist/auth/merchant-pairing.d.ts +51 -0
- package/dist/auth/merchant-pairing.js +66 -16
- package/dist/auth/merchant-pairing.js.map +1 -1
- package/dist/auth/merchant-sessions.d.ts +7 -1
- package/dist/auth/merchant-sessions.js +25 -3
- package/dist/auth/merchant-sessions.js.map +1 -1
- package/dist/buyer-core/build-service.d.ts +3 -1
- package/dist/buyer-core/build-service.js +4 -1
- package/dist/buyer-core/build-service.js.map +1 -1
- package/dist/buyer-core/merchant-index.d.ts +20 -0
- package/dist/buyer-core/merchant-index.js +83 -12
- package/dist/buyer-core/merchant-index.js.map +1 -1
- package/dist/buyer-core/network-search.d.ts +92 -0
- package/dist/buyer-core/network-search.js +144 -0
- package/dist/buyer-core/network-search.js.map +1 -0
- package/dist/buyer-core/product-summary.d.ts +71 -0
- package/dist/buyer-core/product-summary.js +63 -0
- package/dist/buyer-core/product-summary.js.map +1 -0
- package/dist/buyer-core/service.d.ts +26 -0
- package/dist/buyer-core/service.js +38 -8
- package/dist/buyer-core/service.js.map +1 -1
- package/dist/cli.d.ts +5 -1
- package/dist/cli.js +260 -274
- package/dist/cli.js.map +1 -1
- package/dist/cloud/binding/audit.d.ts +72 -0
- package/dist/cloud/binding/audit.js +137 -0
- package/dist/cloud/binding/audit.js.map +1 -0
- package/dist/cloud/binding/enrollment-challenge.d.ts +37 -0
- package/dist/cloud/binding/enrollment-challenge.js +153 -0
- package/dist/cloud/binding/enrollment-challenge.js.map +1 -0
- package/dist/cloud/binding/enrollment-heartbeat.d.ts +26 -0
- package/dist/cloud/binding/enrollment-heartbeat.js +146 -0
- package/dist/cloud/binding/enrollment-heartbeat.js.map +1 -0
- package/dist/cloud/binding/enrollment-key-recovery.d.ts +27 -0
- package/dist/cloud/binding/enrollment-key-recovery.js +127 -0
- package/dist/cloud/binding/enrollment-key-recovery.js.map +1 -0
- package/dist/cloud/binding/issuance.d.ts +76 -0
- package/dist/cloud/binding/issuance.js +121 -0
- package/dist/cloud/binding/issuance.js.map +1 -0
- package/dist/cloud/binding/proofs.d.ts +110 -0
- package/dist/cloud/binding/proofs.js +200 -0
- package/dist/cloud/binding/proofs.js.map +1 -0
- package/dist/cloud/binding/runtime-challenge.d.ts +48 -0
- package/dist/cloud/binding/runtime-challenge.js +185 -0
- package/dist/cloud/binding/runtime-challenge.js.map +1 -0
- package/dist/cloud/bootstrap.d.ts +63 -0
- package/dist/cloud/bootstrap.js +1161 -0
- package/dist/cloud/bootstrap.js.map +1 -0
- package/dist/cloud/catalog-client.d.ts +305 -0
- package/dist/cloud/catalog-client.js +962 -0
- package/dist/cloud/catalog-client.js.map +1 -0
- package/dist/cloud/config.d.ts +103 -0
- package/dist/cloud/config.js +274 -0
- package/dist/cloud/config.js.map +1 -0
- package/dist/cloud/http-router.d.ts +63 -0
- package/dist/cloud/http-router.js +135 -0
- package/dist/cloud/http-router.js.map +1 -0
- package/dist/cloud/listing-publisher.d.ts +45 -0
- package/dist/cloud/listing-publisher.js +244 -0
- package/dist/cloud/listing-publisher.js.map +1 -0
- package/dist/cloud/main.d.ts +16 -0
- package/dist/cloud/main.js +64 -0
- package/dist/cloud/main.js.map +1 -0
- package/dist/cloud/merchant-connect.d.ts +47 -0
- package/dist/cloud/merchant-connect.js +331 -0
- package/dist/cloud/merchant-connect.js.map +1 -0
- package/dist/cloud/merchant-identity.d.ts +14 -0
- package/dist/cloud/merchant-identity.js +76 -0
- package/dist/cloud/merchant-identity.js.map +1 -0
- package/dist/cloud/onboarding/catalog-pipeline.d.ts +135 -0
- package/dist/cloud/onboarding/catalog-pipeline.js +454 -0
- package/dist/cloud/onboarding/catalog-pipeline.js.map +1 -0
- package/dist/cloud/onboarding/local-fallback.d.ts +86 -0
- package/dist/cloud/onboarding/local-fallback.js +98 -0
- package/dist/cloud/onboarding/local-fallback.js.map +1 -0
- package/dist/cloud/onboarding/steps.d.ts +95 -0
- package/dist/cloud/onboarding/steps.js +175 -0
- package/dist/cloud/onboarding/steps.js.map +1 -0
- package/dist/cloud/onboarding/store.d.ts +136 -0
- package/dist/cloud/onboarding/store.js +472 -0
- package/dist/cloud/onboarding/store.js.map +1 -0
- package/dist/cloud/onboarding/types.d.ts +132 -0
- package/dist/cloud/onboarding/types.js +152 -0
- package/dist/cloud/onboarding/types.js.map +1 -0
- package/dist/cloud/product-import-tabular.d.ts +100 -0
- package/dist/cloud/product-import-tabular.js +1073 -0
- package/dist/cloud/product-import-tabular.js.map +1 -0
- package/dist/cloud/product-source.d.ts +104 -0
- package/dist/cloud/product-source.js +276 -0
- package/dist/cloud/product-source.js.map +1 -0
- package/dist/cloud/readiness.d.ts +49 -0
- package/dist/cloud/readiness.js +54 -0
- package/dist/cloud/readiness.js.map +1 -0
- package/dist/commerce/data-source.d.ts +5 -0
- package/dist/commerce/data-source.js.map +1 -1
- package/dist/config/profile.d.ts +4 -0
- package/dist/config/profile.js +14 -0
- package/dist/config/profile.js.map +1 -1
- package/dist/config/provider-kind.d.ts +26 -0
- package/dist/config/provider-kind.js +19 -0
- package/dist/config/provider-kind.js.map +1 -0
- package/dist/contracts/cloud-contracts.d.ts +23 -0
- package/dist/contracts/cloud-contracts.js +90 -0
- package/dist/contracts/cloud-contracts.js.map +1 -0
- package/dist/counterparty/a2a-direct/index.d.ts +3 -0
- package/dist/counterparty/a2a-direct/index.js +22 -6
- package/dist/counterparty/a2a-direct/index.js.map +1 -1
- package/dist/counterparty/registry.d.ts +2 -0
- package/dist/counterparty/registry.js +2 -0
- package/dist/counterparty/registry.js.map +1 -1
- package/dist/counterparty/shopping-cli-hosted/index.d.ts +3 -0
- package/dist/counterparty/shopping-cli-hosted/index.js +9 -2
- package/dist/counterparty/shopping-cli-hosted/index.js.map +1 -1
- package/dist/discovery/catalog-source/buyer-follows.js +2 -2
- package/dist/discovery/catalog-source/buyer-follows.js.map +1 -1
- package/dist/discovery/catalog-source/cloud-card.d.ts +184 -0
- package/dist/discovery/catalog-source/cloud-card.js +385 -0
- package/dist/discovery/catalog-source/cloud-card.js.map +1 -0
- package/dist/discovery/catalog-source/cloud-hosting.d.ts +71 -0
- package/dist/discovery/catalog-source/cloud-hosting.js +70 -0
- package/dist/discovery/catalog-source/cloud-hosting.js.map +1 -0
- package/dist/discovery/catalog-source/errors.d.ts +12 -2
- package/dist/discovery/catalog-source/errors.js +14 -1
- package/dist/discovery/catalog-source/errors.js.map +1 -1
- package/dist/discovery/catalog-source/index.d.ts +2 -0
- package/dist/discovery/catalog-source/index.js +2 -0
- package/dist/discovery/catalog-source/index.js.map +1 -1
- package/dist/discovery/catalog-source/kiwi-source.js +2 -2
- package/dist/discovery/catalog-source/kiwi-source.js.map +1 -1
- package/dist/discovery/catalog-source/merchant-publications.d.ts +2 -2
- package/dist/discovery/catalog-source/merchant-publications.js +10 -5
- package/dist/discovery/catalog-source/merchant-publications.js.map +1 -1
- package/dist/discovery/catalog-source/source.js +2 -2
- package/dist/discovery/catalog-source/source.js.map +1 -1
- package/dist/discovery/merchant-subscriptions.d.ts +45 -0
- package/dist/discovery/merchant-subscriptions.js +319 -0
- package/dist/discovery/merchant-subscriptions.js.map +1 -0
- package/dist/discovery/resolve.d.ts +38 -0
- package/dist/discovery/resolve.js +100 -7
- package/dist/discovery/resolve.js.map +1 -1
- package/dist/fanout/orchestrator.d.ts +2 -0
- package/dist/fanout/orchestrator.js +4 -1
- package/dist/fanout/orchestrator.js.map +1 -1
- package/dist/handoff/ledger.d.ts +1 -0
- package/dist/handoff/ledger.js +3 -0
- package/dist/handoff/ledger.js.map +1 -1
- package/dist/handoff/transaction.js +1 -1
- package/dist/handoff/transaction.js.map +1 -1
- package/dist/http/merchant-engagement-api.d.ts +10 -0
- package/dist/http/merchant-engagement-api.js +138 -0
- package/dist/http/merchant-engagement-api.js.map +1 -0
- package/dist/http/merchant-feed-api.d.ts +7 -0
- package/dist/http/merchant-feed-api.js +129 -0
- package/dist/http/merchant-feed-api.js.map +1 -0
- package/dist/http/merchant-follow-api.d.ts +15 -0
- package/dist/http/merchant-follow-api.js +192 -0
- package/dist/http/merchant-follow-api.js.map +1 -0
- package/dist/http/merchant-management/api.d.ts +258 -0
- package/dist/http/merchant-management/api.js +3022 -0
- package/dist/http/merchant-management/api.js.map +1 -0
- package/dist/http/merchant-management/draft-store.d.ts +51 -0
- package/dist/http/merchant-management/draft-store.js +95 -0
- package/dist/http/merchant-management/draft-store.js.map +1 -0
- package/dist/http/merchant-management/event-projection.d.ts +41 -0
- package/dist/http/merchant-management/event-projection.js +190 -0
- package/dist/http/merchant-management/event-projection.js.map +1 -0
- package/dist/http/merchant-management/operation-store.d.ts +97 -0
- package/dist/http/merchant-management/operation-store.js +252 -0
- package/dist/http/merchant-management/operation-store.js.map +1 -0
- package/dist/http/merchant-management/page.d.ts +29 -0
- package/dist/http/merchant-management/page.js +641 -0
- package/dist/http/merchant-management/page.js.map +1 -0
- package/dist/http/merchant-management/problem-client.d.ts +19 -0
- package/dist/http/merchant-management/problem-client.js +55 -0
- package/dist/http/merchant-management/problem-client.js.map +1 -0
- package/dist/http/merchant-management/problem.d.ts +74 -0
- package/dist/http/merchant-management/problem.js +112 -0
- package/dist/http/merchant-management/problem.js.map +1 -0
- package/dist/http/merchant-management/reconciliation-worker.d.ts +95 -0
- package/dist/http/merchant-management/reconciliation-worker.js +397 -0
- package/dist/http/merchant-management/reconciliation-worker.js.map +1 -0
- package/dist/http/merchant-management/service-state.d.ts +86 -0
- package/dist/http/merchant-management/service-state.js +217 -0
- package/dist/http/merchant-management/service-state.js.map +1 -0
- package/dist/http/merchant-management/trusted-page.d.ts +3 -0
- package/dist/http/merchant-management/trusted-page.js +73 -0
- package/dist/http/merchant-management/trusted-page.js.map +1 -0
- package/dist/http/merchant-management/webauthn-confirmation.d.ts +148 -0
- package/dist/http/merchant-management/webauthn-confirmation.js +517 -0
- package/dist/http/merchant-management/webauthn-confirmation.js.map +1 -0
- package/dist/http/merchant-privacy-api.d.ts +9 -0
- package/dist/http/merchant-privacy-api.js +96 -0
- package/dist/http/merchant-privacy-api.js.map +1 -0
- package/dist/mcp/merchant-rfq-resources.d.ts +37 -0
- package/dist/mcp/merchant-rfq-resources.js +132 -0
- package/dist/mcp/merchant-rfq-resources.js.map +1 -0
- package/dist/mcp/merchant-rfq-tools.d.ts +61 -0
- package/dist/mcp/merchant-rfq-tools.js +584 -0
- package/dist/mcp/merchant-rfq-tools.js.map +1 -0
- package/dist/mcp/merchant-runtime-assembly.d.ts +74 -0
- package/dist/mcp/merchant-runtime-assembly.js +476 -0
- package/dist/mcp/merchant-runtime-assembly.js.map +1 -0
- package/dist/mcp/merchant-server.d.ts +66 -1
- package/dist/mcp/merchant-server.js +260 -23
- package/dist/mcp/merchant-server.js.map +1 -1
- package/dist/mcp/tools.js +8 -2
- package/dist/mcp/tools.js.map +1 -1
- package/dist/merchant/application/actor.d.ts +85 -0
- package/dist/merchant/application/actor.js +162 -0
- package/dist/merchant/application/actor.js.map +1 -0
- package/dist/merchant/application/money.d.ts +35 -0
- package/dist/merchant/application/money.js +124 -0
- package/dist/merchant/application/money.js.map +1 -0
- package/dist/merchant/application/service.d.ts +228 -0
- package/dist/merchant/application/service.js +262 -0
- package/dist/merchant/application/service.js.map +1 -0
- package/dist/merchant/clock-safety.d.ts +50 -0
- package/dist/merchant/clock-safety.js +153 -0
- package/dist/merchant/clock-safety.js.map +1 -0
- package/dist/merchant/engagement-store.d.ts +32 -0
- package/dist/merchant/engagement-store.js +119 -0
- package/dist/merchant/engagement-store.js.map +1 -0
- package/dist/merchant/exact-product-executors.d.ts +11 -0
- package/dist/merchant/exact-product-executors.js +132 -0
- package/dist/merchant/exact-product-executors.js.map +1 -0
- package/dist/merchant/feed-executors.d.ts +17 -0
- package/dist/merchant/feed-executors.js +151 -0
- package/dist/merchant/feed-executors.js.map +1 -0
- package/dist/merchant/feed-store.d.ts +141 -0
- package/dist/merchant/feed-store.js +496 -0
- package/dist/merchant/feed-store.js.map +1 -0
- package/dist/merchant/follow-store.d.ts +66 -0
- package/dist/merchant/follow-store.js +295 -0
- package/dist/merchant/follow-store.js.map +1 -0
- package/dist/merchant/grant-executors.d.ts +11 -0
- package/dist/merchant/grant-executors.js +136 -0
- package/dist/merchant/grant-executors.js.map +1 -0
- package/dist/merchant/grant-store.d.ts +125 -0
- package/dist/merchant/grant-store.js +313 -0
- package/dist/merchant/grant-store.js.map +1 -0
- package/dist/merchant/inventory-executors.d.ts +47 -0
- package/dist/merchant/inventory-executors.js +91 -0
- package/dist/merchant/inventory-executors.js.map +1 -0
- package/dist/merchant/listing-executors.d.ts +51 -0
- package/dist/merchant/listing-executors.js +100 -0
- package/dist/merchant/listing-executors.js.map +1 -0
- package/dist/merchant/negotiation-observer.d.ts +92 -0
- package/dist/merchant/negotiation-observer.js +278 -0
- package/dist/merchant/negotiation-observer.js.map +1 -0
- package/dist/merchant/operation-receipts.d.ts +57 -0
- package/dist/merchant/operation-receipts.js +138 -0
- package/dist/merchant/operation-receipts.js.map +1 -0
- package/dist/merchant/operations-report.d.ts +85 -0
- package/dist/merchant/operations-report.js +227 -0
- package/dist/merchant/operations-report.js.map +1 -0
- package/dist/merchant/promotion-broadcast-recovery.d.ts +22 -0
- package/dist/merchant/promotion-broadcast-recovery.js +74 -0
- package/dist/merchant/promotion-broadcast-recovery.js.map +1 -0
- package/dist/merchant/promotion-broadcast-workflow.d.ts +42 -0
- package/dist/merchant/promotion-broadcast-workflow.js +171 -0
- package/dist/merchant/promotion-broadcast-workflow.js.map +1 -0
- package/dist/merchant/promotion-executors.d.ts +18 -0
- package/dist/merchant/promotion-executors.js +133 -0
- package/dist/merchant/promotion-executors.js.map +1 -0
- package/dist/merchant/promotion-store.d.ts +114 -0
- package/dist/merchant/promotion-store.js +325 -0
- package/dist/merchant/promotion-store.js.map +1 -0
- package/dist/merchant/promotion-time.d.ts +19 -0
- package/dist/merchant/promotion-time.js +162 -0
- package/dist/merchant/promotion-time.js.map +1 -0
- package/dist/merchant/quote-calculator.d.ts +32 -0
- package/dist/merchant/quote-calculator.js +70 -0
- package/dist/merchant/quote-calculator.js.map +1 -0
- package/dist/merchant/service-control-executors.d.ts +15 -0
- package/dist/merchant/service-control-executors.js +52 -0
- package/dist/merchant/service-control-executors.js.map +1 -0
- package/dist/merchant/stats-store.d.ts +5 -0
- package/dist/merchant/stats-store.js +18 -0
- package/dist/merchant/stats-store.js.map +1 -1
- package/dist/merchant/workbench-service.d.ts +1 -0
- package/dist/merchant/workbench-service.js +11 -1
- package/dist/merchant/workbench-service.js.map +1 -1
- package/dist/merchant-admin/pending-page.d.ts +104 -0
- package/dist/merchant-admin/pending-page.js +20 -0
- package/dist/merchant-admin/pending-page.js.map +1 -1
- package/dist/merchant-admin/rfq-page.d.ts +105 -0
- package/dist/merchant-admin/rfq-page.js +176 -0
- package/dist/merchant-admin/rfq-page.js.map +1 -0
- package/dist/merchant-core/commands.d.ts +27 -0
- package/dist/merchant-core/commands.js +90 -1
- package/dist/merchant-core/commands.js.map +1 -1
- package/dist/merchant-core/executor.d.ts +27 -3
- package/dist/merchant-core/executor.js +13 -4
- package/dist/merchant-core/executor.js.map +1 -1
- package/dist/merchant-core/rfq/artifacts.d.ts +78 -0
- package/dist/merchant-core/rfq/artifacts.js +219 -0
- package/dist/merchant-core/rfq/artifacts.js.map +1 -0
- package/dist/merchant-core/rfq/data-source-adapter.d.ts +49 -0
- package/dist/merchant-core/rfq/data-source-adapter.js +128 -0
- package/dist/merchant-core/rfq/data-source-adapter.js.map +1 -0
- package/dist/merchant-core/rfq/delivery.d.ts +43 -0
- package/dist/merchant-core/rfq/delivery.js +57 -0
- package/dist/merchant-core/rfq/delivery.js.map +1 -0
- package/dist/merchant-core/rfq/fact-resolver.d.ts +76 -0
- package/dist/merchant-core/rfq/fact-resolver.js +220 -0
- package/dist/merchant-core/rfq/fact-resolver.js.map +1 -0
- package/dist/merchant-core/rfq/handoff.d.ts +54 -0
- package/dist/merchant-core/rfq/handoff.js +71 -0
- package/dist/merchant-core/rfq/handoff.js.map +1 -0
- package/dist/merchant-core/rfq/policy.d.ts +77 -0
- package/dist/merchant-core/rfq/policy.js +104 -0
- package/dist/merchant-core/rfq/policy.js.map +1 -0
- package/dist/merchant-core/rfq/pricing.d.ts +48 -0
- package/dist/merchant-core/rfq/pricing.js +150 -0
- package/dist/merchant-core/rfq/pricing.js.map +1 -0
- package/dist/merchant-core/rfq/quote-revisions.d.ts +52 -0
- package/dist/merchant-core/rfq/quote-revisions.js +126 -0
- package/dist/merchant-core/rfq/quote-revisions.js.map +1 -0
- package/dist/merchant-core/rfq/release-coordinator.d.ts +99 -0
- package/dist/merchant-core/rfq/release-coordinator.js +355 -0
- package/dist/merchant-core/rfq/release-coordinator.js.map +1 -0
- package/dist/merchant-core/rfq/repository.d.ts +398 -0
- package/dist/merchant-core/rfq/repository.js +855 -0
- package/dist/merchant-core/rfq/repository.js.map +1 -0
- package/dist/merchant-core/rfq/service.d.ts +398 -0
- package/dist/merchant-core/rfq/service.js +1036 -0
- package/dist/merchant-core/rfq/service.js.map +1 -0
- package/dist/merchant-core/rfq/source-records.d.ts +97 -0
- package/dist/merchant-core/rfq/source-records.js +349 -0
- package/dist/merchant-core/rfq/source-records.js.map +1 -0
- package/dist/merchant-core/rfq/types.d.ts +197 -0
- package/dist/merchant-core/rfq/types.js +110 -0
- package/dist/merchant-core/rfq/types.js.map +1 -0
- package/dist/merchant-core/service.d.ts +118 -1
- package/dist/merchant-core/service.js +202 -7
- package/dist/merchant-core/service.js.map +1 -1
- package/dist/merchant-core/storage/clock-skew-alerts.d.ts +21 -0
- package/dist/merchant-core/storage/clock-skew-alerts.js +67 -0
- package/dist/merchant-core/storage/clock-skew-alerts.js.map +1 -0
- package/dist/merchant-core/storage/leased-job.d.ts +42 -0
- package/dist/merchant-core/storage/leased-job.js +38 -0
- package/dist/merchant-core/storage/leased-job.js.map +1 -0
- package/dist/merchant-core/storage/operation-lifecycle.d.ts +78 -0
- package/dist/merchant-core/storage/operation-lifecycle.js +111 -0
- package/dist/merchant-core/storage/operation-lifecycle.js.map +1 -0
- package/dist/merchant-core/storage/redact.d.ts +29 -0
- package/dist/merchant-core/storage/redact.js +34 -0
- package/dist/merchant-core/storage/redact.js.map +1 -0
- package/dist/merchant-core/storage/schema.d.ts +24 -0
- package/dist/merchant-core/storage/schema.js +22 -0
- package/dist/merchant-core/storage/schema.js.map +1 -0
- package/dist/merchant-core/storage/transaction.d.ts +47 -0
- package/dist/merchant-core/storage/transaction.js +28 -0
- package/dist/merchant-core/storage/transaction.js.map +1 -0
- package/dist/merchant-gateway/catalog-publications.d.ts +28 -0
- package/dist/merchant-gateway/catalog-publications.js +69 -0
- package/dist/merchant-gateway/catalog-publications.js.map +1 -1
- package/dist/merchant-gateway/catalog-tools.js +20 -0
- package/dist/merchant-gateway/catalog-tools.js.map +1 -1
- package/dist/merchant-gateway/entry-server.js +10 -0
- package/dist/merchant-gateway/entry-server.js.map +1 -1
- package/dist/negotiation/domain/objects.d.ts +7 -0
- package/dist/negotiation/domain/objects.js +8 -0
- package/dist/negotiation/domain/objects.js.map +1 -1
- package/dist/negotiation/idempotency/store.d.ts +23 -0
- package/dist/negotiation/idempotency/store.js +72 -1
- package/dist/negotiation/idempotency/store.js.map +1 -1
- package/dist/negotiation/idempotency/types.d.ts +16 -0
- package/dist/negotiation/idempotency/types.js +2 -0
- package/dist/negotiation/idempotency/types.js.map +1 -1
- package/dist/negotiation/lease/store.d.ts +18 -22
- package/dist/negotiation/lease/store.js +152 -88
- package/dist/negotiation/lease/store.js.map +1 -1
- package/dist/negotiation/ledger/event.d.ts +6 -0
- package/dist/negotiation/ledger/event.js +1 -0
- package/dist/negotiation/ledger/event.js.map +1 -1
- package/dist/negotiation/ledger/index.d.ts +4 -2
- package/dist/negotiation/ledger/index.js +1 -0
- package/dist/negotiation/ledger/index.js.map +1 -1
- package/dist/negotiation/ledger/payload-segments.d.ts +51 -0
- package/dist/negotiation/ledger/payload-segments.js +247 -0
- package/dist/negotiation/ledger/payload-segments.js.map +1 -0
- package/dist/negotiation/ledger/store.d.ts +34 -0
- package/dist/negotiation/ledger/store.js +162 -0
- package/dist/negotiation/ledger/store.js.map +1 -1
- package/dist/negotiation/recovery/recover.js +1 -1
- package/dist/negotiation/recovery/recover.js.map +1 -1
- package/dist/privacy/ledger-payload-deletion.d.ts +10 -0
- package/dist/privacy/ledger-payload-deletion.js +31 -0
- package/dist/privacy/ledger-payload-deletion.js.map +1 -0
- package/dist/privacy/local-backup-deletion.d.ts +13 -0
- package/dist/privacy/local-backup-deletion.js +115 -0
- package/dist/privacy/local-backup-deletion.js.map +1 -0
- package/dist/privacy/workbench-retention.d.ts +105 -0
- package/dist/privacy/workbench-retention.js +501 -0
- package/dist/privacy/workbench-retention.js.map +1 -0
- package/dist/product-cli.d.ts +2 -2
- package/dist/product-cli.js +24 -9
- package/dist/product-cli.js.map +1 -1
- package/dist/product-init.d.ts +4 -1
- package/dist/product-init.js +39 -11
- package/dist/product-init.js.map +1 -1
- package/dist/product-publish.d.ts +8 -2
- package/dist/product-publish.js +222 -142
- package/dist/product-publish.js.map +1 -1
- package/dist/runtime/fake-model.js +9 -3
- package/dist/runtime/fake-model.js.map +1 -1
- package/dist/runtime/model.d.ts +1 -1
- package/dist/runtime/model.js +3 -3
- package/dist/runtime/model.js.map +1 -1
- package/dist/trust/binding/claims.d.ts +92 -0
- package/dist/trust/binding/claims.js +175 -0
- package/dist/trust/binding/claims.js.map +1 -0
- package/dist/trust/binding/thumbprint.d.ts +35 -0
- package/dist/trust/binding/thumbprint.js +88 -0
- package/dist/trust/binding/thumbprint.js.map +1 -0
- package/dist/trust/binding/verify.d.ts +84 -0
- package/dist/trust/binding/verify.js +121 -0
- package/dist/trust/binding/verify.js.map +1 -0
- package/dist/trust/identity/auth-verifier.d.ts +9 -0
- package/dist/trust/identity/auth-verifier.js +10 -2
- package/dist/trust/identity/auth-verifier.js.map +1 -1
- package/dist/trust/identity/jws.d.ts +22 -1
- package/dist/trust/identity/jws.js +31 -2
- package/dist/trust/identity/jws.js.map +1 -1
- package/package.json +17 -6
- package/skills/kiwi-buyer/SKILL.md +33 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/http/merchant-management/page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;GAWG;AAEH,8CAA8C;AAC9C,MAAM,UAAU,4BAA4B;IAC1C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAimBD,CAAC;AACT,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** RFC 9457 client-side consumer for the Workbench v1 management API. */
|
|
2
|
+
export type ClientRecoveryAction = "none" | "reauthenticate" | "refresh_resource" | "confirm" | "query_operation" | "retry_same_operation" | "resync_feed" | "open_support" | "unknown";
|
|
3
|
+
export interface WorkbenchClientProblem {
|
|
4
|
+
type?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
status: number;
|
|
7
|
+
detail: string;
|
|
8
|
+
code: string;
|
|
9
|
+
requestId?: string;
|
|
10
|
+
operationId?: string;
|
|
11
|
+
retryable: boolean;
|
|
12
|
+
recoveryAction: ClientRecoveryAction;
|
|
13
|
+
details?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Parse only Problem Details responses. Malformed or non-problem responses
|
|
17
|
+
* return undefined so callers can use a transport-level fallback safely.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseWorkbenchProblem(response: Pick<Response, "status" | "headers" | "json">): Promise<WorkbenchClientProblem | undefined>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** RFC 9457 client-side consumer for the Workbench v1 management API. */
|
|
2
|
+
const ACTIONS = new Set([
|
|
3
|
+
"none",
|
|
4
|
+
"reauthenticate",
|
|
5
|
+
"refresh_resource",
|
|
6
|
+
"confirm",
|
|
7
|
+
"query_operation",
|
|
8
|
+
"retry_same_operation",
|
|
9
|
+
"resync_feed",
|
|
10
|
+
"open_support",
|
|
11
|
+
]);
|
|
12
|
+
/**
|
|
13
|
+
* Parse only Problem Details responses. Malformed or non-problem responses
|
|
14
|
+
* return undefined so callers can use a transport-level fallback safely.
|
|
15
|
+
*/
|
|
16
|
+
export async function parseWorkbenchProblem(response) {
|
|
17
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
18
|
+
if (!contentType.toLowerCase().includes("application/problem+json"))
|
|
19
|
+
return undefined;
|
|
20
|
+
let raw;
|
|
21
|
+
try {
|
|
22
|
+
raw = await response.json();
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw))
|
|
28
|
+
return undefined;
|
|
29
|
+
const body = raw;
|
|
30
|
+
const code = text(body.code);
|
|
31
|
+
const detail = text(body.detail);
|
|
32
|
+
if (code === "" || detail === "")
|
|
33
|
+
return undefined;
|
|
34
|
+
const action = text(body.recovery_action);
|
|
35
|
+
return {
|
|
36
|
+
...(typeof body.type === "string" ? { type: body.type } : {}),
|
|
37
|
+
...(typeof body.title === "string" ? { title: body.title } : {}),
|
|
38
|
+
status: response.status,
|
|
39
|
+
detail,
|
|
40
|
+
code,
|
|
41
|
+
...(typeof body.request_id === "string" ? { requestId: body.request_id } : {}),
|
|
42
|
+
...(typeof body.operation_id === "string" ? { operationId: body.operation_id } : {}),
|
|
43
|
+
retryable: body.retryable === true,
|
|
44
|
+
recoveryAction: ACTIONS.has(action)
|
|
45
|
+
? action
|
|
46
|
+
: "unknown",
|
|
47
|
+
...(body.details !== null && typeof body.details === "object" && !Array.isArray(body.details)
|
|
48
|
+
? { details: body.details }
|
|
49
|
+
: {}),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function text(value) {
|
|
53
|
+
return typeof value === "string" ? value.trim() : "";
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=problem-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"problem-client.js","sourceRoot":"","sources":["../../../src/http/merchant-management/problem-client.ts"],"names":[],"mappings":"AAAA,yEAAyE;AA0BzE,MAAM,OAAO,GAAG,IAAI,GAAG,CAAuB;IAC5C,MAAM;IACN,gBAAgB;IAChB,kBAAkB;IAClB,SAAS;IACT,iBAAiB;IACjB,sBAAsB;IACtB,aAAa;IACb,cAAc;CACf,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,QAAuD;IAEvD,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;IAC/D,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QAAE,OAAO,SAAS,CAAC;IACtF,IAAI,GAAY,CAAC;IACjB,IAAI,CAAC;QACH,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IACpF,MAAM,IAAI,G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,IAAI,CAAC,OAAO,CAAC;YAC3F,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAkC,EAAE;YACtD,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC;AAED,SAAS,IAAI,CAAC,KAAc;IAC1B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workbench v0.1.1 /merchant/api/v1 错误契约(RFC 9457)。
|
|
3
|
+
*
|
|
4
|
+
* 仅供新 v1 管理 API 使用;既有 A2A、MCP 和 legacy /merchant/api/* 保持各自已锁定
|
|
5
|
+
* 的错误外壳。`retryable=true` 只表示服务端已证明没有业务效果,可以按同一逻辑操作
|
|
6
|
+
* 重试;结果未知必须查询原 operation。
|
|
7
|
+
*/
|
|
8
|
+
export declare const RECOVERY_ACTIONS: readonly ["none", "reauthenticate", "refresh_resource", "confirm", "query_operation", "retry_same_operation", "resync_feed", "open_support"];
|
|
9
|
+
export type RecoveryAction = (typeof RECOVERY_ACTIONS)[number];
|
|
10
|
+
declare const DEFINITIONS: {
|
|
11
|
+
readonly VALIDATION_ERROR: readonly [422, false, "refresh_resource"];
|
|
12
|
+
readonly UNAUTHENTICATED: readonly [401, false, "reauthenticate"];
|
|
13
|
+
readonly PERMISSION_REVOKED: readonly [403, false, "open_support"];
|
|
14
|
+
readonly RESOURCE_NOT_FOUND: readonly [404, false, "none"];
|
|
15
|
+
readonly VERSION_CONFLICT: readonly [409, false, "refresh_resource"];
|
|
16
|
+
readonly PRECONDITION_FAILED: readonly [412, false, "refresh_resource"];
|
|
17
|
+
readonly PRECONDITION_REQUIRED: readonly [428, false, "refresh_resource"];
|
|
18
|
+
readonly APPROVAL_ALREADY_DECIDED: readonly [409, false, "refresh_resource"];
|
|
19
|
+
readonly CANDIDATE_EXPIRED: readonly [410, false, "refresh_resource"];
|
|
20
|
+
readonly CONFIRMATION_REQUIRED: readonly [403, false, "confirm"];
|
|
21
|
+
readonly CONFIRMATION_EXPIRED: readonly [410, false, "confirm"];
|
|
22
|
+
readonly CONFIRMATION_INVALID: readonly [403, false, "confirm"];
|
|
23
|
+
readonly CONFIRMATION_CHANNEL_UNAVAILABLE: readonly [503, false, "open_support"];
|
|
24
|
+
readonly IDEMPOTENCY_KEY_REUSED: readonly [409, false, "refresh_resource"];
|
|
25
|
+
readonly IDEMPOTENCY_WINDOW_EXPIRED: readonly [409, false, "refresh_resource"];
|
|
26
|
+
readonly OPERATION_RESULT_UNKNOWN: readonly [504, false, "query_operation"];
|
|
27
|
+
readonly DEPENDENCY_UNAVAILABLE: readonly [503, true, "retry_same_operation"];
|
|
28
|
+
readonly CATALOG_UNAVAILABLE: readonly [503, true, "retry_same_operation"];
|
|
29
|
+
readonly PRODUCT_SOURCE_UNAVAILABLE: readonly [503, true, "retry_same_operation"];
|
|
30
|
+
readonly LLM_UNAVAILABLE: readonly [503, true, "retry_same_operation"];
|
|
31
|
+
readonly BROADCAST_PUBLISH_FAILED: readonly [503, false, "query_operation"];
|
|
32
|
+
readonly RATE_LIMITED: readonly [429, true, "retry_same_operation"];
|
|
33
|
+
readonly RUNTIME_PAUSED: readonly [409, false, "none"];
|
|
34
|
+
readonly RUNTIME_RECOVERING: readonly [503, false, "open_support"];
|
|
35
|
+
readonly SERVICE_AUTH_REVOKED: readonly [403, false, "open_support"];
|
|
36
|
+
readonly FEED_RESET_REQUIRED: readonly [409, false, "resync_feed"];
|
|
37
|
+
readonly FEED_CURSOR_INVALID: readonly [400, false, "resync_feed"];
|
|
38
|
+
readonly SNAPSHOT_EXPIRED: readonly [410, false, "resync_feed"];
|
|
39
|
+
readonly MONEY_PRECISION_UNRECOVERABLE: readonly [422, false, "refresh_resource"];
|
|
40
|
+
readonly MONEY_RANGE_EXCEEDED: readonly [422, false, "refresh_resource"];
|
|
41
|
+
readonly RETENTION_RESTRICTED: readonly [409, false, "open_support"];
|
|
42
|
+
readonly STORAGE_CAPACITY_EXCEEDED: readonly [507, false, "open_support"];
|
|
43
|
+
readonly COMPLIANCE_REVIEW_REQUIRED: readonly [409, false, "open_support"];
|
|
44
|
+
readonly INTERNAL_ERROR: readonly [500, false, "open_support"];
|
|
45
|
+
};
|
|
46
|
+
export type WorkbenchProblemCode = keyof typeof DEFINITIONS;
|
|
47
|
+
export interface WorkbenchProblem {
|
|
48
|
+
type: `urn:kiwi:problem:${string}`;
|
|
49
|
+
title: string;
|
|
50
|
+
status: number;
|
|
51
|
+
detail: string;
|
|
52
|
+
code: WorkbenchProblemCode;
|
|
53
|
+
request_id: string;
|
|
54
|
+
operation_id?: string;
|
|
55
|
+
retryable: boolean;
|
|
56
|
+
recovery_action: RecoveryAction;
|
|
57
|
+
details?: Readonly<Record<string, unknown>>;
|
|
58
|
+
}
|
|
59
|
+
export interface ProblemDefinition {
|
|
60
|
+
code: WorkbenchProblemCode;
|
|
61
|
+
type: `urn:kiwi:problem:${string}`;
|
|
62
|
+
status: number;
|
|
63
|
+
retryable: boolean;
|
|
64
|
+
recoveryAction: RecoveryAction;
|
|
65
|
+
}
|
|
66
|
+
export declare const WORKBENCH_PROBLEM_DEFINITIONS: Readonly<Record<WorkbenchProblemCode, ProblemDefinition>>;
|
|
67
|
+
export declare function createWorkbenchProblem(code: WorkbenchProblemCode, input: {
|
|
68
|
+
title: string;
|
|
69
|
+
detail: string;
|
|
70
|
+
requestId: string;
|
|
71
|
+
operationId?: string;
|
|
72
|
+
details?: Readonly<Record<string, unknown>>;
|
|
73
|
+
}): WorkbenchProblem;
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workbench v0.1.1 /merchant/api/v1 错误契约(RFC 9457)。
|
|
3
|
+
*
|
|
4
|
+
* 仅供新 v1 管理 API 使用;既有 A2A、MCP 和 legacy /merchant/api/* 保持各自已锁定
|
|
5
|
+
* 的错误外壳。`retryable=true` 只表示服务端已证明没有业务效果,可以按同一逻辑操作
|
|
6
|
+
* 重试;结果未知必须查询原 operation。
|
|
7
|
+
*/
|
|
8
|
+
export const RECOVERY_ACTIONS = [
|
|
9
|
+
"none",
|
|
10
|
+
"reauthenticate",
|
|
11
|
+
"refresh_resource",
|
|
12
|
+
"confirm",
|
|
13
|
+
"query_operation",
|
|
14
|
+
"retry_same_operation",
|
|
15
|
+
"resync_feed",
|
|
16
|
+
"open_support",
|
|
17
|
+
];
|
|
18
|
+
const DEFINITIONS = {
|
|
19
|
+
VALIDATION_ERROR: [422, false, "refresh_resource"],
|
|
20
|
+
UNAUTHENTICATED: [401, false, "reauthenticate"],
|
|
21
|
+
PERMISSION_REVOKED: [403, false, "open_support"],
|
|
22
|
+
RESOURCE_NOT_FOUND: [404, false, "none"],
|
|
23
|
+
VERSION_CONFLICT: [409, false, "refresh_resource"],
|
|
24
|
+
PRECONDITION_FAILED: [412, false, "refresh_resource"],
|
|
25
|
+
PRECONDITION_REQUIRED: [428, false, "refresh_resource"],
|
|
26
|
+
APPROVAL_ALREADY_DECIDED: [409, false, "refresh_resource"],
|
|
27
|
+
CANDIDATE_EXPIRED: [410, false, "refresh_resource"],
|
|
28
|
+
CONFIRMATION_REQUIRED: [403, false, "confirm"],
|
|
29
|
+
CONFIRMATION_EXPIRED: [410, false, "confirm"],
|
|
30
|
+
CONFIRMATION_INVALID: [403, false, "confirm"],
|
|
31
|
+
CONFIRMATION_CHANNEL_UNAVAILABLE: [503, false, "open_support"],
|
|
32
|
+
IDEMPOTENCY_KEY_REUSED: [409, false, "refresh_resource"],
|
|
33
|
+
IDEMPOTENCY_WINDOW_EXPIRED: [409, false, "refresh_resource"],
|
|
34
|
+
OPERATION_RESULT_UNKNOWN: [504, false, "query_operation"],
|
|
35
|
+
DEPENDENCY_UNAVAILABLE: [503, true, "retry_same_operation"],
|
|
36
|
+
CATALOG_UNAVAILABLE: [503, true, "retry_same_operation"],
|
|
37
|
+
PRODUCT_SOURCE_UNAVAILABLE: [503, true, "retry_same_operation"],
|
|
38
|
+
LLM_UNAVAILABLE: [503, true, "retry_same_operation"],
|
|
39
|
+
BROADCAST_PUBLISH_FAILED: [503, false, "query_operation"],
|
|
40
|
+
RATE_LIMITED: [429, true, "retry_same_operation"],
|
|
41
|
+
RUNTIME_PAUSED: [409, false, "none"],
|
|
42
|
+
RUNTIME_RECOVERING: [503, false, "open_support"],
|
|
43
|
+
SERVICE_AUTH_REVOKED: [403, false, "open_support"],
|
|
44
|
+
FEED_RESET_REQUIRED: [409, false, "resync_feed"],
|
|
45
|
+
FEED_CURSOR_INVALID: [400, false, "resync_feed"],
|
|
46
|
+
SNAPSHOT_EXPIRED: [410, false, "resync_feed"],
|
|
47
|
+
MONEY_PRECISION_UNRECOVERABLE: [422, false, "refresh_resource"],
|
|
48
|
+
MONEY_RANGE_EXCEEDED: [422, false, "refresh_resource"],
|
|
49
|
+
RETENTION_RESTRICTED: [409, false, "open_support"],
|
|
50
|
+
STORAGE_CAPACITY_EXCEEDED: [507, false, "open_support"],
|
|
51
|
+
COMPLIANCE_REVIEW_REQUIRED: [409, false, "open_support"],
|
|
52
|
+
INTERNAL_ERROR: [500, false, "open_support"],
|
|
53
|
+
};
|
|
54
|
+
const SENSITIVE_DETAIL_KEYS = new Set([
|
|
55
|
+
"authorization",
|
|
56
|
+
"token",
|
|
57
|
+
"password",
|
|
58
|
+
"secret",
|
|
59
|
+
"api_key",
|
|
60
|
+
"bottom_price",
|
|
61
|
+
"cost",
|
|
62
|
+
]);
|
|
63
|
+
export const WORKBENCH_PROBLEM_DEFINITIONS = Object.freeze(Object.fromEntries(Object.entries(DEFINITIONS).map(([code, [status, retryable, recoveryAction]]) => [
|
|
64
|
+
code,
|
|
65
|
+
{
|
|
66
|
+
code,
|
|
67
|
+
type: `urn:kiwi:problem:${code.toLowerCase().replaceAll("_", "-")}`,
|
|
68
|
+
status,
|
|
69
|
+
retryable,
|
|
70
|
+
recoveryAction,
|
|
71
|
+
},
|
|
72
|
+
])));
|
|
73
|
+
export function createWorkbenchProblem(code, input) {
|
|
74
|
+
const definition = WORKBENCH_PROBLEM_DEFINITIONS[code];
|
|
75
|
+
const title = requireText(input.title, "title", 160);
|
|
76
|
+
const detail = requireText(input.detail, "detail", 1000);
|
|
77
|
+
const requestId = requireText(input.requestId, "requestId", 128);
|
|
78
|
+
if (code === "OPERATION_RESULT_UNKNOWN" && input.operationId === undefined) {
|
|
79
|
+
throw new Error("OPERATION_RESULT_UNKNOWN requires operationId");
|
|
80
|
+
}
|
|
81
|
+
if (input.details !== undefined)
|
|
82
|
+
assertSafeDetails(input.details);
|
|
83
|
+
return {
|
|
84
|
+
type: definition.type,
|
|
85
|
+
title,
|
|
86
|
+
status: definition.status,
|
|
87
|
+
detail,
|
|
88
|
+
code,
|
|
89
|
+
request_id: requestId,
|
|
90
|
+
...(input.operationId !== undefined
|
|
91
|
+
? { operation_id: requireText(input.operationId, "operationId", 128) }
|
|
92
|
+
: {}),
|
|
93
|
+
retryable: definition.retryable,
|
|
94
|
+
recovery_action: definition.recoveryAction,
|
|
95
|
+
...(input.details !== undefined ? { details: input.details } : {}),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function assertSafeDetails(details) {
|
|
99
|
+
for (const key of Object.keys(details)) {
|
|
100
|
+
if (SENSITIVE_DETAIL_KEYS.has(key.toLowerCase())) {
|
|
101
|
+
throw new Error(`problem details contains forbidden sensitive key: ${key}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function requireText(value, field, maxLength) {
|
|
106
|
+
const text = String(value ?? "").trim();
|
|
107
|
+
if (text.length === 0 || text.length > maxLength) {
|
|
108
|
+
throw new Error(`${field} must contain 1..${maxLength} characters`);
|
|
109
|
+
}
|
|
110
|
+
return text;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=problem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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DatabaseSync } from "node:sqlite";
|
|
3
|
+
export interface OutboxLease {
|
|
4
|
+
merchantId: string;
|
|
5
|
+
operationId: string;
|
|
6
|
+
candidateId: string;
|
|
7
|
+
approvalGeneration: number;
|
|
8
|
+
actionStep: string;
|
|
9
|
+
workerId: string;
|
|
10
|
+
fencingToken: number;
|
|
11
|
+
actorId: string;
|
|
12
|
+
decision: "approve" | "reject";
|
|
13
|
+
actionDigest: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ReconciliationLease {
|
|
16
|
+
merchantId: string;
|
|
17
|
+
operationId: string;
|
|
18
|
+
candidateId: string;
|
|
19
|
+
actorId: string;
|
|
20
|
+
decision: "approve" | "reject";
|
|
21
|
+
workerId: string;
|
|
22
|
+
fencingToken: number;
|
|
23
|
+
attempts: number;
|
|
24
|
+
firstUnknownAt: string;
|
|
25
|
+
}
|
|
26
|
+
export type OperationResult = {
|
|
27
|
+
status: "succeeded";
|
|
28
|
+
} | {
|
|
29
|
+
status: "failed";
|
|
30
|
+
error: string;
|
|
31
|
+
} | {
|
|
32
|
+
status: "unknown";
|
|
33
|
+
error: string;
|
|
34
|
+
};
|
|
35
|
+
export declare function committedDecisionOutcomeResult(outcome: unknown): OperationResult;
|
|
36
|
+
export declare function candidateReconciliationResult(input: {
|
|
37
|
+
status: string;
|
|
38
|
+
executionClaimed: boolean | undefined;
|
|
39
|
+
}): OperationResult;
|
|
40
|
+
export declare class WorkbenchReconciliationStore {
|
|
41
|
+
private readonly db;
|
|
42
|
+
private readonly now;
|
|
43
|
+
private readonly jitter;
|
|
44
|
+
private readonly reconciliationLeasePersistence;
|
|
45
|
+
private reconciliationInTransaction;
|
|
46
|
+
private outboxInTransaction;
|
|
47
|
+
constructor(options: {
|
|
48
|
+
db: DatabaseSync;
|
|
49
|
+
now?: () => string;
|
|
50
|
+
jitter?: () => number;
|
|
51
|
+
});
|
|
52
|
+
candidateIdForOperation(operationId: string): string | undefined;
|
|
53
|
+
listAlerts(merchantId: string, options?: {
|
|
54
|
+
cursor?: string;
|
|
55
|
+
limit?: number;
|
|
56
|
+
}): {
|
|
57
|
+
items: Array<{
|
|
58
|
+
alert_id: string;
|
|
59
|
+
category: string;
|
|
60
|
+
resource: string;
|
|
61
|
+
episode: string;
|
|
62
|
+
severity: "warning" | "critical";
|
|
63
|
+
summary: string;
|
|
64
|
+
created_at: string;
|
|
65
|
+
acknowledged_at: string | null;
|
|
66
|
+
acknowledged_by: string | null;
|
|
67
|
+
resolved_at: string | null;
|
|
68
|
+
}>;
|
|
69
|
+
next_cursor: string | null;
|
|
70
|
+
};
|
|
71
|
+
acknowledgeAlert(merchantId: string, alertId: string, actorId: string): boolean;
|
|
72
|
+
recordClockSkew(input: {
|
|
73
|
+
merchantId: string;
|
|
74
|
+
paused: boolean;
|
|
75
|
+
offsetMs: number;
|
|
76
|
+
}): void;
|
|
77
|
+
leaseOutbox(merchantId: string, workerId: string, leaseMs?: number): OutboxLease | undefined;
|
|
78
|
+
finishOutbox(lease: OutboxLease, result: OperationResult): boolean;
|
|
79
|
+
private outboxLeaseStore;
|
|
80
|
+
leaseReconciliation(workerId: string, leaseMs?: number): ReconciliationLease | undefined;
|
|
81
|
+
private claimReconciliationLease;
|
|
82
|
+
finishReconciliation(lease: ReconciliationLease, result: OperationResult): boolean;
|
|
83
|
+
private upsertAlert;
|
|
84
|
+
}
|
|
85
|
+
export declare class WorkbenchReconciliationWorker {
|
|
86
|
+
private readonly store;
|
|
87
|
+
private readonly options;
|
|
88
|
+
constructor(store: WorkbenchReconciliationStore, options: {
|
|
89
|
+
workerId: string;
|
|
90
|
+
merchantId: string;
|
|
91
|
+
execute: (lease: OutboxLease) => Promise<OperationResult>;
|
|
92
|
+
query: (lease: ReconciliationLease) => Promise<OperationResult>;
|
|
93
|
+
});
|
|
94
|
+
runOnce(): Promise<"outbox" | "reconciliation" | "idle">;
|
|
95
|
+
}
|