@wowok/agent-mcp 2.4.1 → 2.4.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.
Files changed (74) hide show
  1. package/dist/index.d.ts +2 -2
  2. package/dist/index.js +11 -1624
  3. package/dist/knowledge/guard-ledger.js +14 -0
  4. package/dist/knowledge/guard-lint.d.ts +1 -0
  5. package/dist/knowledge/guard-lint.js +83 -3
  6. package/dist/knowledge/guard-migration.d.ts +48 -0
  7. package/dist/knowledge/guard-migration.js +228 -0
  8. package/dist/knowledge/guard-risk.d.ts +2 -0
  9. package/dist/knowledge/guard-risk.js +827 -57
  10. package/dist/knowledge/guard-templates.d.ts +1 -0
  11. package/dist/knowledge/guard-templates.js +278 -2
  12. package/dist/project/graph.d.ts +1 -0
  13. package/dist/project/graph.js +27 -1
  14. package/dist/project/index.d.ts +1 -0
  15. package/dist/project/index.js +39 -2
  16. package/dist/project/namespace.d.ts +11 -1
  17. package/dist/project/namespace.js +27 -2
  18. package/dist/project/query.d.ts +2 -0
  19. package/dist/project/query.js +56 -15
  20. package/dist/rules.d.ts +12 -0
  21. package/dist/rules.js +9 -0
  22. package/dist/schema/call/allocation.d.ts +10 -10
  23. package/dist/schema/call/base.js +3 -3
  24. package/dist/schema/call/machine.d.ts +38 -38
  25. package/dist/schema/call/semantic.js +1 -1
  26. package/dist/schema/call/service.d.ts +7 -7
  27. package/dist/schema/operations.d.ts +48 -48
  28. package/dist/schema/query/index.d.ts +146 -146
  29. package/dist/schema/query/index.js +15 -9
  30. package/dist/schema/utils/guard-query-utils.d.ts +7 -0
  31. package/dist/schema/utils/guard-query-utils.js +14 -1
  32. package/dist/schemas/bridge_operation.output.json +1 -1
  33. package/dist/schemas/index.json +1 -1
  34. package/dist/schemas/messenger_operation.output.json +1 -1
  35. package/dist/schemas/onchain_events.output.json +1 -1
  36. package/dist/schemas/onchain_operations.output.json +2 -2
  37. package/dist/schemas/onchain_operations.schema.json +11 -20
  38. package/dist/schemas/onchain_operations_allocation.schema.json +7 -10
  39. package/dist/schemas/onchain_operations_machine.schema.json +2 -5
  40. package/dist/schemas/onchain_operations_service.schema.json +2 -5
  41. package/dist/schemas/onchain_table_data.output.json +6 -12
  42. package/dist/tools/handlers/bridge.d.ts +1 -0
  43. package/dist/tools/handlers/bridge.js +1 -0
  44. package/dist/tools/handlers/config.d.ts +2 -0
  45. package/dist/tools/handlers/config.js +71 -0
  46. package/dist/tools/handlers/file-export.d.ts +3 -0
  47. package/dist/tools/handlers/file-export.js +90 -0
  48. package/dist/tools/handlers/local.d.ts +30 -0
  49. package/dist/tools/handlers/local.js +27 -0
  50. package/dist/tools/handlers/messenger.d.ts +16 -0
  51. package/dist/tools/handlers/messenger.js +187 -0
  52. package/dist/tools/handlers/onchain.d.ts +2 -0
  53. package/dist/tools/handlers/onchain.js +246 -0
  54. package/dist/tools/handlers/project.d.ts +2 -0
  55. package/dist/tools/handlers/project.js +53 -0
  56. package/dist/tools/handlers/query.d.ts +5 -0
  57. package/dist/tools/handlers/query.js +256 -0
  58. package/dist/tools/handlers/schema-query.d.ts +2 -0
  59. package/dist/tools/handlers/schema-query.js +92 -0
  60. package/dist/tools/handlers/trust.d.ts +2 -0
  61. package/dist/tools/handlers/trust.js +194 -0
  62. package/dist/tools/handlers/wip.d.ts +2 -0
  63. package/dist/tools/handlers/wip.js +44 -0
  64. package/dist/tools/index.d.ts +13 -0
  65. package/dist/tools/index.js +479 -0
  66. package/dist/tools/rules-hook.d.ts +2 -0
  67. package/dist/tools/rules-hook.js +22 -0
  68. package/dist/tools/shared.d.ts +29 -0
  69. package/dist/tools/shared.js +130 -0
  70. package/dist/tools/types.d.ts +35 -0
  71. package/dist/tools/types.js +1 -0
  72. package/dist/tools/wrap.d.ts +6 -0
  73. package/dist/tools/wrap.js +55 -0
  74. package/package.json +19 -5
@@ -1,35 +1,76 @@
1
1
  import { LocalMark } from "@wowok/wowok";
2
- import { extractProjectPrefix, TAG_PREFIX } from "./namespace.js";
2
+ import { extractAllProjectVersions, TAG_PREFIX } from "./namespace.js";
3
3
  export async function listProjects() {
4
4
  const marks = await LocalMark.Instance().list(undefined);
5
5
  const byProject = new Map();
6
6
  for (const m of marks) {
7
- const prefix = extractProjectPrefix(m.tags);
8
- if (!prefix)
7
+ const entries = extractAllProjectVersions(m.tags);
8
+ if (entries.length === 0)
9
9
  continue;
10
- if (!byProject.has(prefix)) {
11
- byProject.set(prefix, { prefix, objectCount: 0, types: [], objects: [] });
10
+ const byPrefix = new Map();
11
+ for (const entry of entries) {
12
+ if (!byPrefix.has(entry.prefix))
13
+ byPrefix.set(entry.prefix, []);
14
+ byPrefix.get(entry.prefix).push(entry.version);
12
15
  }
13
- const proj = byProject.get(prefix);
14
- proj.objectCount++;
15
16
  const typeTag = m.tags?.find((t) => t.startsWith(TAG_PREFIX.type));
16
17
  const type = typeTag?.slice(TAG_PREFIX.type.length);
17
- if (type && !proj.types.includes(type))
18
- proj.types.push(type);
19
- proj.objects.push({ name: m.name, address: m.address, type });
18
+ for (const [prefix, versions] of byPrefix) {
19
+ const hasVersioned = versions.some((v) => v !== undefined);
20
+ const effectiveVersions = hasVersioned
21
+ ? versions.filter((v) => v !== undefined)
22
+ : versions;
23
+ if (!byProject.has(prefix)) {
24
+ byProject.set(prefix, {
25
+ prefix,
26
+ objectCount: 0,
27
+ types: [],
28
+ versions: [],
29
+ objects: [],
30
+ });
31
+ }
32
+ const proj = byProject.get(prefix);
33
+ if (type && !proj.types.includes(type))
34
+ proj.types.push(type);
35
+ for (const v of effectiveVersions) {
36
+ proj.objectCount++;
37
+ if (v && !proj.versions.includes(v)) {
38
+ proj.versions.push(v);
39
+ }
40
+ proj.objects.push({
41
+ name: m.name,
42
+ address: m.address,
43
+ type,
44
+ version: v,
45
+ });
46
+ }
47
+ }
20
48
  }
21
49
  return Array.from(byProject.values()).sort((a, b) => b.objectCount - a.objectCount);
22
50
  }
23
51
  export async function listProjectObjects(prefix) {
24
- const marks = await LocalMark.Instance().list({ tags: [`${TAG_PREFIX.project}${prefix}`] });
25
- return marks.map((m) => {
52
+ const marks = await LocalMark.Instance().list(undefined);
53
+ const results = [];
54
+ const isVersionedFilter = prefix.includes("_v");
55
+ for (const m of marks) {
56
+ const entries = extractAllProjectVersions(m.tags);
57
+ const matched = entries.find((e) => {
58
+ if (isVersionedFilter) {
59
+ return e.version ? `${e.prefix}_${e.version}` === prefix : false;
60
+ }
61
+ return e.prefix === prefix;
62
+ });
63
+ if (!matched)
64
+ continue;
26
65
  const typeTag = m.tags?.find((t) => t.startsWith(TAG_PREFIX.type));
27
- return {
66
+ results.push({
28
67
  name: m.name,
29
68
  address: m.address,
30
69
  type: typeTag?.slice(TAG_PREFIX.type.length),
31
- };
32
- });
70
+ version: matched.version,
71
+ });
72
+ }
73
+ return results;
33
74
  }
34
75
  export async function listShareableObjects() {
35
76
  const marks = await LocalMark.Instance().list({ tags: [`${TAG_PREFIX.shareable}true`] });
@@ -0,0 +1,12 @@
1
+ export { validateOperation, hasBlockingViolations, getWarningViolations, type ConstraintViolation, } from "./knowledge/tool-constraints.js";
2
+ export { computeServiceTrustScore, type ServiceTrustMetrics, } from "./knowledge/trust-metrics.js";
3
+ export { AUDIT_RULES, auditService, hasBlockingErrors, getErrors, getWarnings, summarizeFindings, type AuditFinding, } from "./knowledge/audit-rules.js";
4
+ export { confirmGate, isConfirmGateEnabled, isExplicitlyConfirmed, getFailMode, type ConfirmResult, type FailMode, } from "./safety/confirm-gate.js";
5
+ export { renderPreview } from "./safety/preview.js";
6
+ export { CONFIRMATION_RULES, SAFETY_RULES_VERSION, DEFAULT_AMOUNT_THRESHOLD, getAmountThreshold, formatAmount, collectDefaultWarnings, type OperationPreview, type ConfirmLevel, type ConfirmationRule, } from "./knowledge/safety-rules.js";
7
+ export { distillIntent, extractSignals } from "./experience/intent-distill.js";
8
+ export type { DistilledIntent } from "./experience/types.js";
9
+ export { Harness, getHarness, setHarness } from "./harness/index.js";
10
+ export type { ODG, ExpectedResult, VerifyReport, RecoveryAction, Checkpoint, } from "./harness/types.js";
11
+ export { getDefaultPreferences, inferPreferences, matchServiceToPreferences, mergePreferences, validatePreferences, SUPPORTED_INDUSTRIES, type IndustryTemplate, type Industry, type PreferenceInference, type ServiceForMatching, type PreferenceMatchResult, } from "./customer/user-preferences.js";
12
+ export type { UserPreferences } from "./customer/types.js";
package/dist/rules.js ADDED
@@ -0,0 +1,9 @@
1
+ export { validateOperation, hasBlockingViolations, getWarningViolations, } from "./knowledge/tool-constraints.js";
2
+ export { computeServiceTrustScore, } from "./knowledge/trust-metrics.js";
3
+ export { AUDIT_RULES, auditService, hasBlockingErrors, getErrors, getWarnings, summarizeFindings, } from "./knowledge/audit-rules.js";
4
+ export { confirmGate, isConfirmGateEnabled, isExplicitlyConfirmed, getFailMode, } from "./safety/confirm-gate.js";
5
+ export { renderPreview } from "./safety/preview.js";
6
+ export { CONFIRMATION_RULES, SAFETY_RULES_VERSION, DEFAULT_AMOUNT_THRESHOLD, getAmountThreshold, formatAmount, collectDefaultWarnings, } from "./knowledge/safety-rules.js";
7
+ export { distillIntent, extractSignals } from "./experience/intent-distill.js";
8
+ export { Harness, getHarness, setHarness } from "./harness/index.js";
9
+ export { getDefaultPreferences, inferPreferences, matchServiceToPreferences, mergePreferences, validatePreferences, SUPPORTED_INDUSTRIES, } from "./customer/user-preferences.js";
@@ -22,7 +22,7 @@ export declare const CallAllocation_CreateSchema: z.ZodObject<{
22
22
  }>;
23
23
  allocators: z.ZodObject<{
24
24
  description: z.ZodEffects<z.ZodString, string, string>;
25
- threshold: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
25
+ threshold: z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
26
26
  allocators: z.ZodArray<z.ZodObject<{
27
27
  guard: z.ZodEffects<z.ZodString, string, string>;
28
28
  sharing: z.ZodArray<z.ZodObject<{
@@ -152,7 +152,6 @@ export declare const CallAllocation_CreateSchema: z.ZodObject<{
152
152
  }[];
153
153
  }, {
154
154
  description: string;
155
- threshold: string | number;
156
155
  allocators: {
157
156
  guard: string;
158
157
  sharing: {
@@ -172,6 +171,7 @@ export declare const CallAllocation_CreateSchema: z.ZodObject<{
172
171
  max?: string | number | null | undefined;
173
172
  fix?: string | number | undefined;
174
173
  }[];
174
+ threshold?: string | number | undefined;
175
175
  }>;
176
176
  coin: z.ZodUnion<[z.ZodObject<{
177
177
  balance: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
@@ -259,7 +259,6 @@ export declare const CallAllocation_CreateSchema: z.ZodObject<{
259
259
  };
260
260
  allocators: {
261
261
  description: string;
262
- threshold: string | number;
263
262
  allocators: {
264
263
  guard: string;
265
264
  sharing: {
@@ -279,6 +278,7 @@ export declare const CallAllocation_CreateSchema: z.ZodObject<{
279
278
  max?: string | number | null | undefined;
280
279
  fix?: string | number | undefined;
281
280
  }[];
281
+ threshold?: string | number | undefined;
282
282
  };
283
283
  payment_info: {
284
284
  index: string | number;
@@ -371,7 +371,7 @@ export declare const CallAllocation_DataSchema: z.ZodUnion<[z.ZodObject<{
371
371
  }>;
372
372
  allocators: z.ZodObject<{
373
373
  description: z.ZodEffects<z.ZodString, string, string>;
374
- threshold: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
374
+ threshold: z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
375
375
  allocators: z.ZodArray<z.ZodObject<{
376
376
  guard: z.ZodEffects<z.ZodString, string, string>;
377
377
  sharing: z.ZodArray<z.ZodObject<{
@@ -501,7 +501,6 @@ export declare const CallAllocation_DataSchema: z.ZodUnion<[z.ZodObject<{
501
501
  }[];
502
502
  }, {
503
503
  description: string;
504
- threshold: string | number;
505
504
  allocators: {
506
505
  guard: string;
507
506
  sharing: {
@@ -521,6 +520,7 @@ export declare const CallAllocation_DataSchema: z.ZodUnion<[z.ZodObject<{
521
520
  max?: string | number | null | undefined;
522
521
  fix?: string | number | undefined;
523
522
  }[];
523
+ threshold?: string | number | undefined;
524
524
  }>;
525
525
  coin: z.ZodUnion<[z.ZodObject<{
526
526
  balance: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
@@ -608,7 +608,6 @@ export declare const CallAllocation_DataSchema: z.ZodUnion<[z.ZodObject<{
608
608
  };
609
609
  allocators: {
610
610
  description: string;
611
- threshold: string | number;
612
611
  allocators: {
613
612
  guard: string;
614
613
  sharing: {
@@ -628,6 +627,7 @@ export declare const CallAllocation_DataSchema: z.ZodUnion<[z.ZodObject<{
628
627
  max?: string | number | null | undefined;
629
628
  fix?: string | number | undefined;
630
629
  }[];
630
+ threshold?: string | number | undefined;
631
631
  };
632
632
  payment_info: {
633
633
  index: string | number;
@@ -720,7 +720,7 @@ export declare const CallAllocation_InputSchema: z.ZodObject<{
720
720
  }>;
721
721
  allocators: z.ZodObject<{
722
722
  description: z.ZodEffects<z.ZodString, string, string>;
723
- threshold: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
723
+ threshold: z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
724
724
  allocators: z.ZodArray<z.ZodObject<{
725
725
  guard: z.ZodEffects<z.ZodString, string, string>;
726
726
  sharing: z.ZodArray<z.ZodObject<{
@@ -850,7 +850,6 @@ export declare const CallAllocation_InputSchema: z.ZodObject<{
850
850
  }[];
851
851
  }, {
852
852
  description: string;
853
- threshold: string | number;
854
853
  allocators: {
855
854
  guard: string;
856
855
  sharing: {
@@ -870,6 +869,7 @@ export declare const CallAllocation_InputSchema: z.ZodObject<{
870
869
  max?: string | number | null | undefined;
871
870
  fix?: string | number | undefined;
872
871
  }[];
872
+ threshold?: string | number | undefined;
873
873
  }>;
874
874
  coin: z.ZodUnion<[z.ZodObject<{
875
875
  balance: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
@@ -957,7 +957,6 @@ export declare const CallAllocation_InputSchema: z.ZodObject<{
957
957
  };
958
958
  allocators: {
959
959
  description: string;
960
- threshold: string | number;
961
960
  allocators: {
962
961
  guard: string;
963
962
  sharing: {
@@ -977,6 +976,7 @@ export declare const CallAllocation_InputSchema: z.ZodObject<{
977
976
  max?: string | number | null | undefined;
978
977
  fix?: string | number | undefined;
979
978
  }[];
979
+ threshold?: string | number | undefined;
980
980
  };
981
981
  payment_info: {
982
982
  index: string | number;
@@ -1370,7 +1370,6 @@ export declare const CallAllocation_InputSchema: z.ZodObject<{
1370
1370
  };
1371
1371
  allocators: {
1372
1372
  description: string;
1373
- threshold: string | number;
1374
1373
  allocators: {
1375
1374
  guard: string;
1376
1375
  sharing: {
@@ -1390,6 +1389,7 @@ export declare const CallAllocation_InputSchema: z.ZodObject<{
1390
1389
  max?: string | number | null | undefined;
1391
1390
  fix?: string | number | undefined;
1392
1391
  }[];
1392
+ threshold?: string | number | undefined;
1393
1393
  };
1394
1394
  payment_info: {
1395
1395
  index: string | number;
@@ -166,7 +166,7 @@ export const GuardPuzzleStatusSchema = z.object({
166
166
  }).strict().describe("Guard information puzzle completeness status. 6 dimensions (A-F). false = missing, needs user input.");
167
167
  export const GuardAvailableQuerySchema = z.object({
168
168
  id: z.number().int().describe("Query instruction ID. Example: 1253"),
169
- name: z.string().describe("Query instruction name. Example: 'progress.current_node_name'"),
169
+ name: z.string().describe("Query instruction name. Example: 'progress.current'"),
170
170
  objectType: z.string().describe("Target object type. Example: 'Progress'"),
171
171
  returnType: z.string().describe("Return value type. Example: 'String'"),
172
172
  description: z.string().optional().describe("Query description"),
@@ -290,7 +290,7 @@ export const CallResultSchema = z.discriminatedUnion("type", [
290
290
  type: z.literal("null").describe("Discriminator for this result variant. Constraint: always 'null'. Example: 'null'"),
291
291
  }),
292
292
  CallPendingConfirmationSchema,
293
- ]).describe("Discriminated union of 6 result types: 'transaction' (raw Sui 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.");
293
+ ]).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.");
294
294
  export const ObjectsSchema = z.union([
295
295
  z.object({
296
296
  op: z.union([z.literal('add'), z.literal('set')]),
@@ -345,4 +345,4 @@ export const CallOutputSchema = z.object({
345
345
  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:'...'}"),
346
346
  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'}}"),
347
347
  schema_warning: SchemaWarningSchema.optional().describe("Schema compatibility warning. Present only when client_schema_version is provided in env and a mismatch is detected."),
348
- }).strict().describe("Unified MCP tool output. result.type discriminates 5 outcomes: 'transaction' (raw Sui response), 'submission' (needs Guard data), 'error' (failed with error_code), 'data' (query result), 'null' (no-op). 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'.");
348
+ }).strict().describe("Unified MCP tool output. result.type discriminates 5 outcomes: 'transaction' (raw Wow response), 'submission' (needs Guard data), 'error' (failed with error_code), 'data' (query result), 'null' (no-op). 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'.");
@@ -293,7 +293,7 @@ export declare const NodeSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
293
293
  name: z.ZodString;
294
294
  pairs: z.ZodArray<z.ZodObject<{
295
295
  prev_node: z.ZodString;
296
- threshold: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
296
+ threshold: z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
297
297
  forwards: z.ZodArray<z.ZodObject<{
298
298
  name: z.ZodString;
299
299
  namedOperator: z.ZodUnion<[z.ZodString, z.ZodNull, z.ZodUndefined]>;
@@ -352,8 +352,8 @@ export declare const NodeSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
352
352
  namedOperator?: string | null | undefined;
353
353
  permissionIndex?: string | number | null | undefined;
354
354
  }[];
355
- threshold: string | number;
356
355
  prev_node: string;
356
+ threshold?: string | number | undefined;
357
357
  }>, "many">;
358
358
  }, "strict", z.ZodTypeAny, {
359
359
  name: string;
@@ -384,8 +384,8 @@ export declare const NodeSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
384
384
  namedOperator?: string | null | undefined;
385
385
  permissionIndex?: string | number | null | undefined;
386
386
  }[];
387
- threshold: string | number;
388
387
  prev_node: string;
388
+ threshold?: string | number | undefined;
389
389
  }[];
390
390
  }>, "many">;
391
391
  bReplace: z.ZodOptional<z.ZodBoolean>;
@@ -424,8 +424,8 @@ export declare const NodeSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
424
424
  namedOperator?: string | null | undefined;
425
425
  permissionIndex?: string | number | null | undefined;
426
426
  }[];
427
- threshold: string | number;
428
427
  prev_node: string;
428
+ threshold?: string | number | undefined;
429
429
  }[];
430
430
  }[];
431
431
  bReplace?: boolean | undefined;
@@ -435,7 +435,7 @@ export declare const NodeSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
435
435
  name: z.ZodString;
436
436
  pairs: z.ZodArray<z.ZodObject<{
437
437
  prev_node: z.ZodString;
438
- threshold: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
438
+ threshold: z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
439
439
  forwards: z.ZodArray<z.ZodObject<{
440
440
  name: z.ZodString;
441
441
  namedOperator: z.ZodUnion<[z.ZodString, z.ZodNull, z.ZodUndefined]>;
@@ -494,8 +494,8 @@ export declare const NodeSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
494
494
  namedOperator?: string | null | undefined;
495
495
  permissionIndex?: string | number | null | undefined;
496
496
  }[];
497
- threshold: string | number;
498
497
  prev_node: string;
498
+ threshold?: string | number | undefined;
499
499
  }>, "many">;
500
500
  }, "strict", z.ZodTypeAny, {
501
501
  name: string;
@@ -526,8 +526,8 @@ export declare const NodeSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
526
526
  namedOperator?: string | null | undefined;
527
527
  permissionIndex?: string | number | null | undefined;
528
528
  }[];
529
- threshold: string | number;
530
529
  prev_node: string;
530
+ threshold?: string | number | undefined;
531
531
  }[];
532
532
  }>, "many">;
533
533
  bReplace: z.ZodOptional<z.ZodBoolean>;
@@ -566,8 +566,8 @@ export declare const NodeSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
566
566
  namedOperator?: string | null | undefined;
567
567
  permissionIndex?: string | number | null | undefined;
568
568
  }[];
569
- threshold: string | number;
570
569
  prev_node: string;
570
+ threshold?: string | number | undefined;
571
571
  }[];
572
572
  }[];
573
573
  bReplace?: boolean | undefined;
@@ -780,7 +780,7 @@ export declare const NodeFieldSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"op",
780
780
  name: z.ZodString;
781
781
  pairs: z.ZodArray<z.ZodObject<{
782
782
  prev_node: z.ZodString;
783
- threshold: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
783
+ threshold: z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
784
784
  forwards: z.ZodArray<z.ZodObject<{
785
785
  name: z.ZodString;
786
786
  namedOperator: z.ZodUnion<[z.ZodString, z.ZodNull, z.ZodUndefined]>;
@@ -839,8 +839,8 @@ export declare const NodeFieldSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"op",
839
839
  namedOperator?: string | null | undefined;
840
840
  permissionIndex?: string | number | null | undefined;
841
841
  }[];
842
- threshold: string | number;
843
842
  prev_node: string;
843
+ threshold?: string | number | undefined;
844
844
  }>, "many">;
845
845
  }, "strict", z.ZodTypeAny, {
846
846
  name: string;
@@ -871,8 +871,8 @@ export declare const NodeFieldSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"op",
871
871
  namedOperator?: string | null | undefined;
872
872
  permissionIndex?: string | number | null | undefined;
873
873
  }[];
874
- threshold: string | number;
875
874
  prev_node: string;
875
+ threshold?: string | number | undefined;
876
876
  }[];
877
877
  }>, "many">;
878
878
  bReplace: z.ZodOptional<z.ZodBoolean>;
@@ -911,8 +911,8 @@ export declare const NodeFieldSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"op",
911
911
  namedOperator?: string | null | undefined;
912
912
  permissionIndex?: string | number | null | undefined;
913
913
  }[];
914
- threshold: string | number;
915
914
  prev_node: string;
915
+ threshold?: string | number | undefined;
916
916
  }[];
917
917
  }[];
918
918
  bReplace?: boolean | undefined;
@@ -922,7 +922,7 @@ export declare const NodeFieldSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"op",
922
922
  name: z.ZodString;
923
923
  pairs: z.ZodArray<z.ZodObject<{
924
924
  prev_node: z.ZodString;
925
- threshold: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
925
+ threshold: z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
926
926
  forwards: z.ZodArray<z.ZodObject<{
927
927
  name: z.ZodString;
928
928
  namedOperator: z.ZodUnion<[z.ZodString, z.ZodNull, z.ZodUndefined]>;
@@ -981,8 +981,8 @@ export declare const NodeFieldSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"op",
981
981
  namedOperator?: string | null | undefined;
982
982
  permissionIndex?: string | number | null | undefined;
983
983
  }[];
984
- threshold: string | number;
985
984
  prev_node: string;
985
+ threshold?: string | number | undefined;
986
986
  }>, "many">;
987
987
  }, "strict", z.ZodTypeAny, {
988
988
  name: string;
@@ -1013,8 +1013,8 @@ export declare const NodeFieldSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"op",
1013
1013
  namedOperator?: string | null | undefined;
1014
1014
  permissionIndex?: string | number | null | undefined;
1015
1015
  }[];
1016
- threshold: string | number;
1017
1016
  prev_node: string;
1017
+ threshold?: string | number | undefined;
1018
1018
  }[];
1019
1019
  }>, "many">;
1020
1020
  bReplace: z.ZodOptional<z.ZodBoolean>;
@@ -1053,8 +1053,8 @@ export declare const NodeFieldSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"op",
1053
1053
  namedOperator?: string | null | undefined;
1054
1054
  permissionIndex?: string | number | null | undefined;
1055
1055
  }[];
1056
- threshold: string | number;
1057
1056
  prev_node: string;
1057
+ threshold?: string | number | undefined;
1058
1058
  }[];
1059
1059
  }[];
1060
1060
  bReplace?: boolean | undefined;
@@ -1493,7 +1493,7 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
1493
1493
  name: z.ZodString;
1494
1494
  pairs: z.ZodArray<z.ZodObject<{
1495
1495
  prev_node: z.ZodString;
1496
- threshold: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
1496
+ threshold: z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
1497
1497
  forwards: z.ZodArray<z.ZodObject<{
1498
1498
  name: z.ZodString;
1499
1499
  namedOperator: z.ZodUnion<[z.ZodString, z.ZodNull, z.ZodUndefined]>;
@@ -1552,8 +1552,8 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
1552
1552
  namedOperator?: string | null | undefined;
1553
1553
  permissionIndex?: string | number | null | undefined;
1554
1554
  }[];
1555
- threshold: string | number;
1556
1555
  prev_node: string;
1556
+ threshold?: string | number | undefined;
1557
1557
  }>, "many">;
1558
1558
  }, "strict", z.ZodTypeAny, {
1559
1559
  name: string;
@@ -1584,8 +1584,8 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
1584
1584
  namedOperator?: string | null | undefined;
1585
1585
  permissionIndex?: string | number | null | undefined;
1586
1586
  }[];
1587
- threshold: string | number;
1588
1587
  prev_node: string;
1588
+ threshold?: string | number | undefined;
1589
1589
  }[];
1590
1590
  }>, "many">;
1591
1591
  bReplace: z.ZodOptional<z.ZodBoolean>;
@@ -1624,8 +1624,8 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
1624
1624
  namedOperator?: string | null | undefined;
1625
1625
  permissionIndex?: string | number | null | undefined;
1626
1626
  }[];
1627
- threshold: string | number;
1628
1627
  prev_node: string;
1628
+ threshold?: string | number | undefined;
1629
1629
  }[];
1630
1630
  }[];
1631
1631
  bReplace?: boolean | undefined;
@@ -1635,7 +1635,7 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
1635
1635
  name: z.ZodString;
1636
1636
  pairs: z.ZodArray<z.ZodObject<{
1637
1637
  prev_node: z.ZodString;
1638
- threshold: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
1638
+ threshold: z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
1639
1639
  forwards: z.ZodArray<z.ZodObject<{
1640
1640
  name: z.ZodString;
1641
1641
  namedOperator: z.ZodUnion<[z.ZodString, z.ZodNull, z.ZodUndefined]>;
@@ -1694,8 +1694,8 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
1694
1694
  namedOperator?: string | null | undefined;
1695
1695
  permissionIndex?: string | number | null | undefined;
1696
1696
  }[];
1697
- threshold: string | number;
1698
1697
  prev_node: string;
1698
+ threshold?: string | number | undefined;
1699
1699
  }>, "many">;
1700
1700
  }, "strict", z.ZodTypeAny, {
1701
1701
  name: string;
@@ -1726,8 +1726,8 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
1726
1726
  namedOperator?: string | null | undefined;
1727
1727
  permissionIndex?: string | number | null | undefined;
1728
1728
  }[];
1729
- threshold: string | number;
1730
1729
  prev_node: string;
1730
+ threshold?: string | number | undefined;
1731
1731
  }[];
1732
1732
  }>, "many">;
1733
1733
  bReplace: z.ZodOptional<z.ZodBoolean>;
@@ -1766,8 +1766,8 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
1766
1766
  namedOperator?: string | null | undefined;
1767
1767
  permissionIndex?: string | number | null | undefined;
1768
1768
  }[];
1769
- threshold: string | number;
1770
1769
  prev_node: string;
1770
+ threshold?: string | number | undefined;
1771
1771
  }[];
1772
1772
  }[];
1773
1773
  bReplace?: boolean | undefined;
@@ -2208,8 +2208,8 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
2208
2208
  namedOperator?: string | null | undefined;
2209
2209
  permissionIndex?: string | number | null | undefined;
2210
2210
  }[];
2211
- threshold: string | number;
2212
2211
  prev_node: string;
2212
+ threshold?: string | number | undefined;
2213
2213
  }[];
2214
2214
  }[];
2215
2215
  bReplace?: boolean | undefined;
@@ -2228,8 +2228,8 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
2228
2228
  namedOperator?: string | null | undefined;
2229
2229
  permissionIndex?: string | number | null | undefined;
2230
2230
  }[];
2231
- threshold: string | number;
2232
2231
  prev_node: string;
2232
+ threshold?: string | number | undefined;
2233
2233
  }[];
2234
2234
  }[];
2235
2235
  bReplace?: boolean | undefined;
@@ -2566,7 +2566,7 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
2566
2566
  name: z.ZodString;
2567
2567
  pairs: z.ZodArray<z.ZodObject<{
2568
2568
  prev_node: z.ZodString;
2569
- threshold: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
2569
+ threshold: z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
2570
2570
  forwards: z.ZodArray<z.ZodObject<{
2571
2571
  name: z.ZodString;
2572
2572
  namedOperator: z.ZodUnion<[z.ZodString, z.ZodNull, z.ZodUndefined]>;
@@ -2625,8 +2625,8 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
2625
2625
  namedOperator?: string | null | undefined;
2626
2626
  permissionIndex?: string | number | null | undefined;
2627
2627
  }[];
2628
- threshold: string | number;
2629
2628
  prev_node: string;
2629
+ threshold?: string | number | undefined;
2630
2630
  }>, "many">;
2631
2631
  }, "strict", z.ZodTypeAny, {
2632
2632
  name: string;
@@ -2657,8 +2657,8 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
2657
2657
  namedOperator?: string | null | undefined;
2658
2658
  permissionIndex?: string | number | null | undefined;
2659
2659
  }[];
2660
- threshold: string | number;
2661
2660
  prev_node: string;
2661
+ threshold?: string | number | undefined;
2662
2662
  }[];
2663
2663
  }>, "many">;
2664
2664
  bReplace: z.ZodOptional<z.ZodBoolean>;
@@ -2697,8 +2697,8 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
2697
2697
  namedOperator?: string | null | undefined;
2698
2698
  permissionIndex?: string | number | null | undefined;
2699
2699
  }[];
2700
- threshold: string | number;
2701
2700
  prev_node: string;
2701
+ threshold?: string | number | undefined;
2702
2702
  }[];
2703
2703
  }[];
2704
2704
  bReplace?: boolean | undefined;
@@ -2708,7 +2708,7 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
2708
2708
  name: z.ZodString;
2709
2709
  pairs: z.ZodArray<z.ZodObject<{
2710
2710
  prev_node: z.ZodString;
2711
- threshold: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
2711
+ threshold: z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
2712
2712
  forwards: z.ZodArray<z.ZodObject<{
2713
2713
  name: z.ZodString;
2714
2714
  namedOperator: z.ZodUnion<[z.ZodString, z.ZodNull, z.ZodUndefined]>;
@@ -2767,8 +2767,8 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
2767
2767
  namedOperator?: string | null | undefined;
2768
2768
  permissionIndex?: string | number | null | undefined;
2769
2769
  }[];
2770
- threshold: string | number;
2771
2770
  prev_node: string;
2771
+ threshold?: string | number | undefined;
2772
2772
  }>, "many">;
2773
2773
  }, "strict", z.ZodTypeAny, {
2774
2774
  name: string;
@@ -2799,8 +2799,8 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
2799
2799
  namedOperator?: string | null | undefined;
2800
2800
  permissionIndex?: string | number | null | undefined;
2801
2801
  }[];
2802
- threshold: string | number;
2803
2802
  prev_node: string;
2803
+ threshold?: string | number | undefined;
2804
2804
  }[];
2805
2805
  }>, "many">;
2806
2806
  bReplace: z.ZodOptional<z.ZodBoolean>;
@@ -2839,8 +2839,8 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
2839
2839
  namedOperator?: string | null | undefined;
2840
2840
  permissionIndex?: string | number | null | undefined;
2841
2841
  }[];
2842
- threshold: string | number;
2843
2842
  prev_node: string;
2843
+ threshold?: string | number | undefined;
2844
2844
  }[];
2845
2845
  }[];
2846
2846
  bReplace?: boolean | undefined;
@@ -3281,8 +3281,8 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
3281
3281
  namedOperator?: string | null | undefined;
3282
3282
  permissionIndex?: string | number | null | undefined;
3283
3283
  }[];
3284
- threshold: string | number;
3285
3284
  prev_node: string;
3285
+ threshold?: string | number | undefined;
3286
3286
  }[];
3287
3287
  }[];
3288
3288
  bReplace?: boolean | undefined;
@@ -3301,8 +3301,8 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
3301
3301
  namedOperator?: string | null | undefined;
3302
3302
  permissionIndex?: string | number | null | undefined;
3303
3303
  }[];
3304
- threshold: string | number;
3305
3304
  prev_node: string;
3305
+ threshold?: string | number | undefined;
3306
3306
  }[];
3307
3307
  }[];
3308
3308
  bReplace?: boolean | undefined;
@@ -3848,8 +3848,8 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
3848
3848
  namedOperator?: string | null | undefined;
3849
3849
  permissionIndex?: string | number | null | undefined;
3850
3850
  }[];
3851
- threshold: string | number;
3852
3851
  prev_node: string;
3852
+ threshold?: string | number | undefined;
3853
3853
  }[];
3854
3854
  }[];
3855
3855
  bReplace?: boolean | undefined;
@@ -3868,8 +3868,8 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
3868
3868
  namedOperator?: string | null | undefined;
3869
3869
  permissionIndex?: string | number | null | undefined;
3870
3870
  }[];
3871
- threshold: string | number;
3872
3871
  prev_node: string;
3872
+ threshold?: string | number | undefined;
3873
3873
  }[];
3874
3874
  }[];
3875
3875
  bReplace?: boolean | undefined;
@@ -519,7 +519,7 @@ export function tagObjectRoles(objectChanges) {
519
519
  };
520
520
  });
521
521
  }
522
- const GAS_COIN_PATTERNS = [/::sui::SUI$/i, /::wow::WOW$/i];
522
+ const GAS_COIN_PATTERNS = [/::wow::WOW$/i];
523
523
  const SMALL_AMOUNT_THRESHOLD = BigInt(1_000_000);
524
524
  function isNegative(amount) {
525
525
  return String(amount ?? "0").startsWith("-");