@wowok/agent-mcp 2.7.1 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/index.js +1 -1
- package/dist/config/runtime.js +1 -238
- package/dist/customer/customer-advice.js +1 -130
- package/dist/customer/index.js +1 -11
- package/dist/customer/industry-risks.js +1 -438
- package/dist/customer/info-puzzle.js +1 -681
- package/dist/customer/order-monitor.js +1 -328
- package/dist/customer/order-strategy.js +1 -373
- package/dist/customer/post-purchase.js +1 -351
- package/dist/customer/preorder-compare.js +1 -34
- package/dist/customer/reminder-system.js +1 -316
- package/dist/customer/risk-assessment.js +1 -397
- package/dist/customer/types.js +1 -13
- package/dist/customer/user-preferences.js +1 -460
- package/dist/evaluation/arbitration-game.d.ts +9 -2
- package/dist/evaluation/arbitration-game.js +1 -48
- package/dist/evaluation/builtins/demand-match.js +1 -153
- package/dist/evaluation/builtins/index.js +1 -10
- package/dist/evaluation/builtins/service-risk.js +1 -55
- package/dist/evaluation/capability.js +1 -13
- package/dist/evaluation/composer.js +1 -40
- package/dist/evaluation/engine.js +1 -175
- package/dist/evaluation/extract.js +1 -115
- package/dist/evaluation/game-strategy.d.ts +27 -0
- package/dist/evaluation/game-strategy.js +1 -0
- package/dist/evaluation/gap.js +1 -100
- package/dist/evaluation/index.d.ts +1 -0
- package/dist/evaluation/index.js +1 -11
- package/dist/evaluation/node-game.d.ts +31 -3
- package/dist/evaluation/node-game.js +1 -57
- package/dist/evaluation/region.js +1 -36
- package/dist/evaluation/types.d.ts +1 -0
- package/dist/evaluation/types.js +1 -1
- package/dist/evaluation/user-injection.js +1 -27
- package/dist/experience/experience-reuse.js +1 -103
- package/dist/experience/index.js +1 -5
- package/dist/experience/intent-distill.js +1 -83
- package/dist/experience/realtime-feedback.js +1 -94
- package/dist/experience/types.js +1 -1
- package/dist/experience/user-profile.js +1 -171
- package/dist/extensions/business-modules.js +1 -287
- package/dist/extensions/capability-manifest.js +1 -781
- package/dist/extensions/constraint-registry.js +1 -198
- package/dist/extensions/index.js +1 -6
- package/dist/extensions/metric-registry.js +1 -257
- package/dist/extensions/mode-evaluator.js +1 -170
- package/dist/extensions/modes.js +1 -499
- package/dist/extensions/registry.js +1 -717
- package/dist/extensions/types.js +1 -1
- package/dist/harness/auto-escalation.js +1 -68
- package/dist/harness/checkpoint.js +1 -129
- package/dist/harness/index.js +1 -78
- package/dist/harness/plan.js +1 -315
- package/dist/harness/recover.js +1 -139
- package/dist/harness/types.js +1 -1
- package/dist/harness/verify.js +1 -237
- package/dist/index.js +1 -273
- package/dist/intent/enrich.js +1 -67
- package/dist/intent/index.js +1 -60
- package/dist/intent/matcher.js +1 -81
- package/dist/intent/store.js +1 -55
- package/dist/intent/types.js +1 -10
- package/dist/knowledge/acquisition-flywheel.js +1 -192
- package/dist/knowledge/allocation-confirm.js +1 -534
- package/dist/knowledge/allocation-context.js +1 -249
- package/dist/knowledge/allocation-ledger.js +1 -463
- package/dist/knowledge/allocation-puzzle.js +1 -298
- package/dist/knowledge/allocation-risk.js +1 -568
- package/dist/knowledge/allocation-templates.js +1 -970
- package/dist/knowledge/allocation-translation.js +1 -585
- package/dist/knowledge/arb-risk.js +1 -210
- package/dist/knowledge/arbitration-confirm.js +1 -559
- package/dist/knowledge/arbitration-context.js +1 -505
- package/dist/knowledge/arbitration-ledger.js +1 -521
- package/dist/knowledge/arbitration-puzzle.js +1 -304
- package/dist/knowledge/arbitration-risk.js +1 -423
- package/dist/knowledge/arbitration-templates.js +1 -276
- package/dist/knowledge/arbitration-translation.js +1 -487
- package/dist/knowledge/arbitration-trust.js +1 -117
- package/dist/knowledge/audit-rules.js +1 -141
- package/dist/knowledge/bridge-risk.js +1 -263
- package/dist/knowledge/contact-risk.js +1 -200
- package/dist/knowledge/contact-templates.js +1 -60
- package/dist/knowledge/demand-confirm.js +1 -206
- package/dist/knowledge/demand-matching.js +1 -132
- package/dist/knowledge/demand-risk.js +1 -240
- package/dist/knowledge/demand-translation.js +1 -354
- package/dist/knowledge/deployment-scanner.js +1 -823
- package/dist/knowledge/dynamic-pricing.js +1 -87
- package/dist/knowledge/examples-scanner-cli.js +1 -26
- package/dist/knowledge/examples-scanner.js +1 -843
- package/dist/knowledge/flywheel-loop.js +1 -404
- package/dist/knowledge/fund-layer.js +1 -973
- package/dist/knowledge/glossary.js +1 -211
- package/dist/knowledge/guard-confirm.js +1 -406
- package/dist/knowledge/guard-context.js +1 -287
- package/dist/knowledge/guard-design-patterns.js +1 -360
- package/dist/knowledge/guard-ledger.js +1 -260
- package/dist/knowledge/guard-lint.js +1 -670
- package/dist/knowledge/guard-migration.js +1 -228
- package/dist/knowledge/guard-puzzle.js +1 -805
- package/dist/knowledge/guard-render.js +1 -700
- package/dist/knowledge/guard-risk.js +1 -1879
- package/dist/knowledge/guard-submission-prompt.js +1 -171
- package/dist/knowledge/guard-templates.js +1 -1105
- package/dist/knowledge/guard-translation.js +1 -1119
- package/dist/knowledge/index.js +1 -436
- package/dist/knowledge/industry-evolution.js +1 -323
- package/dist/knowledge/industry-generalizer.js +1 -381
- package/dist/knowledge/industry-registry.js +1 -174
- package/dist/knowledge/intent-metrics.d.ts +4 -3
- package/dist/knowledge/intent-metrics.js +1 -566
- package/dist/knowledge/machine-confirm.js +1 -559
- package/dist/knowledge/machine-context.js +1 -833
- package/dist/knowledge/machine-ledger.js +1 -338
- package/dist/knowledge/machine-puzzle.js +1 -494
- package/dist/knowledge/machine-render.js +1 -565
- package/dist/knowledge/machine-risk.js +1 -669
- package/dist/knowledge/machine-templates.js +1 -1597
- package/dist/knowledge/machine-topology.js +1 -234
- package/dist/knowledge/machine-translation.js +1 -513
- package/dist/knowledge/mcp-schema-audit-cli.js +1 -45
- package/dist/knowledge/mcp-schema-audit.js +1 -777
- package/dist/knowledge/onchain-constants.js +1 -35
- package/dist/knowledge/order-confirm.js +1 -573
- package/dist/knowledge/order-context.js +1 -390
- package/dist/knowledge/order-ledger.js +1 -341
- package/dist/knowledge/order-puzzle.js +1 -255
- package/dist/knowledge/order-risk.js +1 -653
- package/dist/knowledge/order-templates.js +1 -368
- package/dist/knowledge/order-translation.js +1 -550
- package/dist/knowledge/overrides-loader.js +1 -65
- package/dist/knowledge/passport-confirm.js +1 -531
- package/dist/knowledge/passport-context.js +1 -306
- package/dist/knowledge/passport-ledger.js +1 -282
- package/dist/knowledge/passport-puzzle.js +1 -333
- package/dist/knowledge/passport-risk.js +1 -450
- package/dist/knowledge/passport-templates.js +1 -568
- package/dist/knowledge/passport-translation.js +1 -516
- package/dist/knowledge/payment-risk.js +1 -249
- package/dist/knowledge/permission-confirm.js +1 -426
- package/dist/knowledge/permission-context.js +1 -224
- package/dist/knowledge/permission-ledger.js +1 -403
- package/dist/knowledge/permission-puzzle.js +1 -173
- package/dist/knowledge/permission-risk.js +1 -411
- package/dist/knowledge/permission-templates.js +1 -234
- package/dist/knowledge/permission-translation.js +1 -350
- package/dist/knowledge/personal-risk.js +1 -212
- package/dist/knowledge/process-model.js +1 -160
- package/dist/knowledge/progress-confirm.js +1 -456
- package/dist/knowledge/progress-context.js +1 -452
- package/dist/knowledge/progress-ledger.js +1 -330
- package/dist/knowledge/progress-puzzle.js +1 -219
- package/dist/knowledge/progress-risk.js +1 -461
- package/dist/knowledge/progress-templates.js +1 -228
- package/dist/knowledge/progress-translation.js +1 -405
- package/dist/knowledge/proof-confirm.js +1 -187
- package/dist/knowledge/proof-risk.js +1 -207
- package/dist/knowledge/proof-translation.js +1 -283
- package/dist/knowledge/registrar-risk.js +1 -217
- package/dist/knowledge/repository-confirm.js +1 -286
- package/dist/knowledge/repository-risk.js +1 -373
- package/dist/knowledge/repository-translation.js +1 -445
- package/dist/knowledge/reputation-rules.js +1 -99
- package/dist/knowledge/resource-risk.js +1 -157
- package/dist/knowledge/reward-confirm.js +1 -526
- package/dist/knowledge/reward-context.js +1 -504
- package/dist/knowledge/reward-ledger.js +1 -502
- package/dist/knowledge/reward-puzzle.js +1 -300
- package/dist/knowledge/reward-risk.js +1 -627
- package/dist/knowledge/reward-templates.js +1 -197
- package/dist/knowledge/reward-translation.js +1 -501
- package/dist/knowledge/safety-rules.js +1 -404
- package/dist/knowledge/scenario-modes.js +1 -321
- package/dist/knowledge/service-confirm.js +1 -807
- package/dist/knowledge/service-context.js +1 -403
- package/dist/knowledge/service-ledger.js +1 -609
- package/dist/knowledge/service-puzzle.js +1 -236
- package/dist/knowledge/service-risk.js +1 -651
- package/dist/knowledge/service-templates.js +1 -456
- package/dist/knowledge/service-translation.js +1 -622
- package/dist/knowledge/template-registry.js +1 -353
- package/dist/knowledge/tool-constraints.js +1 -195
- package/dist/knowledge/tools-reference.js +1 -178
- package/dist/knowledge/treasury-confirm.js +1 -512
- package/dist/knowledge/treasury-context.js +1 -363
- package/dist/knowledge/treasury-ledger.js +1 -300
- package/dist/knowledge/treasury-puzzle.js +1 -216
- package/dist/knowledge/treasury-risk.js +1 -440
- package/dist/knowledge/treasury-templates.js +1 -358
- package/dist/knowledge/treasury-translation.js +1 -498
- package/dist/knowledge/trust-metrics.js +1 -198
- package/dist/knowledge/util-risk.js +1 -135
- package/dist/loop-engineering/aggregate.js +1 -132
- package/dist/loop-engineering/context-collect.js +1 -83
- package/dist/loop-engineering/diagnose.js +1 -273
- package/dist/loop-engineering/improve.js +1 -405
- package/dist/loop-engineering/index.js +1 -4
- package/dist/loop-engineering/pipeline.js +1 -56
- package/dist/mode-market/index.js +1 -3
- package/dist/mode-market/registry.js +1 -124
- package/dist/mode-market/review.js +1 -214
- package/dist/mode-market/submission.js +1 -85
- package/dist/participation/collaborator-interest.d.ts +23 -0
- package/dist/participation/collaborator-interest.js +1 -0
- package/dist/participation/customer-interest.d.ts +25 -0
- package/dist/participation/customer-interest.js +1 -0
- package/dist/participation/merchant-interest.js +1 -100
- package/dist/participation/radar-core.d.ts +13 -3
- package/dist/participation/radar-core.js +1 -269
- package/dist/participation/supplier-interest.d.ts +25 -0
- package/dist/participation/supplier-interest.js +1 -0
- package/dist/persona/analyzer.js +1 -66
- package/dist/persona/bridge.js +1 -86
- package/dist/persona/defaults.js +1 -195
- package/dist/persona/experience-bridge.js +1 -23
- package/dist/persona/index.js +1 -71
- package/dist/persona/model.js +1 -111
- package/dist/persona/store.js +1 -62
- package/dist/persona/types.d.ts +3 -1
- package/dist/persona/types.js +1 -5
- package/dist/project/business-puzzle.js +1 -383
- package/dist/project/context-assembly.js +1 -254
- package/dist/project/deployment-bridge.js +1 -120
- package/dist/project/deployment-doc.js +1 -1126
- package/dist/project/edit-planner.js +1 -1342
- package/dist/project/evaluation.js +1 -2011
- package/dist/project/game-theory.js +1 -177
- package/dist/project/graph-builder.js +1 -656
- package/dist/project/graph.js +1 -340
- package/dist/project/handlers.js +1 -1784
- package/dist/project/index.d.ts +1 -0
- package/dist/project/index.js +1 -301
- package/dist/project/intent-analyzer.js +1 -149
- package/dist/project/machine-nodes.js +1 -36
- package/dist/project/merchant-guide.js +1 -264
- package/dist/project/migration.js +1 -125
- package/dist/project/mode-actions.js +1 -309
- package/dist/project/namespace.js +1 -206
- package/dist/project/participation-radar.js +1 -428
- package/dist/project/pipeline-actions.js +1 -109
- package/dist/project/project-store.js +1 -422
- package/dist/project/query.js +1 -153
- package/dist/project/reverse-mapping.d.ts +34 -0
- package/dist/project/reverse-mapping.js +1 -0
- package/dist/project/risk-aggregator.js +1 -295
- package/dist/project/rollback-policy.js +1 -290
- package/dist/project/semantic-assembler.js +1 -345
- package/dist/project/semantic-graph.js +1 -292
- package/dist/project/stage-gate.js +1 -369
- package/dist/project/substep-trace.js +1 -332
- package/dist/project/task-tracker.js +1 -78
- package/dist/role/derivation.d.ts +18 -0
- package/dist/role/derivation.js +1 -0
- package/dist/role/index.d.ts +5 -0
- package/dist/role/index.js +1 -0
- package/dist/role/model.d.ts +8 -0
- package/dist/role/model.js +1 -0
- package/dist/role/resolution.d.ts +11 -0
- package/dist/role/resolution.js +1 -0
- package/dist/role/types.d.ts +11 -0
- package/dist/role/types.js +1 -0
- package/dist/rules.js +1 -52
- package/dist/safety/confirm-gate.js +1 -88
- package/dist/safety/index.js +1 -3
- package/dist/safety/preview.js +1 -52
- package/dist/schema/call/allocation.js +1 -34
- package/dist/schema/call/arbitration.js +1 -113
- package/dist/schema/call/base.d.ts +15 -15
- package/dist/schema/call/base.js +1 -370
- package/dist/schema/call/bridge-handler.js +1 -265
- package/dist/schema/call/bridge.d.ts +7 -7
- package/dist/schema/call/bridge.js +1 -458
- package/dist/schema/call/contact.js +1 -37
- package/dist/schema/call/demand.js +1 -47
- package/dist/schema/call/guard.js +1 -161
- package/dist/schema/call/handler.js +1 -322
- package/dist/schema/call/index.js +1 -20
- package/dist/schema/call/machine.js +1 -193
- package/dist/schema/call/order.js +1 -35
- package/dist/schema/call/payment.js +1 -37
- package/dist/schema/call/permission-handler.js +1 -54
- package/dist/schema/call/permission.js +1 -105
- package/dist/schema/call/personal.js +1 -78
- package/dist/schema/call/progress.js +1 -47
- package/dist/schema/call/proof.js +1 -33
- package/dist/schema/call/repository.js +1 -77
- package/dist/schema/call/reward.js +1 -30
- package/dist/schema/call/semantic.js +1 -1679
- package/dist/schema/call/service.js +1 -184
- package/dist/schema/call/treasury.js +1 -71
- package/dist/schema/common/index.js +1 -407
- package/dist/schema/config/index.js +1 -68
- package/dist/schema/evaluation/index.d.ts +213 -16
- package/dist/schema/evaluation/index.js +1 -356
- package/dist/schema/index.js +1 -17
- package/dist/schema/intent-radar/index.d.ts +13 -13
- package/dist/schema/intent-radar/index.js +1 -89
- package/dist/schema/local/index.d.ts +21 -21
- package/dist/schema/local/index.js +1 -927
- package/dist/schema/local/wip.js +1 -187
- package/dist/schema/messenger/index.d.ts +7 -7
- package/dist/schema/messenger/index.js +1 -475
- package/dist/schema/operations.d.ts +7 -7
- package/dist/schema/operations.js +1 -520
- package/dist/schema/persona/index.d.ts +54 -54
- package/dist/schema/persona/index.js +1 -148
- package/dist/schema/project/index.d.ts +94 -48
- package/dist/schema/project/index.js +1 -2057
- package/dist/schema/query/index.d.ts +423 -7
- package/dist/schema/query/index.js +1 -1646
- package/dist/schema/schema-query/index.js +1 -104
- package/dist/schema/schema-version.js +1 -76
- package/dist/schema/sync-layer4.js +1 -286
- package/dist/schema/task-status.js +1 -36
- package/dist/schema/trust/index.js +1 -314
- package/dist/schema/utils/guard-parser.js +1 -419
- package/dist/schema/utils/guard-query-utils.js +1 -46
- package/dist/schema/utils/node-parser.js +1 -369
- package/dist/schema/utils/object-type-utils.js +1 -35
- package/dist/schema/utils/permission-index-utils.js +1 -7
- package/dist/schema/utils/permission-machine-check.js +1 -121
- package/dist/schema/utils/skills-recommendation.js +1 -77
- package/dist/schema-query/index.js +1 -810
- package/dist/schemas/account_operation.output.json +5 -2
- package/dist/schemas/bridge_operation.output.json +5 -2
- package/dist/schemas/evaluation_operation.output.json +112 -7
- package/dist/schemas/evaluation_operation.schema.json +93 -6
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/intent_radar.output.json +4 -1
- package/dist/schemas/intent_radar.schema.json +4 -1
- package/dist/schemas/local_info_operation.output.json +5 -2
- package/dist/schemas/local_mark_operation.output.json +5 -2
- package/dist/schemas/messenger_operation.output.json +5 -2
- package/dist/schemas/onchain_events.output.json +5 -2
- package/dist/schemas/onchain_operations.output.json +5 -2
- package/dist/schemas/onchain_operations.schema.json +4 -4
- package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
- package/dist/schemas/onchain_operations_machine.schema.json +2 -2
- package/dist/schemas/onchain_operations_service.schema.json +1 -1
- package/dist/schemas/onchain_table_data.output.json +6 -3
- package/dist/schemas/persona_operation.output.json +4 -1
- package/dist/schemas/persona_operation.schema.json +4 -1
- package/dist/schemas/project_operation.output.json +28 -8
- package/dist/schemas/query_toolkit.output.json +8 -5
- package/dist/schemas/wowok_buildin_info.output.json +132 -0
- package/dist/schemas/wowok_buildin_info.schema.json +14 -0
- package/dist/telemetry/index.js +1 -112
- package/dist/telemetry/redact.js +1 -23
- package/dist/telemetry/storage.js +1 -80
- package/dist/tools/handlers/bridge.js +1 -1
- package/dist/tools/handlers/config.js +1 -74
- package/dist/tools/handlers/evaluation.js +1 -123
- package/dist/tools/handlers/file-export.js +1 -90
- package/dist/tools/handlers/intent-radar.js +1 -76
- package/dist/tools/handlers/local.js +1 -53
- package/dist/tools/handlers/messenger.js +1 -188
- package/dist/tools/handlers/onchain.js +1 -1180
- package/dist/tools/handlers/persona.js +1 -89
- package/dist/tools/handlers/project.js +1 -211
- package/dist/tools/handlers/query.js +1 -434
- package/dist/tools/handlers/schema-query.js +1 -176
- package/dist/tools/handlers/task-status.js +1 -26
- package/dist/tools/handlers/trust.js +1 -380
- package/dist/tools/handlers/wip.js +1 -90
- package/dist/tools/index.js +1 -1382
- package/dist/tools/retry.js +1 -85
- package/dist/tools/rules-hook.js +1 -23
- package/dist/tools/shared.js +1 -130
- package/dist/tools/types.js +1 -1
- package/dist/tools/upgrade-check.d.ts +19 -0
- package/dist/tools/upgrade-check.js +1 -0
- package/dist/tools/wip-deploy-assist.js +1 -306
- package/dist/tools/wrap.js +1 -500
- package/package.json +4 -2
|
@@ -1,356 +1 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
const RiskLevelEnum = z.enum(["low", "medium", "high"]);
|
|
3
|
-
const PerspectiveEnum = z.enum(["customer", "operator", "observer"]);
|
|
4
|
-
const ArbStatusEnum = z.enum([
|
|
5
|
-
"Principal_confirming",
|
|
6
|
-
"Arbitrator_confirming",
|
|
7
|
-
"Voting",
|
|
8
|
-
"Arbitrated",
|
|
9
|
-
"Objectionable",
|
|
10
|
-
"Finished",
|
|
11
|
-
"Withdrawn",
|
|
12
|
-
]);
|
|
13
|
-
const ArbPerspectiveEnum = z.enum(["disputant", "arbitrator", "voter", "both"]);
|
|
14
|
-
const ExecutionPathEnum = z.enum(["order_holder", "permission", "named_operator", "not_available"]);
|
|
15
|
-
const EvaluationLevelEnum = z.enum(["low", "medium_low", "medium_high", "high"]);
|
|
16
|
-
const IndustryEnum = z.enum([
|
|
17
|
-
"freelance", "rental", "education", "travel", "subscription", "retail", "general", "custom",
|
|
18
|
-
]);
|
|
19
|
-
const RegionSchema = z
|
|
20
|
-
.object({
|
|
21
|
-
mode: z.enum(["remote", "physical"]),
|
|
22
|
-
country: z.string().optional(),
|
|
23
|
-
province: z.string().optional(),
|
|
24
|
-
city: z.string().optional(),
|
|
25
|
-
raw: z.string().describe("Original location string (for traceability)."),
|
|
26
|
-
})
|
|
27
|
-
.strict();
|
|
28
|
-
const WorkflowCapabilitiesSchema = z
|
|
29
|
-
.object({
|
|
30
|
-
has_arbitration: z.boolean(),
|
|
31
|
-
has_refund_path: z.boolean(),
|
|
32
|
-
has_milestone_nodes: z.boolean(),
|
|
33
|
-
has_compensation_fund: z.boolean(),
|
|
34
|
-
has_wip_verification: z.boolean(),
|
|
35
|
-
has_messenger: z.boolean(),
|
|
36
|
-
has_buy_guard: z.boolean(),
|
|
37
|
-
has_dynamic_pricing: z.boolean(),
|
|
38
|
-
is_published: z.boolean(),
|
|
39
|
-
is_paused: z.boolean(),
|
|
40
|
-
})
|
|
41
|
-
.strict();
|
|
42
|
-
export const CapabilityVectorSchema = z
|
|
43
|
-
.object({
|
|
44
|
-
id: z.string().describe("Service/Demand address."),
|
|
45
|
-
kind: z.enum(["service", "demand"]).describe("Whether this is a service or demand."),
|
|
46
|
-
owner: z.string().optional(),
|
|
47
|
-
industry: IndustryEnum.describe("Industry scenario."),
|
|
48
|
-
industry_confidence: z.number().min(0).max(1).optional(),
|
|
49
|
-
region: RegionSchema,
|
|
50
|
-
price_min: z.string().optional().describe("Smallest-unit amount (string to avoid JSON bigint loss)."),
|
|
51
|
-
price_max: z.string().optional().describe("Smallest-unit amount (string to avoid JSON bigint loss)."),
|
|
52
|
-
token_type: z.string().optional(),
|
|
53
|
-
ticket_size: z.enum(["micro", "small", "medium", "large"]).optional(),
|
|
54
|
-
trust_score: z.number().min(0).max(100).optional(),
|
|
55
|
-
reputation_like_ratio: z.number().min(0).max(1).optional(),
|
|
56
|
-
arbitration_independent: z.boolean().optional(),
|
|
57
|
-
merchant_history_count: z.number().int().min(0).optional(),
|
|
58
|
-
capabilities: WorkflowCapabilitiesSchema,
|
|
59
|
-
tags: z.array(z.string()).optional(),
|
|
60
|
-
keywords: z.array(z.string()).optional(),
|
|
61
|
-
})
|
|
62
|
-
.strict();
|
|
63
|
-
const ServiceExtractInputSchema = z
|
|
64
|
-
.object({
|
|
65
|
-
object: z.string().describe("Service object address."),
|
|
66
|
-
description: z.string(),
|
|
67
|
-
location: z.string(),
|
|
68
|
-
sales: z
|
|
69
|
-
.array(z.object({
|
|
70
|
-
name: z.string().optional(),
|
|
71
|
-
price: z.string().describe("Smallest-unit amount (string)."),
|
|
72
|
-
wip_hash: z.string().optional(),
|
|
73
|
-
}).strict())
|
|
74
|
-
.optional(),
|
|
75
|
-
arbitrations: z.array(z.string()).optional(),
|
|
76
|
-
compensation_fund: z.string().optional().describe("Smallest-unit amount (string)."),
|
|
77
|
-
buy_guard: z.string().nullable().optional(),
|
|
78
|
-
machine: z.string().nullable().optional(),
|
|
79
|
-
um: z.string().nullable().optional(),
|
|
80
|
-
bPublished: z.boolean().optional(),
|
|
81
|
-
bPaused: z.boolean().optional(),
|
|
82
|
-
owner: z.string().optional(),
|
|
83
|
-
})
|
|
84
|
-
.strict();
|
|
85
|
-
const DemandExtractInputSchema = z
|
|
86
|
-
.object({
|
|
87
|
-
object: z.string().describe("Demand object address."),
|
|
88
|
-
description: z.string(),
|
|
89
|
-
location: z.string(),
|
|
90
|
-
rewards: z.array(z.string()).optional(),
|
|
91
|
-
um: z.string().nullable().optional(),
|
|
92
|
-
owner: z.string().optional(),
|
|
93
|
-
})
|
|
94
|
-
.strict();
|
|
95
|
-
const UserInjectionSchema = z
|
|
96
|
-
.object({
|
|
97
|
-
intent: z.string().optional().describe("Free-text intent."),
|
|
98
|
-
preferences: z.record(z.unknown()).optional(),
|
|
99
|
-
requirements: z
|
|
100
|
-
.array(z.object({
|
|
101
|
-
rule_id: z.string(),
|
|
102
|
-
condition: z.enum(["require", "forbid"]),
|
|
103
|
-
note: z.string().optional(),
|
|
104
|
-
}).strict())
|
|
105
|
-
.optional()
|
|
106
|
-
.describe("Hard red lines (block when violated)."),
|
|
107
|
-
overrides: z
|
|
108
|
-
.object({
|
|
109
|
-
rules: z.record(z.object({ enabled: z.boolean().optional(), weight: z.number().optional() }).strict()).optional(),
|
|
110
|
-
data_sources: z.record(z.object({ enabled: z.boolean().optional() }).strict()).optional(),
|
|
111
|
-
})
|
|
112
|
-
.strict()
|
|
113
|
-
.optional()
|
|
114
|
-
.describe("Enable/disable/reweight rules and data sources."),
|
|
115
|
-
})
|
|
116
|
-
.strict();
|
|
117
|
-
const ArbGameActionSchema = z
|
|
118
|
-
.object({
|
|
119
|
-
action: z.string().describe("Recommended move (e.g. 'confirm', 'vote', 'objection', 'arb_withdraw')."),
|
|
120
|
-
favorability: z.number().int().min(0).max(100).describe("Favorability 0-100 for the perspective."),
|
|
121
|
-
is_optimal: z.boolean().describe("True when this is the top recommended move."),
|
|
122
|
-
payoff_note: z.string().describe("What the move achieves."),
|
|
123
|
-
risk: RiskLevelEnum.describe("Risk of the move."),
|
|
124
|
-
})
|
|
125
|
-
.strict();
|
|
126
|
-
const NodeForwardSchema = z
|
|
127
|
-
.object({
|
|
128
|
-
name: z.string().describe("Forward (operation) name."),
|
|
129
|
-
to_node: z.string().describe("Target node after execution."),
|
|
130
|
-
execution_path: ExecutionPathEnum.describe("How the account may execute it."),
|
|
131
|
-
guard: z.string().optional().describe("Guard address gating this forward."),
|
|
132
|
-
consequence: z.string().optional().describe("Consequence hint (completion/refund path)."),
|
|
133
|
-
})
|
|
134
|
-
.strict();
|
|
135
|
-
const NodeGameActionSchema = z
|
|
136
|
-
.object({
|
|
137
|
-
forward: z.string().describe("Forward (operation) name."),
|
|
138
|
-
to_node: z.string().describe("Target node after execution."),
|
|
139
|
-
execution_path: ExecutionPathEnum.describe("How the account may execute it."),
|
|
140
|
-
guard: z.string().optional().describe("Guard address gating this forward."),
|
|
141
|
-
favorability: z.number().int().min(0).max(100).describe("Favorability 0-100 for the perspective."),
|
|
142
|
-
is_optimal: z.boolean().describe("True when this is the top recommended move."),
|
|
143
|
-
payoff_note: z.string().describe("What the move achieves."),
|
|
144
|
-
risk: RiskLevelEnum.describe("Risk of the move."),
|
|
145
|
-
})
|
|
146
|
-
.strict();
|
|
147
|
-
const CapabilityGapSchema = z
|
|
148
|
-
.object({
|
|
149
|
-
dimension: z.string().describe("Capability dimension (has_arbitration / region / price / ...)."),
|
|
150
|
-
requirement: z.string().describe("What the demand requires."),
|
|
151
|
-
provided: z.string().describe("What the service provides."),
|
|
152
|
-
status: z.enum(["satisfied", "partial", "missing"]),
|
|
153
|
-
impact: z.enum(["critical", "major", "minor"]),
|
|
154
|
-
suggestion: z.string().describe("Actionable suggestion."),
|
|
155
|
-
})
|
|
156
|
-
.strict();
|
|
157
|
-
const CapabilityGapReportSchema = z
|
|
158
|
-
.object({
|
|
159
|
-
entity_id: z.string(),
|
|
160
|
-
satisfied: z.array(CapabilityGapSchema),
|
|
161
|
-
missing: z.array(CapabilityGapSchema),
|
|
162
|
-
coverage_score: z.number().int().min(0).max(100),
|
|
163
|
-
summary: z.string(),
|
|
164
|
-
})
|
|
165
|
-
.strict();
|
|
166
|
-
const CompositePlanSchema = z
|
|
167
|
-
.object({
|
|
168
|
-
demand: z.string(),
|
|
169
|
-
services: z.array(z.object({ id: z.string(), covered: z.array(z.string()) }).strict()),
|
|
170
|
-
coverage_score: z.number().int().min(0).max(100),
|
|
171
|
-
remaining_missing: z.array(z.string()),
|
|
172
|
-
feasibility: z.enum(["ready", "needs_supply_chain", "infeasible"]),
|
|
173
|
-
summary: z.string(),
|
|
174
|
-
})
|
|
175
|
-
.strict();
|
|
176
|
-
const EvaluationResultSchema = z
|
|
177
|
-
.object({
|
|
178
|
-
evaluation_id: z.string(),
|
|
179
|
-
total: z.number().int().min(0).max(100),
|
|
180
|
-
level: EvaluationLevelEnum,
|
|
181
|
-
breakdown: z.array(z.object({
|
|
182
|
-
rule_id: z.string(),
|
|
183
|
-
dimension: z.string(),
|
|
184
|
-
score: z.number(),
|
|
185
|
-
weight: z.number(),
|
|
186
|
-
reason: z.string().optional(),
|
|
187
|
-
matched: z.array(z.string()).optional(),
|
|
188
|
-
mismatched: z.array(z.string()).optional(),
|
|
189
|
-
red_flag: z.boolean().optional(),
|
|
190
|
-
}).strict()),
|
|
191
|
-
red_flags: z.array(z.string()),
|
|
192
|
-
blocked: z.boolean(),
|
|
193
|
-
trace: z.array(z.object({
|
|
194
|
-
kind: z.enum(["data_source", "rule", "override"]),
|
|
195
|
-
id: z.string(),
|
|
196
|
-
detail: z.string(),
|
|
197
|
-
}).strict()),
|
|
198
|
-
summary: z.string(),
|
|
199
|
-
})
|
|
200
|
-
.strict();
|
|
201
|
-
const ServiceRawDataSchema = z
|
|
202
|
-
.object({
|
|
203
|
-
name: z.string().optional(),
|
|
204
|
-
bPublished: z.boolean().optional(),
|
|
205
|
-
bPaused: z.boolean().optional(),
|
|
206
|
-
price: z.string().optional(),
|
|
207
|
-
priceRaw: z.string().optional().describe("Smallest-unit amount (string)."),
|
|
208
|
-
token_type: z.string().optional(),
|
|
209
|
-
sales: z.array(z.object({
|
|
210
|
-
suspension: z.boolean().optional(),
|
|
211
|
-
wip_url: z.string().optional(),
|
|
212
|
-
wip_hash: z.string().optional(),
|
|
213
|
-
}).strict()).optional(),
|
|
214
|
-
machine: z.string().optional(),
|
|
215
|
-
buy_guard: z.string().optional(),
|
|
216
|
-
customer_required: z.array(z.unknown()).optional(),
|
|
217
|
-
arbitrations: z.array(z.string()).optional(),
|
|
218
|
-
compensation_fund: z.object({
|
|
219
|
-
balance: z.string().optional().describe("Smallest-unit amount (string)."),
|
|
220
|
-
}).strict().optional(),
|
|
221
|
-
compensation_lock_duration: z.number().optional(),
|
|
222
|
-
um: z.string().optional(),
|
|
223
|
-
})
|
|
224
|
-
.strict();
|
|
225
|
-
const MachineNodeRawSchema = z
|
|
226
|
-
.object({
|
|
227
|
-
name: z.string(),
|
|
228
|
-
forwards: z.array(z.object({
|
|
229
|
-
name: z.string().optional(),
|
|
230
|
-
weight: z.number().optional(),
|
|
231
|
-
namedOperator: z.string().nullable().optional(),
|
|
232
|
-
guard: z.string().nullable().optional(),
|
|
233
|
-
to: z.string().optional(),
|
|
234
|
-
}).strict()).optional(),
|
|
235
|
-
is_pair_done: z.boolean().optional(),
|
|
236
|
-
})
|
|
237
|
-
.strict();
|
|
238
|
-
const ReviewRawSchema = z
|
|
239
|
-
.object({
|
|
240
|
-
rating: z.string().optional(),
|
|
241
|
-
reviewer: z.string().optional(),
|
|
242
|
-
verified: z.boolean().optional(),
|
|
243
|
-
has_evidence: z.boolean().optional(),
|
|
244
|
-
timestamp: z.number().optional(),
|
|
245
|
-
})
|
|
246
|
-
.strict();
|
|
247
|
-
const EventRawSchema = z
|
|
248
|
-
.object({
|
|
249
|
-
type: z.string(),
|
|
250
|
-
timestamp: z.number().optional(),
|
|
251
|
-
address: z.string().optional(),
|
|
252
|
-
data: z.record(z.unknown()).optional(),
|
|
253
|
-
})
|
|
254
|
-
.strict();
|
|
255
|
-
export const PuzzleRawDataSchema = z
|
|
256
|
-
.object({
|
|
257
|
-
service: ServiceRawDataSchema,
|
|
258
|
-
machine_nodes: z.array(MachineNodeRawSchema).optional(),
|
|
259
|
-
machine_published: z.boolean().optional(),
|
|
260
|
-
machine_paused: z.boolean().optional(),
|
|
261
|
-
reviews: z.array(ReviewRawSchema).optional(),
|
|
262
|
-
events: z.array(EventRawSchema).optional(),
|
|
263
|
-
similar_services: z.array(z.object({ price: z.string() }).strict()).optional(),
|
|
264
|
-
order_amount: z.string().optional().describe("Smallest-unit amount (string)."),
|
|
265
|
-
trust_score: z.object({ score: z.number(), level: z.string() }).strict().optional(),
|
|
266
|
-
arbitration_owner: z.string().optional(),
|
|
267
|
-
service_owner: z.string().optional(),
|
|
268
|
-
wip_verified: z.boolean().optional(),
|
|
269
|
-
order_history: z.array(z.object({ status: z.string(), has_dispute: z.boolean(), is_repeat: z.boolean() }).strict()).optional(),
|
|
270
|
-
merchant_reputation: z.object({ likes: z.number(), dislikes: z.number() }).strict().optional(),
|
|
271
|
-
})
|
|
272
|
-
.strict();
|
|
273
|
-
export const EvaluationOperationInputSchema = z.discriminatedUnion("action", [
|
|
274
|
-
z.object({ action: z.literal("arb_game"), status: ArbStatusEnum, perspective: ArbPerspectiveEnum }).strict(),
|
|
275
|
-
z.object({
|
|
276
|
-
action: z.literal("node_game"),
|
|
277
|
-
current_node: z.string(),
|
|
278
|
-
perspective: PerspectiveEnum,
|
|
279
|
-
operable: z.array(NodeForwardSchema),
|
|
280
|
-
waiting_on: z.array(z.object({ role: z.string(), forwards: z.array(z.string()) }).strict()).optional(),
|
|
281
|
-
}).strict(),
|
|
282
|
-
z.object({
|
|
283
|
-
action: z.literal("capability_gap"),
|
|
284
|
-
demand: CapabilityVectorSchema,
|
|
285
|
-
service: CapabilityVectorSchema,
|
|
286
|
-
}).strict(),
|
|
287
|
-
z.object({
|
|
288
|
-
action: z.literal("compose_service"),
|
|
289
|
-
demand: CapabilityVectorSchema,
|
|
290
|
-
services: z.array(CapabilityVectorSchema),
|
|
291
|
-
}).strict(),
|
|
292
|
-
z.object({
|
|
293
|
-
action: z.literal("demand_match"),
|
|
294
|
-
demand_cap: CapabilityVectorSchema,
|
|
295
|
-
services: z.array(ServiceExtractInputSchema),
|
|
296
|
-
injection: UserInjectionSchema.optional(),
|
|
297
|
-
account: z.string().optional().describe("Account address; its persona is auto-applied as the base injection (explicit injection overrides)."),
|
|
298
|
-
}).strict(),
|
|
299
|
-
z.object({
|
|
300
|
-
action: z.literal("service_match"),
|
|
301
|
-
service_cap: CapabilityVectorSchema,
|
|
302
|
-
demands: z.array(DemandExtractInputSchema),
|
|
303
|
-
injection: UserInjectionSchema.optional(),
|
|
304
|
-
account: z.string().optional().describe("Account address; its persona is auto-applied as the base injection."),
|
|
305
|
-
}).strict(),
|
|
306
|
-
z.object({
|
|
307
|
-
action: z.literal("service_risk"),
|
|
308
|
-
service_id: z.string().describe("Service object address or LocalMark name."),
|
|
309
|
-
puzzle_raw: PuzzleRawDataSchema,
|
|
310
|
-
injection: UserInjectionSchema.optional(),
|
|
311
|
-
depth: z.enum(["browse", "evaluate", "preorder", "monitor"]).optional(),
|
|
312
|
-
account: z.string().optional().describe("Account address; its persona is auto-applied as the base injection."),
|
|
313
|
-
}).strict(),
|
|
314
|
-
]);
|
|
315
|
-
export const EvaluationOperationOutputSchema = z
|
|
316
|
-
.object({
|
|
317
|
-
result: z
|
|
318
|
-
.discriminatedUnion("action", [
|
|
319
|
-
z.object({
|
|
320
|
-
action: z.literal("arb_game"),
|
|
321
|
-
status: ArbStatusEnum,
|
|
322
|
-
perspective: ArbPerspectiveEnum,
|
|
323
|
-
actions: z.array(ArbGameActionSchema),
|
|
324
|
-
summary: z.string(),
|
|
325
|
-
}).strict(),
|
|
326
|
-
z.object({
|
|
327
|
-
action: z.literal("node_game"),
|
|
328
|
-
current_node: z.string(),
|
|
329
|
-
perspective: PerspectiveEnum,
|
|
330
|
-
actions: z.array(NodeGameActionSchema),
|
|
331
|
-
summary: z.string(),
|
|
332
|
-
}).strict(),
|
|
333
|
-
z.object({
|
|
334
|
-
action: z.literal("capability_gap"),
|
|
335
|
-
report: CapabilityGapReportSchema,
|
|
336
|
-
}).strict(),
|
|
337
|
-
z.object({
|
|
338
|
-
action: z.literal("compose_service"),
|
|
339
|
-
plan: CompositePlanSchema,
|
|
340
|
-
}).strict(),
|
|
341
|
-
z.object({
|
|
342
|
-
action: z.literal("demand_match"),
|
|
343
|
-
matches: z.array(z.object({ service: ServiceExtractInputSchema, result: EvaluationResultSchema }).strict()),
|
|
344
|
-
}).strict(),
|
|
345
|
-
z.object({
|
|
346
|
-
action: z.literal("service_match"),
|
|
347
|
-
matches: z.array(z.object({ demand: DemandExtractInputSchema, result: EvaluationResultSchema }).strict()),
|
|
348
|
-
}).strict(),
|
|
349
|
-
z.object({
|
|
350
|
-
action: z.literal("service_risk"),
|
|
351
|
-
result: EvaluationResultSchema,
|
|
352
|
-
}).strict(),
|
|
353
|
-
])
|
|
354
|
-
.describe("Evaluation result — shape depends on action"),
|
|
355
|
-
})
|
|
356
|
-
.strict();
|
|
1
|
+
import{z}from'zod';const RiskLevelEnum=z['enum'](['low','medium','high']),RiskAppetiteEnum=z['enum'](['conservative','balanced','aggressive']),PerspectiveEnum=z['enum'](['merchant','customer','prospect','supplier','collaborator','arbitrator']),ArbStatusEnum=z['enum'](['Principal_confirming','Arbitrator_confirming','Voting','Arbitrated','Objectionable','Finished','Withdrawn']),ArbPerspectiveEnum=z['enum'](['customer','merchant','arbitrator']),ExecutionPathEnum=z['enum'](['order_holder','permission','named_operator','not_available']),EvaluationLevelEnum=z['enum'](['low','medium_low','medium_high','high']),IndustryEnum=z['enum'](['freelance','rental','education','travel','subscription','retail','general','custom']),RegionSchema=z['object']({'mode':z['enum'](['remote','physical']),'country':z['string']()['optional'](),'province':z['string']()['optional'](),'city':z['string']()['optional'](),'raw':z['string']()['describe']('Original\x20location\x20string\x20(for\x20traceability).')})['strict'](),WorkflowCapabilitiesSchema=z['object']({'has_arbitration':z['boolean'](),'has_refund_path':z['boolean'](),'has_milestone_nodes':z['boolean'](),'has_compensation_fund':z['boolean'](),'has_wip_verification':z['boolean'](),'has_messenger':z['boolean'](),'has_buy_guard':z['boolean'](),'has_dynamic_pricing':z['boolean'](),'is_published':z['boolean'](),'is_paused':z['boolean']()})['strict']();export const CapabilityVectorSchema=z['object']({'id':z['string']()['describe']('Service/Demand\x20address.'),'kind':z['enum'](['service','demand'])['describe']('Whether\x20this\x20is\x20a\x20service\x20or\x20demand.'),'owner':z['string']()['optional'](),'industry':IndustryEnum['describe']('Industry\x20scenario.'),'industry_confidence':z['number']()['min'](0x0)['max'](0x1)['optional'](),'region':RegionSchema,'price_min':z['string']()['optional']()['describe']('Smallest-unit\x20amount\x20(string\x20to\x20avoid\x20JSON\x20bigint\x20loss).'),'price_max':z['string']()['optional']()['describe']('Smallest-unit\x20amount\x20(string\x20to\x20avoid\x20JSON\x20bigint\x20loss).'),'token_type':z['string']()['optional'](),'ticket_size':z['enum'](['micro','small','medium','large'])['optional'](),'trust_score':z['number']()['min'](0x0)['max'](0x64)['optional'](),'reputation_like_ratio':z['number']()['min'](0x0)['max'](0x1)['optional'](),'arbitration_independent':z['boolean']()['optional'](),'merchant_history_count':z['number']()['int']()['min'](0x0)['optional'](),'capabilities':WorkflowCapabilitiesSchema,'tags':z['array'](z['string']())['optional'](),'keywords':z['array'](z['string']())['optional']()})['strict']();const ServiceExtractInputSchema=z['object']({'object':z['string']()['describe']('Service\x20object\x20address.'),'description':z['string'](),'location':z['string'](),'sales':z['array'](z['object']({'name':z['string']()['optional'](),'price':z['string']()['describe']('Smallest-unit\x20amount\x20(string).'),'wip_hash':z['string']()['optional']()})['strict']())['optional'](),'arbitrations':z['array'](z['string']())['optional'](),'compensation_fund':z['string']()['optional']()['describe']('Smallest-unit\x20amount\x20(string).'),'buy_guard':z['string']()['nullable']()['optional'](),'machine':z['string']()['nullable']()['optional'](),'um':z['string']()['nullable']()['optional'](),'bPublished':z['boolean']()['optional'](),'bPaused':z['boolean']()['optional'](),'owner':z['string']()['optional']()})['strict'](),DemandExtractInputSchema=z['object']({'object':z['string']()['describe']('Demand\x20object\x20address.'),'description':z['string'](),'location':z['string'](),'rewards':z['array'](z['string']())['optional'](),'um':z['string']()['nullable']()['optional'](),'owner':z['string']()['optional']()})['strict'](),UserInjectionSchema=z['object']({'intent':z['string']()['optional']()['describe']('Free-text\x20intent.'),'preferences':z['record'](z['unknown']())['optional'](),'requirements':z['array'](z['object']({'rule_id':z['string'](),'condition':z['enum'](['require','forbid']),'note':z['string']()['optional']()})['strict']())['optional']()['describe']('Hard\x20red\x20lines\x20(block\x20when\x20violated).'),'overrides':z['object']({'rules':z['record'](z['object']({'enabled':z['boolean']()['optional'](),'weight':z['number']()['optional']()})['strict']())['optional'](),'data_sources':z['record'](z['object']({'enabled':z['boolean']()['optional']()})['strict']())['optional']()})['strict']()['optional']()['describe']('Enable/disable/reweight\x20rules\x20and\x20data\x20sources.')})['strict'](),ArbGameActionSchema=z['object']({'action':z['string']()['describe']('Recommended\x20move\x20(e.g.\x20\x27confirm\x27,\x20\x27vote\x27,\x20\x27objection\x27,\x20\x27arb_withdraw\x27).'),'favorability':z['number']()['int']()['min'](0x0)['max'](0x64)['describe']('Favorability\x200-100\x20for\x20the\x20perspective.'),'gain_score':z['number']()['int']()['min'](0x0)['describe']('Gain\x20points\x20(收益).'),'risk_score':z['number']()['int']()['min'](0x0)['describe']('Risk\x20points\x20(风险,\x20appetite-adjusted).'),'is_optimal':z['boolean']()['describe']('True\x20when\x20this\x20is\x20the\x20top\x20recommended\x20move.'),'payoff_note':z['string']()['describe']('What\x20the\x20move\x20achieves.'),'risk':RiskLevelEnum['describe']('Risk\x20of\x20the\x20move.')})['strict'](),NodeForwardSchema=z['object']({'name':z['string']()['describe']('Forward\x20(operation)\x20name.'),'to_node':z['string']()['describe']('Target\x20node\x20after\x20execution.'),'execution_path':ExecutionPathEnum['describe']('How\x20the\x20account\x20may\x20execute\x20it.'),'guard':z['string']()['optional']()['describe']('Guard\x20address\x20gating\x20this\x20forward.'),'consequence':z['string']()['optional']()['describe']('Consequence\x20hint\x20(completion/refund\x20path).'),'weight':z['number']()['optional']()['describe']('Forward\x20weight\x20(accumulates\x20toward\x20the\x20pair\x27s\x20threshold).')})['strict'](),NodeGameActionSchema=z['object']({'forward':z['string']()['describe']('Forward\x20(operation)\x20name.'),'to_node':z['string']()['describe']('Target\x20node\x20after\x20execution.'),'execution_path':ExecutionPathEnum['describe']('How\x20the\x20account\x20may\x20execute\x20it.'),'guard':z['string']()['optional']()['describe']('Guard\x20address\x20gating\x20this\x20forward.'),'favorability':z['number']()['int']()['min'](0x0)['max'](0x64)['describe']('Net\x20favorability\x200-100\x20for\x20the\x20perspective\x20(gain\x20−\x20risk).'),'gain_score':z['number']()['int']()['min'](0x0)['describe']('Gain\x20points\x20(收益).'),'risk_score':z['number']()['int']()['min'](0x0)['describe']('Risk\x20points\x20(风险,\x20appetite-adjusted).'),'is_optimal':z['boolean']()['describe']('True\x20when\x20this\x20is\x20the\x20top\x20recommended\x20move.'),'payoff_note':z['string']()['describe']('What\x20the\x20move\x20achieves.'),'risk':RiskLevelEnum['describe']('Risk\x20of\x20the\x20move.')})['strict'](),AllocationSummarySchema=z['object']({'recipient_slots':z['number']()['int']()['min'](0x0)['describe']('Total\x20recipient\x20slots\x20across\x20allocators.'),'guard_gated_slots':z['number']()['int']()['min'](0x0)['describe']('Slots\x20resolved\x20at\x20settlement\x20by\x20a\x20Guard.'),'direct_to_me_slots':z['number']()['int']()['min'](0x0)['describe']('Slots\x20paying\x20directly\x20to\x20this\x20role.'),'to_payer_slots':z['number']()['int']()['min'](0x0)['describe']('Slots\x20routing\x20back\x20to\x20the\x20payer\x20(refund-oriented).')})['strict'](),CooperationInfoSchema=z['object']({'threshold':z['number']()['int']()['min'](0x1)['describe']('Pair\x20threshold\x20(accumulated\x20forward\x20weights\x20to\x20advance).'),'my_weight':z['number']()['int']()['min'](0x0)['describe']('Weight\x20THIS\x20role\x20can\x20contribute.'),'needed_from_others':z['number']()['int']()['min'](0x0)['describe']('Weight\x20still\x20needed\x20from\x20other\x20roles\x20(0\x20=\x20can\x20advance\x20alone).'),'collaborators':z['array'](z['string']())['describe']('Roles\x20that\x20must\x20cooperate\x20to\x20reach\x20the\x20threshold.'),'allocation':AllocationSummarySchema['optional']()['describe']('Allocation\x20waterfall\x20—\x20how\x20funds\x20split\x20once\x20the\x20node\x20advances\x20(利益分配).'),'allocation_note':z['string']()['optional']()['describe']('Human-readable利益分配说明.')})['strict'](),CapabilityGapSchema=z['object']({'dimension':z['string']()['describe']('Capability\x20dimension\x20(has_arbitration\x20/\x20region\x20/\x20price\x20/\x20...).'),'requirement':z['string']()['describe']('What\x20the\x20demand\x20requires.'),'provided':z['string']()['describe']('What\x20the\x20service\x20provides.'),'status':z['enum'](['satisfied','partial','missing']),'impact':z['enum'](['critical','major','minor']),'suggestion':z['string']()['describe']('Actionable\x20suggestion.')})['strict'](),CapabilityGapReportSchema=z['object']({'entity_id':z['string'](),'satisfied':z['array'](CapabilityGapSchema),'missing':z['array'](CapabilityGapSchema),'coverage_score':z['number']()['int']()['min'](0x0)['max'](0x64),'summary':z['string']()})['strict'](),CompositePlanSchema=z['object']({'demand':z['string'](),'services':z['array'](z['object']({'id':z['string'](),'covered':z['array'](z['string']())})['strict']()),'coverage_score':z['number']()['int']()['min'](0x0)['max'](0x64),'remaining_missing':z['array'](z['string']()),'feasibility':z['enum'](['ready','needs_supply_chain','infeasible']),'summary':z['string']()})['strict'](),EvaluationResultSchema=z['object']({'evaluation_id':z['string'](),'total':z['number']()['int']()['min'](0x0)['max'](0x64),'level':EvaluationLevelEnum,'breakdown':z['array'](z['object']({'rule_id':z['string'](),'dimension':z['string'](),'score':z['number'](),'weight':z['number'](),'reason':z['string']()['optional'](),'matched':z['array'](z['string']())['optional'](),'mismatched':z['array'](z['string']())['optional'](),'red_flag':z['boolean']()['optional']()})['strict']()),'red_flags':z['array'](z['string']()),'blocked':z['boolean'](),'trace':z['array'](z['object']({'kind':z['enum'](['data_source','rule','override']),'id':z['string'](),'detail':z['string']()})['strict']()),'summary':z['string']()})['strict'](),ServiceRawDataSchema=z['object']({'name':z['string']()['optional'](),'bPublished':z['boolean']()['optional'](),'bPaused':z['boolean']()['optional'](),'price':z['string']()['optional'](),'priceRaw':z['string']()['optional']()['describe']('Smallest-unit\x20amount\x20(string).'),'token_type':z['string']()['optional'](),'sales':z['array'](z['object']({'suspension':z['boolean']()['optional'](),'wip_url':z['string']()['optional'](),'wip_hash':z['string']()['optional']()})['strict']())['optional'](),'machine':z['string']()['optional'](),'buy_guard':z['string']()['optional'](),'customer_required':z['array'](z['unknown']())['optional'](),'arbitrations':z['array'](z['string']())['optional'](),'compensation_fund':z['object']({'balance':z['string']()['optional']()['describe']('Smallest-unit\x20amount\x20(string).')})['strict']()['optional'](),'compensation_lock_duration':z['number']()['optional'](),'um':z['string']()['optional']()})['strict'](),MachineNodeRawSchema=z['object']({'name':z['string'](),'forwards':z['array'](z['object']({'name':z['string']()['optional'](),'weight':z['number']()['optional'](),'namedOperator':z['string']()['nullable']()['optional'](),'guard':z['string']()['nullable']()['optional'](),'to':z['string']()['optional']()})['strict']())['optional'](),'is_pair_done':z['boolean']()['optional']()})['strict'](),ReviewRawSchema=z['object']({'rating':z['string']()['optional'](),'reviewer':z['string']()['optional'](),'verified':z['boolean']()['optional'](),'has_evidence':z['boolean']()['optional'](),'timestamp':z['number']()['optional']()})['strict'](),EventRawSchema=z['object']({'type':z['string'](),'timestamp':z['number']()['optional'](),'address':z['string']()['optional'](),'data':z['record'](z['unknown']())['optional']()})['strict']();export const PuzzleRawDataSchema=z['object']({'service':ServiceRawDataSchema,'machine_nodes':z['array'](MachineNodeRawSchema)['optional'](),'machine_published':z['boolean']()['optional'](),'machine_paused':z['boolean']()['optional'](),'reviews':z['array'](ReviewRawSchema)['optional'](),'events':z['array'](EventRawSchema)['optional'](),'similar_services':z['array'](z['object']({'price':z['string']()})['strict']())['optional'](),'order_amount':z['string']()['optional']()['describe']('Smallest-unit\x20amount\x20(string).'),'trust_score':z['object']({'score':z['number'](),'level':z['string']()})['strict']()['optional'](),'arbitration_owner':z['string']()['optional'](),'service_owner':z['string']()['optional'](),'wip_verified':z['boolean']()['optional'](),'order_history':z['array'](z['object']({'status':z['string'](),'has_dispute':z['boolean'](),'is_repeat':z['boolean']()})['strict']())['optional'](),'merchant_reputation':z['object']({'likes':z['number'](),'dislikes':z['number']()})['strict']()['optional']()})['strict']();export const EvaluationOperationInputSchema=z['discriminatedUnion']('action',[z['object']({'action':z['literal']('arb_game'),'status':ArbStatusEnum,'perspective':ArbPerspectiveEnum,'appetite':RiskAppetiteEnum['optional']()['describe']('Risk\x20appetite\x20—\x20adjusts\x20risk\x20sensitivity\x20(conservative\x20amplifies\x20risk).'),'account':z['string']()['optional']()['describe']('Account\x20address;\x20its\x20persona\x27s\x20risk_appetite\x20is\x20used\x20as\x20the\x20default\x20appetite.'),'requirements':z['array'](z['string']())['optional']()['describe']('Persona\x20red\x20lines\x20that\x20re-anchor\x20the\x20role\x27s\x20prefer/avoid\x20(人设驱动力).')})['strict'](),z['object']({'action':z['literal']('node_game'),'current_node':z['string'](),'perspective':PerspectiveEnum,'appetite':RiskAppetiteEnum['optional']()['describe']('Risk\x20appetite\x20—\x20adjusts\x20risk\x20sensitivity\x20(conservative\x20amplifies\x20risk).'),'account':z['string']()['optional']()['describe']('Account\x20address;\x20its\x20persona\x27s\x20risk_appetite\x20is\x20used\x20as\x20the\x20default\x20appetite.'),'threshold':z['number']()['int']()['min'](0x1)['optional']()['describe']('Pair\x20threshold\x20—\x20when\x20>\x201,\x20multi-role\x20cooperation\x20is\x20needed\x20to\x20advance.'),'allocation':AllocationSummarySchema['optional']()['describe']('Allocation\x20waterfall\x20—\x20how\x20funds\x20split\x20after\x20the\x20node\x20advances\x20(利益分配).'),'requirements':z['array'](z['string']())['optional']()['describe']('Persona\x20red\x20lines\x20that\x20re-anchor\x20the\x20role\x27s\x20prefer/avoid\x20(人设驱动力).'),'order_amount':z['string']()['optional']()['describe']('Escrowed\x20order\x20amount\x20(smallest-unit\x20string)\x20—\x20the\x20monetary\x20stake\x20at\x20this\x20node\x20(数值化).'),'compensation_fund':z['string']()['optional']()['describe']('Merchant\x20compensation_fund\x20(smallest-unit\x20string)\x20—\x20the\x20monetary\x20risk\x20exposure\x20backing\x20indemnity.'),'operable':z['array'](NodeForwardSchema),'waiting_on':z['array'](z['object']({'role':z['string'](),'forwards':z['array'](z['string']())})['strict']())['optional']()})['strict'](),z['object']({'action':z['literal']('capability_gap'),'demand':CapabilityVectorSchema,'service':CapabilityVectorSchema})['strict'](),z['object']({'action':z['literal']('compose_service'),'demand':CapabilityVectorSchema,'services':z['array'](CapabilityVectorSchema)})['strict'](),z['object']({'action':z['literal']('demand_match'),'demand_cap':CapabilityVectorSchema,'services':z['array'](ServiceExtractInputSchema),'injection':UserInjectionSchema['optional'](),'account':z['string']()['optional']()['describe']('Account\x20address;\x20its\x20persona\x20is\x20auto-applied\x20as\x20the\x20base\x20injection\x20(explicit\x20injection\x20overrides).')})['strict'](),z['object']({'action':z['literal']('service_match'),'service_cap':CapabilityVectorSchema,'demands':z['array'](DemandExtractInputSchema),'injection':UserInjectionSchema['optional'](),'account':z['string']()['optional']()['describe']('Account\x20address;\x20its\x20persona\x20is\x20auto-applied\x20as\x20the\x20base\x20injection.')})['strict'](),z['object']({'action':z['literal']('service_risk'),'service_id':z['string']()['describe']('Service\x20object\x20address\x20or\x20LocalMark\x20name.'),'puzzle_raw':PuzzleRawDataSchema,'injection':UserInjectionSchema['optional'](),'depth':z['enum'](['browse','evaluate','preorder','monitor'])['optional'](),'account':z['string']()['optional']()['describe']('Account\x20address;\x20its\x20persona\x20is\x20auto-applied\x20as\x20the\x20base\x20injection.')})['strict']()]);export const EvaluationOperationOutputSchema=z['object']({'result':z['discriminatedUnion']('action',[z['object']({'action':z['literal']('arb_game'),'status':ArbStatusEnum,'perspective':ArbPerspectiveEnum,'actions':z['array'](ArbGameActionSchema),'summary':z['string']()})['strict'](),z['object']({'action':z['literal']('node_game'),'current_node':z['string'](),'perspective':PerspectiveEnum,'actions':z['array'](NodeGameActionSchema),'cooperation':CooperationInfoSchema['optional'](),'value_at_stake':z['string']()['optional']()['describe']('Escrowed\x20order\x20amount\x20(smallest-unit\x20string)\x20—\x20the\x20monetary\x20value\x20at\x20stake.'),'risk_exposure':z['string']()['optional']()['describe']('Compensation_fund\x20(smallest-unit\x20string)\x20—\x20the\x20monetary\x20risk\x20exposure\x20backing\x20indemnity.'),'summary':z['string']()})['strict'](),z['object']({'action':z['literal']('capability_gap'),'report':CapabilityGapReportSchema})['strict'](),z['object']({'action':z['literal']('compose_service'),'plan':CompositePlanSchema})['strict'](),z['object']({'action':z['literal']('demand_match'),'matches':z['array'](z['object']({'service':ServiceExtractInputSchema,'result':EvaluationResultSchema})['strict']())})['strict'](),z['object']({'action':z['literal']('service_match'),'matches':z['array'](z['object']({'demand':DemandExtractInputSchema,'result':EvaluationResultSchema})['strict']())})['strict'](),z['object']({'action':z['literal']('service_risk'),'result':EvaluationResultSchema})['strict']()])['describe']('Evaluation\x20result\x20—\x20shape\x20depends\x20on\x20action')})['strict']();
|
package/dist/schema/index.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from './query/index.js';
|
|
3
|
-
export * from './local/index.js';
|
|
4
|
-
export * from './messenger/index.js';
|
|
5
|
-
export * from './common/index.js';
|
|
6
|
-
export * from './operations.js';
|
|
7
|
-
export * from './utils/guard-parser.js';
|
|
8
|
-
export * from './utils/node-parser.js';
|
|
9
|
-
export * from './project/index.js';
|
|
10
|
-
export * from './config/index.js';
|
|
11
|
-
export * from './trust/index.js';
|
|
12
|
-
export * from './evaluation/index.js';
|
|
13
|
-
export * from './task-status.js';
|
|
14
|
-
export * from './persona/index.js';
|
|
15
|
-
export * from './intent-radar/index.js';
|
|
16
|
-
export * from './schema-query/index.js';
|
|
17
|
-
export { MCP_SCHEMA_VERSION, getSchemaVersions, checkClientSchemaCompatibility, attachSchemaWarning, } from './schema-version.js';
|
|
1
|
+
export*from'./call/index.js';export*from'./query/index.js';export*from'./local/index.js';export*from'./messenger/index.js';export*from'./common/index.js';export*from'./operations.js';export*from'./utils/guard-parser.js';export*from'./utils/node-parser.js';export*from'./project/index.js';export*from'./config/index.js';export*from'./trust/index.js';export*from'./evaluation/index.js';export*from'./task-status.js';export*from'./persona/index.js';export*from'./intent-radar/index.js';export*from'./schema-query/index.js';export{MCP_SCHEMA_VERSION,getSchemaVersions,checkClientSchemaCompatibility,attachSchemaWarning}from'./schema-version.js';
|
|
@@ -3,19 +3,19 @@ export declare const IntentRadarInputSchema: z.ZodDiscriminatedUnion<"action", [
|
|
|
3
3
|
action: z.ZodLiteral<"save">;
|
|
4
4
|
intent: z.ZodString;
|
|
5
5
|
account: z.ZodOptional<z.ZodString>;
|
|
6
|
-
role: z.ZodOptional<z.ZodEnum<["merchant", "
|
|
6
|
+
role: z.ZodOptional<z.ZodEnum<["merchant", "customer", "prospect", "supplier", "collaborator", "arbitrator"]>>;
|
|
7
7
|
target_types: z.ZodOptional<z.ZodArray<z.ZodEnum<["NewOrderEvent", "ProgressEvent", "DemandPresentEvent", "DemandFeedbackEvent", "NewEntityEvent", "ArbEvent"]>, "many">>;
|
|
8
8
|
}, "strict", z.ZodTypeAny, {
|
|
9
9
|
intent: string;
|
|
10
10
|
action: "save";
|
|
11
11
|
account?: string | undefined;
|
|
12
|
-
role?: "
|
|
12
|
+
role?: "merchant" | "customer" | "prospect" | "supplier" | "collaborator" | "arbitrator" | undefined;
|
|
13
13
|
target_types?: ("NewOrderEvent" | "ArbEvent" | "ProgressEvent" | "DemandPresentEvent" | "DemandFeedbackEvent" | "NewEntityEvent")[] | undefined;
|
|
14
14
|
}, {
|
|
15
15
|
intent: string;
|
|
16
16
|
action: "save";
|
|
17
17
|
account?: string | undefined;
|
|
18
|
-
role?: "
|
|
18
|
+
role?: "merchant" | "customer" | "prospect" | "supplier" | "collaborator" | "arbitrator" | undefined;
|
|
19
19
|
target_types?: ("NewOrderEvent" | "ArbEvent" | "ProgressEvent" | "DemandPresentEvent" | "DemandFeedbackEvent" | "NewEntityEvent")[] | undefined;
|
|
20
20
|
}>, z.ZodObject<{
|
|
21
21
|
action: z.ZodLiteral<"list">;
|
|
@@ -63,7 +63,7 @@ export declare const IntentRadarOutputSchema: z.ZodDiscriminatedUnion<"action",
|
|
|
63
63
|
id: z.ZodString;
|
|
64
64
|
intent: z.ZodString;
|
|
65
65
|
account: z.ZodOptional<z.ZodString>;
|
|
66
|
-
role: z.ZodOptional<z.ZodEnum<["merchant", "
|
|
66
|
+
role: z.ZodOptional<z.ZodEnum<["merchant", "customer", "prospect", "supplier", "collaborator", "arbitrator"]>>;
|
|
67
67
|
industries: z.ZodArray<z.ZodEnum<["freelance", "rental", "education", "travel", "subscription", "retail", "general", "custom"]>, "many">;
|
|
68
68
|
keywords: z.ZodArray<z.ZodString, "many">;
|
|
69
69
|
target_types: z.ZodArray<z.ZodEnum<["NewOrderEvent", "ProgressEvent", "DemandPresentEvent", "DemandFeedbackEvent", "NewEntityEvent", "ArbEvent"]>, "many">;
|
|
@@ -78,7 +78,7 @@ export declare const IntentRadarOutputSchema: z.ZodDiscriminatedUnion<"action",
|
|
|
78
78
|
target_types: ("NewOrderEvent" | "ArbEvent" | "ProgressEvent" | "DemandPresentEvent" | "DemandFeedbackEvent" | "NewEntityEvent")[];
|
|
79
79
|
created_at: number;
|
|
80
80
|
account?: string | undefined;
|
|
81
|
-
role?: "
|
|
81
|
+
role?: "merchant" | "customer" | "prospect" | "supplier" | "collaborator" | "arbitrator" | undefined;
|
|
82
82
|
}, {
|
|
83
83
|
id: string;
|
|
84
84
|
intent: string;
|
|
@@ -88,7 +88,7 @@ export declare const IntentRadarOutputSchema: z.ZodDiscriminatedUnion<"action",
|
|
|
88
88
|
target_types: ("NewOrderEvent" | "ArbEvent" | "ProgressEvent" | "DemandPresentEvent" | "DemandFeedbackEvent" | "NewEntityEvent")[];
|
|
89
89
|
created_at: number;
|
|
90
90
|
account?: string | undefined;
|
|
91
|
-
role?: "
|
|
91
|
+
role?: "merchant" | "customer" | "prospect" | "supplier" | "collaborator" | "arbitrator" | undefined;
|
|
92
92
|
}>;
|
|
93
93
|
}, "strict", z.ZodTypeAny, {
|
|
94
94
|
intent: {
|
|
@@ -100,7 +100,7 @@ export declare const IntentRadarOutputSchema: z.ZodDiscriminatedUnion<"action",
|
|
|
100
100
|
target_types: ("NewOrderEvent" | "ArbEvent" | "ProgressEvent" | "DemandPresentEvent" | "DemandFeedbackEvent" | "NewEntityEvent")[];
|
|
101
101
|
created_at: number;
|
|
102
102
|
account?: string | undefined;
|
|
103
|
-
role?: "
|
|
103
|
+
role?: "merchant" | "customer" | "prospect" | "supplier" | "collaborator" | "arbitrator" | undefined;
|
|
104
104
|
};
|
|
105
105
|
action: "save";
|
|
106
106
|
}, {
|
|
@@ -113,7 +113,7 @@ export declare const IntentRadarOutputSchema: z.ZodDiscriminatedUnion<"action",
|
|
|
113
113
|
target_types: ("NewOrderEvent" | "ArbEvent" | "ProgressEvent" | "DemandPresentEvent" | "DemandFeedbackEvent" | "NewEntityEvent")[];
|
|
114
114
|
created_at: number;
|
|
115
115
|
account?: string | undefined;
|
|
116
|
-
role?: "
|
|
116
|
+
role?: "merchant" | "customer" | "prospect" | "supplier" | "collaborator" | "arbitrator" | undefined;
|
|
117
117
|
};
|
|
118
118
|
action: "save";
|
|
119
119
|
}>, z.ZodObject<{
|
|
@@ -122,7 +122,7 @@ export declare const IntentRadarOutputSchema: z.ZodDiscriminatedUnion<"action",
|
|
|
122
122
|
id: z.ZodString;
|
|
123
123
|
intent: z.ZodString;
|
|
124
124
|
account: z.ZodOptional<z.ZodString>;
|
|
125
|
-
role: z.ZodOptional<z.ZodEnum<["merchant", "
|
|
125
|
+
role: z.ZodOptional<z.ZodEnum<["merchant", "customer", "prospect", "supplier", "collaborator", "arbitrator"]>>;
|
|
126
126
|
industries: z.ZodArray<z.ZodEnum<["freelance", "rental", "education", "travel", "subscription", "retail", "general", "custom"]>, "many">;
|
|
127
127
|
keywords: z.ZodArray<z.ZodString, "many">;
|
|
128
128
|
target_types: z.ZodArray<z.ZodEnum<["NewOrderEvent", "ProgressEvent", "DemandPresentEvent", "DemandFeedbackEvent", "NewEntityEvent", "ArbEvent"]>, "many">;
|
|
@@ -137,7 +137,7 @@ export declare const IntentRadarOutputSchema: z.ZodDiscriminatedUnion<"action",
|
|
|
137
137
|
target_types: ("NewOrderEvent" | "ArbEvent" | "ProgressEvent" | "DemandPresentEvent" | "DemandFeedbackEvent" | "NewEntityEvent")[];
|
|
138
138
|
created_at: number;
|
|
139
139
|
account?: string | undefined;
|
|
140
|
-
role?: "
|
|
140
|
+
role?: "merchant" | "customer" | "prospect" | "supplier" | "collaborator" | "arbitrator" | undefined;
|
|
141
141
|
}, {
|
|
142
142
|
id: string;
|
|
143
143
|
intent: string;
|
|
@@ -147,7 +147,7 @@ export declare const IntentRadarOutputSchema: z.ZodDiscriminatedUnion<"action",
|
|
|
147
147
|
target_types: ("NewOrderEvent" | "ArbEvent" | "ProgressEvent" | "DemandPresentEvent" | "DemandFeedbackEvent" | "NewEntityEvent")[];
|
|
148
148
|
created_at: number;
|
|
149
149
|
account?: string | undefined;
|
|
150
|
-
role?: "
|
|
150
|
+
role?: "merchant" | "customer" | "prospect" | "supplier" | "collaborator" | "arbitrator" | undefined;
|
|
151
151
|
}>, "many">;
|
|
152
152
|
}, "strict", z.ZodTypeAny, {
|
|
153
153
|
action: "list";
|
|
@@ -160,7 +160,7 @@ export declare const IntentRadarOutputSchema: z.ZodDiscriminatedUnion<"action",
|
|
|
160
160
|
target_types: ("NewOrderEvent" | "ArbEvent" | "ProgressEvent" | "DemandPresentEvent" | "DemandFeedbackEvent" | "NewEntityEvent")[];
|
|
161
161
|
created_at: number;
|
|
162
162
|
account?: string | undefined;
|
|
163
|
-
role?: "
|
|
163
|
+
role?: "merchant" | "customer" | "prospect" | "supplier" | "collaborator" | "arbitrator" | undefined;
|
|
164
164
|
}[];
|
|
165
165
|
}, {
|
|
166
166
|
action: "list";
|
|
@@ -173,7 +173,7 @@ export declare const IntentRadarOutputSchema: z.ZodDiscriminatedUnion<"action",
|
|
|
173
173
|
target_types: ("NewOrderEvent" | "ArbEvent" | "ProgressEvent" | "DemandPresentEvent" | "DemandFeedbackEvent" | "NewEntityEvent")[];
|
|
174
174
|
created_at: number;
|
|
175
175
|
account?: string | undefined;
|
|
176
|
-
role?: "
|
|
176
|
+
role?: "merchant" | "customer" | "prospect" | "supplier" | "collaborator" | "arbitrator" | undefined;
|
|
177
177
|
}[];
|
|
178
178
|
}>, z.ZodObject<{
|
|
179
179
|
action: z.ZodLiteral<"remove">;
|
|
@@ -1,89 +1 @@
|
|
|
1
|
-
import { z
|
|
2
|
-
const RoleEnum = z.enum(["merchant", "user", "arbitrator"]);
|
|
3
|
-
const IndustryScenarioEnum = z.enum([
|
|
4
|
-
"freelance", "rental", "education", "travel", "subscription", "retail", "general", "custom",
|
|
5
|
-
]);
|
|
6
|
-
const TargetTypeEnum = z.enum([
|
|
7
|
-
"NewOrderEvent",
|
|
8
|
-
"ProgressEvent",
|
|
9
|
-
"DemandPresentEvent",
|
|
10
|
-
"DemandFeedbackEvent",
|
|
11
|
-
"NewEntityEvent",
|
|
12
|
-
"ArbEvent",
|
|
13
|
-
]);
|
|
14
|
-
const IntentRecordSchema = z
|
|
15
|
-
.object({
|
|
16
|
-
id: z.string(),
|
|
17
|
-
intent: z.string(),
|
|
18
|
-
account: z.string().optional(),
|
|
19
|
-
role: RoleEnum.optional(),
|
|
20
|
-
industries: z.array(IndustryScenarioEnum),
|
|
21
|
-
keywords: z.array(z.string()),
|
|
22
|
-
target_types: z.array(TargetTypeEnum),
|
|
23
|
-
created_at: z.number(),
|
|
24
|
-
updated_at: z.number(),
|
|
25
|
-
})
|
|
26
|
-
.strict();
|
|
27
|
-
const IntentEventHitSchema = z
|
|
28
|
-
.object({
|
|
29
|
-
event_type: z.string(),
|
|
30
|
-
event_id: z.string(),
|
|
31
|
-
related_objects: z.array(z.string()),
|
|
32
|
-
business_meaning: z.string(),
|
|
33
|
-
score: z.number(),
|
|
34
|
-
matched_industries: z.array(z.string()),
|
|
35
|
-
matched_keywords: z.array(z.string()),
|
|
36
|
-
event: z.record(z.unknown()),
|
|
37
|
-
})
|
|
38
|
-
.strict();
|
|
39
|
-
const IntentMatchResultSchema = z
|
|
40
|
-
.object({
|
|
41
|
-
intent_id: z.string(),
|
|
42
|
-
intent: z.string(),
|
|
43
|
-
hits: z.array(IntentEventHitSchema),
|
|
44
|
-
scanned: z.number(),
|
|
45
|
-
})
|
|
46
|
-
.strict();
|
|
47
|
-
export const IntentRadarInputSchema = z.discriminatedUnion("action", [
|
|
48
|
-
z.object({
|
|
49
|
-
action: z.literal("save"),
|
|
50
|
-
intent: z.string().describe("Free-form business intent, e.g. 'find subscription services in Shanghai'."),
|
|
51
|
-
account: z.string().optional().describe("Bound account; omit for a system-level intent."),
|
|
52
|
-
role: RoleEnum.optional(),
|
|
53
|
-
target_types: z.array(TargetTypeEnum).optional().describe("Event types to watch; empty = all."),
|
|
54
|
-
}).strict(),
|
|
55
|
-
z.object({
|
|
56
|
-
action: z.literal("list"),
|
|
57
|
-
account: z.string().optional().describe("Filter by bound account; omit for all."),
|
|
58
|
-
}).strict(),
|
|
59
|
-
z.object({
|
|
60
|
-
action: z.literal("remove"),
|
|
61
|
-
id: z.string().describe("Intent id to delete."),
|
|
62
|
-
}).strict(),
|
|
63
|
-
z.object({
|
|
64
|
-
action: z.literal("match"),
|
|
65
|
-
intent_id: z.string().optional().describe("Match a single intent; omit to match all intents."),
|
|
66
|
-
account: z.string().optional().describe("Filter intents by account."),
|
|
67
|
-
events: z.array(z.record(z.unknown())).optional().describe("Events to score (from onchain_events). Omit to auto-pull recent events."),
|
|
68
|
-
network: z.enum(["mainnet", "testnet"]).optional(),
|
|
69
|
-
limit: z.number().int().min(1).max(100).optional().describe("Max events to auto-pull when `events` is omitted."),
|
|
70
|
-
}).strict(),
|
|
71
|
-
]);
|
|
72
|
-
export const IntentRadarOutputSchema = z.discriminatedUnion("action", [
|
|
73
|
-
z.object({
|
|
74
|
-
action: z.literal("save"),
|
|
75
|
-
intent: IntentRecordSchema,
|
|
76
|
-
}).strict(),
|
|
77
|
-
z.object({
|
|
78
|
-
action: z.literal("list"),
|
|
79
|
-
intents: z.array(IntentRecordSchema),
|
|
80
|
-
}).strict(),
|
|
81
|
-
z.object({
|
|
82
|
-
action: z.literal("remove"),
|
|
83
|
-
removed: z.boolean(),
|
|
84
|
-
}).strict(),
|
|
85
|
-
z.object({
|
|
86
|
-
action: z.literal("match"),
|
|
87
|
-
results: z.array(IntentMatchResultSchema),
|
|
88
|
-
}).strict(),
|
|
89
|
-
]);
|
|
1
|
+
import{z}from'zod';const RoleEnum=z['enum'](['merchant','customer','prospect','supplier','collaborator','arbitrator']),IndustryScenarioEnum=z['enum'](['freelance','rental','education','travel','subscription','retail','general','custom']),TargetTypeEnum=z['enum'](['NewOrderEvent','ProgressEvent','DemandPresentEvent','DemandFeedbackEvent','NewEntityEvent','ArbEvent']),IntentRecordSchema=z['object']({'id':z['string'](),'intent':z['string'](),'account':z['string']()['optional'](),'role':RoleEnum['optional'](),'industries':z['array'](IndustryScenarioEnum),'keywords':z['array'](z['string']()),'target_types':z['array'](TargetTypeEnum),'created_at':z['number'](),'updated_at':z['number']()})['strict'](),IntentEventHitSchema=z['object']({'event_type':z['string'](),'event_id':z['string'](),'related_objects':z['array'](z['string']()),'business_meaning':z['string'](),'score':z['number'](),'matched_industries':z['array'](z['string']()),'matched_keywords':z['array'](z['string']()),'event':z['record'](z['unknown']())})['strict'](),IntentMatchResultSchema=z['object']({'intent_id':z['string'](),'intent':z['string'](),'hits':z['array'](IntentEventHitSchema),'scanned':z['number']()})['strict']();export const IntentRadarInputSchema=z['discriminatedUnion']('action',[z['object']({'action':z['literal']('save'),'intent':z['string']()['describe']('Free-form\x20business\x20intent,\x20e.g.\x20\x27find\x20subscription\x20services\x20in\x20Shanghai\x27.'),'account':z['string']()['optional']()['describe']('Bound\x20account;\x20omit\x20for\x20a\x20system-level\x20intent.'),'role':RoleEnum['optional'](),'target_types':z['array'](TargetTypeEnum)['optional']()['describe']('Event\x20types\x20to\x20watch;\x20empty\x20=\x20all.')})['strict'](),z['object']({'action':z['literal']('list'),'account':z['string']()['optional']()['describe']('Filter\x20by\x20bound\x20account;\x20omit\x20for\x20all.')})['strict'](),z['object']({'action':z['literal']('remove'),'id':z['string']()['describe']('Intent\x20id\x20to\x20delete.')})['strict'](),z['object']({'action':z['literal']('match'),'intent_id':z['string']()['optional']()['describe']('Match\x20a\x20single\x20intent;\x20omit\x20to\x20match\x20all\x20intents.'),'account':z['string']()['optional']()['describe']('Filter\x20intents\x20by\x20account.'),'events':z['array'](z['record'](z['unknown']()))['optional']()['describe']('Events\x20to\x20score\x20(from\x20onchain_events).\x20Omit\x20to\x20auto-pull\x20recent\x20events.'),'network':z['enum'](['mainnet','testnet'])['optional'](),'limit':z['number']()['int']()['min'](0x1)['max'](0x64)['optional']()['describe']('Max\x20events\x20to\x20auto-pull\x20when\x20`events`\x20is\x20omitted.')})['strict']()]);export const IntentRadarOutputSchema=z['discriminatedUnion']('action',[z['object']({'action':z['literal']('save'),'intent':IntentRecordSchema})['strict'](),z['object']({'action':z['literal']('list'),'intents':z['array'](IntentRecordSchema)})['strict'](),z['object']({'action':z['literal']('remove'),'removed':z['boolean']()})['strict'](),z['object']({'action':z['literal']('match'),'results':z['array'](IntentMatchResultSchema)})['strict']()]);
|