@wowok/agent-mcp 2.6.0 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/customer/info-puzzle.d.ts +1 -1
- package/dist/customer/info-puzzle.js +4 -2
- package/dist/customer/risk-assessment.js +26 -4
- package/dist/customer/types.d.ts +2 -0
- package/dist/examples/guard-template-balance-check.json +38 -0
- package/dist/examples/guard-template-time-lock.json +39 -0
- package/dist/examples/machine-template-7node-rental.json +114 -0
- package/dist/examples/rental-ziroom-machine-create.json +137 -0
- package/dist/examples/rental-ziroom-permission-create.json +35 -0
- package/dist/examples/rental-ziroom-service-create.json +80 -0
- package/dist/examples/retail-myshop-service-create.json +88 -0
- package/dist/extensions/capability-manifest.d.ts +125 -0
- package/dist/extensions/capability-manifest.js +594 -0
- package/dist/extensions/constraint-registry.d.ts +24 -0
- package/dist/extensions/constraint-registry.js +196 -0
- package/dist/extensions/index.d.ts +12 -0
- package/dist/extensions/index.js +6 -0
- package/dist/extensions/metric-registry.d.ts +26 -0
- package/dist/extensions/metric-registry.js +257 -0
- package/dist/extensions/mode-evaluator.d.ts +15 -0
- package/dist/extensions/mode-evaluator.js +170 -0
- package/dist/extensions/modes.d.ts +2 -0
- package/dist/extensions/modes.js +493 -0
- package/dist/extensions/registry.d.ts +50 -0
- package/dist/extensions/registry.js +662 -0
- package/dist/extensions/types.d.ts +219 -0
- package/dist/extensions/types.js +1 -0
- package/dist/index.js +50 -0
- package/dist/knowledge/deployment-scanner.d.ts +3 -0
- package/dist/knowledge/deployment-scanner.js +64 -3
- package/dist/knowledge/fund-layer.d.ts +72 -0
- package/dist/knowledge/fund-layer.js +420 -0
- package/dist/knowledge/guard-render.d.ts +57 -0
- package/dist/knowledge/guard-render.js +700 -0
- package/dist/knowledge/guard-risk.d.ts +13 -0
- package/dist/knowledge/guard-risk.js +57 -0
- package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
- package/dist/knowledge/guard-submission-prompt.js +171 -0
- package/dist/knowledge/guard-templates.js +278 -0
- package/dist/knowledge/machine-ledger.js +1 -1
- package/dist/knowledge/machine-render.d.ts +41 -0
- package/dist/knowledge/machine-render.js +565 -0
- package/dist/knowledge/machine-templates.js +24 -5
- package/dist/knowledge/reward-confirm.js +2 -2
- package/dist/knowledge/reward-puzzle.js +1 -1
- package/dist/knowledge/reward-risk.js +9 -9
- package/dist/knowledge/reward-templates.js +2 -2
- package/dist/knowledge/service-confirm.d.ts +15 -6
- package/dist/knowledge/service-confirm.js +119 -11
- package/dist/knowledge/service-context.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-risk.d.ts +1 -1
- package/dist/knowledge/service-risk.js +3 -3
- package/dist/knowledge/service-templates.js +2 -2
- package/dist/knowledge/service-translation.d.ts +1 -1
- package/dist/knowledge/service-translation.js +7 -7
- package/dist/knowledge/tool-constraints.js +6 -2
- package/dist/project/deployment-bridge.d.ts +1 -1
- package/dist/project/deployment-bridge.js +31 -7
- package/dist/project/deployment-doc.d.ts +3 -0
- package/dist/project/deployment-doc.js +76 -14
- package/dist/project/edit-planner.d.ts +123 -0
- package/dist/project/edit-planner.js +1371 -0
- package/dist/project/evaluation.d.ts +2 -0
- package/dist/project/evaluation.js +873 -88
- package/dist/project/graph-builder.d.ts +4 -1
- package/dist/project/graph-builder.js +132 -62
- package/dist/project/graph.d.ts +1 -0
- package/dist/project/handlers.d.ts +317 -6
- package/dist/project/handlers.js +1171 -19
- package/dist/project/stage-gate.d.ts +4 -0
- package/dist/project/stage-gate.js +64 -5
- package/dist/project/task-tracker.d.ts +26 -0
- package/dist/project/task-tracker.js +78 -0
- package/dist/safety/preview.js +16 -0
- package/dist/schema/call/allocation.d.ts +16 -16
- package/dist/schema/call/allocation.js +2 -2
- package/dist/schema/call/arbitration.js +19 -6
- package/dist/schema/call/base.d.ts +21 -13
- package/dist/schema/call/base.js +27 -6
- package/dist/schema/call/bridge.d.ts +5 -5
- package/dist/schema/call/bridge.js +3 -1
- package/dist/schema/call/contact.js +2 -2
- package/dist/schema/call/demand.d.ts +23 -31
- package/dist/schema/call/demand.js +2 -2
- package/dist/schema/call/guard.js +2 -2
- package/dist/schema/call/machine.d.ts +1976 -752
- package/dist/schema/call/machine.js +50 -4
- package/dist/schema/call/order.d.ts +149 -228
- package/dist/schema/call/order.js +4 -3
- package/dist/schema/call/payment.d.ts +183 -3
- package/dist/schema/call/payment.js +21 -3
- package/dist/schema/call/permission.js +2 -2
- package/dist/schema/call/personal.d.ts +241 -52
- package/dist/schema/call/progress.d.ts +53 -61
- package/dist/schema/call/progress.js +18 -4
- package/dist/schema/call/repository.d.ts +23 -31
- package/dist/schema/call/repository.js +2 -2
- package/dist/schema/call/reward.js +3 -3
- package/dist/schema/call/semantic.d.ts +1 -1
- package/dist/schema/call/semantic.js +37 -2
- package/dist/schema/call/service.d.ts +275 -127
- package/dist/schema/call/service.js +89 -13
- package/dist/schema/call/treasury.js +3 -3
- package/dist/schema/common/index.d.ts +13 -2
- package/dist/schema/common/index.js +80 -15
- package/dist/schema/local/index.d.ts +32 -35
- package/dist/schema/local/index.js +28 -6
- package/dist/schema/messenger/index.d.ts +274 -46
- package/dist/schema/operations.d.ts +1264 -544
- package/dist/schema/operations.js +65 -7
- package/dist/schema/project/index.d.ts +2846 -167
- package/dist/schema/project/index.js +570 -16
- package/dist/schema/query/index.d.ts +922 -349
- package/dist/schema/query/index.js +205 -42
- package/dist/schema/schema-query/index.d.ts +65 -3
- package/dist/schema/schema-query/index.js +38 -5
- package/dist/schema/utils/node-parser.js +20 -4
- package/dist/schema/utils/object-type-utils.d.ts +12 -0
- package/dist/schema/utils/object-type-utils.js +35 -0
- package/dist/schema/utils/permission-machine-check.d.ts +49 -0
- package/dist/schema/utils/permission-machine-check.js +121 -0
- package/dist/schema/utils/skills-recommendation.d.ts +2 -0
- package/dist/schema/utils/skills-recommendation.js +76 -0
- package/dist/schema-query/index.d.ts +20 -1
- package/dist/schema-query/index.js +306 -4
- package/dist/schemas/account_operation.output.json +7 -1
- package/dist/schemas/account_operation.schema.json +3 -3
- package/dist/schemas/bridge_operation.output.json +6 -0
- package/dist/schemas/bridge_operation.schema.json +1 -1
- package/dist/schemas/guard-templates.json +379 -0
- package/dist/schemas/guard2file.schema.json +1 -1
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/local_info_operation.output.json +6 -0
- package/dist/schemas/local_mark_operation.output.json +7 -1
- package/dist/schemas/local_mark_operation.schema.json +1 -1
- package/dist/schemas/machineNode2file.schema.json +1 -1
- package/dist/schemas/messenger_operation.schema.json +4 -4
- package/dist/schemas/onchain_events.output.json +1 -1
- package/dist/schemas/onchain_operations.output.json +2820 -0
- package/dist/schemas/onchain_operations.schema.json +444 -330
- package/dist/schemas/onchain_operations_allocation.schema.json +37 -28
- package/dist/schemas/onchain_operations_arbitration.schema.json +16 -14
- package/dist/schemas/onchain_operations_contact.schema.json +10 -10
- package/dist/schemas/onchain_operations_demand.schema.json +10 -10
- package/dist/schemas/onchain_operations_gen_passport.schema.json +16 -16
- package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -2
- package/dist/schemas/onchain_operations_guard.schema.json +2 -2
- package/dist/schemas/onchain_operations_machine.schema.json +43 -35
- package/dist/schemas/onchain_operations_order.schema.json +72 -78
- package/dist/schemas/onchain_operations_payment.schema.json +141 -111
- package/dist/schemas/onchain_operations_permission.schema.json +3 -3
- package/dist/schemas/onchain_operations_personal.schema.json +7 -7
- package/dist/schemas/onchain_operations_progress.schema.json +9 -9
- package/dist/schemas/onchain_operations_proof.schema.json +8 -8
- package/dist/schemas/onchain_operations_repository.schema.json +10 -10
- package/dist/schemas/onchain_operations_reward.schema.json +14 -14
- package/dist/schemas/onchain_operations_service.schema.json +119 -48
- package/dist/schemas/onchain_operations_treasury.schema.json +11 -11
- package/dist/schemas/onchain_table_data.output.json +33 -25
- package/dist/schemas/onchain_table_data.schema.json +22 -21
- package/dist/schemas/project_operation.output.json +2194 -23
- package/dist/schemas/project_operation.schema.json +84 -6
- package/dist/schemas/query_toolkit.output.json +108 -80
- package/dist/schemas/query_toolkit.schema.json +12 -12
- package/dist/schemas/schema_query.output.json +70 -3
- package/dist/schemas/schema_query.schema.json +18 -3
- package/dist/schemas/wowok_buildin_info.output.json +81 -8
- package/dist/schemas/wowok_buildin_info.schema.json +46 -2
- package/dist/tools/handlers/local.js +20 -5
- package/dist/tools/handlers/onchain.js +594 -6
- package/dist/tools/handlers/project.js +76 -4
- package/dist/tools/handlers/query.js +27 -0
- package/dist/tools/handlers/schema-query.js +43 -1
- package/dist/tools/handlers/task-status.d.ts +170 -0
- package/dist/tools/handlers/task-status.js +55 -0
- package/dist/tools/handlers/wip.js +47 -1
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.js +387 -12
- package/dist/tools/retry.d.ts +8 -0
- package/dist/tools/retry.js +85 -0
- package/dist/tools/wip-deploy-assist.d.ts +28 -0
- package/dist/tools/wip-deploy-assist.js +278 -0
- package/package.json +2 -2
- package/dist/schemas/guard-node-examples.md +0 -199
package/dist/schema/call/base.js
CHANGED
|
@@ -15,9 +15,30 @@ export function strictParse(schema, input, fieldName = "input") {
|
|
|
15
15
|
const inputFields = Object.keys(input || {});
|
|
16
16
|
const unknownFields = inputFields.filter(f => !allowedFields.includes(f));
|
|
17
17
|
if (unknownFields.length > 0) {
|
|
18
|
-
throw new Error(`Unknown ${fieldName} field(s): ${unknownFields.join(', ')}`
|
|
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.`);
|
|
19
21
|
}
|
|
20
|
-
|
|
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;
|
|
21
42
|
}
|
|
22
43
|
export const NamedObjectSchema = z.object({
|
|
23
44
|
name: NameSchema.optional().describe("The name of the object"),
|
|
@@ -227,7 +248,7 @@ export const SemanticSummarySchema = z.object({
|
|
|
227
248
|
export const CallResponseErrorSchema = z.object({
|
|
228
249
|
type: z.literal("error").describe("Discriminator for this result variant. Constraint: always 'error'. Example: 'error'"),
|
|
229
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'"),
|
|
230
|
-
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", "unknown"]).optional().describe("Error classification for programmatic recovery. Constraint: enum of
|
|
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'"),
|
|
231
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"),
|
|
232
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'"),
|
|
233
254
|
related_object: z.string().optional().describe("Object ID related to the error, if any. Example: '0x123...'"),
|
|
@@ -263,7 +284,7 @@ export const SubmissionCallSchema = z.object({
|
|
|
263
284
|
object: NameOrAddressSchema.describe("Guard object name or ID to verify against. Example: 'my-delivery-guard' or '0x123...'"),
|
|
264
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"),
|
|
265
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.`),
|
|
266
|
-
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."),
|
|
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:[...]}}"),
|
|
267
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'.");
|
|
268
289
|
export const TypedPermissionObjectSchema = z.union([
|
|
269
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."),
|
|
@@ -292,7 +313,7 @@ export const CallResultSchema = z.discriminatedUnion("type", [
|
|
|
292
313
|
}),
|
|
293
314
|
CallPendingConfirmationSchema,
|
|
294
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.");
|
|
295
|
-
export const ObjectsSchema = z.union([
|
|
316
|
+
export const ObjectsSchema = z.preprocess((val) => (Array.isArray(val) ? { op: 'add', objects: val } : val), z.union([
|
|
296
317
|
z.object({
|
|
297
318
|
op: z.union([z.literal('add'), z.literal('set')]),
|
|
298
319
|
objects: z.array(NameOrAddressSchema).describe('List of object IDs or names to add or set'),
|
|
@@ -304,7 +325,7 @@ export const ObjectsSchema = z.union([
|
|
|
304
325
|
z.object({
|
|
305
326
|
op: z.literal('clear'),
|
|
306
327
|
}).strict(),
|
|
307
|
-
]);
|
|
328
|
+
]));
|
|
308
329
|
export const VerifyMismatchSchema = z.object({
|
|
309
330
|
dimension: z.enum(["created", "modified", "released", "state", "event"]).describe("Verify dimension that mismatched. Example: 'created'"),
|
|
310
331
|
expected: z.string().describe("What the Expect Loop declared. Example: 'Service object created'"),
|
|
@@ -2707,19 +2707,19 @@ export declare const BridgeCallOutputSchema: z.ZodObject<{
|
|
|
2707
2707
|
}>, z.ZodObject<{
|
|
2708
2708
|
type: z.ZodLiteral<"error">;
|
|
2709
2709
|
error: z.ZodString;
|
|
2710
|
-
error_code: z.ZodOptional<z.ZodEnum<["invalid_parameter", "guard_rejected", "state_conflict", "insufficient_balance", "object_not_found", "permission_denied", "immutable_violation", "network_error", "unknown"]>>;
|
|
2710
|
+
error_code: z.ZodOptional<z.ZodEnum<["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"]>>;
|
|
2711
2711
|
retryable: z.ZodOptional<z.ZodBoolean>;
|
|
2712
2712
|
recovery_hint: z.ZodOptional<z.ZodString>;
|
|
2713
2713
|
}, "strip", z.ZodTypeAny, {
|
|
2714
2714
|
type: "error";
|
|
2715
2715
|
error: string;
|
|
2716
|
-
error_code?: "unknown" | "invalid_parameter" | "guard_rejected" | "state_conflict" | "insufficient_balance" | "object_not_found" | "permission_denied" | "immutable_violation" | "network_error" | undefined;
|
|
2716
|
+
error_code?: "unknown" | "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" | undefined;
|
|
2717
2717
|
retryable?: boolean | undefined;
|
|
2718
2718
|
recovery_hint?: string | undefined;
|
|
2719
2719
|
}, {
|
|
2720
2720
|
type: "error";
|
|
2721
2721
|
error: string;
|
|
2722
|
-
error_code?: "unknown" | "invalid_parameter" | "guard_rejected" | "state_conflict" | "insufficient_balance" | "object_not_found" | "permission_denied" | "immutable_violation" | "network_error" | undefined;
|
|
2722
|
+
error_code?: "unknown" | "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" | undefined;
|
|
2723
2723
|
retryable?: boolean | undefined;
|
|
2724
2724
|
recovery_hint?: string | undefined;
|
|
2725
2725
|
}>]>;
|
|
@@ -3393,7 +3393,7 @@ export declare const BridgeCallOutputSchema: z.ZodObject<{
|
|
|
3393
3393
|
} | {
|
|
3394
3394
|
type: "error";
|
|
3395
3395
|
error: string;
|
|
3396
|
-
error_code?: "unknown" | "invalid_parameter" | "guard_rejected" | "state_conflict" | "insufficient_balance" | "object_not_found" | "permission_denied" | "immutable_violation" | "network_error" | undefined;
|
|
3396
|
+
error_code?: "unknown" | "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" | undefined;
|
|
3397
3397
|
retryable?: boolean | undefined;
|
|
3398
3398
|
recovery_hint?: string | undefined;
|
|
3399
3399
|
};
|
|
@@ -3528,7 +3528,7 @@ export declare const BridgeCallOutputSchema: z.ZodObject<{
|
|
|
3528
3528
|
} | {
|
|
3529
3529
|
type: "error";
|
|
3530
3530
|
error: string;
|
|
3531
|
-
error_code?: "unknown" | "invalid_parameter" | "guard_rejected" | "state_conflict" | "insufficient_balance" | "object_not_found" | "permission_denied" | "immutable_violation" | "network_error" | undefined;
|
|
3531
|
+
error_code?: "unknown" | "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" | undefined;
|
|
3532
3532
|
retryable?: boolean | undefined;
|
|
3533
3533
|
recovery_hint?: string | undefined;
|
|
3534
3534
|
};
|
|
@@ -444,7 +444,9 @@ export const BridgeCallOutputSchema = z.object({
|
|
|
444
444
|
.enum([
|
|
445
445
|
"invalid_parameter", "guard_rejected", "state_conflict",
|
|
446
446
|
"insufficient_balance", "object_not_found", "permission_denied",
|
|
447
|
-
"immutable_violation", "network_error", "
|
|
447
|
+
"immutable_violation", "network_error", "rate_limit",
|
|
448
|
+
"gas_exceeded", "bcs_error", "signature_error",
|
|
449
|
+
"config_error", "wip_verification_failed", "unknown",
|
|
448
450
|
])
|
|
449
451
|
.optional()
|
|
450
452
|
.describe("Error classification for programmatic recovery"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { WithPermissionObjectSchema, CallEnvSchema, SubmissionCallSchema } from "./base.js";
|
|
3
|
-
import { NameOrAddressSchema, ReceivedObjectsOrRecentlySchema, DescriptionSchema, LongNameSchema, NameSchema } from "../common/index.js";
|
|
3
|
+
import { NameOrAddressSchema, ReceivedObjectsOrRecentlySchema, DescriptionSchema, LongNameSchema, NameSchema, RECEIVE_FORMAT_BLOCK_OBJECTS } from "../common/index.js";
|
|
4
4
|
export const ImEntrySchema = z.object({
|
|
5
5
|
at: NameOrAddressSchema.describe("Contact's account address or name for instant messaging"),
|
|
6
6
|
description: LongNameSchema.optional().describe("Optional description or note about this contact"),
|
|
@@ -28,7 +28,7 @@ export const CallContact_DataSchema = z.object({
|
|
|
28
28
|
description: DescriptionSchema.optional().describe("Contact object description or public information"),
|
|
29
29
|
location: LongNameSchema.optional().describe("Physical or virtual location information for this contact"),
|
|
30
30
|
ims: ImsOperationSchema.optional().describe("IM contact list operation: add, set, remove, or clear instant messaging contacts"),
|
|
31
|
-
owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Receive objects sent to this
|
|
31
|
+
owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Receive objects sent to this Contact object and unwrap them to the permission owner." + RECEIVE_FORMAT_BLOCK_OBJECTS),
|
|
32
32
|
}).strict().describe("On-chain Contact operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, permission, ...} to create a Contact. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. 'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. (2) OPERATE EXISTING: Set 'object' field with STRING format (object ID or name). The 'object' field is CRITICAL and REQUIRED in both cases. STRING for existing, OBJECT for new creation.");
|
|
33
33
|
export const CallContact_InputSchema = z.object({
|
|
34
34
|
data: CallContact_DataSchema.describe("Contact operation data containing object reference and operations to perform"),
|
|
@@ -171,7 +171,7 @@ export declare const CallDemand_DataSchema: z.ZodObject<{
|
|
|
171
171
|
}>>;
|
|
172
172
|
description: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
173
173
|
location: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
174
|
-
rewards: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
174
|
+
rewards: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodObject<{
|
|
175
175
|
op: z.ZodUnion<[z.ZodLiteral<"add">, z.ZodLiteral<"set">]>;
|
|
176
176
|
objects: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
177
177
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -195,7 +195,15 @@ export declare const CallDemand_DataSchema: z.ZodObject<{
|
|
|
195
195
|
op: "clear";
|
|
196
196
|
}, {
|
|
197
197
|
op: "clear";
|
|
198
|
-
}>]
|
|
198
|
+
}>]>, {
|
|
199
|
+
op: "set" | "add";
|
|
200
|
+
objects: string[];
|
|
201
|
+
} | {
|
|
202
|
+
op: "remove";
|
|
203
|
+
objects: string[];
|
|
204
|
+
} | {
|
|
205
|
+
op: "clear";
|
|
206
|
+
}, unknown>>;
|
|
199
207
|
feedback: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
200
208
|
who: z.ZodObject<{
|
|
201
209
|
name_or_address: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
@@ -427,15 +435,7 @@ export declare const CallDemand_DataSchema: z.ZodObject<{
|
|
|
427
435
|
feedback?: string | undefined;
|
|
428
436
|
acceptance_score?: number | undefined;
|
|
429
437
|
}[] | undefined;
|
|
430
|
-
rewards?:
|
|
431
|
-
op: "set" | "add";
|
|
432
|
-
objects: string[];
|
|
433
|
-
} | {
|
|
434
|
-
op: "remove";
|
|
435
|
-
objects: string[];
|
|
436
|
-
} | {
|
|
437
|
-
op: "clear";
|
|
438
|
-
} | undefined;
|
|
438
|
+
rewards?: unknown;
|
|
439
439
|
guards?: {
|
|
440
440
|
guard: {
|
|
441
441
|
guard: string;
|
|
@@ -543,7 +543,7 @@ export declare const CallDemand_InputSchema: z.ZodObject<{
|
|
|
543
543
|
}>>;
|
|
544
544
|
description: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
545
545
|
location: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
546
|
-
rewards: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
546
|
+
rewards: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodObject<{
|
|
547
547
|
op: z.ZodUnion<[z.ZodLiteral<"add">, z.ZodLiteral<"set">]>;
|
|
548
548
|
objects: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
549
549
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -567,7 +567,15 @@ export declare const CallDemand_InputSchema: z.ZodObject<{
|
|
|
567
567
|
op: "clear";
|
|
568
568
|
}, {
|
|
569
569
|
op: "clear";
|
|
570
|
-
}>]
|
|
570
|
+
}>]>, {
|
|
571
|
+
op: "set" | "add";
|
|
572
|
+
objects: string[];
|
|
573
|
+
} | {
|
|
574
|
+
op: "remove";
|
|
575
|
+
objects: string[];
|
|
576
|
+
} | {
|
|
577
|
+
op: "clear";
|
|
578
|
+
}, unknown>>;
|
|
571
579
|
feedback: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
572
580
|
who: z.ZodObject<{
|
|
573
581
|
name_or_address: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
@@ -799,15 +807,7 @@ export declare const CallDemand_InputSchema: z.ZodObject<{
|
|
|
799
807
|
feedback?: string | undefined;
|
|
800
808
|
acceptance_score?: number | undefined;
|
|
801
809
|
}[] | undefined;
|
|
802
|
-
rewards?:
|
|
803
|
-
op: "set" | "add";
|
|
804
|
-
objects: string[];
|
|
805
|
-
} | {
|
|
806
|
-
op: "remove";
|
|
807
|
-
objects: string[];
|
|
808
|
-
} | {
|
|
809
|
-
op: "clear";
|
|
810
|
-
} | undefined;
|
|
810
|
+
rewards?: unknown;
|
|
811
811
|
guards?: {
|
|
812
812
|
guard: {
|
|
813
813
|
guard: string;
|
|
@@ -1200,15 +1200,7 @@ export declare const CallDemand_InputSchema: z.ZodObject<{
|
|
|
1200
1200
|
feedback?: string | undefined;
|
|
1201
1201
|
acceptance_score?: number | undefined;
|
|
1202
1202
|
}[] | undefined;
|
|
1203
|
-
rewards?:
|
|
1204
|
-
op: "set" | "add";
|
|
1205
|
-
objects: string[];
|
|
1206
|
-
} | {
|
|
1207
|
-
op: "remove";
|
|
1208
|
-
objects: string[];
|
|
1209
|
-
} | {
|
|
1210
|
-
op: "clear";
|
|
1211
|
-
} | undefined;
|
|
1203
|
+
rewards?: unknown;
|
|
1212
1204
|
guards?: {
|
|
1213
1205
|
guard: {
|
|
1214
1206
|
guard: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { WithPermissionObjectSchema, ObjectsSchema, CallEnvSchema, SubmissionCallSchema, } from './base.js';
|
|
3
3
|
import { ServiceGuardSchema } from '../query/index.js';
|
|
4
|
-
import { AccountOrMark_AddressSchema, DescriptionSchema, LongNameSchema, NameOrAddressSchema, ReceivedObjectsOrRecentlySchema } from '../common/index.js';
|
|
4
|
+
import { AccountOrMark_AddressSchema, DescriptionSchema, LongNameSchema, NameOrAddressSchema, ReceivedObjectsOrRecentlySchema, RECEIVE_FORMAT_BLOCK_OBJECTS } from '../common/index.js';
|
|
5
5
|
export const GuardsSchema = z.discriminatedUnion('op', [
|
|
6
6
|
z.object({
|
|
7
7
|
op: z.literal('add'),
|
|
@@ -37,7 +37,7 @@ export const CallDemand_DataSchema = z.object({
|
|
|
37
37
|
rewards: ObjectsSchema.optional().describe('Reward information of the Demand object'),
|
|
38
38
|
feedback: z.array(FeedbackInfoSchema).optional().describe('User feedback information for the Demand object'),
|
|
39
39
|
guards: GuardsSchema.optional().describe('Validation Guard list for the Demand object. Used to verify whether the service recommended by the user meets the requirements'),
|
|
40
|
-
owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe('Unwrap CoinWrapper objects and other objects received by this object and send them to the owner of its Permission object.'),
|
|
40
|
+
owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe('Unwrap CoinWrapper objects and other objects received by this Demand object and send them to the owner of its Permission object.' + RECEIVE_FORMAT_BLOCK_OBJECTS),
|
|
41
41
|
um: z.union([NameOrAddressSchema, z.null()]).optional().describe('Contact object ID or name.'),
|
|
42
42
|
}).strict().describe("On-chain Demand operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, permission, ...} to create a Demand. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. 'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. (2) OPERATE EXISTING: Set 'object' field with STRING format (object ID or name). The 'object' field is CRITICAL and REQUIRED in both cases. STRING for existing, OBJECT for new creation.");
|
|
43
43
|
export const CallDemand_InputSchema = z.object({
|
|
@@ -96,7 +96,7 @@ export const GuardBindingHintSchema = z.object({
|
|
|
96
96
|
.describe("Whether the Guard references the Host Object itself (circular reference pattern). true=Guard queries the Host Object it binds to."),
|
|
97
97
|
}).strict().describe("Optional semantic hint for Guard capability system. Provides intent + binding context so the MCP server can derive GuardPuzzle, run risk assessment, and generate confirmation text. Strongly recommended: fill this field to enable puzzle_status, matched_scene, suggested_patterns, confirmation_text, and pending_questions in the response guard_advice.");
|
|
98
98
|
export const CallGuard_DataSchema = z.object({
|
|
99
|
-
namedNew: NamedObjectSchema.optional().describe("Name and optional tags for the new Guard object. Set 'onChain: true' to create a public on-chain identity. When using root.type='file', this field OVERRIDES namedNew in the file."),
|
|
99
|
+
namedNew: NamedObjectSchema.optional().describe("Name and optional tags for the new Guard object. Set 'onChain: true' to create a public on-chain identity. When using root.type='file', this field OVERRIDES namedNew in the file. CIRCULAR DEPENDENCY (DOC-01): When a Guard queries a Service that hasn't been created yet, use a LocalMark NAME (not address) in the query table — the name is resolved to an address at transaction build time. Workflow: (1) Create Service (Phase 1, no publish) → (2) Create Guard referencing Service by name → (3) Update Service.buy_guard = Guard address → (4) Publish Service."),
|
|
100
100
|
description: DescriptionSchema.optional().describe("Guard description. When using root.type='file', this field OVERRIDES description in the file."),
|
|
101
101
|
table: z.array(GuardTableItemBaseSchema).optional().describe("Data table of the Guard object. When using root.type='file', this field OVERRIDES table in the file."),
|
|
102
102
|
root: CallGuard_RootSchema.describe("Root definition: either a direct GuardNode (must be a logical operation returning Bool) or a file reference (type='file'). When type='file', the file can define all Guard fields (namedNew, description, table, root, rely), and schema fields override file content."),
|
|
@@ -126,7 +126,7 @@ export const CallGuard_DataSchema = z.object({
|
|
|
126
126
|
return true;
|
|
127
127
|
}, {
|
|
128
128
|
message: "Invalid Guard root: When using 'identifier' as root, the referenced table item must exist and have value_type='Bool' (or 0)."
|
|
129
|
-
}).describe("On-chain Guard creation. IMPORTANT: All defined data (include all submitted data) must be defined in the 'table' field. USAGE: Set 'namedNew' field with {name, tags?, onChain?} to name the new Guard. The Guard is immutable once created. Define the validation logic in 'root' field. When root.type='file', the file can contain all Guard fields, and any fields defined in the schema will OVERRIDE the file content.");
|
|
129
|
+
}).describe("On-chain Guard creation. IMPORTANT: All defined data (include all submitted data) must be defined in the 'table' field. USAGE: Set 'namedNew' field with {name, tags?, onChain?} to name the new Guard (you may also use 'object' as an alias for 'namedNew' — the MCP preprocess will convert it automatically). The Guard is immutable once created. Define the validation logic in 'root' field. When root.type='file', the file can contain all Guard fields, and any fields defined in the schema will OVERRIDE the file content.");
|
|
130
130
|
export const CallGuard_InputSchema = z.object({
|
|
131
131
|
data: CallGuard_DataSchema.describe("Guard data definition."),
|
|
132
132
|
env: CallEnvSchema.optional(),
|