wowok 2.1.9 → 2.1.10

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/NOTICE ADDED
@@ -0,0 +1,46 @@
1
+ WoWok Blockchain Project
2
+ https://wowok.net
3
+
4
+ ====================================================================
5
+
6
+ NOTICE
7
+
8
+ This product includes software developed by Mysten Labs, Inc.
9
+ https://mystenlabs.com
10
+
11
+ Portions of this software are derived from the Sui project:
12
+ https://github.com/MystenLabs/sui
13
+ Licensed under the Apache License, Version 2.0
14
+ https://github.com/MystenLabs/sui?tab=Apache-2.0-1-ov-file
15
+
16
+ ====================================================================
17
+
18
+ DISCLAIMER
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+
32
+ ====================================================================
33
+
34
+ THIRD-PARTY SOFTWARE NOTICES
35
+
36
+ The following third-party software is used in this project:
37
+
38
+ 1. Sui - Mysten Labs, Inc.
39
+ - License: Apache License 2.0
40
+ - Source: https://github.com/MystenLabs/sui
41
+ - License URL: https://github.com/MystenLabs/sui?tab=Apache-2.0-1-ov-file
42
+ - Used in: Move compiler, JSON-RPC API, and other blockchain components
43
+
44
+ ====================================================================
45
+
46
+ END OF NOTICE
@@ -26,6 +26,7 @@ export interface GuardInstructFilterOptions {
26
26
  returnType?: ValueType;
27
27
  paramCount?: number;
28
28
  scope?: "instruct" | "object query" | "all";
29
+ objectType?: ObjectType;
29
30
  }
30
31
  export declare function filterGuardInstruct(options: GuardInstructFilterOptions): GuardItem[];
31
32
  export declare function getGuardQueryInfo(queryIdOrName: number | string): GuardQuery | undefined;
@@ -4376,6 +4376,11 @@ function filterGuardInstruct(options) {
4376
4376
  return false;
4377
4377
  }
4378
4378
  }
4379
+ if (options.objectType !== void 0) {
4380
+ if (query.objectType !== options.objectType) {
4381
+ return false;
4382
+ }
4383
+ }
4379
4384
  return true;
4380
4385
  });
4381
4386
  results.push(...filteredQueries);
@@ -215,6 +215,16 @@ export declare function reliesLogic(tx: Transaction, guard: GuardObject, logic_a
215
215
  * @throws Error if query fails or file write fails
216
216
  */
217
217
  export declare const guard2file: (guard: string, file_path: string, format?: "json" | "markdown", network?: ENTRYPOINT) => Promise<void>;
218
+ /**
219
+ * Generate comments for Guard nodes
220
+ */
221
+ export declare const generateNodeComments: (node: GuardNode, comments?: Array<{
222
+ type: string;
223
+ description: string;
224
+ }>) => Array<{
225
+ type: string;
226
+ description: string;
227
+ }>;
218
228
  export declare const gen_passport: (env: CallEnv, guard: string, info?: SubmissionCall) => Promise<CallResult>;
219
229
  export interface GuardParseError {
220
230
  message: string;
@@ -34,6 +34,7 @@ __export(guard_exports, {
34
34
  create: () => create,
35
35
  formatGuardParseErrors: () => formatGuardParseErrors,
36
36
  gen_passport: () => gen_passport,
37
+ generateNodeComments: () => generateNodeComments,
37
38
  guard2file: () => guard2file,
38
39
  guardFn: () => guardFn,
39
40
  newGuard: () => newGuard,
@@ -738,6 +739,14 @@ const generateGuardMarkdown = (guardObj) => {
738
739
  lines.push("");
739
740
  lines.push(`**Object ID:** ${guardObj.object}`);
740
741
  lines.push("");
742
+ lines.push("## Summary");
743
+ lines.push("");
744
+ const description = guardObj.description || "";
745
+ const tableCount = guardObj.table ? guardObj.table.length : 0;
746
+ let summary = `${description.length > 100 ? description.substring(0, 97) + "..." : description}`;
747
+ summary += ` [${tableCount} tables]`;
748
+ lines.push(summary);
749
+ lines.push("");
741
750
  lines.push("## Description");
742
751
  lines.push("");
743
752
  lines.push(guardObj.description || "");
@@ -792,22 +801,6 @@ const generateGuardMarkdown = (guardObj) => {
792
801
  }
793
802
  lines.push("");
794
803
  }
795
- lines.push("## Guard Instructions Reference");
796
- lines.push("");
797
- lines.push("Use these instructions in query nodes:");
798
- lines.push("");
799
- lines.push("| ID | Name | Object Type | Return Type | Description |");
800
- lines.push("|----|------|-------------|-------------|-------------|");
801
- for (const query of import_guard_ins.GUARDQUERY.slice(0, 20)) {
802
- lines.push(
803
- `| ${query.id} | ${query.name} | ${query.objectType} | ${valueTypeToString(query.return)} | ${query.description} |`
804
- );
805
- }
806
- lines.push("");
807
- lines.push(
808
- "*For complete list, use `wowok_buildin_info` with query='guard instructions'*"
809
- );
810
- lines.push("");
811
804
  return lines.join("\n");
812
805
  };
813
806
  const formatValueForMarkdown = (value) => {
@@ -4,7 +4,7 @@ export { CallArbitration } from "./arbitration.js";
4
4
  export type { CallArbitration_Data } from "./arbitration.js";
5
5
  export { CallDemand } from "./demand.js";
6
6
  export type { CallDemand_Data } from "./demand.js";
7
- export { CallGuard, guard2file, parseGuardFile, parseGuardFromMarkdown, validateGuardNode, formatGuardParseErrors, type GuardParseError, type GuardParseResult, } from "./guard.js";
7
+ export { CallGuard, guard2file, parseGuardFile, parseGuardFromMarkdown, validateGuardNode, formatGuardParseErrors, generateNodeComments, type GuardParseError, type GuardParseResult, } from "./guard.js";
8
8
  export type { CallGuard_Data } from "./guard.js";
9
9
  export { gen_passport } from "./guard.js";
10
10
  export { CallMachine, machineNode2file } from "./machine.js";
@@ -40,6 +40,7 @@ __export(call_exports, {
40
40
  formatGuardParseErrors: () => import_guard.formatGuardParseErrors,
41
41
  gen_passport: () => import_guard2.gen_passport,
42
42
  gen_proof: () => import_proof2.gen_proof,
43
+ generateNodeComments: () => import_guard.generateNodeComments,
43
44
  guard2file: () => import_guard.guard2file,
44
45
  machineNode2file: () => import_machine.machineNode2file,
45
46
  parseGuardFile: () => import_guard.parseGuardFile,
@@ -26,6 +26,7 @@ export interface GuardInstructFilterOptions {
26
26
  returnType?: ValueType;
27
27
  paramCount?: number;
28
28
  scope?: "instruct" | "object query" | "all";
29
+ objectType?: ObjectType;
29
30
  }
30
31
  export declare function filterGuardInstruct(options: GuardInstructFilterOptions): GuardItem[];
31
32
  export declare function getGuardQueryInfo(queryIdOrName: number | string): GuardQuery | undefined;
@@ -4350,6 +4350,11 @@ function filterGuardInstruct(options) {
4350
4350
  return false;
4351
4351
  }
4352
4352
  }
4353
+ if (options.objectType !== void 0) {
4354
+ if (query.objectType !== options.objectType) {
4355
+ return false;
4356
+ }
4357
+ }
4353
4358
  return true;
4354
4359
  });
4355
4360
  results.push(...filteredQueries);
@@ -215,6 +215,16 @@ export declare function reliesLogic(tx: Transaction, guard: GuardObject, logic_a
215
215
  * @throws Error if query fails or file write fails
216
216
  */
217
217
  export declare const guard2file: (guard: string, file_path: string, format?: "json" | "markdown", network?: ENTRYPOINT) => Promise<void>;
218
+ /**
219
+ * Generate comments for Guard nodes
220
+ */
221
+ export declare const generateNodeComments: (node: GuardNode, comments?: Array<{
222
+ type: string;
223
+ description: string;
224
+ }>) => Array<{
225
+ type: string;
226
+ description: string;
227
+ }>;
218
228
  export declare const gen_passport: (env: CallEnv, guard: string, info?: SubmissionCall) => Promise<CallResult>;
219
229
  export interface GuardParseError {
220
230
  message: string;
@@ -714,6 +714,14 @@ const generateGuardMarkdown = (guardObj) => {
714
714
  lines.push("");
715
715
  lines.push(`**Object ID:** ${guardObj.object}`);
716
716
  lines.push("");
717
+ lines.push("## Summary");
718
+ lines.push("");
719
+ const description = guardObj.description || "";
720
+ const tableCount = guardObj.table ? guardObj.table.length : 0;
721
+ let summary = `${description.length > 100 ? description.substring(0, 97) + "..." : description}`;
722
+ summary += ` [${tableCount} tables]`;
723
+ lines.push(summary);
724
+ lines.push("");
717
725
  lines.push("## Description");
718
726
  lines.push("");
719
727
  lines.push(guardObj.description || "");
@@ -768,22 +776,6 @@ const generateGuardMarkdown = (guardObj) => {
768
776
  }
769
777
  lines.push("");
770
778
  }
771
- lines.push("## Guard Instructions Reference");
772
- lines.push("");
773
- lines.push("Use these instructions in query nodes:");
774
- lines.push("");
775
- lines.push("| ID | Name | Object Type | Return Type | Description |");
776
- lines.push("|----|------|-------------|-------------|-------------|");
777
- for (const query of GUARDQUERY.slice(0, 20)) {
778
- lines.push(
779
- `| ${query.id} | ${query.name} | ${query.objectType} | ${valueTypeToString(query.return)} | ${query.description} |`
780
- );
781
- }
782
- lines.push("");
783
- lines.push(
784
- "*For complete list, use `wowok_buildin_info` with query='guard instructions'*"
785
- );
786
- lines.push("");
787
779
  return lines.join("\n");
788
780
  };
789
781
  const formatValueForMarkdown = (value) => {
@@ -1189,6 +1181,7 @@ export {
1189
1181
  create,
1190
1182
  formatGuardParseErrors,
1191
1183
  gen_passport,
1184
+ generateNodeComments,
1192
1185
  guard2file,
1193
1186
  guardFn,
1194
1187
  newGuard,
@@ -4,7 +4,7 @@ export { CallArbitration } from "./arbitration.js";
4
4
  export type { CallArbitration_Data } from "./arbitration.js";
5
5
  export { CallDemand } from "./demand.js";
6
6
  export type { CallDemand_Data } from "./demand.js";
7
- export { CallGuard, guard2file, parseGuardFile, parseGuardFromMarkdown, validateGuardNode, formatGuardParseErrors, type GuardParseError, type GuardParseResult, } from "./guard.js";
7
+ export { CallGuard, guard2file, parseGuardFile, parseGuardFromMarkdown, validateGuardNode, formatGuardParseErrors, generateNodeComments, type GuardParseError, type GuardParseResult, } from "./guard.js";
8
8
  export type { CallGuard_Data } from "./guard.js";
9
9
  export { gen_passport } from "./guard.js";
10
10
  export { CallMachine, machineNode2file } from "./machine.js";
@@ -7,7 +7,8 @@ import {
7
7
  parseGuardFile,
8
8
  parseGuardFromMarkdown,
9
9
  validateGuardNode,
10
- formatGuardParseErrors
10
+ formatGuardParseErrors,
11
+ generateNodeComments
11
12
  } from "./guard.js";
12
13
  import { gen_passport } from "./guard.js";
13
14
  import { CallMachine, machineNode2file } from "./machine.js";
@@ -49,6 +50,7 @@ export {
49
50
  formatGuardParseErrors,
50
51
  gen_passport,
51
52
  gen_proof,
53
+ generateNodeComments,
52
54
  guard2file,
53
55
  machineNode2file,
54
56
  parseGuardFile,