@wowok/agent-mcp 2.6.9 → 2.7.1
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 +0 -2
- package/dist/customer/risk-assessment.d.ts +5 -1
- package/dist/customer/risk-assessment.js +4 -4
- package/dist/evaluation/arbitration-game.d.ts +16 -0
- package/dist/evaluation/arbitration-game.js +48 -0
- package/dist/evaluation/builtins/demand-match.d.ts +15 -0
- package/dist/evaluation/builtins/demand-match.js +153 -0
- package/dist/evaluation/builtins/index.d.ts +3 -0
- package/dist/evaluation/builtins/index.js +10 -0
- package/dist/evaluation/builtins/service-risk.d.ts +6 -0
- package/dist/evaluation/builtins/service-risk.js +55 -0
- package/dist/evaluation/capability.d.ts +50 -0
- package/dist/evaluation/capability.js +13 -0
- package/dist/evaluation/composer.d.ts +13 -0
- package/dist/evaluation/composer.js +40 -0
- package/dist/evaluation/engine.d.ts +18 -0
- package/dist/evaluation/engine.js +175 -0
- package/dist/evaluation/extract.d.ts +30 -0
- package/dist/evaluation/extract.js +115 -0
- package/dist/evaluation/gap.d.ts +2 -0
- package/dist/evaluation/gap.js +100 -0
- package/dist/evaluation/index.d.ts +11 -0
- package/dist/evaluation/index.js +11 -0
- package/dist/evaluation/node-game.d.ts +34 -0
- package/dist/evaluation/node-game.js +57 -0
- package/dist/evaluation/region.d.ts +10 -0
- package/dist/evaluation/region.js +36 -0
- package/dist/evaluation/types.d.ts +76 -0
- package/dist/evaluation/types.js +1 -0
- package/dist/evaluation/user-injection.d.ts +6 -0
- package/dist/evaluation/user-injection.js +27 -0
- package/dist/examples/education-contact-create.json +40 -0
- package/dist/examples/freelance-contact-create.json +40 -0
- package/dist/examples/insurance-machine-create.json +1 -1
- package/dist/examples/insurance-service-allocators.json +1 -1
- package/dist/examples/machine-publish.json +1 -1
- package/dist/examples/rental-ziroom-service-create.json +1 -1
- package/dist/examples/retail-adv-guard-messenger-proof-create.json +1 -1
- package/dist/examples/retail-myshop-service-create.json +1 -1
- package/dist/examples/retail-myshop-service-customer-required.json +1 -1
- package/dist/examples/subscription-contact-create.json +40 -0
- package/dist/examples/threebody-machine-create.json +1 -1
- package/dist/examples/travel-machine-create.json +1 -1
- package/dist/examples/travel-service-create.json +1 -1
- package/dist/harness/plan.js +42 -3
- package/dist/intent/enrich.d.ts +1 -0
- package/dist/intent/enrich.js +67 -0
- package/dist/intent/index.d.ts +23 -0
- package/dist/intent/index.js +60 -0
- package/dist/intent/matcher.d.ts +2 -0
- package/dist/intent/matcher.js +81 -0
- package/dist/intent/store.d.ts +19 -0
- package/dist/intent/store.js +55 -0
- package/dist/intent/types.d.ts +33 -0
- package/dist/intent/types.js +10 -0
- package/dist/knowledge/arbitration-risk.js +1 -11
- package/dist/knowledge/contact-templates.d.ts +27 -0
- package/dist/knowledge/contact-templates.js +60 -0
- package/dist/knowledge/examples-scanner.js +21 -3
- package/dist/knowledge/fund-layer.js +8 -4
- package/dist/knowledge/industry-generalizer.js +21 -21
- package/dist/knowledge/machine-risk.js +0 -1
- package/dist/knowledge/mcp-schema-audit.d.ts +1 -1
- package/dist/knowledge/mcp-schema-audit.js +8 -4
- package/dist/knowledge/service-risk.js +38 -2
- package/dist/knowledge/service-templates.js +1 -1
- package/dist/knowledge/service-translation.js +2 -2
- package/dist/knowledge/template-registry.d.ts +1 -1
- package/dist/knowledge/template-registry.js +13 -1
- package/dist/knowledge/tools-reference.js +23 -0
- package/dist/persona/analyzer.d.ts +16 -0
- package/dist/persona/analyzer.js +66 -0
- package/dist/persona/bridge.d.ts +5 -0
- package/dist/persona/bridge.js +86 -0
- package/dist/persona/defaults.d.ts +4 -0
- package/dist/persona/defaults.js +195 -0
- package/dist/persona/experience-bridge.d.ts +3 -0
- package/dist/persona/experience-bridge.js +23 -0
- package/dist/persona/index.d.ts +18 -0
- package/dist/persona/index.js +71 -0
- package/dist/persona/model.d.ts +7 -0
- package/dist/persona/model.js +111 -0
- package/dist/persona/store.d.ts +19 -0
- package/dist/persona/store.js +62 -0
- package/dist/persona/types.d.ts +43 -0
- package/dist/persona/types.js +5 -0
- package/dist/project/handlers.d.ts +5 -0
- package/dist/project/handlers.js +23 -1
- package/dist/project/semantic-graph.js +47 -0
- package/dist/rules.d.ts +2 -0
- package/dist/rules.js +43 -0
- package/dist/schema/call/semantic.js +23 -1
- package/dist/schema/call/service.js +7 -1
- package/dist/schema/evaluation/index.d.ts +4239 -0
- package/dist/schema/evaluation/index.js +356 -0
- package/dist/schema/index.d.ts +4 -0
- package/dist/schema/index.js +4 -0
- package/dist/schema/intent-radar/index.d.ts +284 -0
- package/dist/schema/intent-radar/index.js +89 -0
- package/dist/schema/messenger/index.d.ts +171 -0
- package/dist/schema/messenger/index.js +5 -0
- package/dist/schema/operations.js +1 -1
- package/dist/schema/persona/index.d.ts +1985 -0
- package/dist/schema/persona/index.js +148 -0
- package/dist/schema/project/index.d.ts +2 -2
- package/dist/schema/query/index.js +6 -0
- package/dist/schema/sync-layer4.d.ts +1 -1
- package/dist/schema/sync-layer4.js +9 -5
- package/dist/schema/task-status.d.ts +168 -0
- package/dist/schema/task-status.js +36 -0
- package/dist/schema/trust/index.js +1 -1
- package/dist/schemas/evaluation_operation.output.json +677 -0
- package/dist/schemas/evaluation_operation.schema.json +903 -0
- package/dist/schemas/index.json +25 -1
- package/dist/schemas/intent_radar.output.json +229 -0
- package/dist/schemas/intent_radar.schema.json +135 -0
- package/dist/schemas/messenger_operation.output.json +14 -0
- package/dist/schemas/messenger_operation.schema.json +18 -0
- package/dist/schemas/onchain_operations.schema.json +2 -2
- package/dist/schemas/onchain_operations_service.schema.json +2 -2
- package/dist/schemas/persona_operation.output.json +389 -0
- package/dist/schemas/persona_operation.schema.json +247 -0
- package/dist/schemas/query_task_status.output.json +115 -0
- package/dist/schemas/query_task_status.schema.json +24 -0
- package/dist/schemas/query_toolkit.output.json +1 -1
- package/dist/schemas/trust_score.schema.json +1 -1
- package/dist/tools/handlers/evaluation.d.ts +2 -0
- package/dist/tools/handlers/evaluation.js +123 -0
- package/dist/tools/handlers/intent-radar.d.ts +2 -0
- package/dist/tools/handlers/intent-radar.js +76 -0
- package/dist/tools/handlers/onchain.js +98 -0
- package/dist/tools/handlers/persona.d.ts +4 -0
- package/dist/tools/handlers/persona.js +89 -0
- package/dist/tools/handlers/task-status.d.ts +0 -168
- package/dist/tools/handlers/task-status.js +0 -29
- package/dist/tools/index.js +83 -7
- package/dist/tools/wip-deploy-assist.d.ts +1 -1
- package/dist/tools/wip-deploy-assist.js +33 -5
- package/package.json +2 -2
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const IndustryEnum = z.enum(["freelance", "rental", "education", "travel", "subscription", "retail"]);
|
|
3
|
+
const RoleEnum = z.enum(["merchant", "user", "arbitrator"]);
|
|
4
|
+
const ScopeEnum = z.enum(["system", "account"]);
|
|
5
|
+
const PersonaIdentitySchema = z
|
|
6
|
+
.object({
|
|
7
|
+
region: z.string().optional(),
|
|
8
|
+
languages: z.array(z.string()).optional(),
|
|
9
|
+
self_description: z.string().optional(),
|
|
10
|
+
})
|
|
11
|
+
.strict();
|
|
12
|
+
const PersonaLayerSchema = z
|
|
13
|
+
.object({
|
|
14
|
+
identity: PersonaIdentitySchema.optional(),
|
|
15
|
+
preferences: z.record(z.unknown()).optional(),
|
|
16
|
+
strategy: z.array(z.string()).optional(),
|
|
17
|
+
rules: z.array(z.string()).optional(),
|
|
18
|
+
requirements: z.array(z.string()).optional(),
|
|
19
|
+
spec: z.string().optional(),
|
|
20
|
+
})
|
|
21
|
+
.strict();
|
|
22
|
+
const PersonaSchema = z
|
|
23
|
+
.object({
|
|
24
|
+
version: z.number(),
|
|
25
|
+
scope: ScopeEnum,
|
|
26
|
+
account: z.string().optional(),
|
|
27
|
+
role: RoleEnum,
|
|
28
|
+
industries: z.array(IndustryEnum),
|
|
29
|
+
long_term: PersonaLayerSchema,
|
|
30
|
+
current: PersonaLayerSchema,
|
|
31
|
+
updated_at: z.number(),
|
|
32
|
+
})
|
|
33
|
+
.strict();
|
|
34
|
+
const PersonaSourceSchema = z
|
|
35
|
+
.object({
|
|
36
|
+
scope: ScopeEnum,
|
|
37
|
+
account: z.string().optional(),
|
|
38
|
+
part: z.enum(["long_term", "current"]),
|
|
39
|
+
})
|
|
40
|
+
.strict();
|
|
41
|
+
const EffectivePersonaSchema = z
|
|
42
|
+
.object({
|
|
43
|
+
scope: ScopeEnum,
|
|
44
|
+
account: z.string().optional(),
|
|
45
|
+
role: RoleEnum,
|
|
46
|
+
industries: z.array(IndustryEnum),
|
|
47
|
+
layer: PersonaLayerSchema,
|
|
48
|
+
sources: z.array(PersonaSourceSchema),
|
|
49
|
+
})
|
|
50
|
+
.strict();
|
|
51
|
+
const PersonaAnalysisSuggestionSchema = z
|
|
52
|
+
.object({
|
|
53
|
+
field: z.string(),
|
|
54
|
+
value: z.unknown(),
|
|
55
|
+
reason: z.string(),
|
|
56
|
+
})
|
|
57
|
+
.strict();
|
|
58
|
+
const PersonaAnalysisSchema = z
|
|
59
|
+
.object({
|
|
60
|
+
role: RoleEnum.optional(),
|
|
61
|
+
industries: z.array(IndustryEnum),
|
|
62
|
+
preferences: z.record(z.unknown()),
|
|
63
|
+
requirements: z.array(z.string()),
|
|
64
|
+
rules: z.array(z.string()),
|
|
65
|
+
suggestions: z.array(PersonaAnalysisSuggestionSchema),
|
|
66
|
+
confidence: z.number(),
|
|
67
|
+
})
|
|
68
|
+
.strict();
|
|
69
|
+
export const PersonaOperationInputSchema = z.discriminatedUnion("action", [
|
|
70
|
+
z.object({
|
|
71
|
+
action: z.literal("get"),
|
|
72
|
+
account: z.string().optional().describe("Chain account address; omitted = system only."),
|
|
73
|
+
industry: IndustryEnum.optional(),
|
|
74
|
+
role: RoleEnum.optional(),
|
|
75
|
+
}).strict(),
|
|
76
|
+
z.object({
|
|
77
|
+
action: z.literal("list"),
|
|
78
|
+
}).strict(),
|
|
79
|
+
z.object({
|
|
80
|
+
action: z.literal("set"),
|
|
81
|
+
scope: ScopeEnum,
|
|
82
|
+
account: z.string().optional().describe("Required when scope=account."),
|
|
83
|
+
role: RoleEnum,
|
|
84
|
+
industries: z.array(IndustryEnum).default([]),
|
|
85
|
+
long_term: PersonaLayerSchema.optional(),
|
|
86
|
+
current: PersonaLayerSchema.optional(),
|
|
87
|
+
}).strict(),
|
|
88
|
+
z.object({
|
|
89
|
+
action: z.literal("analyze"),
|
|
90
|
+
context: z.string().describe("Free-form context: website URL, experience summary, self description, goal."),
|
|
91
|
+
}).strict(),
|
|
92
|
+
z.object({
|
|
93
|
+
action: z.literal("apply"),
|
|
94
|
+
context: z.string().describe("Free-form context whose extracted signals feed the CURRENT layer."),
|
|
95
|
+
scope: ScopeEnum,
|
|
96
|
+
account: z.string().optional(),
|
|
97
|
+
role: RoleEnum.optional(),
|
|
98
|
+
industries: z.array(IndustryEnum).optional(),
|
|
99
|
+
mode: z.enum(["merge", "replace"]).optional().describe("merge (default) unions strategy/rules/requirements into current; replace discards the existing current layer."),
|
|
100
|
+
}).strict(),
|
|
101
|
+
z.object({
|
|
102
|
+
action: z.literal("sync"),
|
|
103
|
+
account: z.string().optional().describe("Account whose behavior (experience layer) is merged into its CURRENT layer. Omit to sync the system persona."),
|
|
104
|
+
}).strict(),
|
|
105
|
+
z.object({
|
|
106
|
+
action: z.literal("remove"),
|
|
107
|
+
scope: ScopeEnum,
|
|
108
|
+
account: z.string().optional(),
|
|
109
|
+
}).strict(),
|
|
110
|
+
]);
|
|
111
|
+
export const PersonaOperationOutputSchema = z.discriminatedUnion("action", [
|
|
112
|
+
z.object({
|
|
113
|
+
action: z.literal("get"),
|
|
114
|
+
effective: EffectivePersonaSchema,
|
|
115
|
+
context_text: z.string(),
|
|
116
|
+
injection: z.record(z.unknown()),
|
|
117
|
+
}).strict(),
|
|
118
|
+
z.object({
|
|
119
|
+
action: z.literal("list"),
|
|
120
|
+
personas: z.array(PersonaSchema),
|
|
121
|
+
defaults: z.array(PersonaSchema),
|
|
122
|
+
}).strict(),
|
|
123
|
+
z.object({
|
|
124
|
+
action: z.literal("set"),
|
|
125
|
+
persona: PersonaSchema,
|
|
126
|
+
line_count: z.number(),
|
|
127
|
+
}).strict(),
|
|
128
|
+
z.object({
|
|
129
|
+
action: z.literal("analyze"),
|
|
130
|
+
analysis: PersonaAnalysisSchema,
|
|
131
|
+
}).strict(),
|
|
132
|
+
z.object({
|
|
133
|
+
action: z.literal("apply"),
|
|
134
|
+
persona: PersonaSchema,
|
|
135
|
+
effective: EffectivePersonaSchema,
|
|
136
|
+
applied: z.array(PersonaAnalysisSuggestionSchema),
|
|
137
|
+
}).strict(),
|
|
138
|
+
z.object({
|
|
139
|
+
action: z.literal("sync"),
|
|
140
|
+
persona: PersonaSchema,
|
|
141
|
+
applied: PersonaLayerSchema,
|
|
142
|
+
effective: EffectivePersonaSchema,
|
|
143
|
+
}).strict(),
|
|
144
|
+
z.object({
|
|
145
|
+
action: z.literal("remove"),
|
|
146
|
+
removed: z.boolean(),
|
|
147
|
+
}).strict(),
|
|
148
|
+
]);
|
|
@@ -398,6 +398,7 @@ export declare const ProjectOperationInputSchema: z.ZodObject<{
|
|
|
398
398
|
intent?: string | undefined;
|
|
399
399
|
project?: string | undefined;
|
|
400
400
|
service_address?: string | undefined;
|
|
401
|
+
save?: boolean | undefined;
|
|
401
402
|
context_objects?: string[] | undefined;
|
|
402
403
|
include_events?: boolean | undefined;
|
|
403
404
|
context_network?: "testnet" | "mainnet" | undefined;
|
|
@@ -443,7 +444,6 @@ export declare const ProjectOperationInputSchema: z.ZodObject<{
|
|
|
443
444
|
diff_address?: string | undefined;
|
|
444
445
|
diff_from_time?: number | undefined;
|
|
445
446
|
diff_to_time?: number | undefined;
|
|
446
|
-
save?: boolean | undefined;
|
|
447
447
|
detail_level?: "summary" | "full" | "detailed" | undefined;
|
|
448
448
|
object_kind?: "guard" | "machine" | undefined;
|
|
449
449
|
edit_format?: "json" | "tree_outline" | undefined;
|
|
@@ -578,6 +578,7 @@ export declare const ProjectOperationInputSchema: z.ZodObject<{
|
|
|
578
578
|
intent?: string | undefined;
|
|
579
579
|
project?: string | undefined;
|
|
580
580
|
service_address?: string | undefined;
|
|
581
|
+
save?: boolean | undefined;
|
|
581
582
|
context_objects?: string[] | undefined;
|
|
582
583
|
include_events?: boolean | undefined;
|
|
583
584
|
context_network?: "testnet" | "mainnet" | undefined;
|
|
@@ -623,7 +624,6 @@ export declare const ProjectOperationInputSchema: z.ZodObject<{
|
|
|
623
624
|
diff_address?: string | undefined;
|
|
624
625
|
diff_from_time?: number | undefined;
|
|
625
626
|
diff_to_time?: number | undefined;
|
|
626
|
-
save?: boolean | undefined;
|
|
627
627
|
detail_level?: "summary" | "full" | "detailed" | undefined;
|
|
628
628
|
object_kind?: "guard" | "machine" | undefined;
|
|
629
629
|
edit_format?: "json" | "tree_outline" | undefined;
|
|
@@ -120,6 +120,12 @@ export const ServiceSaleSchema = z.object({
|
|
|
120
120
|
suspension: z.boolean().describe("Whether sale is suspended"),
|
|
121
121
|
wip: z.string().describe("WIP file URL. EMPTY string \"\" skips verification (TESTING ONLY). " +
|
|
122
122
|
"Production MUST use a real HTTP URL pointing to a .wip file generated by the wip_file tool. " +
|
|
123
|
+
"⚠️ NETWORK DEPLOYMENT REQUIRED: the URL is stored ON-CHAIN and every customer fetches it " +
|
|
124
|
+
"when placing an order. A local file path (C:\\..., /path/file.wip), a localhost/loopback URL " +
|
|
125
|
+
"or a LAN private-IP URL is unreachable by customers on other machines — it passes the " +
|
|
126
|
+
"merchant-side set-time verification but makes order_new abort 100% for customers. " +
|
|
127
|
+
"Either deploy the .wip file to a public endpoint (GitHub Pages / IPFS / your own website) " +
|
|
128
|
+
"and set this to the public URL, or leave it empty (\"\") to skip WIP verification (TESTING ONLY). " +
|
|
123
129
|
"Example: \"https://cdn.example.com/products/phone_v1.wip\""),
|
|
124
130
|
wip_hash: z.string().describe("SHA-256 hash (hex string) of the sale's WIP file, committed on-chain by the merchant. " +
|
|
125
131
|
"BUY RULE: if this is NON-EMPTY, the buyer MUST pass this exact value as wip_hash when creating an order " +
|
|
@@ -2,7 +2,7 @@ import * as fs from 'fs';
|
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
export const LAYER3_DIR = path.resolve('d:/wowok/agent/mcp/dist/schemas');
|
|
4
4
|
export const LAYER4_DIR = path.resolve('c:/Users/zhou/.trae-cn/mcps/s_wowok-7838e181/solo_agent/mcp_wagent/tools');
|
|
5
|
-
export const
|
|
5
|
+
export const ALL_TOOLS = [
|
|
6
6
|
'onchain_operations',
|
|
7
7
|
'account_operation',
|
|
8
8
|
'local_mark_operation',
|
|
@@ -20,6 +20,10 @@ export const TOOLS_17 = [
|
|
|
20
20
|
'project_operation',
|
|
21
21
|
'config_operation',
|
|
22
22
|
'trust_score',
|
|
23
|
+
'query_task_status',
|
|
24
|
+
'evaluation_operation',
|
|
25
|
+
'persona_operation',
|
|
26
|
+
'intent_radar',
|
|
23
27
|
];
|
|
24
28
|
const JSON_SCHEMA_DRAFT7 = 'http://json-schema.org/draft-07/schema#';
|
|
25
29
|
const RECURSIVE_EXTERNAL_FILES = new Set(['guard-node-schema.json']);
|
|
@@ -227,7 +231,7 @@ export function syncDeployedToolDescriptors(options = {}) {
|
|
|
227
231
|
let succeeded = 0;
|
|
228
232
|
let failed = 0;
|
|
229
233
|
const failures = [];
|
|
230
|
-
for (const tool of
|
|
234
|
+
for (const tool of ALL_TOOLS) {
|
|
231
235
|
try {
|
|
232
236
|
const deployed = buildDeployedFile(tool, layer3Dir, layer4Dir, cache);
|
|
233
237
|
const outputPath = path.join(layer4Dir, `${tool}.json`);
|
|
@@ -253,7 +257,7 @@ export function syncDeployedToolDescriptors(options = {}) {
|
|
|
253
257
|
failed++;
|
|
254
258
|
}
|
|
255
259
|
}
|
|
256
|
-
log(`\n✅ Succeeded: ${succeeded}/${
|
|
260
|
+
log(`\n✅ Succeeded: ${succeeded}/${ALL_TOOLS.length}`);
|
|
257
261
|
if (failed > 0) {
|
|
258
262
|
logErr(`❌ Failed: ${failed}`);
|
|
259
263
|
for (const f of failures) {
|
|
@@ -261,7 +265,7 @@ export function syncDeployedToolDescriptors(options = {}) {
|
|
|
261
265
|
}
|
|
262
266
|
}
|
|
263
267
|
else {
|
|
264
|
-
log(
|
|
268
|
+
log(`All ${ALL_TOOLS.length} Layer 4 deployed files are now FULL schemas (no stubs remain).`);
|
|
265
269
|
}
|
|
266
270
|
return {
|
|
267
271
|
ok: succeeded,
|
|
@@ -269,7 +273,7 @@ export function syncDeployedToolDescriptors(options = {}) {
|
|
|
269
273
|
errors: failures,
|
|
270
274
|
layer3Dir,
|
|
271
275
|
layer4Dir,
|
|
272
|
-
total:
|
|
276
|
+
total: ALL_TOOLS.length,
|
|
273
277
|
};
|
|
274
278
|
}
|
|
275
279
|
export function shouldAutoSyncAtStartup() {
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const QueryTaskStatusInputSchema: z.ZodObject<{
|
|
3
|
+
task_id: z.ZodOptional<z.ZodString>;
|
|
4
|
+
project_id: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, "strict", z.ZodTypeAny, {
|
|
6
|
+
project_id?: string | undefined;
|
|
7
|
+
task_id?: string | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
project_id?: string | undefined;
|
|
10
|
+
task_id?: string | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const TaskStateSchema: z.ZodObject<{
|
|
13
|
+
task_id: z.ZodString;
|
|
14
|
+
operation: z.ZodString;
|
|
15
|
+
status: z.ZodEnum<["pending", "running", "completed", "failed", "cancelled"]>;
|
|
16
|
+
progress: z.ZodNumber;
|
|
17
|
+
message: z.ZodString;
|
|
18
|
+
result: z.ZodNullable<z.ZodUnknown>;
|
|
19
|
+
error: z.ZodNullable<z.ZodString>;
|
|
20
|
+
started_at: z.ZodNumber;
|
|
21
|
+
completed_at: z.ZodNullable<z.ZodNumber>;
|
|
22
|
+
project_id: z.ZodNullable<z.ZodString>;
|
|
23
|
+
}, "strict", z.ZodTypeAny, {
|
|
24
|
+
message: string;
|
|
25
|
+
status: "failed" | "completed" | "pending" | "cancelled" | "running";
|
|
26
|
+
error: string | null;
|
|
27
|
+
operation: string;
|
|
28
|
+
progress: number;
|
|
29
|
+
completed_at: number | null;
|
|
30
|
+
project_id: string | null;
|
|
31
|
+
task_id: string;
|
|
32
|
+
started_at: number;
|
|
33
|
+
result?: unknown;
|
|
34
|
+
}, {
|
|
35
|
+
message: string;
|
|
36
|
+
status: "failed" | "completed" | "pending" | "cancelled" | "running";
|
|
37
|
+
error: string | null;
|
|
38
|
+
operation: string;
|
|
39
|
+
progress: number;
|
|
40
|
+
completed_at: number | null;
|
|
41
|
+
project_id: string | null;
|
|
42
|
+
task_id: string;
|
|
43
|
+
started_at: number;
|
|
44
|
+
result?: unknown;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const QueryTaskStatusOutputSchema: z.ZodObject<{
|
|
47
|
+
task_id: z.ZodOptional<z.ZodString>;
|
|
48
|
+
task: z.ZodNullable<z.ZodObject<{
|
|
49
|
+
task_id: z.ZodString;
|
|
50
|
+
operation: z.ZodString;
|
|
51
|
+
status: z.ZodEnum<["pending", "running", "completed", "failed", "cancelled"]>;
|
|
52
|
+
progress: z.ZodNumber;
|
|
53
|
+
message: z.ZodString;
|
|
54
|
+
result: z.ZodNullable<z.ZodUnknown>;
|
|
55
|
+
error: z.ZodNullable<z.ZodString>;
|
|
56
|
+
started_at: z.ZodNumber;
|
|
57
|
+
completed_at: z.ZodNullable<z.ZodNumber>;
|
|
58
|
+
project_id: z.ZodNullable<z.ZodString>;
|
|
59
|
+
}, "strict", z.ZodTypeAny, {
|
|
60
|
+
message: string;
|
|
61
|
+
status: "failed" | "completed" | "pending" | "cancelled" | "running";
|
|
62
|
+
error: string | null;
|
|
63
|
+
operation: string;
|
|
64
|
+
progress: number;
|
|
65
|
+
completed_at: number | null;
|
|
66
|
+
project_id: string | null;
|
|
67
|
+
task_id: string;
|
|
68
|
+
started_at: number;
|
|
69
|
+
result?: unknown;
|
|
70
|
+
}, {
|
|
71
|
+
message: string;
|
|
72
|
+
status: "failed" | "completed" | "pending" | "cancelled" | "running";
|
|
73
|
+
error: string | null;
|
|
74
|
+
operation: string;
|
|
75
|
+
progress: number;
|
|
76
|
+
completed_at: number | null;
|
|
77
|
+
project_id: string | null;
|
|
78
|
+
task_id: string;
|
|
79
|
+
started_at: number;
|
|
80
|
+
result?: unknown;
|
|
81
|
+
}>>;
|
|
82
|
+
tasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
83
|
+
task_id: z.ZodString;
|
|
84
|
+
operation: z.ZodString;
|
|
85
|
+
status: z.ZodEnum<["pending", "running", "completed", "failed", "cancelled"]>;
|
|
86
|
+
progress: z.ZodNumber;
|
|
87
|
+
message: z.ZodString;
|
|
88
|
+
result: z.ZodNullable<z.ZodUnknown>;
|
|
89
|
+
error: z.ZodNullable<z.ZodString>;
|
|
90
|
+
started_at: z.ZodNumber;
|
|
91
|
+
completed_at: z.ZodNullable<z.ZodNumber>;
|
|
92
|
+
project_id: z.ZodNullable<z.ZodString>;
|
|
93
|
+
}, "strict", z.ZodTypeAny, {
|
|
94
|
+
message: string;
|
|
95
|
+
status: "failed" | "completed" | "pending" | "cancelled" | "running";
|
|
96
|
+
error: string | null;
|
|
97
|
+
operation: string;
|
|
98
|
+
progress: number;
|
|
99
|
+
completed_at: number | null;
|
|
100
|
+
project_id: string | null;
|
|
101
|
+
task_id: string;
|
|
102
|
+
started_at: number;
|
|
103
|
+
result?: unknown;
|
|
104
|
+
}, {
|
|
105
|
+
message: string;
|
|
106
|
+
status: "failed" | "completed" | "pending" | "cancelled" | "running";
|
|
107
|
+
error: string | null;
|
|
108
|
+
operation: string;
|
|
109
|
+
progress: number;
|
|
110
|
+
completed_at: number | null;
|
|
111
|
+
project_id: string | null;
|
|
112
|
+
task_id: string;
|
|
113
|
+
started_at: number;
|
|
114
|
+
result?: unknown;
|
|
115
|
+
}>, "many">>;
|
|
116
|
+
}, "strict", z.ZodTypeAny, {
|
|
117
|
+
task: {
|
|
118
|
+
message: string;
|
|
119
|
+
status: "failed" | "completed" | "pending" | "cancelled" | "running";
|
|
120
|
+
error: string | null;
|
|
121
|
+
operation: string;
|
|
122
|
+
progress: number;
|
|
123
|
+
completed_at: number | null;
|
|
124
|
+
project_id: string | null;
|
|
125
|
+
task_id: string;
|
|
126
|
+
started_at: number;
|
|
127
|
+
result?: unknown;
|
|
128
|
+
} | null;
|
|
129
|
+
task_id?: string | undefined;
|
|
130
|
+
tasks?: {
|
|
131
|
+
message: string;
|
|
132
|
+
status: "failed" | "completed" | "pending" | "cancelled" | "running";
|
|
133
|
+
error: string | null;
|
|
134
|
+
operation: string;
|
|
135
|
+
progress: number;
|
|
136
|
+
completed_at: number | null;
|
|
137
|
+
project_id: string | null;
|
|
138
|
+
task_id: string;
|
|
139
|
+
started_at: number;
|
|
140
|
+
result?: unknown;
|
|
141
|
+
}[] | undefined;
|
|
142
|
+
}, {
|
|
143
|
+
task: {
|
|
144
|
+
message: string;
|
|
145
|
+
status: "failed" | "completed" | "pending" | "cancelled" | "running";
|
|
146
|
+
error: string | null;
|
|
147
|
+
operation: string;
|
|
148
|
+
progress: number;
|
|
149
|
+
completed_at: number | null;
|
|
150
|
+
project_id: string | null;
|
|
151
|
+
task_id: string;
|
|
152
|
+
started_at: number;
|
|
153
|
+
result?: unknown;
|
|
154
|
+
} | null;
|
|
155
|
+
task_id?: string | undefined;
|
|
156
|
+
tasks?: {
|
|
157
|
+
message: string;
|
|
158
|
+
status: "failed" | "completed" | "pending" | "cancelled" | "running";
|
|
159
|
+
error: string | null;
|
|
160
|
+
operation: string;
|
|
161
|
+
progress: number;
|
|
162
|
+
completed_at: number | null;
|
|
163
|
+
project_id: string | null;
|
|
164
|
+
task_id: string;
|
|
165
|
+
started_at: number;
|
|
166
|
+
result?: unknown;
|
|
167
|
+
}[] | undefined;
|
|
168
|
+
}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const QueryTaskStatusInputSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
task_id: z
|
|
5
|
+
.string()
|
|
6
|
+
.optional()
|
|
7
|
+
.describe("The task ID to query (returned by a prior async operation). " +
|
|
8
|
+
"If omitted, lists all recent tasks (most recent first, max 50)."),
|
|
9
|
+
project_id: z
|
|
10
|
+
.string()
|
|
11
|
+
.optional()
|
|
12
|
+
.describe("Optional filter — when listing tasks (task_id omitted), only return tasks for this project."),
|
|
13
|
+
})
|
|
14
|
+
.strict()
|
|
15
|
+
.describe("Query the status of an async task, or list all recent tasks when task_id is omitted.");
|
|
16
|
+
export const TaskStateSchema = z
|
|
17
|
+
.object({
|
|
18
|
+
task_id: z.string().describe("Unique task identifier."),
|
|
19
|
+
operation: z.string().describe("Operation type that created this task (e.g. 'build_graph')."),
|
|
20
|
+
status: z.enum(["pending", "running", "completed", "failed", "cancelled"]).describe("Current task status."),
|
|
21
|
+
progress: z.number().describe("Progress percentage 0-100."),
|
|
22
|
+
message: z.string().describe("Human-readable progress message."),
|
|
23
|
+
result: z.unknown().nullable().describe("Result payload (set when status='completed'). null otherwise."),
|
|
24
|
+
error: z.string().nullable().describe("Error message (set when status='failed'). null otherwise."),
|
|
25
|
+
started_at: z.number().describe("Timestamp (ms) when the task was created."),
|
|
26
|
+
completed_at: z.number().nullable().describe("Timestamp (ms) when the task reached a terminal state. null if still running."),
|
|
27
|
+
project_id: z.string().nullable().describe("Project ID associated with this task, if any."),
|
|
28
|
+
})
|
|
29
|
+
.strict();
|
|
30
|
+
export const QueryTaskStatusOutputSchema = z
|
|
31
|
+
.object({
|
|
32
|
+
task_id: z.string().optional().describe("The queried task ID (present when a single task was queried)."),
|
|
33
|
+
task: TaskStateSchema.nullable().describe("The task state. null if task_id not found or when listing."),
|
|
34
|
+
tasks: z.array(TaskStateSchema).optional().describe("List of tasks (present when task_id was omitted)."),
|
|
35
|
+
})
|
|
36
|
+
.strict();
|
|
@@ -110,7 +110,7 @@ export const TrustScoreInputSchema = z
|
|
|
110
110
|
"If omitted at depth=preorder, the industry is inferred from the puzzle."),
|
|
111
111
|
preferences: PreorderPreferencesInputSchema.optional().describe("Optional user preference overrides (partial; merged over profile-derived defaults). " +
|
|
112
112
|
"Only used at depth=preorder for preference matching and pref-aware strategies."),
|
|
113
|
-
user_metrics: UserMetricsInputSchema.optional().describe("Optional user-controllable scoring factors
|
|
113
|
+
user_metrics: UserMetricsInputSchema.optional().describe("Optional user-controllable scoring factors. " +
|
|
114
114
|
"Evaluated at depth=preorder; the composite adjustment (±cap) nudges the order confidence score."),
|
|
115
115
|
network: z
|
|
116
116
|
.string()
|