@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
package/dist/schema/call/base.js
CHANGED
|
@@ -1,370 +1 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { WowTransactionBlockResponseSchema } from "../local/index.js";
|
|
3
|
-
import { BalanceTypeSchema, EntrypointSchema, ObjectBaseSchema, GuardTableItemSchema, NameSchema, NameOrAddressSchema, TokenTypeWithDefaultSchema } from "../common/index.js";
|
|
4
|
-
import { ENTRYPOINT, MAX_GUARD_COUNT_PASSPORT } from "@wowok/wowok";
|
|
5
|
-
export function strictParse(schema, input, fieldName = "input") {
|
|
6
|
-
let innerSchema = schema;
|
|
7
|
-
while (innerSchema._def?.typeName === 'ZodEffects') {
|
|
8
|
-
innerSchema = innerSchema._def.schema;
|
|
9
|
-
}
|
|
10
|
-
const shape = innerSchema._def.shape?.();
|
|
11
|
-
if (!shape) {
|
|
12
|
-
return schema.parse(input);
|
|
13
|
-
}
|
|
14
|
-
const allowedFields = Object.keys(shape);
|
|
15
|
-
const inputFields = Object.keys(input || {});
|
|
16
|
-
const unknownFields = inputFields.filter(f => !allowedFields.includes(f));
|
|
17
|
-
if (unknownFields.length > 0) {
|
|
18
|
-
throw new Error(`Unknown ${fieldName} field(s): ${unknownFields.join(', ')}. ` +
|
|
19
|
-
`Allowed fields: ${allowedFields.join(', ')}. ` +
|
|
20
|
-
`Remove the unknown field(s) or check the schema for the correct field name.`);
|
|
21
|
-
}
|
|
22
|
-
const result = schema.safeParse(input);
|
|
23
|
-
if (!result.success) {
|
|
24
|
-
const errorLines = result.error.issues.map(issue => {
|
|
25
|
-
const path = issue.path.length > 0
|
|
26
|
-
? issue.path.map(p => typeof p === "number" ? `[${p}]` : p).join(".").replace(".[", "[")
|
|
27
|
-
: "(root)";
|
|
28
|
-
let extras = "";
|
|
29
|
-
const issueAny = issue;
|
|
30
|
-
if (issue.code === "invalid_type") {
|
|
31
|
-
const expected = issueAny.expected;
|
|
32
|
-
const received = issueAny.received;
|
|
33
|
-
if (typeof expected === "string" && typeof received === "string") {
|
|
34
|
-
extras = ` (expected: ${expected}; received: ${received})`;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return ` - ${fieldName}.${path} [${issue.code}]: ${issue.message}${extras}`;
|
|
38
|
-
});
|
|
39
|
-
throw new Error(`${fieldName} validation failed with ${result.error.issues.length} error(s):\n${errorLines.join("\n")}`);
|
|
40
|
-
}
|
|
41
|
-
return result.data;
|
|
42
|
-
}
|
|
43
|
-
export const NamedObjectSchema = z.object({
|
|
44
|
-
name: NameSchema.optional().describe("The name of the object"),
|
|
45
|
-
tags: z.array(z.string()).optional().describe("The tags of the object"),
|
|
46
|
-
onChain: z.boolean().optional().describe("CRITICAL: Whether to sync the name to the blockchain. DEFAULT (undefined/false): The name is stored LOCALLY ONLY on your device (PRIVATE). If set to true: The name is published ON-CHAIN and becomes PUBLICLY VISIBLE to everyone. Only set to true for displaying the relationships you are willing to make public on the chain."),
|
|
47
|
-
replaceExistName: z.boolean().optional().describe("FORCE CLAIM: Set to true ONLY when the user explicitly expresses a STRONG INTENTION to forcefully take over an existing name (e.g., 'I must use this name', 'force rename', 'replace the existing one'). " +
|
|
48
|
-
"WARNING: This will UNBIND the name from its original object and rebind it to the new one, potentially breaking existing references. " +
|
|
49
|
-
"If not specified or false: the operation will FAIL with an error when the name is already in use (safe default behavior)."),
|
|
50
|
-
}).strict().describe("Assign a name and optional tags to a new object. By default, names are stored LOCALLY (private) on your device. " +
|
|
51
|
-
"Set 'onChain: true' to create a PUBLIC on-chain identity visible to everyone. " +
|
|
52
|
-
"IMPORTANT: If the requested name is already taken, the operation will FAIL by default. " +
|
|
53
|
-
"Only set 'replaceExistName: true' when the user EXPLICITLY demands to forcefully claim the name.");
|
|
54
|
-
export const NormalObjectSchema = z.union([
|
|
55
|
-
NameOrAddressSchema.describe("String format: Reference an EXISTING object by its name (local mark) or on-chain object ID. Example: 'my-service' or '0x1234...'"),
|
|
56
|
-
NamedObjectSchema.describe("Object format: CREATE a NEW object with specified properties. See NamedObjectSchema for details including 'name' (optional), 'tags' (optional), 'onChain' (whether to make name public), and 'replaceExistName' (force claim existing name)."),
|
|
57
|
-
]).describe("Two ways to specify an object: (1) STRING - Reference an EXISTING object by name or ID; (2) OBJECT - CREATE a NEW object using NamedObjectSchema structure with optional name, tags, and visibility settings.");
|
|
58
|
-
export const NamedObjectWithDescriptionSchema = NamedObjectSchema.extend({
|
|
59
|
-
description: z.string().optional().describe("The description of the object"),
|
|
60
|
-
}).strict().describe("Create a new object with a name and optional description. The name helps identify the object, while the description provides additional details about its purpose or functionality.");
|
|
61
|
-
export const DescriptionObjectSchema = z.union([
|
|
62
|
-
NameOrAddressSchema.describe("String format: Reference an EXISTING object by its name (local mark) or on-chain object ID. Example: 'my-object' or '0x1234...'"),
|
|
63
|
-
NamedObjectWithDescriptionSchema.describe("Object format: CREATE a NEW object with name, optional description, and visibility settings. Extends NamedObjectSchema with an additional 'description' field for detailed object information.")
|
|
64
|
-
]).describe("Two ways to specify an object: (1) STRING - Reference an EXISTING object by name or ID; (2) OBJECT - CREATE a NEW object with full configuration including optional name, tags, description, and visibility settings (local private by default, or public on-chain with onChain:true).");
|
|
65
|
-
export const TypeNamedObjectSchema = NamedObjectSchema.extend({
|
|
66
|
-
type_parameter: TokenTypeWithDefaultSchema.describe("Payment token type for this object (format: {address}::{module}::{struct}). e.g. '0x2::wow::WOW' (WOW, the default), '0x...::usdt::USDT' (USDT), '0x...::eth::ETH' (ETH). Defines which token this object accepts for payments. To discover all available tokens and their type tags, call wowok_buildin_info with info 'mainnet bridge tokens' and use the returned `wowTypeTag` value here."),
|
|
67
|
-
}).describe("Create a new named object (with optional tags) and specify a token type for payments (e.g., WOW, USDT, ETH).");
|
|
68
|
-
export const NamedObjectWithPermissionSchema = NamedObjectSchema.extend({
|
|
69
|
-
permission: DescriptionObjectSchema.optional(),
|
|
70
|
-
}).strict().describe("Use a Permission object to manage access control: (1) Specify an existing Permission object's name or ID; (2) Create a new Permission object (which can be named and tagged); or (3) Leave empty to automatically create a new unnamed Permission object.");
|
|
71
|
-
export const TypeNamedObjectWithPermissionSchema = NamedObjectWithPermissionSchema.extend({
|
|
72
|
-
type_parameter: TokenTypeWithDefaultSchema.describe("Payment token type for this object (format: {address}::{module}::{struct}). e.g. '0x2::wow::WOW' (WOW, the default), '0x...::usdt::USDT' (USDT), '0x...::eth::ETH' (ETH). Defines which token this object accepts for payments. To discover all available tokens and their type tags, call wowok_buildin_info with info 'mainnet bridge tokens' and use the returned `wowTypeTag` value here."),
|
|
73
|
-
}).strict().describe("Create a new named on-chain object with both a specific token type (e.g., WOW, USDT, ETH) AND permission control. Use this when you need to specify a token type for payment operations AND require permission management (who can manage/operate this object). For objects without permission management, use TypeNamedObjectSchema instead.");
|
|
74
|
-
export const CoinParamSchema = z.union([
|
|
75
|
-
z.object({
|
|
76
|
-
balance: BalanceTypeSchema,
|
|
77
|
-
}).describe("Specify an amount value."),
|
|
78
|
-
z.object({
|
|
79
|
-
coin: z.string().describe("Coin object ID or name(local mark). Use a specified Coin object."),
|
|
80
|
-
}),
|
|
81
|
-
]).describe("Specify the amount to pay from the transaction account, or the Coin ID owned by the transaction account. Used for payment.");
|
|
82
|
-
export const CallEnvSchema = z.object({
|
|
83
|
-
account: NameOrAddressSchema.optional().default(""),
|
|
84
|
-
permission_guard: z.array(z.string()).optional().describe("List of permission guard IDs. Used to extend additional operation permissions (requires verification and configuration in the Permission object)."),
|
|
85
|
-
no_cache: z.boolean().optional().describe("Whether to disable caching."),
|
|
86
|
-
network: EntrypointSchema.optional(),
|
|
87
|
-
referrer: NameOrAddressSchema.optional().describe("Referrer ID. If the user is using the network for the first time, the referrer ID will be recorded."),
|
|
88
|
-
confirmed: z.boolean().optional().describe("Phase 2 ConfirmGate: set to true to proceed after a 'pending_confirmation' result. The operation is NOT executed until you re-call with confirmed=true after user consent."),
|
|
89
|
-
user_intent_phrases: z.array(z.string()).optional().describe("Phase 2 ConfirmGate: explicit user intent phrases collected from conversation context (e.g. 'use default account', 'force publish'). Used to bypass confirmation rules whose bypass_on_explicit_intent matches."),
|
|
90
|
-
project: z.string().optional().describe("Project prefix to assign this object to (e.g. 'myshop'). When set: 1) the object is tagged with 'project:<prefix>' on-chain automatically via ProjectService, 2) the newly created object is auto-associated to the SQLite project for local management, evaluation, and graph tracking. The project MUST exist (create via project_operation action='create_project' first). Use project_operation to manage projects."),
|
|
91
|
-
client_schema_version: z.string().optional().describe("Client-side schema version (semver, e.g. '1.0.0'). When provided, the server checks compatibility and attaches warnings if mismatched."),
|
|
92
|
-
schema_strict_mode: z.boolean().optional().default(false).describe("When true, schema incompatibility returns an error instead of a warning. Default: false (warn mode)."),
|
|
93
|
-
dry_run: z.boolean().optional().describe("Phase 1 dry_run: when true, SIMULATE the transaction without signing or submitting. Returns effects + events showing what WOULD happen — no on-chain state is modified, no gas is charged. Use this to verify an operation will succeed before committing. Essential for the 5-step loop's Plan step. The returned digest will be 'dry_run:<timestamp>' and objectChanges will be empty (simulation only)."),
|
|
94
|
-
}).strict().describe(`IMPORTANT: Execution environment includes: account for signing operations, network selection (${ENTRYPOINT}), additional Guard permissions, and more. Used to specify context information during the call. If account is not specified, the default account ("") will be used.`);
|
|
95
|
-
export const ObjectsOpSchema = z.union([
|
|
96
|
-
z.object({
|
|
97
|
-
op: z.literal("set").or(z.literal("add")).or(z.literal("remove")),
|
|
98
|
-
objects: z.array(NameOrAddressSchema),
|
|
99
|
-
}).describe("Set, add, or remove object ID list."),
|
|
100
|
-
z.object({
|
|
101
|
-
op: z.literal("clear"),
|
|
102
|
-
}).describe("Remove all objects."),
|
|
103
|
-
]).describe("Operate object list. Used to set, add, or remove objects.");
|
|
104
|
-
export const ResponseDataSchema = ObjectBaseSchema.extend({
|
|
105
|
-
change: z.union([z.literal("created"), z.literal("mutated"), z.string()]).describe("What happened to this object in the operation. Constraint: 'created' | 'mutated' | custom string. Example: 'created'"),
|
|
106
|
-
}).describe("One object record in a query result. Contains the object's basic info plus how it changed in this operation.");
|
|
107
|
-
export const ObjectRoleSchema = z.object({
|
|
108
|
-
id: z.string().describe("Object ID (64-hex with 0x prefix). Identifies the on-chain object. Example: '0xa1d4...'"),
|
|
109
|
-
name: z.union([z.string(), z.null()]).optional().describe("Local mark name if assigned, else null. Relation: resolved via local_mark_operation. Example: 'my-shop' or null"),
|
|
110
|
-
role: z.enum([
|
|
111
|
-
"Permission", "Guard", "Machine", "Progress", "Service", "Order", "Allocation",
|
|
112
|
-
"Arbitration", "ArbCase", "Messenger", "Contact", "Demand", "Reward", "Personal",
|
|
113
|
-
"Repository", "Treasury", "Discount", "Other"
|
|
114
|
-
]).describe("Business role of the object in the dependency graph. Constraint: enum of 18 values. Relation: derived from objectType last segment; drives Plan/Verify Loop positioning. Example: 'Service'"),
|
|
115
|
-
relation: z.object({
|
|
116
|
-
parent: z.union([z.string(), z.null()]).optional().describe("Parent object ID, if this object belongs to another (e.g. Machine belongs to Service). Example: '0x123...' or null"),
|
|
117
|
-
relation_type: z.enum(["machine_of", "guard_of", "allocator_of", "permission_of", "progress_of", "allocation_of", "arb_of", "other"]).optional().describe("How this object relates to its parent. Example: 'machine_of'"),
|
|
118
|
-
}).optional().describe("Relationship to another object in the dependency graph"),
|
|
119
|
-
immutable: z.boolean().optional().describe("Whether the object has entered an immutable state (e.g. Service published). Constraint: true after publish. Example: true"),
|
|
120
|
-
}).strict().describe("An object tagged with its business role and relationship within the object dependency graph");
|
|
121
|
-
export const FundRoleSchema = z.object({
|
|
122
|
-
amount: z.string().describe("Amount change as stringified integer (smallest unit). Negative=spend, positive=receive. Example: '-10000000000'"),
|
|
123
|
-
coinType: z.string().describe("Coin type tag (format: {address}::{module}::{struct}). Example: '0x2::wow::WOW'"),
|
|
124
|
-
role: z.enum(["payment", "refund", "change", "compensation", "reward", "gas", "deposit", "release", "other"]).describe("Business role of this fund movement. Constraint: enum of 9 values. Relation: derived from operation context. Example: 'payment'"),
|
|
125
|
-
from: z.string().nullable().optional().describe("Sender address if known. Example: '0xabc...' or null"),
|
|
126
|
-
to: z.string().nullable().optional().describe("Recipient address if known. Example: '0xdef...' or null"),
|
|
127
|
-
}).strict().describe("A fund movement tagged with its business role");
|
|
128
|
-
export const NextActionSchema = z.object({
|
|
129
|
-
action: z.string().describe("Recommended next action. Example: 'add sales products'"),
|
|
130
|
-
reason: z.string().describe("Why this action is recommended. Example: 'Service has no products; customers cannot order'"),
|
|
131
|
-
tool: z.string().optional().describe("MCP tool to use, if applicable. Example: 'onchain_operations'"),
|
|
132
|
-
prerequisite: z.string().optional().describe("Condition that must hold before this action. Example: 'Service must be created first'"),
|
|
133
|
-
priority: z.enum(["required", "recommended", "optional"]).describe("Priority. Constraint: enum. Example: 'required'"),
|
|
134
|
-
}).strict().describe("A recommended next action with priority and rationale");
|
|
135
|
-
export const EventSemanticSchema = z.object({
|
|
136
|
-
event_type: z.string().describe("Raw on-chain event type tag. Example: '0x2::service::ServicePublishedEvent'"),
|
|
137
|
-
business_meaning: z.string().describe("Human-readable business meaning. Example: 'Service has been published and is now immutable'"),
|
|
138
|
-
category: z.enum(["lifecycle", "state_change", "fund_flow", "permission", "guard", "other"]).describe("Business category. Constraint: enum of 6 values. Example: 'lifecycle'"),
|
|
139
|
-
related_object: z.string().optional().describe("Object ID the event relates to, if extractable. Example: '0x123...'"),
|
|
140
|
-
side_effect: z.string().optional().describe("Side effect description for AI. Example: 'Customers can now place orders against this Service'"),
|
|
141
|
-
}).strict().describe("An on-chain event annotated with business semantics");
|
|
142
|
-
export const ExperienceSchema = z.object({
|
|
143
|
-
advice: z.string().optional().describe("Advice from past experience. Example: 'Last time you forgot to set buy_guard; add it before publishing'"),
|
|
144
|
-
avoid: z.array(z.string()).optional().describe("Pitfalls to avoid based on history. Example: ['Guard rejection on delivery_proof']"),
|
|
145
|
-
relevance: z.number().min(0).max(1).optional().describe("Relevance score 0-1 of the matched experience. Example: 0.85"),
|
|
146
|
-
matched_scenario: z.string().optional().describe("Matched historical scenario. Example: 'publish_service_freelance'"),
|
|
147
|
-
}).strict().describe("Experience layer feedback from past operations (Phase 2 Topic 2). Provides advice and pitfalls based on historical patterns.");
|
|
148
|
-
export const ServiceStatusSchema = z.object({
|
|
149
|
-
active: z.array(z.string()).describe("Phase 2 services currently active (enabled). Example: ['confirm_gate','project_service','experience_layer']"),
|
|
150
|
-
inactive: z.array(z.string()).optional().describe("Phase 2 services currently inactive (can be toggled via config_operation). Example: ['harness','graph_persist']"),
|
|
151
|
-
}).strict().describe("Phase 2 runtime service status (populated when semantic_rich is enabled). Lets AI see which services are active in each response.");
|
|
152
|
-
export const CustomerReminderSchema = z.object({
|
|
153
|
-
id: z.string().describe("Reminder rule id. Example: 'high_risk_score'"),
|
|
154
|
-
stage: z.enum(["browse", "evaluate", "preorder", "in_progress", "complete", "after_sale"]).describe("Order lifecycle stage when this reminder fires. Example: 'evaluate'"),
|
|
155
|
-
priority: z.enum(["required", "recommended", "info", "reminder"]).describe("Priority. 'required' = blocks purchase; 'recommended' = strong caution. Example: 'required'"),
|
|
156
|
-
message: z.string().describe("Human-readable reminder message. Example: 'Composite risk score 25/100, strongly discourage purchase'"),
|
|
157
|
-
action: z.string().optional().describe("Suggested next action. Example: 'require merchant to bind Arbitration before ordering'"),
|
|
158
|
-
}).strict().describe("A buyer-side reminder triggered at a specific order lifecycle stage (Phase 3 C-3).");
|
|
159
|
-
export const PreferenceMatchSchema = z.object({
|
|
160
|
-
score: z.number().min(0).max(100).describe("Match score 0-100 (higher = better fit). Example: 75"),
|
|
161
|
-
matches: z.array(z.string()).describe("Aspects that match user preferences. Example: ['Price 10% below average','Has arbitration']"),
|
|
162
|
-
mismatches: z.array(z.string()).describe("Aspects that mismatch user preferences. Example: ['Delivery cycle exceeds expectation']"),
|
|
163
|
-
}).strict().describe("Service-to-preference match result (Phase 3 C-2). 7-dimension scoring: price/time/region/brand/bargain/emotion/risk.");
|
|
164
|
-
export const CustomerAdviceSchema = z.object({
|
|
165
|
-
risk_score: z.number().min(0).max(100).optional().describe("Composite risk score 0-100 (higher = safer). Relation: from risk-assessment.ts 4-dimension scoring. Example: 75"),
|
|
166
|
-
risk_level: z.enum(["low", "medium_low", "medium_high", "high"]).optional().describe("Risk level bucket. 'high' = strongly discourage purchase. Example: 'medium_high'"),
|
|
167
|
-
recommendations: z.array(z.string()).describe("Actionable recommendations for the buyer. Example: ['Require merchant to configure arbitration','Negotiate refund terms via Messenger']"),
|
|
168
|
-
reminders: z.array(CustomerReminderSchema).describe("Stage-specific reminders (deduped, sorted by priority, capped to 3 high-risk). Example: [{priority:'required', message:'Ambiguous Guard must be human-reviewed'}]"),
|
|
169
|
-
preference_match: PreferenceMatchSchema.optional().describe("Service-to-preference match (populated when user preferences exist). Example: {score:75, matches:[...], mismatches:[...]}"),
|
|
170
|
-
}).strict().describe("Buyer-side advice (Phase 3 C-3.3). Populated in semantic.customer_advice for order/query operations when customer_intelligence service is enabled.");
|
|
171
|
-
export const EvolutionContextSchema = z.object({
|
|
172
|
-
industry_signal: z.string().optional().describe("Industry evolution signal summary. Example: 'Industry health 82/100 (healthy); 25 cumulative industry signals'"),
|
|
173
|
-
evolution_advice: z.string().optional().describe("Evolution advice for the current operation. Example: 'Recommend mandatory arbitration + compensation fund + delivery Guard'"),
|
|
174
|
-
confidence: z.number().min(0).max(1).describe("Confidence of the evolution context 0-1. <0.5 means no data yet. Example: 0.75"),
|
|
175
|
-
health_score: z.number().min(0).max(100).optional().describe("Industry health score 0-100 if available. Example: 82"),
|
|
176
|
-
pending_suggestions: z.number().int().min(0).optional().describe("Count of pending industry update suggestions (filtered by role if role is set). Example: 3"),
|
|
177
|
-
intent: z.enum(["default", "growth", "retention", "compliance", "efficiency", "trust_building", "custom"]).optional().describe("Phase 4 P4-6.C: Current business intent driving the scoring model. Absent = 'default'. Example: 'growth'"),
|
|
178
|
-
role_advice: z.array(z.string()).optional().describe("Phase 4 P4-6.C: Role-targeted advice strings (user/merchant/arbitrator). Example: ['Strengthen loyalty flywheel','Optimize first-order conversion']"),
|
|
179
|
-
role: z.enum(["user", "merchant", "arbitrator"]).optional().describe("Phase 4 P4-6.C: Role used for advice routing. Example: 'merchant'"),
|
|
180
|
-
}).strict().describe("Phase 4 industry evolution context (populated when industry_evolution service is enabled). Provides AI with industry-level health signals, evolution advice, and role-targeted recommendations.");
|
|
181
|
-
export const GuardPuzzleStatusSchema = z.object({
|
|
182
|
-
intent: z.boolean().describe("Intent dimension complete (action + rule + failure conditions)"),
|
|
183
|
-
binding: z.boolean().describe("Binding dimension complete (host object + field + circular ref)"),
|
|
184
|
-
data: z.boolean().describe("Data dimension complete (table entries + witnesses)"),
|
|
185
|
-
query: z.boolean().describe("Query dimension complete (query instructions if needed)"),
|
|
186
|
-
logic: z.boolean().describe("Logic dimension complete (root node returns Bool)"),
|
|
187
|
-
constraints: z.boolean().describe("Constraints dimension complete (10 Pitfalls checked)"),
|
|
188
|
-
}).strict().describe("Guard information puzzle completeness status. 6 dimensions (A-F). false = missing, needs user input.");
|
|
189
|
-
export const GuardAvailableQuerySchema = z.object({
|
|
190
|
-
id: z.number().int().describe("Query instruction ID. Example: 1253"),
|
|
191
|
-
name: z.string().describe("Query instruction name. Example: 'progress.current'"),
|
|
192
|
-
objectType: z.string().describe("Target object type. Example: 'Progress'"),
|
|
193
|
-
returnType: z.string().describe("Return value type. Example: 'String'"),
|
|
194
|
-
description: z.string().optional().describe("Query description"),
|
|
195
|
-
}).strict().describe("A Guard query instruction available for the current context (subset of GUARDQUERY 375 entries).");
|
|
196
|
-
export const GuardAdviceSchema = z.object({
|
|
197
|
-
current_round: z.enum(["R1", "R2", "R3", "R4", "R5", "R6", "R7", "R8", "R9", "R10"]).optional()
|
|
198
|
-
.describe("Current R1-R10 dialogue round. R1=intent, R2=table, R3=tree, R4=rely, R5=binding, R6=review, R7=CREATE, R8=test, R9=bind, R10=verify. Example: 'R3'"),
|
|
199
|
-
puzzle_status: GuardPuzzleStatusSchema.optional()
|
|
200
|
-
.describe("Information puzzle completeness (6 dimensions). Missing dimensions need user input before CREATE."),
|
|
201
|
-
matched_scene: z.string().optional()
|
|
202
|
-
.describe("Matched Guard scene id from the 8 binding scenarios ledger. Example: 'machine_forward_guard'"),
|
|
203
|
-
scene_description: z.string().optional()
|
|
204
|
-
.describe("Human-readable scene description. Example: 'Workflow node forward validation (Forward.guard)'"),
|
|
205
|
-
scene_constraints: z.array(z.string()).optional()
|
|
206
|
-
.describe("Special constraints for the matched scene. Example: ['Forward.guard cannot be modified after Machine is published']"),
|
|
207
|
-
suggested_patterns: z.array(z.string()).optional()
|
|
208
|
-
.describe("Suggested Guard patterns based on user intent. Example: ['time lock','progress status check']"),
|
|
209
|
-
available_queries: z.array(GuardAvailableQuerySchema).optional()
|
|
210
|
-
.describe("Available query instructions for the current context (subset of 375 GUARDQUERY entries)"),
|
|
211
|
-
risk_warnings: z.array(z.string()).optional()
|
|
212
|
-
.describe("Risk warnings for the current Guard design. Example: ['Guard cannot be modified after creation','Time lock test uses 1000ms']"),
|
|
213
|
-
pending_questions: z.array(z.string()).optional()
|
|
214
|
-
.describe("Questions for the user to complete the puzzle. Example: ['Which Host Object will the Guard bind to?']"),
|
|
215
|
-
confirmation_text: z.string().optional()
|
|
216
|
-
.describe("Structured semantic confirmation text for user review (generated when puzzle is complete). User must explicitly confirm before CREATE."),
|
|
217
|
-
test_result: z.object({
|
|
218
|
-
status: z.enum(["pass", "fail", "not_tested"]),
|
|
219
|
-
failure_node: z.string().optional().describe("Node that caused failure (if fail)"),
|
|
220
|
-
passport_id: z.string().optional().describe("Generated Passport ID (if pass)"),
|
|
221
|
-
}).optional().describe("gen_passport static test result. Must pass before CREATE."),
|
|
222
|
-
risk_assessment: z.object({
|
|
223
|
-
overall_risk: z.enum(["critical", "high", "medium", "low", "info"]).describe("Overall risk level (highest from all risks)"),
|
|
224
|
-
risk_count: z.number().int().describe("Total number of detected risks"),
|
|
225
|
-
critical_count: z.number().int().describe("Number of critical risks"),
|
|
226
|
-
high_count: z.number().int().describe("Number of high risks"),
|
|
227
|
-
needs_human_review: z.boolean().describe("Whether human review is required (critical or 2+ high risks)"),
|
|
228
|
-
top_risks: z.array(z.string()).describe("Top risk titles (critical and high, max 3)"),
|
|
229
|
-
stakeholder_advice: z.record(z.string(), z.array(z.string())).optional().describe("Per-stakeholder advice. Key=stakeholder (customer/provider/arbitrator/claimant), value=advice list"),
|
|
230
|
-
}).optional().describe("Business-layer risk assessment (game theory, data source trust, logic gaps). Populated during Guard design to warn about business risks beyond syntax."),
|
|
231
|
-
}).strict().describe("Guard advice (Phase 5 Guard capability system). Injected when user intent involves Guard. Provides context for Guard design, generation, confirmation, and execution.");
|
|
232
|
-
export const SemanticSummarySchema = z.object({
|
|
233
|
-
intent: z.string().describe("Inferred user intent / operation goal. Constraint: snake_case string. Relation: derived from operation_type + data signals. Example: 'publish_service'"),
|
|
234
|
-
status: z.enum(["success", "partial", "failed", "pending_input"]).describe("Business-level status (not raw tx status). 'pending_input' = needs Guard submission. Example: 'success'"),
|
|
235
|
-
summary: z.string().describe("One-sentence human-readable summary of what happened. AI should read this first. Example: 'Successfully published Service my-shop with Machine bound'"),
|
|
236
|
-
created: z.array(ObjectRoleSchema).optional().describe("Objects newly created in this operation, tagged with roles"),
|
|
237
|
-
modified: z.array(ObjectRoleSchema).optional().describe("Objects mutated in this operation, tagged with roles"),
|
|
238
|
-
released: z.array(FundRoleSchema).optional().describe("Fund movements in this operation, tagged with roles"),
|
|
239
|
-
events: z.array(EventSemanticSchema).optional().describe("On-chain events annotated with business semantics (S-8)"),
|
|
240
|
-
next_actions: z.array(NextActionSchema).optional().describe("Recommended next actions to drive the workflow forward"),
|
|
241
|
-
warnings: z.array(z.string()).optional().describe("Business-level warnings. Example: 'order_allocators not configured; order funds cannot be distributed'"),
|
|
242
|
-
experience: ExperienceSchema.optional().describe("Experience layer feedback from past operations (Phase 2 Topic 2)"),
|
|
243
|
-
service_status: ServiceStatusSchema.optional().describe("Phase 2 runtime service status (populated when semantic_rich is enabled). Lets AI see active services in each response."),
|
|
244
|
-
customer_advice: CustomerAdviceSchema.optional().describe("Buyer-side advice (Phase 3 C-3.3). Populated when customer_intelligence service is enabled AND operation is order/query on a Service. Contains risk_score, recommendations, reminders, and preference_match."),
|
|
245
|
-
evolution_context: EvolutionContextSchema.optional().describe("Phase 4 industry evolution context (populated when industry_evolution service is enabled). Provides AI with industry health signals and evolution advice."),
|
|
246
|
-
guard_advice: GuardAdviceSchema.optional().describe("Phase 5 Guard capability advice (populated when user intent involves Guard). Provides puzzle status, scene matching, suggested patterns, available queries, risk warnings, and confirmation text. AI uses this to guide Guard design dialogue (R1-R10)."),
|
|
247
|
-
}).strict().describe("Business semantic summary: translates the raw transaction response into AI-directly-understandable business meaning");
|
|
248
|
-
export const CallResponseErrorSchema = z.object({
|
|
249
|
-
type: z.literal("error").describe("Discriminator for this result variant. Constraint: always 'error'. Example: 'error'"),
|
|
250
|
-
error: z.string().describe("Human-readable error message from the chain or SDK. Relation: enriched via enrichMoveError before classification. Example: 'Insufficient balance for gas'"),
|
|
251
|
-
error_code: z.enum(["invalid_parameter", "guard_rejected", "state_conflict", "insufficient_balance", "object_not_found", "permission_denied", "immutable_violation", "network_error", "rate_limit", "gas_exceeded", "bcs_error", "signature_error", "config_error", "wip_verification_failed", "unknown"]).optional().describe("Error classification for programmatic recovery. Constraint: enum of 15 values (must match ErrorCode in semantic.ts). Relation: drives Recover Loop strategy selection. Example: 'insufficient_balance'"),
|
|
252
|
-
retryable: z.boolean().optional().describe("Whether the same call can be retried as-is. Constraint: true for network_error, rate_limit, gas_exceeded, and insufficient_balance. Example: true"),
|
|
253
|
-
recovery_hint: z.string().optional().describe("Recovery suggestion for AI or user. Relation: paired with error_code to guide Recover Loop. Example: 'Claim faucet tokens then retry'"),
|
|
254
|
-
related_object: z.string().optional().describe("Object ID related to the error, if any. Example: '0x123...'"),
|
|
255
|
-
}).describe("Error result. Contains the raw error message plus structured classification (error_code/retryable/recovery_hint) so AI can choose a recovery strategy without parsing the error string.");
|
|
256
|
-
export const OperationPreviewSchema = z.object({
|
|
257
|
-
level: z.enum(["none", "standard", "amount", "publish", "irreversible"]).describe("Confirmation level. 'irreversible' = cannot be undone (arb verdict, payment). 'publish' = locks immutable fields. 'amount' = amount-sensitive. 'standard' = default-value warnings."),
|
|
258
|
-
operation: z.string().describe("operation_type that triggered the gate. Example: 'payment'"),
|
|
259
|
-
object: z.union([z.string(), z.record(z.unknown()), z.null()]).optional().describe("Object name/id involved (string for existing, object for new creation). Example: 'myshop_service' or {name: 'myshop_service'}"),
|
|
260
|
-
network: z.string().optional().describe("Network in use. Example: 'mainnet'"),
|
|
261
|
-
account: z.string().optional().describe("Signing account ('' = default). Example: '' or '0xabc...'"),
|
|
262
|
-
amount: z.object({
|
|
263
|
-
value: z.string().describe("Smallest-unit value as string. Example: '2500000000'"),
|
|
264
|
-
token: z.string().describe("Coin type tag. Example: '0x2::wow::WOW'"),
|
|
265
|
-
human_readable: z.string().describe("Human-readable amount. Example: '2.5 WOW'"),
|
|
266
|
-
recipient: z.string().optional().describe("Recipient address if known. Example: '0xdef...'"),
|
|
267
|
-
}).optional().describe("Amount info for amount-level confirmations."),
|
|
268
|
-
immutable_after: z.array(z.string()).optional().describe("Fields that become immutable after this op (for publish). Example: ['machine','order_allocators']"),
|
|
269
|
-
warnings: z.array(z.string()).optional().describe("Default-value warnings. Example: ['Using default account (env.account=\"\")']"),
|
|
270
|
-
irreversible: z.boolean().optional().describe("True when the operation cannot be reverted. Example: true"),
|
|
271
|
-
}).strict().describe("Preview of an operation awaiting user confirmation (Phase 2 Topic 4 ConfirmGate).");
|
|
272
|
-
export const CallPendingConfirmationSchema = z.object({
|
|
273
|
-
type: z.literal("pending_confirmation").describe("Discriminator. The operation was NOT executed; it is blocked pending user confirmation. Re-call with env.confirmed=true to proceed, or modify/cancel."),
|
|
274
|
-
preview: OperationPreviewSchema.describe("Preview of the operation awaiting confirmation."),
|
|
275
|
-
rule_id: z.string().optional().describe("Id of the confirmation rule that matched. Example: 'publish_immutable'"),
|
|
276
|
-
}).describe("Pending confirmation. The ConfirmGate blocked the operation. Read preview first; if user consents, re-invoke the SAME call with env.confirmed=true.");
|
|
277
|
-
export const GuardSubmissionToFillSchema = z.object({
|
|
278
|
-
guard: NameOrAddressSchema.describe("Guard object name or ID that requires submission data. Example: 'my-delivery-guard'"),
|
|
279
|
-
submission: z.array(GuardTableItemSchema).describe("User-submitted data matching the Guard's required fields. Relation: structure must match the Guard table's column definitions. Example: [{field:'delivery_proof', value:'Qm...'}]"),
|
|
280
|
-
}).strict().describe("One Guard's submission data: the Guard to verify plus the user-provided data that satisfies its requirements.");
|
|
281
|
-
export const SubmissionCallSchema = z.object({
|
|
282
|
-
type: z.literal("submission").describe("Discriminator for this result variant. Constraint: always 'submission'. Example: 'submission'"),
|
|
283
|
-
guard: z.array(z.object({
|
|
284
|
-
object: NameOrAddressSchema.describe("Guard object name or ID to verify against. Example: 'my-delivery-guard' or '0x123...'"),
|
|
285
|
-
impack: z.boolean().describe("Whether this Guard's verification result participates in the final logic. Constraint: if false, the Guard is checked but does not block the operation. Example: true"),
|
|
286
|
-
}).strict()).max(MAX_GUARD_COUNT_PASSPORT).describe(`Array of Guard objects to verify. Constraint: at most ${MAX_GUARD_COUNT_PASSPORT} entries (MAX_GUARD_COUNT_PASSPORT). Relation: each entry corresponds to a Guard bound to the operation.`),
|
|
287
|
-
submission: z.array(GuardSubmissionToFillSchema).describe("User-submitted data for each Guard. Relation: one entry per Guard in the guard array; fill submission fields and resubmit via call_with_submission. PLACEMENT: this `submission` field is at the SAME level as `data` and `env` in the operation input — NOT inside `data.data`. Example structure: {tool:'onchain_operations', data:{operation_type:'order', data:{object:'my_order', progress:{...}}}, submission:{type:'submission', guard:[...], submission:[...]}}"),
|
|
288
|
-
}).strict().describe("Guard verification required. The operation was blocked because one or more Guards require user-submitted data. Fill the submission array and resubmit. Semantic status is 'pending_input'.");
|
|
289
|
-
export const TypedPermissionObjectSchema = z.union([
|
|
290
|
-
NameOrAddressSchema.describe("String format: Reference an EXISTING object by its name (local mark) or on-chain object ID. Use this when the object already exists and you want to reference it."),
|
|
291
|
-
TypeNamedObjectWithPermissionSchema.describe("Object format: CREATE a NEW object with COMPLETE configuration including: optional name, tags, description, token type for payments (e.g., '0x2::wow::WOW'), AND Permission-based access control. Use this for creating sophisticated objects with both payment token specification and permission management."),
|
|
292
|
-
]).describe("Two ways to specify an object: (1) STRING - Reference an EXISTING object by name or ID; (2) OBJECT - CREATE a NEW object with full configuration including name, tags, description, token type for payments, and Permission-based access control. The object format is used when you need both token specification AND permission management.");
|
|
293
|
-
export const WithPermissionObjectSchema = z.union([
|
|
294
|
-
NameOrAddressSchema.describe("String format: Reference an EXISTING object by its name (local mark) or on-chain object ID. Use when the Permission object already exists."),
|
|
295
|
-
NamedObjectWithPermissionSchema.describe("Object format: CREATE a NEW object with Permission-based access control. Includes optional name, tags, visibility settings, AND a Permission object (which itself can be referenced by string or created as a new object). Use this to create objects with managed access permissions."),
|
|
296
|
-
]).describe("Two ways to specify a Permission-managed object: (1) STRING - Reference an EXISTING Permission object by name or ID; (2) OBJECT - CREATE a NEW object with Permission access control, where the Permission can also be either referenced (string) or newly created (object). This is used when you need permission management but don't need to specify a token type.");
|
|
297
|
-
export const TypedDescriptionObjectSchema = z.union([
|
|
298
|
-
NameOrAddressSchema.describe("String format: Reference an EXISTING object by its name (local mark) or on-chain object ID. Use when the object already exists."),
|
|
299
|
-
TypeNamedObjectSchema.describe("Object format: CREATE a NEW object with token type specification for payments. Includes optional name, tags, visibility settings, AND a specific token type (e.g., '0x2::wow::WOW' or '0x2::usdt::USDT'). Use this when you need to specify what token the object will use for payments but don't need permission management."),
|
|
300
|
-
]).describe("Two ways to specify an object: (1) STRING - Reference an EXISTING object by name or ID; (2) OBJECT - CREATE a NEW object with token type specification for payments. The object format includes name, tags, visibility settings, and a required token type. This is used when you need to specify the payment token but don't need permission management.");
|
|
301
|
-
export const CallResultSchema = z.discriminatedUnion("type", [
|
|
302
|
-
SubmissionCallSchema,
|
|
303
|
-
WowTransactionBlockResponseSchema.extend({
|
|
304
|
-
type: z.literal("transaction").describe("Discriminator for this result variant. Constraint: always 'transaction'. Example: 'transaction'"),
|
|
305
|
-
}),
|
|
306
|
-
CallResponseErrorSchema,
|
|
307
|
-
z.object({
|
|
308
|
-
type: z.literal("data").describe("Discriminator for this result variant. Constraint: always 'data'. Example: 'data'"),
|
|
309
|
-
data: z.array(ResponseDataSchema).describe("Array of object records returned by a query operation. Example: [{id:'0x...', change:'created'}]"),
|
|
310
|
-
}),
|
|
311
|
-
z.object({
|
|
312
|
-
type: z.literal("null").describe("Discriminator for this result variant. Constraint: always 'null'. Example: 'null'"),
|
|
313
|
-
}),
|
|
314
|
-
CallPendingConfirmationSchema,
|
|
315
|
-
]).describe("Discriminated union of 6 result types: 'transaction' (raw Wow response), 'submission' (Guard verification needed), 'error' (failed with error_code), 'data' (query result array), 'null' (no-op completed), 'pending_confirmation' (ConfirmGate blocked — re-call with env.confirmed=true). AI should check result.type first to determine how to process the response.");
|
|
316
|
-
export const ObjectsSchema = z.preprocess((val) => (Array.isArray(val) ? { op: 'add', objects: val } : val), z.union([
|
|
317
|
-
z.object({
|
|
318
|
-
op: z.union([z.literal('add'), z.literal('set')]),
|
|
319
|
-
objects: z.array(NameOrAddressSchema).describe('List of object IDs or names to add or set'),
|
|
320
|
-
}).strict(),
|
|
321
|
-
z.object({
|
|
322
|
-
op: z.literal('remove'),
|
|
323
|
-
objects: z.array(NameOrAddressSchema).describe('List of object IDs or names to remove'),
|
|
324
|
-
}).strict(),
|
|
325
|
-
z.object({
|
|
326
|
-
op: z.literal('clear'),
|
|
327
|
-
}).strict(),
|
|
328
|
-
]));
|
|
329
|
-
export const VerifyMismatchSchema = z.object({
|
|
330
|
-
dimension: z.enum(["created", "modified", "released", "state", "event"]).describe("Verify dimension that mismatched. Example: 'created'"),
|
|
331
|
-
expected: z.string().describe("What the Expect Loop declared. Example: 'Service object created'"),
|
|
332
|
-
actual: z.string().describe("What actually happened. Example: 'No object created'"),
|
|
333
|
-
severity: z.enum(["pass", "warn", "fail"]).describe("Severity: 'fail' blocks progress, 'warn' is advisory, 'pass' never appears here. Example: 'fail'"),
|
|
334
|
-
detail: z.string().describe("Human-readable explanation of the mismatch. Example: 'Expected Service creation but transaction succeeded without object change'"),
|
|
335
|
-
}).describe("One mismatch between expected and actual result. AI should read severity first to decide whether to halt.");
|
|
336
|
-
export const VerifyReportSchema = z.object({
|
|
337
|
-
status: z.enum(["pass", "warn", "fail"]).describe("Overall verify status. Constraint: 'fail' if any mismatch has severity 'fail'; 'warn' if only warns; 'pass' if no mismatches. Example: 'fail'"),
|
|
338
|
-
mismatches: z.array(VerifyMismatchSchema).describe("List of mismatches found. Empty array when status is 'pass'. Example: [{dimension:'created', expected:'...', actual:'...', severity:'fail', detail:'...'}]"),
|
|
339
|
-
summary: z.string().describe("Human-readable summary of the verify result. Example: '2 mismatches found: created dimension failed, event dimension warned'"),
|
|
340
|
-
timestamp: z.string().describe("ISO 8601 timestamp when verify ran. Example: '2026-07-14T10:30:00.000Z'"),
|
|
341
|
-
}).describe("Verify Loop report. Compares expected vs actual semantic fields across 5 dimensions. When status is 'fail', AI should consult the recovery_action in the parent harness_report.");
|
|
342
|
-
export const RecoveryActionSchema = z.object({
|
|
343
|
-
strategy: z.enum(["retry", "claim_faucet", "fill_submission", "recreate", "switch_account", "query_and_retry", "adjust_params", "escalate_human", "stop"]).describe("Recovery strategy chosen by the Recover Loop. Constraint: 9 strategies matching error_code table. Example: 'claim_faucet'"),
|
|
344
|
-
should_retry: z.boolean().describe("Whether AI should retry the original operation after applying the strategy. Constraint: false for 'stop' and 'escalate_human'. Example: true"),
|
|
345
|
-
adjusted_params: z.record(z.string(), z.unknown()).optional().describe("Suggested parameter adjustments for 'adjust_params' strategy. Example: {amount: '100000000'}"),
|
|
346
|
-
user_prompt: z.string().optional().describe("Prompt to show the user when recovery is semi-automatic or manual. Example: 'Please switch to an account with provider permission'"),
|
|
347
|
-
max_attempts: z.number().int().describe("Maximum attempts for this error_code type. Example: 3"),
|
|
348
|
-
current_attempt: z.number().int().describe("Current attempt count (1-indexed). Example: 1"),
|
|
349
|
-
detail: z.string().describe("Human-readable explanation of the recovery decision. Example: 'Insufficient balance detected; claim faucet tokens then retry'"),
|
|
350
|
-
}).describe("Recover Loop action. Generated when verify fails or an error occurs. AI should follow the strategy and respect max_attempts.");
|
|
351
|
-
export const HarnessReportSchema = z.object({
|
|
352
|
-
verify: VerifyReportSchema.describe("Verify Loop report comparing expected vs actual."),
|
|
353
|
-
recovery: RecoveryActionSchema.optional().describe("Recover Loop action. Present only when verify.status is 'fail' or 'warn', or when an error occurred."),
|
|
354
|
-
}).describe("L4 Harness report attached to CallOutput when the Harness is injected. Contains verify result and optional recovery action. AI should check verify.status first; if 'fail', consult recovery.strategy.");
|
|
355
|
-
export const SchemaWarningSchema = z.object({
|
|
356
|
-
compatible: z.boolean().describe("Whether the client schema version is compatible with the server."),
|
|
357
|
-
warnings: z.array(z.string()).describe("Schema compatibility warnings or errors."),
|
|
358
|
-
client_version: z.string().optional().describe("The client schema version that was checked."),
|
|
359
|
-
server_versions: z.object({
|
|
360
|
-
sdk: z.string().describe("Server-side SDK schema version."),
|
|
361
|
-
mcp: z.string().describe("Server-side MCP tool schema version."),
|
|
362
|
-
}).describe("Server-side schema versions."),
|
|
363
|
-
}).strict().describe("Schema compatibility warning attached to tool output when client_schema_version is provided and a mismatch is detected.");
|
|
364
|
-
export const CallOutputSchema = z.object({
|
|
365
|
-
result: CallResultSchema.describe("Discriminated result. Check result.type first: 'transaction'|'submission'|'error'|'data'|'null'|'pending_confirmation'. Each variant has different fields."),
|
|
366
|
-
message: z.string().optional().describe("Human-readable summary or hint. Constraint: always present for error/transaction results; may be omitted for data/null. Example: 'Transaction completed successfully'"),
|
|
367
|
-
semantic: SemanticSummarySchema.optional().describe("Business semantic summary. AI should read semantic first; fall back to parsing result only when semantic is absent. Relation: populated by MCP server from operation context; undefined when intent cannot be confidently inferred or for non-transaction tools. Example: {intent:'publish_service', status:'success', summary:'...'}"),
|
|
368
|
-
harness_report: HarnessReportSchema.optional().describe("L4 Harness report (Verify + Recover). Present only when the Harness is injected and an Expected Result was declared for this operation. Relation: produced by handler.ts calling harness.verify() and harness.recover(). Example: {verify:{status:'fail', mismatches:[...]}, recovery:{strategy:'recreate'}}"),
|
|
369
|
-
schema_warning: SchemaWarningSchema.optional().describe("Schema compatibility warning. Present only when client_schema_version is provided in env and a mismatch is detected."),
|
|
370
|
-
}).strict().describe("Unified MCP tool output. result.type discriminates 6 outcomes: 'transaction' (raw Wow response), 'submission' (needs Guard data), 'error' (failed with error_code), 'data' (query result), 'null' (no-op), 'pending_confirmation' (ConfirmGate blocked — re-call with env.confirmed=true). When semantic is present, prefer it over raw result parsing. When harness_report is present, check verify.status first and follow recovery.strategy if status is 'fail'.");
|
|
1
|
+
import{z}from'zod';import{WowTransactionBlockResponseSchema}from'../local/index.js';import{BalanceTypeSchema,EntrypointSchema,ObjectBaseSchema,GuardTableItemSchema,NameSchema,NameOrAddressSchema,TokenTypeWithDefaultSchema}from'../common/index.js';import{ENTRYPOINT,MAX_GUARD_COUNT_PASSPORT}from'@wowok/wowok';export function strictParse(a,b,c='input'){let d=a;while(d['_def']?.['typeName']==='ZodEffects'){d=d['_def']['schema'];}const e=d['_def']['shape']?.();if(!e)return a['parse'](b);const f=Object['keys'](e),g=Object['keys'](b||{}),h=g['filter'](j=>!f['includes'](j));if(h['length']>0x0)throw new Error('Unknown\x20'+c+'\x20field(s):\x20'+h['join'](',\x20')+'.\x20'+('Allowed\x20fields:\x20'+f['join'](',\x20')+'.\x20')+'Remove\x20the\x20unknown\x20field(s)\x20or\x20check\x20the\x20schema\x20for\x20the\x20correct\x20field\x20name.');const i=a['safeParse'](b);if(!i['success']){const j=i['error']['issues']['map'](k=>{const l=k['path']['length']>0x0?k['path']['map'](o=>typeof o==='number'?'['+o+']':o)['join']('.')['replace']('.[','['):'(root)';let m='';const n=k;if(k['code']==='invalid_type'){const o=n['expected'],p=n['received'];typeof o==='string'&&typeof p==='string'&&(m='\x20(expected:\x20'+o+';\x20received:\x20'+p+')');}return'\x20\x20-\x20'+c+'.'+l+'\x20['+k['code']+']:\x20'+k['message']+m;});throw new Error(c+'\x20validation\x20failed\x20with\x20'+i['error']['issues']['length']+'\x20error(s):\x0a'+j['join']('\x0a'));}return i['data'];}export const NamedObjectSchema=z['object']({'name':NameSchema['optional']()['describe']('The\x20name\x20of\x20the\x20object'),'tags':z['array'](z['string']())['optional']()['describe']('The\x20tags\x20of\x20the\x20object'),'onChain':z['boolean']()['optional']()['describe']('CRITICAL:\x20Whether\x20to\x20sync\x20the\x20name\x20to\x20the\x20blockchain.\x20DEFAULT\x20(undefined/false):\x20The\x20name\x20is\x20stored\x20LOCALLY\x20ONLY\x20on\x20your\x20device\x20(PRIVATE).\x20If\x20set\x20to\x20true:\x20The\x20name\x20is\x20published\x20ON-CHAIN\x20and\x20becomes\x20PUBLICLY\x20VISIBLE\x20to\x20everyone.\x20Only\x20set\x20to\x20true\x20for\x20displaying\x20the\x20relationships\x20you\x20are\x20willing\x20to\x20make\x20public\x20on\x20the\x20chain.'),'replaceExistName':z['boolean']()['optional']()['describe']('FORCE\x20CLAIM:\x20Set\x20to\x20true\x20ONLY\x20when\x20the\x20user\x20explicitly\x20expresses\x20a\x20STRONG\x20INTENTION\x20to\x20forcefully\x20take\x20over\x20an\x20existing\x20name\x20(e.g.,\x20\x27I\x20must\x20use\x20this\x20name\x27,\x20\x27force\x20rename\x27,\x20\x27replace\x20the\x20existing\x20one\x27).\x20'+'WARNING:\x20This\x20will\x20UNBIND\x20the\x20name\x20from\x20its\x20original\x20object\x20and\x20rebind\x20it\x20to\x20the\x20new\x20one,\x20potentially\x20breaking\x20existing\x20references.\x20'+'If\x20not\x20specified\x20or\x20false:\x20the\x20operation\x20will\x20FAIL\x20with\x20an\x20error\x20when\x20the\x20name\x20is\x20already\x20in\x20use\x20(safe\x20default\x20behavior).')})['strict']()['describe']('Assign\x20a\x20name\x20and\x20optional\x20tags\x20to\x20a\x20new\x20object.\x20By\x20default,\x20names\x20are\x20stored\x20LOCALLY\x20(private)\x20on\x20your\x20device.\x20'+'Set\x20\x27onChain:\x20true\x27\x20to\x20create\x20a\x20PUBLIC\x20on-chain\x20identity\x20visible\x20to\x20everyone.\x20'+'IMPORTANT:\x20If\x20the\x20requested\x20name\x20is\x20already\x20taken,\x20the\x20operation\x20will\x20FAIL\x20by\x20default.\x20'+'Only\x20set\x20\x27replaceExistName:\x20true\x27\x20when\x20the\x20user\x20EXPLICITLY\x20demands\x20to\x20forcefully\x20claim\x20the\x20name.');export const NormalObjectSchema=z['union']([NameOrAddressSchema['describe']('String\x20format:\x20Reference\x20an\x20EXISTING\x20object\x20by\x20its\x20name\x20(local\x20mark)\x20or\x20on-chain\x20object\x20ID.\x20Example:\x20\x27my-service\x27\x20or\x20\x270x1234...\x27'),NamedObjectSchema['describe']('Object\x20format:\x20CREATE\x20a\x20NEW\x20object\x20with\x20specified\x20properties.\x20See\x20NamedObjectSchema\x20for\x20details\x20including\x20\x27name\x27\x20(optional),\x20\x27tags\x27\x20(optional),\x20\x27onChain\x27\x20(whether\x20to\x20make\x20name\x20public),\x20and\x20\x27replaceExistName\x27\x20(force\x20claim\x20existing\x20name).')])['describe']('Two\x20ways\x20to\x20specify\x20an\x20object:\x20(1)\x20STRING\x20-\x20Reference\x20an\x20EXISTING\x20object\x20by\x20name\x20or\x20ID;\x20(2)\x20OBJECT\x20-\x20CREATE\x20a\x20NEW\x20object\x20using\x20NamedObjectSchema\x20structure\x20with\x20optional\x20name,\x20tags,\x20and\x20visibility\x20settings.');export const NamedObjectWithDescriptionSchema=NamedObjectSchema['extend']({'description':z['string']()['optional']()['describe']('The\x20description\x20of\x20the\x20object')})['strict']()['describe']('Create\x20a\x20new\x20object\x20with\x20a\x20name\x20and\x20optional\x20description.\x20The\x20name\x20helps\x20identify\x20the\x20object,\x20while\x20the\x20description\x20provides\x20additional\x20details\x20about\x20its\x20purpose\x20or\x20functionality.');export const DescriptionObjectSchema=z['union']([NameOrAddressSchema['describe']('String\x20format:\x20Reference\x20an\x20EXISTING\x20object\x20by\x20its\x20name\x20(local\x20mark)\x20or\x20on-chain\x20object\x20ID.\x20Example:\x20\x27my-object\x27\x20or\x20\x270x1234...\x27'),NamedObjectWithDescriptionSchema['describe']('Object\x20format:\x20CREATE\x20a\x20NEW\x20object\x20with\x20name,\x20optional\x20description,\x20and\x20visibility\x20settings.\x20Extends\x20NamedObjectSchema\x20with\x20an\x20additional\x20\x27description\x27\x20field\x20for\x20detailed\x20object\x20information.')])['describe']('Two\x20ways\x20to\x20specify\x20an\x20object:\x20(1)\x20STRING\x20-\x20Reference\x20an\x20EXISTING\x20object\x20by\x20name\x20or\x20ID;\x20(2)\x20OBJECT\x20-\x20CREATE\x20a\x20NEW\x20object\x20with\x20full\x20configuration\x20including\x20optional\x20name,\x20tags,\x20description,\x20and\x20visibility\x20settings\x20(local\x20private\x20by\x20default,\x20or\x20public\x20on-chain\x20with\x20onChain:true).');export const TypeNamedObjectSchema=NamedObjectSchema['extend']({'type_parameter':TokenTypeWithDefaultSchema['describe']('Payment\x20token\x20type\x20for\x20this\x20object\x20(format:\x20{address}::{module}::{struct}).\x20e.g.\x20\x270x2::wow::WOW\x27\x20(WOW,\x20the\x20default),\x20\x270x...::usdt::USDT\x27\x20(USDT),\x20\x270x...::eth::ETH\x27\x20(ETH).\x20Defines\x20which\x20token\x20this\x20object\x20accepts\x20for\x20payments.\x20To\x20discover\x20all\x20available\x20tokens\x20and\x20their\x20type\x20tags,\x20call\x20wowok_buildin_info\x20with\x20info\x20\x27mainnet\x20bridge\x20tokens\x27\x20and\x20use\x20the\x20returned\x20`wowTypeTag`\x20value\x20here.')})['describe']('Create\x20a\x20new\x20named\x20object\x20(with\x20optional\x20tags)\x20and\x20specify\x20a\x20token\x20type\x20for\x20payments\x20(e.g.,\x20WOW,\x20USDT,\x20ETH).');export const NamedObjectWithPermissionSchema=NamedObjectSchema['extend']({'permission':DescriptionObjectSchema['optional']()})['strict']()['describe']('Use\x20a\x20Permission\x20object\x20to\x20manage\x20access\x20control:\x20(1)\x20Specify\x20an\x20existing\x20Permission\x20object\x27s\x20name\x20or\x20ID;\x20(2)\x20Create\x20a\x20new\x20Permission\x20object\x20(which\x20can\x20be\x20named\x20and\x20tagged);\x20or\x20(3)\x20Leave\x20empty\x20to\x20automatically\x20create\x20a\x20new\x20unnamed\x20Permission\x20object.');export const TypeNamedObjectWithPermissionSchema=NamedObjectWithPermissionSchema['extend']({'type_parameter':TokenTypeWithDefaultSchema['describe']('Payment\x20token\x20type\x20for\x20this\x20object\x20(format:\x20{address}::{module}::{struct}).\x20e.g.\x20\x270x2::wow::WOW\x27\x20(WOW,\x20the\x20default),\x20\x270x...::usdt::USDT\x27\x20(USDT),\x20\x270x...::eth::ETH\x27\x20(ETH).\x20Defines\x20which\x20token\x20this\x20object\x20accepts\x20for\x20payments.\x20To\x20discover\x20all\x20available\x20tokens\x20and\x20their\x20type\x20tags,\x20call\x20wowok_buildin_info\x20with\x20info\x20\x27mainnet\x20bridge\x20tokens\x27\x20and\x20use\x20the\x20returned\x20`wowTypeTag`\x20value\x20here.')})['strict']()['describe']('Create\x20a\x20new\x20named\x20on-chain\x20object\x20with\x20both\x20a\x20specific\x20token\x20type\x20(e.g.,\x20WOW,\x20USDT,\x20ETH)\x20AND\x20permission\x20control.\x20Use\x20this\x20when\x20you\x20need\x20to\x20specify\x20a\x20token\x20type\x20for\x20payment\x20operations\x20AND\x20require\x20permission\x20management\x20(who\x20can\x20manage/operate\x20this\x20object).\x20For\x20objects\x20without\x20permission\x20management,\x20use\x20TypeNamedObjectSchema\x20instead.');export const CoinParamSchema=z['union']([z['object']({'balance':BalanceTypeSchema})['describe']('Specify\x20an\x20amount\x20value.'),z['object']({'coin':z['string']()['describe']('Coin\x20object\x20ID\x20or\x20name(local\x20mark).\x20Use\x20a\x20specified\x20Coin\x20object.')})])['describe']('Specify\x20the\x20amount\x20to\x20pay\x20from\x20the\x20transaction\x20account,\x20or\x20the\x20Coin\x20ID\x20owned\x20by\x20the\x20transaction\x20account.\x20Used\x20for\x20payment.');export const CallEnvSchema=z['object']({'account':NameOrAddressSchema['optional']()['default'](''),'permission_guard':z['array'](z['string']())['optional']()['describe']('List\x20of\x20permission\x20guard\x20IDs.\x20Used\x20to\x20extend\x20additional\x20operation\x20permissions\x20(requires\x20verification\x20and\x20configuration\x20in\x20the\x20Permission\x20object).'),'no_cache':z['boolean']()['optional']()['describe']('Whether\x20to\x20disable\x20caching.'),'network':EntrypointSchema['optional'](),'referrer':NameOrAddressSchema['optional']()['describe']('Referrer\x20ID.\x20If\x20the\x20user\x20is\x20using\x20the\x20network\x20for\x20the\x20first\x20time,\x20the\x20referrer\x20ID\x20will\x20be\x20recorded.'),'confirmed':z['boolean']()['optional']()['describe']('Phase\x202\x20ConfirmGate:\x20set\x20to\x20true\x20to\x20proceed\x20after\x20a\x20\x27pending_confirmation\x27\x20result.\x20The\x20operation\x20is\x20NOT\x20executed\x20until\x20you\x20re-call\x20with\x20confirmed=true\x20after\x20user\x20consent.'),'user_intent_phrases':z['array'](z['string']())['optional']()['describe']('Phase\x202\x20ConfirmGate:\x20explicit\x20user\x20intent\x20phrases\x20collected\x20from\x20conversation\x20context\x20(e.g.\x20\x27use\x20default\x20account\x27,\x20\x27force\x20publish\x27).\x20Used\x20to\x20bypass\x20confirmation\x20rules\x20whose\x20bypass_on_explicit_intent\x20matches.'),'project':z['string']()['optional']()['describe']('Project\x20prefix\x20to\x20assign\x20this\x20object\x20to\x20(e.g.\x20\x27myshop\x27).\x20When\x20set:\x201)\x20the\x20object\x20is\x20tagged\x20with\x20\x27project:<prefix>\x27\x20on-chain\x20automatically\x20via\x20ProjectService,\x202)\x20the\x20newly\x20created\x20object\x20is\x20auto-associated\x20to\x20the\x20SQLite\x20project\x20for\x20local\x20management,\x20evaluation,\x20and\x20graph\x20tracking.\x20The\x20project\x20MUST\x20exist\x20(create\x20via\x20project_operation\x20action=\x27create_project\x27\x20first).\x20Use\x20project_operation\x20to\x20manage\x20projects.'),'client_schema_version':z['string']()['optional']()['describe']('Client-side\x20schema\x20version\x20(semver,\x20e.g.\x20\x271.0.0\x27).\x20When\x20provided,\x20the\x20server\x20checks\x20compatibility\x20and\x20attaches\x20warnings\x20if\x20mismatched.'),'schema_strict_mode':z['boolean']()['optional']()['default'](![])['describe']('When\x20true,\x20schema\x20incompatibility\x20returns\x20an\x20error\x20instead\x20of\x20a\x20warning.\x20Default:\x20false\x20(warn\x20mode).'),'dry_run':z['boolean']()['optional']()['describe']('Phase\x201\x20dry_run:\x20when\x20true,\x20SIMULATE\x20the\x20transaction\x20without\x20signing\x20or\x20submitting.\x20Returns\x20effects\x20+\x20events\x20showing\x20what\x20WOULD\x20happen\x20—\x20no\x20on-chain\x20state\x20is\x20modified,\x20no\x20gas\x20is\x20charged.\x20Use\x20this\x20to\x20verify\x20an\x20operation\x20will\x20succeed\x20before\x20committing.\x20Essential\x20for\x20the\x205-step\x20loop\x27s\x20Plan\x20step.\x20The\x20returned\x20digest\x20will\x20be\x20\x27dry_run:<timestamp>\x27\x20and\x20objectChanges\x20will\x20be\x20empty\x20(simulation\x20only).')})['strict']()['describe']('IMPORTANT:\x20Execution\x20environment\x20includes:\x20account\x20for\x20signing\x20operations,\x20network\x20selection\x20('+ENTRYPOINT+'),\x20additional\x20Guard\x20permissions,\x20and\x20more.\x20Used\x20to\x20specify\x20context\x20information\x20during\x20the\x20call.\x20If\x20account\x20is\x20not\x20specified,\x20the\x20default\x20account\x20(\x22\x22)\x20will\x20be\x20used.');export const ObjectsOpSchema=z['union']([z['object']({'op':z['literal']('set')['or'](z['literal']('add'))['or'](z['literal']('remove')),'objects':z['array'](NameOrAddressSchema)})['describe']('Set,\x20add,\x20or\x20remove\x20object\x20ID\x20list.'),z['object']({'op':z['literal']('clear')})['describe']('Remove\x20all\x20objects.')])['describe']('Operate\x20object\x20list.\x20Used\x20to\x20set,\x20add,\x20or\x20remove\x20objects.');export const ResponseDataSchema=ObjectBaseSchema['extend']({'change':z['union']([z['literal']('created'),z['literal']('mutated'),z['string']()])['describe']('What\x20happened\x20to\x20this\x20object\x20in\x20the\x20operation.\x20Constraint:\x20\x27created\x27\x20|\x20\x27mutated\x27\x20|\x20custom\x20string.\x20Example:\x20\x27created\x27')})['describe']('One\x20object\x20record\x20in\x20a\x20query\x20result.\x20Contains\x20the\x20object\x27s\x20basic\x20info\x20plus\x20how\x20it\x20changed\x20in\x20this\x20operation.');export const ObjectRoleSchema=z['object']({'id':z['string']()['describe']('Object\x20ID\x20(64-hex\x20with\x200x\x20prefix).\x20Identifies\x20the\x20on-chain\x20object.\x20Example:\x20\x270xa1d4...\x27'),'name':z['union']([z['string'](),z['null']()])['optional']()['describe']('Local\x20mark\x20name\x20if\x20assigned,\x20else\x20null.\x20Relation:\x20resolved\x20via\x20local_mark_operation.\x20Example:\x20\x27my-shop\x27\x20or\x20null'),'role':z['enum'](['Permission','Guard','Machine','Progress','Service','Order','Allocation','Arbitration','ArbCase','Messenger','Contact','Demand','Reward','Personal','Repository','Treasury','Discount','Other'])['describe']('Business\x20role\x20of\x20the\x20object\x20in\x20the\x20dependency\x20graph.\x20Constraint:\x20enum\x20of\x2018\x20values.\x20Relation:\x20derived\x20from\x20objectType\x20last\x20segment;\x20drives\x20Plan/Verify\x20Loop\x20positioning.\x20Example:\x20\x27Service\x27'),'relation':z['object']({'parent':z['union']([z['string'](),z['null']()])['optional']()['describe']('Parent\x20object\x20ID,\x20if\x20this\x20object\x20belongs\x20to\x20another\x20(e.g.\x20Machine\x20belongs\x20to\x20Service).\x20Example:\x20\x270x123...\x27\x20or\x20null'),'relation_type':z['enum'](['machine_of','guard_of','allocator_of','permission_of','progress_of','allocation_of','arb_of','other'])['optional']()['describe']('How\x20this\x20object\x20relates\x20to\x20its\x20parent.\x20Example:\x20\x27machine_of\x27')})['optional']()['describe']('Relationship\x20to\x20another\x20object\x20in\x20the\x20dependency\x20graph'),'immutable':z['boolean']()['optional']()['describe']('Whether\x20the\x20object\x20has\x20entered\x20an\x20immutable\x20state\x20(e.g.\x20Service\x20published).\x20Constraint:\x20true\x20after\x20publish.\x20Example:\x20true')})['strict']()['describe']('An\x20object\x20tagged\x20with\x20its\x20business\x20role\x20and\x20relationship\x20within\x20the\x20object\x20dependency\x20graph');export const FundRoleSchema=z['object']({'amount':z['string']()['describe']('Amount\x20change\x20as\x20stringified\x20integer\x20(smallest\x20unit).\x20Negative=spend,\x20positive=receive.\x20Example:\x20\x27-10000000000\x27'),'coinType':z['string']()['describe']('Coin\x20type\x20tag\x20(format:\x20{address}::{module}::{struct}).\x20Example:\x20\x270x2::wow::WOW\x27'),'role':z['enum'](['payment','refund','change','compensation','reward','gas','deposit','release','other'])['describe']('Business\x20role\x20of\x20this\x20fund\x20movement.\x20Constraint:\x20enum\x20of\x209\x20values.\x20Relation:\x20derived\x20from\x20operation\x20context.\x20Example:\x20\x27payment\x27'),'from':z['string']()['nullable']()['optional']()['describe']('Sender\x20address\x20if\x20known.\x20Example:\x20\x270xabc...\x27\x20or\x20null'),'to':z['string']()['nullable']()['optional']()['describe']('Recipient\x20address\x20if\x20known.\x20Example:\x20\x270xdef...\x27\x20or\x20null')})['strict']()['describe']('A\x20fund\x20movement\x20tagged\x20with\x20its\x20business\x20role');export const NextActionSchema=z['object']({'action':z['string']()['describe']('Recommended\x20next\x20action.\x20Example:\x20\x27add\x20sales\x20products\x27'),'reason':z['string']()['describe']('Why\x20this\x20action\x20is\x20recommended.\x20Example:\x20\x27Service\x20has\x20no\x20products;\x20customers\x20cannot\x20order\x27'),'tool':z['string']()['optional']()['describe']('MCP\x20tool\x20to\x20use,\x20if\x20applicable.\x20Example:\x20\x27onchain_operations\x27'),'prerequisite':z['string']()['optional']()['describe']('Condition\x20that\x20must\x20hold\x20before\x20this\x20action.\x20Example:\x20\x27Service\x20must\x20be\x20created\x20first\x27'),'priority':z['enum'](['required','recommended','optional'])['describe']('Priority.\x20Constraint:\x20enum.\x20Example:\x20\x27required\x27')})['strict']()['describe']('A\x20recommended\x20next\x20action\x20with\x20priority\x20and\x20rationale');export const EventSemanticSchema=z['object']({'event_type':z['string']()['describe']('Raw\x20on-chain\x20event\x20type\x20tag.\x20Example:\x20\x270x2::service::ServicePublishedEvent\x27'),'business_meaning':z['string']()['describe']('Human-readable\x20business\x20meaning.\x20Example:\x20\x27Service\x20has\x20been\x20published\x20and\x20is\x20now\x20immutable\x27'),'category':z['enum'](['lifecycle','state_change','fund_flow','permission','guard','other'])['describe']('Business\x20category.\x20Constraint:\x20enum\x20of\x206\x20values.\x20Example:\x20\x27lifecycle\x27'),'related_object':z['string']()['optional']()['describe']('Object\x20ID\x20the\x20event\x20relates\x20to,\x20if\x20extractable.\x20Example:\x20\x270x123...\x27'),'side_effect':z['string']()['optional']()['describe']('Side\x20effect\x20description\x20for\x20AI.\x20Example:\x20\x27Customers\x20can\x20now\x20place\x20orders\x20against\x20this\x20Service\x27')})['strict']()['describe']('An\x20on-chain\x20event\x20annotated\x20with\x20business\x20semantics');export const ExperienceSchema=z['object']({'advice':z['string']()['optional']()['describe']('Advice\x20from\x20past\x20experience.\x20Example:\x20\x27Last\x20time\x20you\x20forgot\x20to\x20set\x20buy_guard;\x20add\x20it\x20before\x20publishing\x27'),'avoid':z['array'](z['string']())['optional']()['describe']('Pitfalls\x20to\x20avoid\x20based\x20on\x20history.\x20Example:\x20[\x27Guard\x20rejection\x20on\x20delivery_proof\x27]'),'relevance':z['number']()['min'](0x0)['max'](0x1)['optional']()['describe']('Relevance\x20score\x200-1\x20of\x20the\x20matched\x20experience.\x20Example:\x200.85'),'matched_scenario':z['string']()['optional']()['describe']('Matched\x20historical\x20scenario.\x20Example:\x20\x27publish_service_freelance\x27')})['strict']()['describe']('Experience\x20layer\x20feedback\x20from\x20past\x20operations\x20(Phase\x202\x20Topic\x202).\x20Provides\x20advice\x20and\x20pitfalls\x20based\x20on\x20historical\x20patterns.');export const ServiceStatusSchema=z['object']({'active':z['array'](z['string']())['describe']('Phase\x202\x20services\x20currently\x20active\x20(enabled).\x20Example:\x20[\x27confirm_gate\x27,\x27project_service\x27,\x27experience_layer\x27]'),'inactive':z['array'](z['string']())['optional']()['describe']('Phase\x202\x20services\x20currently\x20inactive\x20(can\x20be\x20toggled\x20via\x20config_operation).\x20Example:\x20[\x27harness\x27,\x27graph_persist\x27]')})['strict']()['describe']('Phase\x202\x20runtime\x20service\x20status\x20(populated\x20when\x20semantic_rich\x20is\x20enabled).\x20Lets\x20AI\x20see\x20which\x20services\x20are\x20active\x20in\x20each\x20response.');export const CustomerReminderSchema=z['object']({'id':z['string']()['describe']('Reminder\x20rule\x20id.\x20Example:\x20\x27high_risk_score\x27'),'stage':z['enum'](['browse','evaluate','preorder','in_progress','complete','after_sale'])['describe']('Order\x20lifecycle\x20stage\x20when\x20this\x20reminder\x20fires.\x20Example:\x20\x27evaluate\x27'),'priority':z['enum'](['required','recommended','info','reminder'])['describe']('Priority.\x20\x27required\x27\x20=\x20blocks\x20purchase;\x20\x27recommended\x27\x20=\x20strong\x20caution.\x20Example:\x20\x27required\x27'),'message':z['string']()['describe']('Human-readable\x20reminder\x20message.\x20Example:\x20\x27Composite\x20risk\x20score\x2025/100,\x20strongly\x20discourage\x20purchase\x27'),'action':z['string']()['optional']()['describe']('Suggested\x20next\x20action.\x20Example:\x20\x27require\x20merchant\x20to\x20bind\x20Arbitration\x20before\x20ordering\x27')})['strict']()['describe']('A\x20buyer-side\x20reminder\x20triggered\x20at\x20a\x20specific\x20order\x20lifecycle\x20stage\x20(Phase\x203\x20C-3).');export const PreferenceMatchSchema=z['object']({'score':z['number']()['min'](0x0)['max'](0x64)['describe']('Match\x20score\x200-100\x20(higher\x20=\x20better\x20fit).\x20Example:\x2075'),'matches':z['array'](z['string']())['describe']('Aspects\x20that\x20match\x20user\x20preferences.\x20Example:\x20[\x27Price\x2010%\x20below\x20average\x27,\x27Has\x20arbitration\x27]'),'mismatches':z['array'](z['string']())['describe']('Aspects\x20that\x20mismatch\x20user\x20preferences.\x20Example:\x20[\x27Delivery\x20cycle\x20exceeds\x20expectation\x27]')})['strict']()['describe']('Service-to-preference\x20match\x20result\x20(Phase\x203\x20C-2).\x207-dimension\x20scoring:\x20price/time/region/brand/bargain/emotion/risk.');export const CustomerAdviceSchema=z['object']({'risk_score':z['number']()['min'](0x0)['max'](0x64)['optional']()['describe']('Composite\x20risk\x20score\x200-100\x20(higher\x20=\x20safer).\x20Relation:\x20from\x20risk-assessment.ts\x204-dimension\x20scoring.\x20Example:\x2075'),'risk_level':z['enum'](['low','medium_low','medium_high','high'])['optional']()['describe']('Risk\x20level\x20bucket.\x20\x27high\x27\x20=\x20strongly\x20discourage\x20purchase.\x20Example:\x20\x27medium_high\x27'),'recommendations':z['array'](z['string']())['describe']('Actionable\x20recommendations\x20for\x20the\x20buyer.\x20Example:\x20[\x27Require\x20merchant\x20to\x20configure\x20arbitration\x27,\x27Negotiate\x20refund\x20terms\x20via\x20Messenger\x27]'),'reminders':z['array'](CustomerReminderSchema)['describe']('Stage-specific\x20reminders\x20(deduped,\x20sorted\x20by\x20priority,\x20capped\x20to\x203\x20high-risk).\x20Example:\x20[{priority:\x27required\x27,\x20message:\x27Ambiguous\x20Guard\x20must\x20be\x20human-reviewed\x27}]'),'preference_match':PreferenceMatchSchema['optional']()['describe']('Service-to-preference\x20match\x20(populated\x20when\x20user\x20preferences\x20exist).\x20Example:\x20{score:75,\x20matches:[...],\x20mismatches:[...]}')})['strict']()['describe']('Buyer-side\x20advice\x20(Phase\x203\x20C-3.3).\x20Populated\x20in\x20semantic.customer_advice\x20for\x20order/query\x20operations\x20when\x20customer_intelligence\x20service\x20is\x20enabled.');export const EvolutionContextSchema=z['object']({'industry_signal':z['string']()['optional']()['describe']('Industry\x20evolution\x20signal\x20summary.\x20Example:\x20\x27Industry\x20health\x2082/100\x20(healthy);\x2025\x20cumulative\x20industry\x20signals\x27'),'evolution_advice':z['string']()['optional']()['describe']('Evolution\x20advice\x20for\x20the\x20current\x20operation.\x20Example:\x20\x27Recommend\x20mandatory\x20arbitration\x20+\x20compensation\x20fund\x20+\x20delivery\x20Guard\x27'),'confidence':z['number']()['min'](0x0)['max'](0x1)['describe']('Confidence\x20of\x20the\x20evolution\x20context\x200-1.\x20<0.5\x20means\x20no\x20data\x20yet.\x20Example:\x200.75'),'health_score':z['number']()['min'](0x0)['max'](0x64)['optional']()['describe']('Industry\x20health\x20score\x200-100\x20if\x20available.\x20Example:\x2082'),'pending_suggestions':z['number']()['int']()['min'](0x0)['optional']()['describe']('Count\x20of\x20pending\x20industry\x20update\x20suggestions\x20(filtered\x20by\x20role\x20if\x20role\x20is\x20set).\x20Example:\x203'),'intent':z['enum'](['default','growth','retention','compliance','efficiency','trust_building','custom'])['optional']()['describe']('Phase\x204\x20P4-6.C:\x20Current\x20business\x20intent\x20driving\x20the\x20scoring\x20model.\x20Absent\x20=\x20\x27default\x27.\x20Example:\x20\x27growth\x27'),'role_advice':z['array'](z['string']())['optional']()['describe']('Phase\x204\x20P4-6.C:\x20Role-targeted\x20advice\x20strings\x20(merchant/customer/prospect/supplier/collaborator/arbitrator).\x20Example:\x20[\x27Strengthen\x20loyalty\x20flywheel\x27,\x27Optimize\x20first-order\x20conversion\x27]'),'role':z['enum'](['merchant','customer','prospect','supplier','collaborator','arbitrator'])['optional']()['describe']('Phase\x204\x20P4-6.C:\x20Role\x20used\x20for\x20advice\x20routing.\x20Example:\x20\x27merchant\x27')})['strict']()['describe']('Phase\x204\x20industry\x20evolution\x20context\x20(populated\x20when\x20industry_evolution\x20service\x20is\x20enabled).\x20Provides\x20AI\x20with\x20industry-level\x20health\x20signals,\x20evolution\x20advice,\x20and\x20role-targeted\x20recommendations.');export const GuardPuzzleStatusSchema=z['object']({'intent':z['boolean']()['describe']('Intent\x20dimension\x20complete\x20(action\x20+\x20rule\x20+\x20failure\x20conditions)'),'binding':z['boolean']()['describe']('Binding\x20dimension\x20complete\x20(host\x20object\x20+\x20field\x20+\x20circular\x20ref)'),'data':z['boolean']()['describe']('Data\x20dimension\x20complete\x20(table\x20entries\x20+\x20witnesses)'),'query':z['boolean']()['describe']('Query\x20dimension\x20complete\x20(query\x20instructions\x20if\x20needed)'),'logic':z['boolean']()['describe']('Logic\x20dimension\x20complete\x20(root\x20node\x20returns\x20Bool)'),'constraints':z['boolean']()['describe']('Constraints\x20dimension\x20complete\x20(10\x20Pitfalls\x20checked)')})['strict']()['describe']('Guard\x20information\x20puzzle\x20completeness\x20status.\x206\x20dimensions\x20(A-F).\x20false\x20=\x20missing,\x20needs\x20user\x20input.');export const GuardAvailableQuerySchema=z['object']({'id':z['number']()['int']()['describe']('Query\x20instruction\x20ID.\x20Example:\x201253'),'name':z['string']()['describe']('Query\x20instruction\x20name.\x20Example:\x20\x27progress.current\x27'),'objectType':z['string']()['describe']('Target\x20object\x20type.\x20Example:\x20\x27Progress\x27'),'returnType':z['string']()['describe']('Return\x20value\x20type.\x20Example:\x20\x27String\x27'),'description':z['string']()['optional']()['describe']('Query\x20description')})['strict']()['describe']('A\x20Guard\x20query\x20instruction\x20available\x20for\x20the\x20current\x20context\x20(subset\x20of\x20GUARDQUERY\x20375\x20entries).');export const GuardAdviceSchema=z['object']({'current_round':z['enum'](['R1','R2','R3','R4','R5','R6','R7','R8','R9','R10'])['optional']()['describe']('Current\x20R1-R10\x20dialogue\x20round.\x20R1=intent,\x20R2=table,\x20R3=tree,\x20R4=rely,\x20R5=binding,\x20R6=review,\x20R7=CREATE,\x20R8=test,\x20R9=bind,\x20R10=verify.\x20Example:\x20\x27R3\x27'),'puzzle_status':GuardPuzzleStatusSchema['optional']()['describe']('Information\x20puzzle\x20completeness\x20(6\x20dimensions).\x20Missing\x20dimensions\x20need\x20user\x20input\x20before\x20CREATE.'),'matched_scene':z['string']()['optional']()['describe']('Matched\x20Guard\x20scene\x20id\x20from\x20the\x208\x20binding\x20scenarios\x20ledger.\x20Example:\x20\x27machine_forward_guard\x27'),'scene_description':z['string']()['optional']()['describe']('Human-readable\x20scene\x20description.\x20Example:\x20\x27Workflow\x20node\x20forward\x20validation\x20(Forward.guard)\x27'),'scene_constraints':z['array'](z['string']())['optional']()['describe']('Special\x20constraints\x20for\x20the\x20matched\x20scene.\x20Example:\x20[\x27Forward.guard\x20cannot\x20be\x20modified\x20after\x20Machine\x20is\x20published\x27]'),'suggested_patterns':z['array'](z['string']())['optional']()['describe']('Suggested\x20Guard\x20patterns\x20based\x20on\x20user\x20intent.\x20Example:\x20[\x27time\x20lock\x27,\x27progress\x20status\x20check\x27]'),'available_queries':z['array'](GuardAvailableQuerySchema)['optional']()['describe']('Available\x20query\x20instructions\x20for\x20the\x20current\x20context\x20(subset\x20of\x20375\x20GUARDQUERY\x20entries)'),'risk_warnings':z['array'](z['string']())['optional']()['describe']('Risk\x20warnings\x20for\x20the\x20current\x20Guard\x20design.\x20Example:\x20[\x27Guard\x20cannot\x20be\x20modified\x20after\x20creation\x27,\x27Time\x20lock\x20test\x20uses\x201000ms\x27]'),'pending_questions':z['array'](z['string']())['optional']()['describe']('Questions\x20for\x20the\x20user\x20to\x20complete\x20the\x20puzzle.\x20Example:\x20[\x27Which\x20Host\x20Object\x20will\x20the\x20Guard\x20bind\x20to?\x27]'),'confirmation_text':z['string']()['optional']()['describe']('Structured\x20semantic\x20confirmation\x20text\x20for\x20user\x20review\x20(generated\x20when\x20puzzle\x20is\x20complete).\x20User\x20must\x20explicitly\x20confirm\x20before\x20CREATE.'),'test_result':z['object']({'status':z['enum'](['pass','fail','not_tested']),'failure_node':z['string']()['optional']()['describe']('Node\x20that\x20caused\x20failure\x20(if\x20fail)'),'passport_id':z['string']()['optional']()['describe']('Generated\x20Passport\x20ID\x20(if\x20pass)')})['optional']()['describe']('gen_passport\x20static\x20test\x20result.\x20Must\x20pass\x20before\x20CREATE.'),'risk_assessment':z['object']({'overall_risk':z['enum'](['critical','high','medium','low','info'])['describe']('Overall\x20risk\x20level\x20(highest\x20from\x20all\x20risks)'),'risk_count':z['number']()['int']()['describe']('Total\x20number\x20of\x20detected\x20risks'),'critical_count':z['number']()['int']()['describe']('Number\x20of\x20critical\x20risks'),'high_count':z['number']()['int']()['describe']('Number\x20of\x20high\x20risks'),'needs_human_review':z['boolean']()['describe']('Whether\x20human\x20review\x20is\x20required\x20(critical\x20or\x202+\x20high\x20risks)'),'top_risks':z['array'](z['string']())['describe']('Top\x20risk\x20titles\x20(critical\x20and\x20high,\x20max\x203)'),'stakeholder_advice':z['record'](z['string'](),z['array'](z['string']()))['optional']()['describe']('Per-stakeholder\x20advice.\x20Key=stakeholder\x20(customer/provider/arbitrator/claimant),\x20value=advice\x20list')})['optional']()['describe']('Business-layer\x20risk\x20assessment\x20(game\x20theory,\x20data\x20source\x20trust,\x20logic\x20gaps).\x20Populated\x20during\x20Guard\x20design\x20to\x20warn\x20about\x20business\x20risks\x20beyond\x20syntax.')})['strict']()['describe']('Guard\x20advice\x20(Phase\x205\x20Guard\x20capability\x20system).\x20Injected\x20when\x20user\x20intent\x20involves\x20Guard.\x20Provides\x20context\x20for\x20Guard\x20design,\x20generation,\x20confirmation,\x20and\x20execution.');export const SemanticSummarySchema=z['object']({'intent':z['string']()['describe']('Inferred\x20user\x20intent\x20/\x20operation\x20goal.\x20Constraint:\x20snake_case\x20string.\x20Relation:\x20derived\x20from\x20operation_type\x20+\x20data\x20signals.\x20Example:\x20\x27publish_service\x27'),'status':z['enum'](['success','partial','failed','pending_input'])['describe']('Business-level\x20status\x20(not\x20raw\x20tx\x20status).\x20\x27pending_input\x27\x20=\x20needs\x20Guard\x20submission.\x20Example:\x20\x27success\x27'),'summary':z['string']()['describe']('One-sentence\x20human-readable\x20summary\x20of\x20what\x20happened.\x20AI\x20should\x20read\x20this\x20first.\x20Example:\x20\x27Successfully\x20published\x20Service\x20my-shop\x20with\x20Machine\x20bound\x27'),'created':z['array'](ObjectRoleSchema)['optional']()['describe']('Objects\x20newly\x20created\x20in\x20this\x20operation,\x20tagged\x20with\x20roles'),'modified':z['array'](ObjectRoleSchema)['optional']()['describe']('Objects\x20mutated\x20in\x20this\x20operation,\x20tagged\x20with\x20roles'),'released':z['array'](FundRoleSchema)['optional']()['describe']('Fund\x20movements\x20in\x20this\x20operation,\x20tagged\x20with\x20roles'),'events':z['array'](EventSemanticSchema)['optional']()['describe']('On-chain\x20events\x20annotated\x20with\x20business\x20semantics\x20(S-8)'),'next_actions':z['array'](NextActionSchema)['optional']()['describe']('Recommended\x20next\x20actions\x20to\x20drive\x20the\x20workflow\x20forward'),'warnings':z['array'](z['string']())['optional']()['describe']('Business-level\x20warnings.\x20Example:\x20\x27order_allocators\x20not\x20configured;\x20order\x20funds\x20cannot\x20be\x20distributed\x27'),'experience':ExperienceSchema['optional']()['describe']('Experience\x20layer\x20feedback\x20from\x20past\x20operations\x20(Phase\x202\x20Topic\x202)'),'service_status':ServiceStatusSchema['optional']()['describe']('Phase\x202\x20runtime\x20service\x20status\x20(populated\x20when\x20semantic_rich\x20is\x20enabled).\x20Lets\x20AI\x20see\x20active\x20services\x20in\x20each\x20response.'),'customer_advice':CustomerAdviceSchema['optional']()['describe']('Buyer-side\x20advice\x20(Phase\x203\x20C-3.3).\x20Populated\x20when\x20customer_intelligence\x20service\x20is\x20enabled\x20AND\x20operation\x20is\x20order/query\x20on\x20a\x20Service.\x20Contains\x20risk_score,\x20recommendations,\x20reminders,\x20and\x20preference_match.'),'evolution_context':EvolutionContextSchema['optional']()['describe']('Phase\x204\x20industry\x20evolution\x20context\x20(populated\x20when\x20industry_evolution\x20service\x20is\x20enabled).\x20Provides\x20AI\x20with\x20industry\x20health\x20signals\x20and\x20evolution\x20advice.'),'guard_advice':GuardAdviceSchema['optional']()['describe']('Phase\x205\x20Guard\x20capability\x20advice\x20(populated\x20when\x20user\x20intent\x20involves\x20Guard).\x20Provides\x20puzzle\x20status,\x20scene\x20matching,\x20suggested\x20patterns,\x20available\x20queries,\x20risk\x20warnings,\x20and\x20confirmation\x20text.\x20AI\x20uses\x20this\x20to\x20guide\x20Guard\x20design\x20dialogue\x20(R1-R10).')})['strict']()['describe']('Business\x20semantic\x20summary:\x20translates\x20the\x20raw\x20transaction\x20response\x20into\x20AI-directly-understandable\x20business\x20meaning');export const CallResponseErrorSchema=z['object']({'type':z['literal']('error')['describe']('Discriminator\x20for\x20this\x20result\x20variant.\x20Constraint:\x20always\x20\x27error\x27.\x20Example:\x20\x27error\x27'),'error':z['string']()['describe']('Human-readable\x20error\x20message\x20from\x20the\x20chain\x20or\x20SDK.\x20Relation:\x20enriched\x20via\x20enrichMoveError\x20before\x20classification.\x20Example:\x20\x27Insufficient\x20balance\x20for\x20gas\x27'),'error_code':z['enum'](['invalid_parameter','guard_rejected','state_conflict','insufficient_balance','object_not_found','permission_denied','immutable_violation','network_error','rate_limit','gas_exceeded','bcs_error','signature_error','config_error','wip_verification_failed','unknown'])['optional']()['describe']('Error\x20classification\x20for\x20programmatic\x20recovery.\x20Constraint:\x20enum\x20of\x2015\x20values\x20(must\x20match\x20ErrorCode\x20in\x20semantic.ts).\x20Relation:\x20drives\x20Recover\x20Loop\x20strategy\x20selection.\x20Example:\x20\x27insufficient_balance\x27'),'retryable':z['boolean']()['optional']()['describe']('Whether\x20the\x20same\x20call\x20can\x20be\x20retried\x20as-is.\x20Constraint:\x20true\x20for\x20network_error,\x20rate_limit,\x20gas_exceeded,\x20and\x20insufficient_balance.\x20Example:\x20true'),'recovery_hint':z['string']()['optional']()['describe']('Recovery\x20suggestion\x20for\x20AI\x20or\x20user.\x20Relation:\x20paired\x20with\x20error_code\x20to\x20guide\x20Recover\x20Loop.\x20Example:\x20\x27Claim\x20faucet\x20tokens\x20then\x20retry\x27'),'related_object':z['string']()['optional']()['describe']('Object\x20ID\x20related\x20to\x20the\x20error,\x20if\x20any.\x20Example:\x20\x270x123...\x27')})['describe']('Error\x20result.\x20Contains\x20the\x20raw\x20error\x20message\x20plus\x20structured\x20classification\x20(error_code/retryable/recovery_hint)\x20so\x20AI\x20can\x20choose\x20a\x20recovery\x20strategy\x20without\x20parsing\x20the\x20error\x20string.');export const OperationPreviewSchema=z['object']({'level':z['enum'](['none','standard','amount','publish','irreversible'])['describe']('Confirmation\x20level.\x20\x27irreversible\x27\x20=\x20cannot\x20be\x20undone\x20(arb\x20verdict,\x20payment).\x20\x27publish\x27\x20=\x20locks\x20immutable\x20fields.\x20\x27amount\x27\x20=\x20amount-sensitive.\x20\x27standard\x27\x20=\x20default-value\x20warnings.'),'operation':z['string']()['describe']('operation_type\x20that\x20triggered\x20the\x20gate.\x20Example:\x20\x27payment\x27'),'object':z['union']([z['string'](),z['record'](z['unknown']()),z['null']()])['optional']()['describe']('Object\x20name/id\x20involved\x20(string\x20for\x20existing,\x20object\x20for\x20new\x20creation).\x20Example:\x20\x27myshop_service\x27\x20or\x20{name:\x20\x27myshop_service\x27}'),'network':z['string']()['optional']()['describe']('Network\x20in\x20use.\x20Example:\x20\x27mainnet\x27'),'account':z['string']()['optional']()['describe']('Signing\x20account\x20(\x27\x27\x20=\x20default).\x20Example:\x20\x27\x27\x20or\x20\x270xabc...\x27'),'amount':z['object']({'value':z['string']()['describe']('Smallest-unit\x20value\x20as\x20string.\x20Example:\x20\x272500000000\x27'),'token':z['string']()['describe']('Coin\x20type\x20tag.\x20Example:\x20\x270x2::wow::WOW\x27'),'human_readable':z['string']()['describe']('Human-readable\x20amount.\x20Example:\x20\x272.5\x20WOW\x27'),'recipient':z['string']()['optional']()['describe']('Recipient\x20address\x20if\x20known.\x20Example:\x20\x270xdef...\x27')})['optional']()['describe']('Amount\x20info\x20for\x20amount-level\x20confirmations.'),'immutable_after':z['array'](z['string']())['optional']()['describe']('Fields\x20that\x20become\x20immutable\x20after\x20this\x20op\x20(for\x20publish).\x20Example:\x20[\x27machine\x27,\x27order_allocators\x27]'),'warnings':z['array'](z['string']())['optional']()['describe']('Default-value\x20warnings.\x20Example:\x20[\x27Using\x20default\x20account\x20(env.account=\x22\x22)\x27]'),'irreversible':z['boolean']()['optional']()['describe']('True\x20when\x20the\x20operation\x20cannot\x20be\x20reverted.\x20Example:\x20true')})['strict']()['describe']('Preview\x20of\x20an\x20operation\x20awaiting\x20user\x20confirmation\x20(Phase\x202\x20Topic\x204\x20ConfirmGate).');export const CallPendingConfirmationSchema=z['object']({'type':z['literal']('pending_confirmation')['describe']('Discriminator.\x20The\x20operation\x20was\x20NOT\x20executed;\x20it\x20is\x20blocked\x20pending\x20user\x20confirmation.\x20Re-call\x20with\x20env.confirmed=true\x20to\x20proceed,\x20or\x20modify/cancel.'),'preview':OperationPreviewSchema['describe']('Preview\x20of\x20the\x20operation\x20awaiting\x20confirmation.'),'rule_id':z['string']()['optional']()['describe']('Id\x20of\x20the\x20confirmation\x20rule\x20that\x20matched.\x20Example:\x20\x27publish_immutable\x27')})['describe']('Pending\x20confirmation.\x20The\x20ConfirmGate\x20blocked\x20the\x20operation.\x20Read\x20preview\x20first;\x20if\x20user\x20consents,\x20re-invoke\x20the\x20SAME\x20call\x20with\x20env.confirmed=true.');export const GuardSubmissionToFillSchema=z['object']({'guard':NameOrAddressSchema['describe']('Guard\x20object\x20name\x20or\x20ID\x20that\x20requires\x20submission\x20data.\x20Example:\x20\x27my-delivery-guard\x27'),'submission':z['array'](GuardTableItemSchema)['describe']('User-submitted\x20data\x20matching\x20the\x20Guard\x27s\x20required\x20fields.\x20Relation:\x20structure\x20must\x20match\x20the\x20Guard\x20table\x27s\x20column\x20definitions.\x20Example:\x20[{field:\x27delivery_proof\x27,\x20value:\x27Qm...\x27}]')})['strict']()['describe']('One\x20Guard\x27s\x20submission\x20data:\x20the\x20Guard\x20to\x20verify\x20plus\x20the\x20user-provided\x20data\x20that\x20satisfies\x20its\x20requirements.');export const SubmissionCallSchema=z['object']({'type':z['literal']('submission')['describe']('Discriminator\x20for\x20this\x20result\x20variant.\x20Constraint:\x20always\x20\x27submission\x27.\x20Example:\x20\x27submission\x27'),'guard':z['array'](z['object']({'object':NameOrAddressSchema['describe']('Guard\x20object\x20name\x20or\x20ID\x20to\x20verify\x20against.\x20Example:\x20\x27my-delivery-guard\x27\x20or\x20\x270x123...\x27'),'impack':z['boolean']()['describe']('Whether\x20this\x20Guard\x27s\x20verification\x20result\x20participates\x20in\x20the\x20final\x20logic.\x20Constraint:\x20if\x20false,\x20the\x20Guard\x20is\x20checked\x20but\x20does\x20not\x20block\x20the\x20operation.\x20Example:\x20true')})['strict']())['max'](MAX_GUARD_COUNT_PASSPORT)['describe']('Array\x20of\x20Guard\x20objects\x20to\x20verify.\x20Constraint:\x20at\x20most\x20'+MAX_GUARD_COUNT_PASSPORT+'\x20entries\x20(MAX_GUARD_COUNT_PASSPORT).\x20Relation:\x20each\x20entry\x20corresponds\x20to\x20a\x20Guard\x20bound\x20to\x20the\x20operation.'),'submission':z['array'](GuardSubmissionToFillSchema)['describe']('User-submitted\x20data\x20for\x20each\x20Guard.\x20Relation:\x20one\x20entry\x20per\x20Guard\x20in\x20the\x20guard\x20array;\x20fill\x20submission\x20fields\x20and\x20resubmit\x20via\x20call_with_submission.\x20PLACEMENT:\x20this\x20`submission`\x20field\x20is\x20at\x20the\x20SAME\x20level\x20as\x20`data`\x20and\x20`env`\x20in\x20the\x20operation\x20input\x20—\x20NOT\x20inside\x20`data.data`.\x20Example\x20structure:\x20{tool:\x27onchain_operations\x27,\x20data:{operation_type:\x27order\x27,\x20data:{object:\x27my_order\x27,\x20progress:{...}}},\x20submission:{type:\x27submission\x27,\x20guard:[...],\x20submission:[...]}}')})['strict']()['describe']('Guard\x20verification\x20required.\x20The\x20operation\x20was\x20blocked\x20because\x20one\x20or\x20more\x20Guards\x20require\x20user-submitted\x20data.\x20Fill\x20the\x20submission\x20array\x20and\x20resubmit.\x20Semantic\x20status\x20is\x20\x27pending_input\x27.');export const TypedPermissionObjectSchema=z['union']([NameOrAddressSchema['describe']('String\x20format:\x20Reference\x20an\x20EXISTING\x20object\x20by\x20its\x20name\x20(local\x20mark)\x20or\x20on-chain\x20object\x20ID.\x20Use\x20this\x20when\x20the\x20object\x20already\x20exists\x20and\x20you\x20want\x20to\x20reference\x20it.'),TypeNamedObjectWithPermissionSchema['describe']('Object\x20format:\x20CREATE\x20a\x20NEW\x20object\x20with\x20COMPLETE\x20configuration\x20including:\x20optional\x20name,\x20tags,\x20description,\x20token\x20type\x20for\x20payments\x20(e.g.,\x20\x270x2::wow::WOW\x27),\x20AND\x20Permission-based\x20access\x20control.\x20Use\x20this\x20for\x20creating\x20sophisticated\x20objects\x20with\x20both\x20payment\x20token\x20specification\x20and\x20permission\x20management.')])['describe']('Two\x20ways\x20to\x20specify\x20an\x20object:\x20(1)\x20STRING\x20-\x20Reference\x20an\x20EXISTING\x20object\x20by\x20name\x20or\x20ID;\x20(2)\x20OBJECT\x20-\x20CREATE\x20a\x20NEW\x20object\x20with\x20full\x20configuration\x20including\x20name,\x20tags,\x20description,\x20token\x20type\x20for\x20payments,\x20and\x20Permission-based\x20access\x20control.\x20The\x20object\x20format\x20is\x20used\x20when\x20you\x20need\x20both\x20token\x20specification\x20AND\x20permission\x20management.');export const WithPermissionObjectSchema=z['union']([NameOrAddressSchema['describe']('String\x20format:\x20Reference\x20an\x20EXISTING\x20object\x20by\x20its\x20name\x20(local\x20mark)\x20or\x20on-chain\x20object\x20ID.\x20Use\x20when\x20the\x20Permission\x20object\x20already\x20exists.'),NamedObjectWithPermissionSchema['describe']('Object\x20format:\x20CREATE\x20a\x20NEW\x20object\x20with\x20Permission-based\x20access\x20control.\x20Includes\x20optional\x20name,\x20tags,\x20visibility\x20settings,\x20AND\x20a\x20Permission\x20object\x20(which\x20itself\x20can\x20be\x20referenced\x20by\x20string\x20or\x20created\x20as\x20a\x20new\x20object).\x20Use\x20this\x20to\x20create\x20objects\x20with\x20managed\x20access\x20permissions.')])['describe']('Two\x20ways\x20to\x20specify\x20a\x20Permission-managed\x20object:\x20(1)\x20STRING\x20-\x20Reference\x20an\x20EXISTING\x20Permission\x20object\x20by\x20name\x20or\x20ID;\x20(2)\x20OBJECT\x20-\x20CREATE\x20a\x20NEW\x20object\x20with\x20Permission\x20access\x20control,\x20where\x20the\x20Permission\x20can\x20also\x20be\x20either\x20referenced\x20(string)\x20or\x20newly\x20created\x20(object).\x20This\x20is\x20used\x20when\x20you\x20need\x20permission\x20management\x20but\x20don\x27t\x20need\x20to\x20specify\x20a\x20token\x20type.');export const TypedDescriptionObjectSchema=z['union']([NameOrAddressSchema['describe']('String\x20format:\x20Reference\x20an\x20EXISTING\x20object\x20by\x20its\x20name\x20(local\x20mark)\x20or\x20on-chain\x20object\x20ID.\x20Use\x20when\x20the\x20object\x20already\x20exists.'),TypeNamedObjectSchema['describe']('Object\x20format:\x20CREATE\x20a\x20NEW\x20object\x20with\x20token\x20type\x20specification\x20for\x20payments.\x20Includes\x20optional\x20name,\x20tags,\x20visibility\x20settings,\x20AND\x20a\x20specific\x20token\x20type\x20(e.g.,\x20\x270x2::wow::WOW\x27\x20or\x20\x270x2::usdt::USDT\x27).\x20Use\x20this\x20when\x20you\x20need\x20to\x20specify\x20what\x20token\x20the\x20object\x20will\x20use\x20for\x20payments\x20but\x20don\x27t\x20need\x20permission\x20management.')])['describe']('Two\x20ways\x20to\x20specify\x20an\x20object:\x20(1)\x20STRING\x20-\x20Reference\x20an\x20EXISTING\x20object\x20by\x20name\x20or\x20ID;\x20(2)\x20OBJECT\x20-\x20CREATE\x20a\x20NEW\x20object\x20with\x20token\x20type\x20specification\x20for\x20payments.\x20The\x20object\x20format\x20includes\x20name,\x20tags,\x20visibility\x20settings,\x20and\x20a\x20required\x20token\x20type.\x20This\x20is\x20used\x20when\x20you\x20need\x20to\x20specify\x20the\x20payment\x20token\x20but\x20don\x27t\x20need\x20permission\x20management.');export const CallResultSchema=z['discriminatedUnion']('type',[SubmissionCallSchema,WowTransactionBlockResponseSchema['extend']({'type':z['literal']('transaction')['describe']('Discriminator\x20for\x20this\x20result\x20variant.\x20Constraint:\x20always\x20\x27transaction\x27.\x20Example:\x20\x27transaction\x27')}),CallResponseErrorSchema,z['object']({'type':z['literal']('data')['describe']('Discriminator\x20for\x20this\x20result\x20variant.\x20Constraint:\x20always\x20\x27data\x27.\x20Example:\x20\x27data\x27'),'data':z['array'](ResponseDataSchema)['describe']('Array\x20of\x20object\x20records\x20returned\x20by\x20a\x20query\x20operation.\x20Example:\x20[{id:\x270x...\x27,\x20change:\x27created\x27}]')}),z['object']({'type':z['literal']('null')['describe']('Discriminator\x20for\x20this\x20result\x20variant.\x20Constraint:\x20always\x20\x27null\x27.\x20Example:\x20\x27null\x27')}),CallPendingConfirmationSchema])['describe']('Discriminated\x20union\x20of\x206\x20result\x20types:\x20\x27transaction\x27\x20(raw\x20Wow\x20response),\x20\x27submission\x27\x20(Guard\x20verification\x20needed),\x20\x27error\x27\x20(failed\x20with\x20error_code),\x20\x27data\x27\x20(query\x20result\x20array),\x20\x27null\x27\x20(no-op\x20completed),\x20\x27pending_confirmation\x27\x20(ConfirmGate\x20blocked\x20—\x20re-call\x20with\x20env.confirmed=true).\x20AI\x20should\x20check\x20result.type\x20first\x20to\x20determine\x20how\x20to\x20process\x20the\x20response.');export const ObjectsSchema=z['preprocess'](a=>Array['isArray'](a)?{'op':'add','objects':a}:a,z['union']([z['object']({'op':z['union']([z['literal']('add'),z['literal']('set')]),'objects':z['array'](NameOrAddressSchema)['describe']('List\x20of\x20object\x20IDs\x20or\x20names\x20to\x20add\x20or\x20set')})['strict'](),z['object']({'op':z['literal']('remove'),'objects':z['array'](NameOrAddressSchema)['describe']('List\x20of\x20object\x20IDs\x20or\x20names\x20to\x20remove')})['strict'](),z['object']({'op':z['literal']('clear')})['strict']()]));export const VerifyMismatchSchema=z['object']({'dimension':z['enum'](['created','modified','released','state','event'])['describe']('Verify\x20dimension\x20that\x20mismatched.\x20Example:\x20\x27created\x27'),'expected':z['string']()['describe']('What\x20the\x20Expect\x20Loop\x20declared.\x20Example:\x20\x27Service\x20object\x20created\x27'),'actual':z['string']()['describe']('What\x20actually\x20happened.\x20Example:\x20\x27No\x20object\x20created\x27'),'severity':z['enum'](['pass','warn','fail'])['describe']('Severity:\x20\x27fail\x27\x20blocks\x20progress,\x20\x27warn\x27\x20is\x20advisory,\x20\x27pass\x27\x20never\x20appears\x20here.\x20Example:\x20\x27fail\x27'),'detail':z['string']()['describe']('Human-readable\x20explanation\x20of\x20the\x20mismatch.\x20Example:\x20\x27Expected\x20Service\x20creation\x20but\x20transaction\x20succeeded\x20without\x20object\x20change\x27')})['describe']('One\x20mismatch\x20between\x20expected\x20and\x20actual\x20result.\x20AI\x20should\x20read\x20severity\x20first\x20to\x20decide\x20whether\x20to\x20halt.');export const VerifyReportSchema=z['object']({'status':z['enum'](['pass','warn','fail'])['describe']('Overall\x20verify\x20status.\x20Constraint:\x20\x27fail\x27\x20if\x20any\x20mismatch\x20has\x20severity\x20\x27fail\x27;\x20\x27warn\x27\x20if\x20only\x20warns;\x20\x27pass\x27\x20if\x20no\x20mismatches.\x20Example:\x20\x27fail\x27'),'mismatches':z['array'](VerifyMismatchSchema)['describe']('List\x20of\x20mismatches\x20found.\x20Empty\x20array\x20when\x20status\x20is\x20\x27pass\x27.\x20Example:\x20[{dimension:\x27created\x27,\x20expected:\x27...\x27,\x20actual:\x27...\x27,\x20severity:\x27fail\x27,\x20detail:\x27...\x27}]'),'summary':z['string']()['describe']('Human-readable\x20summary\x20of\x20the\x20verify\x20result.\x20Example:\x20\x272\x20mismatches\x20found:\x20created\x20dimension\x20failed,\x20event\x20dimension\x20warned\x27'),'timestamp':z['string']()['describe']('ISO\x208601\x20timestamp\x20when\x20verify\x20ran.\x20Example:\x20\x272026-07-14T10:30:00.000Z\x27')})['describe']('Verify\x20Loop\x20report.\x20Compares\x20expected\x20vs\x20actual\x20semantic\x20fields\x20across\x205\x20dimensions.\x20When\x20status\x20is\x20\x27fail\x27,\x20AI\x20should\x20consult\x20the\x20recovery_action\x20in\x20the\x20parent\x20harness_report.');export const RecoveryActionSchema=z['object']({'strategy':z['enum'](['retry','claim_faucet','fill_submission','recreate','switch_account','query_and_retry','adjust_params','escalate_human','stop'])['describe']('Recovery\x20strategy\x20chosen\x20by\x20the\x20Recover\x20Loop.\x20Constraint:\x209\x20strategies\x20matching\x20error_code\x20table.\x20Example:\x20\x27claim_faucet\x27'),'should_retry':z['boolean']()['describe']('Whether\x20AI\x20should\x20retry\x20the\x20original\x20operation\x20after\x20applying\x20the\x20strategy.\x20Constraint:\x20false\x20for\x20\x27stop\x27\x20and\x20\x27escalate_human\x27.\x20Example:\x20true'),'adjusted_params':z['record'](z['string'](),z['unknown']())['optional']()['describe']('Suggested\x20parameter\x20adjustments\x20for\x20\x27adjust_params\x27\x20strategy.\x20Example:\x20{amount:\x20\x27100000000\x27}'),'user_prompt':z['string']()['optional']()['describe']('Prompt\x20to\x20show\x20the\x20user\x20when\x20recovery\x20is\x20semi-automatic\x20or\x20manual.\x20Example:\x20\x27Please\x20switch\x20to\x20an\x20account\x20with\x20provider\x20permission\x27'),'max_attempts':z['number']()['int']()['describe']('Maximum\x20attempts\x20for\x20this\x20error_code\x20type.\x20Example:\x203'),'current_attempt':z['number']()['int']()['describe']('Current\x20attempt\x20count\x20(1-indexed).\x20Example:\x201'),'detail':z['string']()['describe']('Human-readable\x20explanation\x20of\x20the\x20recovery\x20decision.\x20Example:\x20\x27Insufficient\x20balance\x20detected;\x20claim\x20faucet\x20tokens\x20then\x20retry\x27')})['describe']('Recover\x20Loop\x20action.\x20Generated\x20when\x20verify\x20fails\x20or\x20an\x20error\x20occurs.\x20AI\x20should\x20follow\x20the\x20strategy\x20and\x20respect\x20max_attempts.');export const HarnessReportSchema=z['object']({'verify':VerifyReportSchema['describe']('Verify\x20Loop\x20report\x20comparing\x20expected\x20vs\x20actual.'),'recovery':RecoveryActionSchema['optional']()['describe']('Recover\x20Loop\x20action.\x20Present\x20only\x20when\x20verify.status\x20is\x20\x27fail\x27\x20or\x20\x27warn\x27,\x20or\x20when\x20an\x20error\x20occurred.')})['describe']('L4\x20Harness\x20report\x20attached\x20to\x20CallOutput\x20when\x20the\x20Harness\x20is\x20injected.\x20Contains\x20verify\x20result\x20and\x20optional\x20recovery\x20action.\x20AI\x20should\x20check\x20verify.status\x20first;\x20if\x20\x27fail\x27,\x20consult\x20recovery.strategy.');export const SchemaWarningSchema=z['object']({'compatible':z['boolean']()['describe']('Whether\x20the\x20client\x20schema\x20version\x20is\x20compatible\x20with\x20the\x20server.'),'warnings':z['array'](z['string']())['describe']('Schema\x20compatibility\x20warnings\x20or\x20errors.'),'client_version':z['string']()['optional']()['describe']('The\x20client\x20schema\x20version\x20that\x20was\x20checked.'),'server_versions':z['object']({'sdk':z['string']()['describe']('Server-side\x20SDK\x20schema\x20version.'),'mcp':z['string']()['describe']('Server-side\x20MCP\x20tool\x20schema\x20version.')})['describe']('Server-side\x20schema\x20versions.')})['strict']()['describe']('Schema\x20compatibility\x20warning\x20attached\x20to\x20tool\x20output\x20when\x20client_schema_version\x20is\x20provided\x20and\x20a\x20mismatch\x20is\x20detected.');export const CallOutputSchema=z['object']({'result':CallResultSchema['describe']('Discriminated\x20result.\x20Check\x20result.type\x20first:\x20\x27transaction\x27|\x27submission\x27|\x27error\x27|\x27data\x27|\x27null\x27|\x27pending_confirmation\x27.\x20Each\x20variant\x20has\x20different\x20fields.'),'message':z['string']()['optional']()['describe']('Human-readable\x20summary\x20or\x20hint.\x20Constraint:\x20always\x20present\x20for\x20error/transaction\x20results;\x20may\x20be\x20omitted\x20for\x20data/null.\x20Example:\x20\x27Transaction\x20completed\x20successfully\x27'),'semantic':SemanticSummarySchema['optional']()['describe']('Business\x20semantic\x20summary.\x20AI\x20should\x20read\x20semantic\x20first;\x20fall\x20back\x20to\x20parsing\x20result\x20only\x20when\x20semantic\x20is\x20absent.\x20Relation:\x20populated\x20by\x20MCP\x20server\x20from\x20operation\x20context;\x20undefined\x20when\x20intent\x20cannot\x20be\x20confidently\x20inferred\x20or\x20for\x20non-transaction\x20tools.\x20Example:\x20{intent:\x27publish_service\x27,\x20status:\x27success\x27,\x20summary:\x27...\x27}'),'harness_report':HarnessReportSchema['optional']()['describe']('L4\x20Harness\x20report\x20(Verify\x20+\x20Recover).\x20Present\x20only\x20when\x20the\x20Harness\x20is\x20injected\x20and\x20an\x20Expected\x20Result\x20was\x20declared\x20for\x20this\x20operation.\x20Relation:\x20produced\x20by\x20handler.ts\x20calling\x20harness.verify()\x20and\x20harness.recover().\x20Example:\x20{verify:{status:\x27fail\x27,\x20mismatches:[...]},\x20recovery:{strategy:\x27recreate\x27}}'),'schema_warning':SchemaWarningSchema['optional']()['describe']('Schema\x20compatibility\x20warning.\x20Present\x20only\x20when\x20client_schema_version\x20is\x20provided\x20in\x20env\x20and\x20a\x20mismatch\x20is\x20detected.')})['strict']()['describe']('Unified\x20MCP\x20tool\x20output.\x20result.type\x20discriminates\x206\x20outcomes:\x20\x27transaction\x27\x20(raw\x20Wow\x20response),\x20\x27submission\x27\x20(needs\x20Guard\x20data),\x20\x27error\x27\x20(failed\x20with\x20error_code),\x20\x27data\x27\x20(query\x20result),\x20\x27null\x27\x20(no-op),\x20\x27pending_confirmation\x27\x20(ConfirmGate\x20blocked\x20—\x20re-call\x20with\x20env.confirmed=true).\x20When\x20semantic\x20is\x20present,\x20prefer\x20it\x20over\x20raw\x20result\x20parsing.\x20When\x20harness_report\x20is\x20present,\x20check\x20verify.status\x20first\x20and\x20follow\x20recovery.strategy\x20if\x20status\x20is\x20\x27fail\x27.');
|