@wowok/agent-mcp 2.2.13 → 2.2.15

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 (126) hide show
  1. package/README.md +19 -11
  2. package/dist/index.js +44 -100
  3. package/dist/schema/query/index.js +1 -1
  4. package/dist/schema-query/index.d.ts +29 -0
  5. package/dist/schema-query/index.js +149 -0
  6. package/dist/schemas/account_operation.schema.json +255 -0
  7. package/dist/schemas/guard2file.schema.json +71 -0
  8. package/dist/schemas/index.json +139 -0
  9. package/dist/schemas/local_info_operation.schema.json +142 -0
  10. package/dist/schemas/local_mark_operation.schema.json +119 -0
  11. package/dist/schemas/machineNode2file.schema.json +71 -0
  12. package/dist/schemas/messenger_operation.schema.json +1393 -0
  13. package/dist/schemas/onchain_events.schema.json +113 -0
  14. package/dist/schemas/onchain_operations.schema.json +376 -0
  15. package/dist/schemas/onchain_operations_allocation.schema.json +914 -0
  16. package/dist/schemas/onchain_operations_arbitration.schema.json +1166 -0
  17. package/dist/schemas/onchain_operations_contact.schema.json +853 -0
  18. package/dist/schemas/onchain_operations_demand.schema.json +984 -0
  19. package/dist/schemas/onchain_operations_gen_passport.schema.json +1141 -0
  20. package/dist/schemas/onchain_operations_guard.schema.json +713 -0
  21. package/dist/schemas/onchain_operations_machine.schema.json +1347 -0
  22. package/dist/schemas/onchain_operations_order.schema.json +830 -0
  23. package/dist/schemas/onchain_operations_payment.schema.json +717 -0
  24. package/dist/schemas/onchain_operations_permission.schema.json +1088 -0
  25. package/dist/schemas/onchain_operations_personal.schema.json +1282 -0
  26. package/dist/schemas/onchain_operations_progress.schema.json +751 -0
  27. package/dist/schemas/onchain_operations_repository.schema.json +1572 -0
  28. package/dist/schemas/onchain_operations_reward.schema.json +955 -0
  29. package/dist/schemas/onchain_operations_service.schema.json +1411 -0
  30. package/dist/schemas/onchain_operations_treasury.schema.json +1155 -0
  31. package/dist/schemas/onchain_table_data.schema.json +35 -0
  32. package/dist/schemas/query_toolkit.schema.json +32 -0
  33. package/dist/schemas/schema_query.schema.json +33 -0
  34. package/dist/schemas/wip_file.schema.json +27 -0
  35. package/dist/schemas/wowok_buildin_info.schema.json +487 -0
  36. package/package.json +7 -5
  37. package/dist/docs/index.d.ts +0 -3
  38. package/dist/docs/index.js +0 -2
  39. package/dist/docs/loader.d.ts +0 -12
  40. package/dist/docs/loader.js +0 -177
  41. package/dist/docs/search.d.ts +0 -17
  42. package/dist/docs/search.js +0 -325
  43. package/dist/docs/types.d.ts +0 -55
  44. package/dist/docs/types.js +0 -1
  45. package/docs/README.md +0 -249
  46. package/docs/WIP.md +0 -388
  47. package/docs/WTS.md +0 -536
  48. package/docs/docs/account.md +0 -914
  49. package/docs/docs/allocation.md +0 -635
  50. package/docs/docs/arbitration.md +0 -1804
  51. package/docs/docs/arbitration_state_machine.md +0 -270
  52. package/docs/docs/contact.md +0 -709
  53. package/docs/docs/demand.md +0 -948
  54. package/docs/docs/guard.md +0 -1465
  55. package/docs/docs/localinfo.md +0 -432
  56. package/docs/docs/localmark.md +0 -583
  57. package/docs/docs/machine.md +0 -2490
  58. package/docs/docs/messenger.md +0 -2098
  59. package/docs/docs/onchain_events.md +0 -267
  60. package/docs/docs/order.md +0 -1001
  61. package/docs/docs/payment.md +0 -512
  62. package/docs/docs/permission.md +0 -1438
  63. package/docs/docs/personal.md +0 -742
  64. package/docs/docs/progress.md +0 -1748
  65. package/docs/docs/query.md +0 -467
  66. package/docs/docs/repository.md +0 -1043
  67. package/docs/docs/reward.md +0 -833
  68. package/docs/docs/service.md +0 -2130
  69. package/docs/docs/stage-01-introduction.md +0 -243
  70. package/docs/docs/stage-02-trust.md +0 -302
  71. package/docs/docs/stage-03-collaboration.md +0 -337
  72. package/docs/docs/stage-04-transaction.md +0 -277
  73. package/docs/docs/stage-05-business.md +0 -151
  74. package/docs/docs/stage-06-personal.md +0 -203
  75. package/docs/docs/stage-07-query.md +0 -572
  76. package/docs/docs/stage-08-examples.md +0 -184
  77. package/docs/docs/treasury.md +0 -1149
  78. package/docs/docs/wowok_buildin_info.md +0 -740
  79. package/docs/examples/Insurance/Insurance.md +0 -594
  80. package/docs/examples/Insurance/Insurance_TestResults.md +0 -481
  81. package/docs/examples/Insurance/insurance_complete_guard_v1.json +0 -50
  82. package/docs/examples/MyShop/MyShop.md +0 -1353
  83. package/docs/examples/MyShop/MyShop_TestResults.md +0 -1003
  84. package/docs/examples/MyShop_Advanced/MyShop_Advanced.md +0 -1898
  85. package/docs/examples/MyShop_Advanced/MyShop_Advanced_MerchantSystem_TestResults.md +0 -1297
  86. package/docs/examples/MyShop_Advanced/MyShop_Advanced_OrderFlow_TestResults.md +0 -743
  87. package/docs/examples/MyShop_Advanced/machine_nodes.json +0 -222
  88. package/docs/examples/ThreeBody_Signature/ThreeBody_Signature.md +0 -776
  89. package/docs/examples/ThreeBody_Signature/ThreeBody_Signature_TestResults.md +0 -599
  90. package/docs/examples/Travel/Travel.md +0 -1157
  91. package/docs/examples/Travel/Travel_TestResults.md +0 -743
  92. package/docs/examples/Travel/calc-weather-timestamps.js +0 -8
  93. package/docs/examples/Travel/travel_machine_v2_export.json +0 -104
  94. package/docs/examples/Travel/weather_check_guard_v1.json +0 -51
  95. package/docs/skills/WOWOK.md +0 -650
  96. package/docs/skills/onchain_operations/_common.md +0 -406
  97. package/docs/skills/onchain_operations/_index.md +0 -196
  98. package/docs/skills/onchain_operations/allocation.md +0 -28
  99. package/docs/skills/onchain_operations/arbitration.md +0 -106
  100. package/docs/skills/onchain_operations/contact.md +0 -40
  101. package/docs/skills/onchain_operations/demand.md +0 -53
  102. package/docs/skills/onchain_operations/gen_passport.md +0 -23
  103. package/docs/skills/onchain_operations/guard.md +0 -56
  104. package/docs/skills/onchain_operations/machine.md +0 -89
  105. package/docs/skills/onchain_operations/order.md +0 -56
  106. package/docs/skills/onchain_operations/payment.md +0 -24
  107. package/docs/skills/onchain_operations/permission.md +0 -68
  108. package/docs/skills/onchain_operations/personal.md +0 -58
  109. package/docs/skills/onchain_operations/progress.md +0 -38
  110. package/docs/skills/onchain_operations/repository.md +0 -70
  111. package/docs/skills/onchain_operations/reward.md +0 -38
  112. package/docs/skills/onchain_operations/service.md +0 -78
  113. package/docs/skills/onchain_operations/treasury.md +0 -68
  114. package/docs/skills/schema-account_operation.md +0 -402
  115. package/docs/skills/schema-guard2file.md +0 -153
  116. package/docs/skills/schema-local_info_operation.md +0 -160
  117. package/docs/skills/schema-local_mark_operation.md +0 -148
  118. package/docs/skills/schema-machineNode2file.md +0 -155
  119. package/docs/skills/schema-messenger_operation.md +0 -547
  120. package/docs/skills/schema-onchain_events.md +0 -201
  121. package/docs/skills/schema-onchain_table_data.md +0 -334
  122. package/docs/skills/schema-query_toolkit.md +0 -395
  123. package/docs/skills/schema-wip_file.md +0 -240
  124. package/docs/skills/schema-wowok_buildin_info.md +0 -296
  125. package/docs/wip-examples/three_body.html +0 -57
  126. package/docs/wip-examples/three_body.wip +0 -30
@@ -1,395 +0,0 @@
1
- # Schema: query_toolkit
2
-
3
- > WOWOK data query toolkit: Query local naming info (accounts, names, Object IDs), and query on-chain WOWOK objects, received tokens, user profile, etc.
4
- >
5
- > **LOCAL** (device-only, never on-chain): `local_mark_list` | `account_list` | `local_info_list` | `local_names` | `token_list` | `account_balance`
6
- >
7
- > **ONCHAIN** (blockchain): `onchain_personal_profile` | `onchain_objects` | `onchain_received`
8
- >
9
- > Use local queries for account management and address book lookups. Use onchain queries for blockchain data exploration, user profiles, object inspection, and payment tracking.
10
- >
11
- > **Note**: Dynamic table data queries (`onchain_table`, `onchain_table_item_*`) have been moved to the dedicated **`onchain_table_data`** tool. See [schema-onchain_table_data.md](schema-onchain_table_data.md) for details.
12
-
13
- ---
14
-
15
- ## Top-Level Structure
16
-
17
- ```typescript
18
- // Discriminated union by query_type — exactly ONE query per call
19
- QueryToolkit = {
20
- query_type: "local_mark_list" | "account_list" | "local_info_list" | "local_names" |
21
- "token_list" | "account_balance" | "onchain_personal_profile" |
22
- "onchain_objects" | "onchain_received";
23
- // ... query-specific parameters (see below)
24
- }
25
- ```
26
-
27
- ---
28
-
29
- ## Common Parameters (All Onchain Queries)
30
-
31
- | Parameter | Type | Description |
32
- |-----------|------|-------------|
33
- | `no_cache` | `boolean` (optional) | Set to `true` to bypass cache and fetch fresh on-chain data |
34
- | `network` | `"localnet" \| "testnet"` (optional) | Network to query; defaults to the configured default network |
35
-
36
- ---
37
-
38
- ## Common Parameters (Paginated Queries)
39
-
40
- | Parameter | Type | Applies To | Description |
41
- |-----------|------|-----------|-------------|
42
- | `cursor` | `string \| null` (optional) | onchain_received, account_balance.coin | Pagination cursor from previous page's `nextCursor` |
43
- | `limit` | `number \| null` (optional) | onchain_received, account_balance.coin | Max items per page |
44
-
45
- ---
46
-
47
- ## Query Types
48
-
49
- ### 1. local_mark_list
50
-
51
- Query your LOCAL address book — maps human-readable names to blockchain addresses with optional tags.
52
-
53
- ```typescript
54
- {
55
- query_type: "local_mark_list";
56
- filter?: LocalMarkFilter;
57
- }
58
-
59
- LocalMarkFilter {
60
- name?: string; // Filter by mark name (fuzzy match)
61
- tags?: string[]; // Filter by tags — returns marks with ANY of the specified tags
62
- address?: string; // Filter by address (exact match, 0x + 64 hex)
63
- createdAt?: { gte?: number; lte?: number };
64
- updatedAt?: { gte?: number; lte?: number };
65
- }
66
- ```
67
-
68
- **Result**: `MarkData[]`
69
-
70
- ```typescript
71
- MarkData {
72
- name?: string;
73
- address: string;
74
- tags?: string[];
75
- createdAt?: number;
76
- updatedAt?: number;
77
- }
78
- ```
79
-
80
- ---
81
-
82
- ### 2. account_list
83
-
84
- Query your LOCAL accounts — view all accounts stored on this device.
85
-
86
- ```typescript
87
- {
88
- query_type: "account_list";
89
- filter?: AccountFilter;
90
- }
91
-
92
- AccountFilter {
93
- name?: string; // Filter by name (fuzzy match)
94
- address?: string; // Filter by address (partial match)
95
- suspended?: boolean; // Filter by suspension status
96
- hasMessenger?: boolean; // Filter accounts with messenger enabled
97
- m?: string; // Filter by messenger name (fuzzy)
98
- createdAt?: { gte?: number; lte?: number };
99
- updatedAt?: { gte?: number; lte?: number };
100
- }
101
- ```
102
-
103
- **Result**: `AccountData[]`
104
-
105
- ```typescript
106
- AccountData {
107
- name?: string;
108
- address: string;
109
- pubkey?: string;
110
- secret?: string;
111
- suspended?: boolean;
112
- createdAt?: number;
113
- updatedAt?: number;
114
- m?: string | null; // Messenger name, null if disabled
115
- }
116
- ```
117
-
118
- ---
119
-
120
- ### 3. local_info_list
121
-
122
- Query your LOCAL private info — sensitive data like delivery addresses, phone numbers, contacts.
123
-
124
- ```typescript
125
- {
126
- query_type: "local_info_list";
127
- filter?: LocalInfoFilter;
128
- }
129
-
130
- LocalInfoFilter {
131
- name?: string;
132
- default?: string;
133
- contents?: string[];
134
- createdAt?: { gte?: number; lte?: number };
135
- updatedAt?: { gte?: number; lte?: number };
136
- }
137
- ```
138
-
139
- **Result**: `InfoData[]`
140
-
141
- ```typescript
142
- InfoData {
143
- name: string;
144
- default: string;
145
- contents?: string[];
146
- createdAt?: number;
147
- updatedAt?: number;
148
- }
149
- ```
150
-
151
- ---
152
-
153
- ### 4. local_names
154
-
155
- Batch reverse lookup — query local names by a list of addresses.
156
-
157
- ```typescript
158
- {
159
- query_type: "local_names";
160
- addresses: string[]; // Array of account addresses (0x...) to look up
161
- }
162
- ```
163
-
164
- **Result**: `{ address: string; name?: string }[]`
165
-
166
- ```typescript
167
- {
168
- address: string; // The queried address
169
- name?: string; // Local name assigned to this address, undefined if none
170
- }
171
- ```
172
-
173
- ---
174
-
175
- ### 5. token_list
176
-
177
- Query cached token metadata — symbol, decimals, icon URL, description.
178
-
179
- ```typescript
180
- {
181
- query_type: "token_list";
182
- filter?: TokenDataFilter;
183
- }
184
-
185
- TokenDataFilter {
186
- alias_or_name?: string; // Filter by alias or name (max 64 bcs characters)
187
- symbol?: string; // Filter by symbol
188
- type?: string; // Filter by token type (e.g., "0x2::wow::WOW")
189
- }
190
- ```
191
-
192
- **Result**: `TokenTypeInfo[]`
193
-
194
- ```typescript
195
- TokenTypeInfo {
196
- type: string; // Full token type (e.g., "0x2::wow::WOW")
197
- alias?: string;
198
- name: string;
199
- symbol: string;
200
- decimals: number;
201
- description: string; // Token description (required)
202
- iconUrl?: string | null; // URL for the token logo (may be null)
203
- id?: string | null; // Object ID for the CoinMetadata object (may be null)
204
- }
205
- ```
206
-
207
- ---
208
-
209
- ### 6. account_balance
210
-
211
- Query an account's coin balance OR paginated coin objects.
212
-
213
- ```typescript
214
- {
215
- query_type: "account_balance";
216
- name_or_address?: string; // Account name or address. Empty string "" = default account
217
- balance?: boolean; // Set to true to query total balance amount
218
- coin?: { // Set to query paginated coin objects instead of balance
219
- cursor?: string | null; // Pagination cursor
220
- limit?: number | null; // Max coin objects per page
221
- };
222
- token_type?: string; // Token type; defaults to "0x2::wow::WOW" (platform token)
223
- network?: "localnet" | "testnet";
224
- }
225
- ```
226
-
227
- **Result** (when `balance: true`):
228
-
229
- ```typescript
230
- {
231
- address: string;
232
- balance: {
233
- coinType: string;
234
- coinObjectCount: number;
235
- totalBalance: string;
236
- lockedBalance: Record<string, string>;
237
- };
238
- }
239
- ```
240
-
241
- **Result** (when `coin` is set):
242
-
243
- ```typescript
244
- {
245
- address: string;
246
- coin: {
247
- data: CoinStruct[];
248
- hasNextPage: boolean;
249
- nextCursor?: string | null;
250
- };
251
- }
252
-
253
- CoinStruct {
254
- balance: string;
255
- coinObjectId: string;
256
- coinType: string;
257
- digest: string;
258
- previousTransaction: string;
259
- version: string;
260
- }
261
- ```
262
-
263
- ---
264
-
265
- ### 7. onchain_personal_profile
266
-
267
- Query any user's PUBLIC on-chain profile — social links, reputation, personal info, voting history, referrer.
268
-
269
- ```typescript
270
- {
271
- query_type: "onchain_personal_profile";
272
- account?: string; // Account name or ID. Empty string "" = default account
273
- no_cache?: boolean;
274
- network?: "localnet" | "testnet";
275
- }
276
- ```
277
-
278
- **Result**: `ObjectPersonal | undefined`
279
-
280
- ```typescript
281
- ObjectPersonal {
282
- id: string;
283
- type: string;
284
- version: string;
285
- digest: string;
286
- owner: string;
287
- links?: PersonalLink[];
288
- likes?: number;
289
- dislikes?: number;
290
- records?: PersonalRecord[];
291
- votes?: PersonalVote[];
292
- referrer?: string;
293
- }
294
-
295
- PersonalLink {
296
- name: string;
297
- value: string;
298
- }
299
-
300
- PersonalRecord {
301
- name: string;
302
- value: string;
303
- }
304
-
305
- PersonalVote {
306
- entity: string;
307
- vote: boolean; // true = like, false = dislike
308
- }
309
- ```
310
-
311
- ---
312
-
313
- ### 8. onchain_objects
314
-
315
- Batch query on-chain WOWOK objects by ID — supports Service, Machine, Order, Treasury, Reward, Arb, Personal, Contact, and more.
316
-
317
- ```typescript
318
- {
319
- query_type: "onchain_objects";
320
- objects: string[]; // List of object IDs (names or addresses) to query in batch
321
- no_cache?: boolean;
322
- network?: "localnet" | "testnet";
323
- }
324
- ```
325
-
326
- **Result**: `{ objects: ObjectBase[] }`
327
-
328
- ```typescript
329
- ObjectBase {
330
- id: string;
331
- type: string; // "Service" | "Machine" | "Order" | "Treasury" | "Reward" | "Arb" | "Personal" | "Contact" | ...
332
- version: string;
333
- digest: string;
334
- owner: string;
335
- // ... type-specific fields
336
- }
337
- ```
338
-
339
- ---
340
-
341
- ### 9. onchain_received
342
-
343
- Query objects (payments, tokens, NFTs) received by an on-chain object.
344
-
345
- ```typescript
346
- {
347
- query_type: "onchain_received";
348
- name_or_address: string | AccountOrMark_Address; // Account name, address, or mark. Supports shorthand string (e.g. "alice") or full {name_or_address, local_mark_first} object
349
- all_type?: boolean; // Set to true to query all token types; defaults to the object's Token type '0x2::payment::CoinWrapper<TOKEN>' (Coins wrapper sent via Payment). Fails if object has no Token type.
350
- cursor?: string | null; // Pagination cursor from previous page
351
- limit?: number | null; // Max records per page
352
- no_cache?: boolean;
353
- network?: "localnet" | "testnet";
354
- }
355
- ```
356
-
357
- **Result**: `ReceivedBalance | ReceivedNormal[]`
358
-
359
- ```typescript
360
- // When querying a single token type (all_type not set or false):
361
- ReceivedBalance {
362
- balance: string;
363
- coinType: string;
364
- coinObjectCount: number;
365
- totalBalance: string;
366
- }
367
-
368
- // When querying all types (all_type: true):
369
- ReceivedNormal {
370
- id: string;
371
- type: string;
372
- // ... object-specific fields
373
- }
374
- ```
375
-
376
- ---
377
-
378
- ## Output Schema
379
-
380
- All queries return results wrapped in a unified `z.object({ result: ... })` structure with strict schema validation:
381
-
382
- ```typescript
383
- WatchQueryOperationsResult {
384
- result: {
385
- query_type: string; // Echoes the requested query_type
386
- result: any; // Query-specific result (see each query type above)
387
- }
388
- }
389
- ```
390
-
391
- The output schema validates all 9 query types with their specific return types. Each query's `result` field is strictly typed:
392
- - Local queries return arrays (`MarkData[]`, `AccountData[]`, `InfoData[]`, `TokenTypeInfo[]`)
393
- - `account_balance` returns `{ address, balance? | coin? }`
394
- - Onchain queries return `ObjectType | undefined` or `{ objects: ObjectBase[] }`
395
- - `onchain_received` returns `ReceivedBalance | ReceivedNormal[]`
@@ -1,240 +0,0 @@
1
- # WIP File Tool Schema
2
-
3
- > **Tool Name**: `wip_file`
4
- > **Description**: Generate, verify, sign, or convert WIP (Witness Immutable Promise) files to HTML.
5
-
6
- ---
7
-
8
- ## Tool Schema
9
-
10
- ```typescript
11
- wip_file: {
12
- operation: "generate" | "verify" | "sign" | "wip2html",
13
- params: GenerateWip_Input | VerifyWip_Input | SignWip_Input | Wip2Html_Input
14
- }
15
- ```
16
-
17
- ---
18
-
19
- ## Operation: generate
20
-
21
- Generate a WIP file from markdown text and optional images.
22
-
23
- ### Input Schema
24
-
25
- ```typescript
26
- GenerateWip_Input {
27
- options: WipGenerationOptions, // REQUIRED - WIP generation options
28
- outputPath: string // REQUIRED - Output file path (.wip file)
29
- }
30
- ```
31
-
32
- ### Sub Schemas
33
-
34
- ```typescript
35
- WipGenerationOptions {
36
- markdown_text: string, // REQUIRED - Markdown formatted text content (max 10000 chars)
37
- images?: ImageSource[], // OPTIONAL - Image list (max 10 images)
38
- account?: string // OPTIONAL - Signing account (account name or address)
39
- }
40
-
41
- ImageSource {
42
- source: string, // REQUIRED - Image source path or URL
43
- // Supports: 1) Local file path (e.g., '/path/to/image.png', 'C:\Users\name\image.jpg')
44
- // 2) Network URL (e.g., 'https://example.com/image.png')
45
- // 3) Data URL (e.g., 'data:image/png;base64,iVBORw0K...')
46
- id?: string, // OPTIONAL - Image ID for reference in WIP content
47
- filename?: string // OPTIONAL - File name (auto-extracted if not provided)
48
- }
49
- ```
50
-
51
- ### Output Schema
52
-
53
- ```typescript
54
- GenerateWip_Output {
55
- filePath: string // Generated WIP file path
56
- }
57
- ```
58
-
59
- ---
60
-
61
- ## Operation: verify
62
-
63
- Verify the integrity and signature of a WIP file.
64
-
65
- ### Input Schema
66
-
67
- ```typescript
68
- VerifyWip_Input {
69
- wipFilePath: string, // REQUIRED - WIP file path to verify
70
- // Supports: 1) Local file path
71
- // 2) Network URL
72
- // 3) Data URL
73
- hash_equal?: string, // OPTIONAL - Expected hash value for verification
74
- requireSignature?: boolean // OPTIONAL - Require digital signature (fails if no signature)
75
- }
76
- ```
77
-
78
- ### Output Schema
79
-
80
- ```typescript
81
- VerifyWip_Output = WipVerificationResult
82
-
83
- WipVerificationResult {
84
- valid: boolean, // Whether verification passed
85
- error?: string, // Error message (when verification fails)
86
- hashValid: boolean, // Whether hash verification passed
87
- signatureValid?: boolean, // Whether signature verification passed (when signature exists)
88
- hasSignature: boolean, // Whether signature exists
89
- signatures?: WipSignatureVerification[] // Signature verification details list
90
- }
91
-
92
- WipSignatureVerification {
93
- publicKey: string, // Signature public key
94
- address?: string, // Address derived from public key
95
- valid: boolean // Whether signature is valid
96
- }
97
- ```
98
-
99
- ---
100
-
101
- ## Operation: sign
102
-
103
- Sign an existing WIP file with the specified account.
104
-
105
- ### Input Schema
106
-
107
- ```typescript
108
- SignWip_Input {
109
- wipFilePath: string, // REQUIRED - WIP file path to sign
110
- // Supports: 1) Local file path
111
- // 2) Network URL
112
- account?: string, // OPTIONAL - Signing account (defaults to default account)
113
- outputPath?: string // OPTIONAL - Output file path (defaults to 'signed_' prefix)
114
- }
115
- ```
116
-
117
- ### Output Schema
118
-
119
- ```typescript
120
- SignWip_Output {
121
- filePath: string // Signed WIP file path
122
- }
123
- ```
124
-
125
- ---
126
-
127
- ## Operation: wip2html
128
-
129
- Convert WIP file(s) to HTML format.
130
-
131
- ### Input Schema
132
-
133
- ```typescript
134
- Wip2Html_Input {
135
- wipPath: string, // REQUIRED - WIP file path or directory path
136
- // Supports: 1) Single WIP file (e.g., '/path/to/file.wip')
137
- // 2) Directory containing .wip files
138
- // 3) Network URL
139
- options?: WipToHtmlOptions // OPTIONAL - Conversion options
140
- }
141
-
142
- WipToHtmlOptions {
143
- title?: string, // OPTIONAL - HTML page title
144
- theme?: "light" | "dark", // OPTIONAL - Theme style
145
- outputPath?: string // OPTIONAL - Output file path or directory
146
- }
147
- ```
148
-
149
- ### Output Schema
150
-
151
- ```typescript
152
- Wip2Html_Output {
153
- html?: string, // HTML string content (single file without outputPath)
154
- filePath?: string, // Output file path (when outputPath is specified)
155
- files?: string[] // Converted file path array (when processing directory)
156
- }
157
- ```
158
-
159
- ---
160
-
161
- ## Complete WIP File Structure
162
-
163
- ```typescript
164
- WipFile {
165
- wip: string, // Root identifier (schema URL)
166
- payload: WipPayload, // Content payload
167
- meta: WipMeta // Metadata
168
- }
169
-
170
- WipPayload {
171
- content: WipContent, // Text content
172
- media: WipMedia[] // Media file array (max 10)
173
- }
174
-
175
- WipContent {
176
- text: string, // Text content (max 10000 chars)
177
- format: "plain" | "markdown" | "html" // Text format
178
- }
179
-
180
- WipMedia {
181
- id: string, // Unique media file identifier
182
- type: "image/png" | "image/jpeg" | "image/gif" | "image/webp", // MIME type
183
- data: string, // Base64 encoded file data
184
- filename?: string // Optional file name
185
- }
186
-
187
- WipMeta {
188
- type: "wip", // File type identifier (fixed)
189
- version: string, // Format version number
190
- created: string, // Creation time (ISO 8601 format)
191
- hash: string, // SHA-256 hash of payload (format: sha256:hexString)
192
- algorithm: "sha256", // Hash algorithm (fixed)
193
- signature?: WipSignature | WipSignature[] // Optional digital signature(s)
194
- }
195
-
196
- WipSignature {
197
- value: string, // Base64 encoded signature value
198
- publicKey: string, // Verification public key (Base64 32 bytes) or DID
199
- algorithm: "Ed25519", // Signature algorithm (fixed)
200
- address?: string // Signer address
201
- }
202
- ```
203
-
204
- ---
205
-
206
- ## Constraints
207
-
208
- | Constraint | Value |
209
- |------------|-------|
210
- | Max image size | 2MB per image |
211
- | Max total size | 10MB |
212
- | Max image count | 10 images |
213
- | Max text length | 10000 characters |
214
- | Schema URL | https://schema.wip.wowok.net/v1 |
215
- | Version | 1.0.0 |
216
-
217
- ---
218
-
219
- ## WIP Operation Output (Discriminated Union)
220
-
221
- ```typescript
222
- WipOperationOutput =
223
- | { type: "generate"; filePath: string }
224
- | {
225
- type: "verify";
226
- valid: boolean;
227
- error?: string;
228
- hashValid: boolean;
229
- signatureValid?: boolean;
230
- hasSignature: boolean;
231
- signatures?: any[];
232
- }
233
- | { type: "sign"; filePath: string }
234
- | {
235
- type: "wip2html";
236
- html?: string;
237
- filePath?: string;
238
- files?: string[];
239
- }
240
- ```