wowok_agent 2.1.29 → 2.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -3
- package/dist/index.js +12 -11
- package/dist/schema/call/handler.d.ts +2 -1
- package/dist/schema/call/handler.js +3 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2958,7 +2958,6 @@ declare const OnchainOperationsSchema: z.ZodDiscriminatedUnion<"operation_type",
|
|
|
2958
2958
|
pause?: boolean | undefined;
|
|
2959
2959
|
publish?: boolean | undefined;
|
|
2960
2960
|
}>;
|
|
2961
|
-
json_or_markdown_file: z.ZodOptional<z.ZodString>;
|
|
2962
2961
|
env: z.ZodOptional<z.ZodObject<{
|
|
2963
2962
|
account: z.ZodDefault<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
|
|
2964
2963
|
permission_guard: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -3345,7 +3344,6 @@ declare const OnchainOperationsSchema: z.ZodDiscriminatedUnion<"operation_type",
|
|
|
3345
3344
|
permission_guard?: string[] | undefined;
|
|
3346
3345
|
referrer?: string | undefined;
|
|
3347
3346
|
} | undefined;
|
|
3348
|
-
json_or_markdown_file?: string | undefined;
|
|
3349
3347
|
}, {
|
|
3350
3348
|
data: {
|
|
3351
3349
|
object: string | {
|
|
@@ -3533,7 +3531,6 @@ declare const OnchainOperationsSchema: z.ZodDiscriminatedUnion<"operation_type",
|
|
|
3533
3531
|
permission_guard?: string[] | undefined;
|
|
3534
3532
|
referrer?: string | undefined;
|
|
3535
3533
|
} | undefined;
|
|
3536
|
-
json_or_markdown_file?: string | undefined;
|
|
3537
3534
|
}>, z.ZodObject<{
|
|
3538
3535
|
operation_type: z.ZodLiteral<"progress">;
|
|
3539
3536
|
data: z.ZodObject<{
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,8 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
4
4
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
5
|
import { readFileSync } from "fs";
|
|
6
6
|
import { resolve } from "path";
|
|
7
|
-
|
|
7
|
+
// Read package.json
|
|
8
|
+
const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
|
|
8
9
|
// Import schema
|
|
9
10
|
import { CallService_DataSchema, CallMachine_DataSchema, MachineNode2File_InputSchema, MachineNode2File_OutputWrappedSchema, CallProgress_DataSchema, CallPermission_DataSchema, CallGuard_DataSchema, Guard2File_InputSchema, Guard2File_OutputWrappedSchema, CallArbitration_DataSchema, CallRepository_DataSchema, CallContact_DataSchema, CallTreasury_DataSchema, CallReward_DataSchema, CallAllocation_DataSchema, CallPersonal_DataSchema, CallPayment_DataSchema, CallDemand_DataSchema, CallOrder_DataSchema, CallEnvSchema, SubmissionCallSchema, strictParse, CallOutputSchema, handleCallResult, createServerConfig, createCapabilitiesConfig, createToolMeta, transformSubmission, getEnvConfig, WipGenerationOptionsSchema, WipToHtmlOptionsSchema, TokenDataFilterSchema, LocalInfoFilterSchema, LocalMarkFilterSchema, AccountFilterSchema, TokenTypeSchema, OnchainEventsInputSchema, OnchainEventsResultSchema, ProtocolInfoQuerySchema, ProtocolInfoResultSchema, WatchQueryOperationsResultSchema, NameOrAddressSchema, AccountOrMark_AddressSchema, ObjectTypeSchema, AccountOperationOutputWrappedSchema, LocalMarkOperationOutputWrappedSchema, LocalInfoOperationOutputWrappedSchema, WipOperationOutputSchema, MessengerOperationOutputSchema, AccountOperationSchema, LocalMarkOperationSchema, LocalInfoOperationSchema, parseMachineNodesFromText, formatNodeErrors as formatMachineNodeErrors, MessengerOperationInputSchema, } from "./schema/index.js";
|
|
10
11
|
// Import wowok SDK
|
|
@@ -112,8 +113,8 @@ Token amounts are HIGHLY SENSITIVE. Always:
|
|
|
112
113
|
- guard2file
|
|
113
114
|
- machineNode2file
|
|
114
115
|
`;
|
|
115
|
-
// Create server instance
|
|
116
|
-
const server = new McpServer(createServerConfig(packageJson), createCapabilitiesConfig());
|
|
116
|
+
// Create server instance with SERVER_DESCRIPTION
|
|
117
|
+
const server = new McpServer(createServerConfig(packageJson, SERVER_DESCRIPTION), createCapabilitiesConfig());
|
|
117
118
|
// ================================================
|
|
118
119
|
// Helper Functions
|
|
119
120
|
// ================================================
|
|
@@ -172,7 +173,6 @@ const OnchainOperationsSchema = z.discriminatedUnion("operation_type", [
|
|
|
172
173
|
z.object({
|
|
173
174
|
operation_type: z.literal("machine"),
|
|
174
175
|
data: CallMachine_DataSchema,
|
|
175
|
-
json_or_markdown_file: z.string().optional().describe("Path to a JSON or Markdown file containing the node definition. File content will be parsed and used to set nodes. If parsing fails, error will include line number and node information."),
|
|
176
176
|
env: CallEnvSchema.optional(),
|
|
177
177
|
submission: SubmissionCallSchema.optional(),
|
|
178
178
|
}).describe("⚙️ Machine Object: Design and deploy automated workflow templates (Machines) that define how services are delivered, etc.."),
|
|
@@ -393,25 +393,26 @@ async function handleOnchainOperations(args) {
|
|
|
393
393
|
return handleCallResult(result);
|
|
394
394
|
}
|
|
395
395
|
case "machine": {
|
|
396
|
-
// Handle json_or_markdown_file if provided
|
|
397
|
-
if (validated.json_or_markdown_file
|
|
396
|
+
// Handle json_or_markdown_file in data.node if provided
|
|
397
|
+
if (validated.data.node && typeof validated.data.node === 'object' && 'json_or_markdown_file' in validated.data.node) {
|
|
398
|
+
const filePathStr = validated.data.node.json_or_markdown_file;
|
|
398
399
|
let fileContent;
|
|
399
400
|
try {
|
|
400
|
-
const filePath = resolve(
|
|
401
|
+
const filePath = resolve(filePathStr);
|
|
401
402
|
fileContent = readFileSync(filePath, 'utf-8');
|
|
402
403
|
}
|
|
403
404
|
catch (e) {
|
|
404
|
-
throw new Error(`Failed to read file '${
|
|
405
|
+
throw new Error(`Failed to read file '${filePathStr}': ${e.message}`);
|
|
405
406
|
}
|
|
406
407
|
const parseResult = parseMachineNodesFromText(fileContent);
|
|
407
408
|
if (!parseResult.success) {
|
|
408
409
|
const errorMessages = formatMachineNodeErrors(parseResult.errors);
|
|
409
|
-
throw new Error(`Machine node validation failed for file '${
|
|
410
|
+
throw new Error(`Machine node validation failed for file '${filePathStr}':\n\n${errorMessages}`);
|
|
410
411
|
}
|
|
411
412
|
if (!parseResult.data) {
|
|
412
|
-
throw new Error(`No nodes found in file '${
|
|
413
|
+
throw new Error(`No nodes found in file '${filePathStr}'`);
|
|
413
414
|
}
|
|
414
|
-
//
|
|
415
|
+
// Replace data.node with parsed nodes (set operation with replace)
|
|
415
416
|
validated.data.node = {
|
|
416
417
|
op: "set",
|
|
417
418
|
nodes: parseResult.data,
|
|
@@ -12,9 +12,10 @@ export declare function handleCallResult(result: any): {
|
|
|
12
12
|
/**
|
|
13
13
|
* Create standard MCP Server configuration
|
|
14
14
|
* @param packageJson package.json content
|
|
15
|
+
* @param description server description (overrides packageJson.description)
|
|
15
16
|
* @returns MCP Server configuration
|
|
16
17
|
*/
|
|
17
|
-
export declare function createServerConfig(packageJson: any): {
|
|
18
|
+
export declare function createServerConfig(packageJson: any, description?: string): {
|
|
18
19
|
name: any;
|
|
19
20
|
version: any;
|
|
20
21
|
description: any;
|
|
@@ -85,13 +85,14 @@ export function handleCallResult(result) {
|
|
|
85
85
|
/**
|
|
86
86
|
* Create standard MCP Server configuration
|
|
87
87
|
* @param packageJson package.json content
|
|
88
|
+
* @param description server description (overrides packageJson.description)
|
|
88
89
|
* @returns MCP Server configuration
|
|
89
90
|
*/
|
|
90
|
-
export function createServerConfig(packageJson) {
|
|
91
|
+
export function createServerConfig(packageJson, description) {
|
|
91
92
|
return {
|
|
92
93
|
name: packageJson.name,
|
|
93
94
|
version: packageJson.version,
|
|
94
|
-
description: packageJson.description,
|
|
95
|
+
description: description || packageJson.description,
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
98
|
/**
|