@wowok/agent-mcp 3.2.0 → 3.2.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/dist/config/exposure.d.ts +8 -8
- package/dist/config/judgment.d.ts +20 -20
- package/dist/config/rule-engine.d.ts +20 -20
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/graph/onchain/facts.js +1 -1
- package/dist/graph/onchain/sdk-batch.d.ts +1 -0
- package/dist/graph/onchain/sdk-batch.js +1 -1
- package/dist/graph/onchain/sdk-dataplane.d.ts +1 -0
- package/dist/graph/onchain/sdk-dataplane.js +1 -1
- package/dist/knowledge/allocation-templates.d.ts +1 -1
- package/dist/knowledge/allocation-templates.js +1 -1
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +1 -1
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/builtin-templates.d.ts +1 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/discount-threshold.d.ts +15 -0
- package/dist/knowledge/discount-threshold.js +1 -0
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.d.ts +2 -2
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-generalizer.d.ts +38 -1
- package/dist/knowledge/industry-generalizer.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/industry-strategy.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/onchain-constants.d.ts +2 -2
- package/dist/knowledge/onchain-constants.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +10 -0
- package/dist/knowledge/strategy-manuals.d.ts +1 -1
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-loader.d.ts +20 -0
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/arbitrator-interest.js +1 -1
- package/dist/participation/customer-interest.js +1 -1
- package/dist/participation/merchant-interest.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/mode-actions.d.ts +12 -1
- package/dist/playbooks/service-build/mode-actions.js +1 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/reverse-mapping-refund-p0-5.spec.d.ts +1 -0
- package/dist/playbooks/service-build/reverse-mapping-refund-p0-5.spec.js +1 -0
- package/dist/playbooks/service-build/reverse-mapping.js +1 -1
- package/dist/playbooks/service-build/semantic-graph.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/role/profiles.js +1 -1
- package/dist/role/types.d.ts +2 -0
- package/dist/role/types.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/call/allocation.d.ts +7 -7
- package/dist/schema/call/arbitration.d.ts +1 -1
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +5 -5
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +5 -9
- package/dist/schema/call/bridge.js +1 -1
- package/dist/schema/call/contact.d.ts +1 -1
- package/dist/schema/call/demand.d.ts +1 -1
- package/dist/schema/call/guard.d.ts +11 -11
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +2 -2
- package/dist/schema/call/order.d.ts +1 -1
- package/dist/schema/call/payment.d.ts +1 -1
- package/dist/schema/call/permission.d.ts +1 -1
- package/dist/schema/call/personal.d.ts +1 -1
- package/dist/schema/call/progress.d.ts +1 -1
- package/dist/schema/call/proof.d.ts +2 -2
- package/dist/schema/call/repository.d.ts +1 -1
- package/dist/schema/call/reward.d.ts +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +5 -5
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/call/treasury.d.ts +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/evaluation/index.d.ts +6 -2
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/index.d.ts +8 -8
- package/dist/schema/goal/planning.d.ts +15 -15
- package/dist/schema/industry-pack/index.d.ts +15 -0
- package/dist/schema/industry-pack/modes.d.ts +15 -0
- package/dist/schema/industry-pack/modes.js +1 -1
- package/dist/schema/intent-radar/index.d.ts +3 -0
- package/dist/schema/intent-radar/index.js +1 -1
- package/dist/schema/local/index.d.ts +577 -18
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +140 -20
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +30 -28
- package/dist/schema/operations.js +1 -1
- package/dist/schema/persona/index.d.ts +708 -708
- package/dist/schema/persona/index.js +1 -1
- package/dist/schema/query/bi.d.ts +20 -6
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +32 -32
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-query/index.d.ts +3 -3
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/watch/index.d.ts +2 -2
- package/dist/schema/workflow/index.d.ts +2 -2
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +6 -2
- package/dist/schemas/account_operation.schema.json +1 -1
- package/dist/schemas/bridge_operation.schema.json +2 -10
- package/dist/schemas/evaluation_operation.output.json +2 -0
- package/dist/schemas/evaluation_operation.schema.json +2 -0
- package/dist/schemas/index.json +7 -1
- package/dist/schemas/industry_pack_operation.output.json +87 -4
- package/dist/schemas/intent_radar.output.json +2 -0
- package/dist/schemas/intent_radar.schema.json +1 -0
- package/dist/schemas/local_cache_operation.output.json +1536 -0
- package/dist/schemas/local_cache_operation.schema.json +101 -0
- package/dist/schemas/local_mark_operation.output.json +51 -36
- package/dist/schemas/local_mark_operation.schema.json +1 -0
- package/dist/schemas/messenger_operation.schema.json +358 -35
- package/dist/schemas/onchain_operations.schema.json +10 -10
- package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
- package/dist/schemas/onchain_operations_arbitration.schema.json +3 -3
- package/dist/schemas/onchain_operations_payment.schema.json +1 -1
- package/dist/schemas/onchain_operations_reward.schema.json +1 -1
- package/dist/schemas/onchain_operations_service.schema.json +3 -3
- package/dist/schemas/onchain_operations_treasury.schema.json +1 -1
- package/dist/schemas/onchain_table_data.output.json +11 -0
- package/dist/schemas/query_toolkit.output.json +11 -4
- package/dist/schemas/query_toolkit.schema.json +13 -2
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/bridge.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/local.d.ts +1 -0
- package/dist/tools/handlers/local.js +1 -1
- package/dist/tools/handlers/messenger.d.ts +9 -2
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/name-resolution.d.ts +4 -0
- package/dist/tools/handlers/name-resolution.js +1 -0
- package/dist/tools/handlers/name-resolution.spec.d.ts +1 -0
- package/dist/tools/handlers/name-resolution.spec.js +1 -0
- package/dist/tools/handlers/onchain-name-registration.d.ts +37 -0
- package/dist/tools/handlers/onchain-name-registration.js +1 -0
- package/dist/tools/handlers/onchain-name-registration.spec.d.ts +1 -0
- package/dist/tools/handlers/onchain-name-registration.spec.js +1 -0
- package/dist/tools/handlers/onchain.d.ts +1 -0
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.d.ts +1 -0
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/registry/local.js +1 -1
- package/dist/tools/sanitize-description-roundtrip.spec.d.ts +1 -0
- package/dist/tools/sanitize-description-roundtrip.spec.js +1 -0
- package/dist/tools/sanitize-output.d.ts +1 -0
- package/dist/tools/sanitize-output.js +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ObjectType } from "@wowok/wowok";
|
|
2
|
+
export interface CreatedObjectRef {
|
|
3
|
+
type?: ObjectType | string;
|
|
4
|
+
object?: string;
|
|
5
|
+
change?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface NamedObjectRequest {
|
|
8
|
+
name: string;
|
|
9
|
+
field: string;
|
|
10
|
+
tags?: string[];
|
|
11
|
+
onChain?: boolean;
|
|
12
|
+
replaceExistName?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface LocalMarkWrite {
|
|
15
|
+
name: {
|
|
16
|
+
value: string;
|
|
17
|
+
replaceExistName?: boolean;
|
|
18
|
+
};
|
|
19
|
+
address: string;
|
|
20
|
+
tags?: string[];
|
|
21
|
+
}
|
|
22
|
+
export interface LocalMarkAccess {
|
|
23
|
+
getAddress(nameOrAddress: string | undefined | null): Promise<string | undefined>;
|
|
24
|
+
put(marks: LocalMarkWrite[]): Promise<unknown>;
|
|
25
|
+
}
|
|
26
|
+
export declare function operationPrimaryType(operationType: string | undefined): ObjectType | undefined;
|
|
27
|
+
export declare function collectOnChainNamedObjectRequests(data: unknown, maxDepth?: number): NamedObjectRequest[];
|
|
28
|
+
export declare function planLocalMarkRegistrations(requests: NamedObjectRequest[], created: CreatedObjectRef[], operationType: string | undefined): LocalMarkWrite[];
|
|
29
|
+
export interface NameRegistrationReport {
|
|
30
|
+
resolved: string[];
|
|
31
|
+
written: string[];
|
|
32
|
+
failed: Array<{
|
|
33
|
+
name: string;
|
|
34
|
+
error: string;
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
export declare function registerLocalMarksForCreatedObjects(requests: NamedObjectRequest[], created: CreatedObjectRef[], operationType: string | undefined, access: LocalMarkAccess): Promise<NameRegistrationReport>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ObjectType}from'@wowok/wowok';const OPERATION_PRIMARY_TYPE={'service':ObjectType['Service'],'machine':ObjectType['Machine'],'guard':ObjectType['Guard'],'progress':ObjectType['Progress'],'repository':ObjectType['Repository'],'arbitration':ObjectType['Arbitration'],'contact':ObjectType['Contact'],'treasury':ObjectType['Treasury'],'reward':ObjectType['Reward'],'allocation':ObjectType['Allocation'],'demand':ObjectType['Demand'],'order':ObjectType['Order'],'proof':ObjectType['Proof'],'permission':ObjectType['Permission']},NAMED_FIELD_TYPES={'namedNewOrder':ObjectType['Order'],'namedNewAllocation':ObjectType['Allocation'],'namedNewProgress':ObjectType['Progress'],'namedNewPayment':ObjectType['Payment'],'namedArb':ObjectType['Arb']};export function operationPrimaryType(a){return a?OPERATION_PRIMARY_TYPE[a]:undefined;}function expectedTypeForField(a,b){return NAMED_FIELD_TYPES[a]??operationPrimaryType(b);}export function collectOnChainNamedObjectRequests(a,b=0x8){const c=[],d=new WeakSet(),e=(f,g,h)=>{if(f==null||h>b)return;if(Array['isArray'](f)){for(const j of f)e(j,g,h+0x1);return;}if(typeof f!=='object')return;if(d['has'](f))return;d['add'](f);const i=f;if(i['onChain']===!![]&&typeof i['name']==='string'&&i['name']['trim']()['length']>0x0){const k={'name':i['name']['trim'](),'field':g,'onChain':!![]};if(Array['isArray'](i['tags'])){const l=i['tags']['filter'](m=>typeof m==='string'&&m['length']>0x0);if(l['length']>0x0)k['tags']=l;}if(i['replaceExistName']===!![])k['replaceExistName']=!![];c['push'](k);}for(const [m,n]of Object['entries'](i)){e(n,m,h+0x1);}};return e(a,'object',0x0),c;}export function planLocalMarkRegistrations(a,b,c){const d=new Map();for(const f of b??[]){if(f?.['change']!=='created')continue;if(typeof f['object']!=='string'||f['object']['length']===0x0)continue;if(f['type']==null)continue;const g=String(f['type']);if(!d['has'](g))d['set'](g,f['object']);}const e=[];for(const h of a??[]){const i=expectedTypeForField(h['field'],c);if(!i)continue;const j=d['get'](String(i));if(!j)continue;e['push']({'name':{'value':h['name'],'replaceExistName':h['replaceExistName']},'address':j,'tags':h['tags']});}return e;}export async function registerLocalMarksForCreatedObjects(a,b,c,d){const e={'resolved':[],'written':[],'failed':[]},f=planLocalMarkRegistrations(a,b,c);for(const g of f){try{const h=await d['getAddress'](g['name']['value']);if(h?.['toLowerCase']()===g['address']['toLowerCase']()){e['resolved']['push'](g['name']['value']);continue;}await d['put']([g]),e['written']['push'](g['name']['value']),e['resolved']['push'](g['name']['value']);}catch(i){e['failed']['push']({'name':g['name']['value'],'error':i instanceof Error?i['message']:String(i)});}}return e;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{describe,expect,it}from'vitest';import{ObjectType}from'@wowok/wowok';import{collectOnChainNamedObjectRequests,planLocalMarkRegistrations,registerLocalMarksForCreatedObjects}from'./onchain-name-registration.js';function fakeMarkStore(a={}){const b=new Map(Object['entries'](a)),c=[];return{'writes':c,async 'getAddress'(d){return b['get'](String(d)['toLowerCase']());},async 'put'(d){for(const e of d){c['push'](e),b['set'](e['name']['value']['toLowerCase'](),e['address']);}return d;}};}const GUARD_ADDR='0x1111111111111111111111111111111111111111111111111111111111111111';describe('collectOnChainNamedObjectRequests',()=>{it('finds\x20a\x20Guard\x20named\x20with\x20onChain:true\x20under\x20`namedNew`',()=>{const a=collectOnChainNamedObjectRequests({'namedNew':{'name':'bkg_g_holder','onChain':!![]}});expect(a)['toEqual']([{'name':'bkg_g_holder','field':'namedNew','onChain':!![]}]);}),it('finds\x20a\x20Guard\x20named\x20with\x20onChain:true\x20under\x20the\x20`object`\x20alias',()=>{const a=collectOnChainNamedObjectRequests({'object':{'name':'bkg_g_holder','onChain':!![]}});expect(a)['toHaveLength'](0x1),expect(a[0x0])['toMatchObject']({'name':'bkg_g_holder','field':'object'});}),it('ignores\x20a\x20local-only\x20(onChain\x20falsy)\x20name\x20—\x20that\x20path\x20already\x20writes\x20a\x20mark',()=>{expect(collectOnChainNamedObjectRequests({'object':{'name':'private_shop'}}))['toEqual']([]),expect(collectOnChainNamedObjectRequests({'object':{'name':'x','onChain':![]}}))['toEqual']([]);}),it('ignores\x20Guard\x20table\x20entries,\x20which\x20carry\x20a\x20`name`\x20but\x20never\x20request\x20onChain',()=>{const a=collectOnChainNamedObjectRequests({'namedNew':{'name':'g','onChain':!![]},'table':[{'identifier':0x1,'name':'order_id','b_submission':!![]}]});expect(a['map'](b=>b['name']))['toEqual'](['g']);}),it('carries\x20tags\x20and\x20replaceExistName\x20through',()=>{const a=collectOnChainNamedObjectRequests({'object':{'name':'g','onChain':!![],'tags':['a','b'],'replaceExistName':!![]}});expect(a[0x0])['toEqual']({'name':'g','field':'object','onChain':!![],'tags':['a','b'],'replaceExistName':!![]});}),it('finds\x20a\x20nested\x20named\x20object\x20(order_new.namedNewOrder)',()=>{const a=collectOnChainNamedObjectRequests({'object':{'name':'svc'},'order_new':{'namedNewOrder':{'name':'ord_1','onChain':!![]}}});expect(a)['toEqual']([{'name':'ord_1','field':'namedNewOrder','onChain':!![]}]);});}),describe('planLocalMarkRegistrations',()=>{it('pairs\x20the\x20Guard\x20request\x20with\x20the\x20Guard\x20the\x20transaction\x20created',()=>{const a=planLocalMarkRegistrations([{'name':'bkg_g_holder','field':'namedNew','onChain':!![]}],[{'type':ObjectType['Guard'],'object':GUARD_ADDR,'change':'created'}],'guard');expect(a)['toEqual']([{'name':{'value':'bkg_g_holder','replaceExistName':undefined},'address':GUARD_ADDR,'tags':undefined}]);}),it('pairs\x20by\x20FIELD\x20hint\x20when\x20several\x20objects\x20are\x20created\x20in\x20one\x20call',()=>{const a='0x2222222222222222222222222222222222222222222222222222222222222222',b='0x3333333333333333333333333333333333333333333333333333333333333333',c=planLocalMarkRegistrations([{'name':'svc','field':'object','onChain':!![]},{'name':'ord','field':'namedNewOrder','onChain':!![]}],[{'type':ObjectType['Order'],'object':b,'change':'created'},{'type':ObjectType['Service'],'object':a,'change':'created'}],'service');expect(c)['toEqual']([{'name':{'value':'svc','replaceExistName':undefined},'address':a,'tags':undefined},{'name':{'value':'ord','replaceExistName':undefined},'address':b,'tags':undefined}]);}),it('drops\x20the\x20request\x20when\x20nothing\x20of\x20that\x20type\x20was\x20created\x20(never\x20guess)',()=>{const a=planLocalMarkRegistrations([{'name':'g','field':'namedNew','onChain':!![]}],[{'type':ObjectType['Payment'],'object':GUARD_ADDR,'change':'created'}],'guard');expect(a)['toEqual']([]);}),it('ignores\x20mutated\x20(not\x20created)\x20objects',()=>{const a=planLocalMarkRegistrations([{'name':'g','field':'namedNew','onChain':!![]}],[{'type':ObjectType['Guard'],'object':GUARD_ADDR,'change':'mutated'}],'guard');expect(a)['toEqual']([]);});}),describe('registerLocalMarksForCreatedObjects\x20—\x20the\x20created\x20name\x20resolves\x20locally',()=>{it('writes\x20a\x20LocalMark\x20so\x20the\x20name\x20resolves\x20for\x20a\x20subsequent\x20reference',async()=>{const a=fakeMarkStore(),b=await registerLocalMarksForCreatedObjects([{'name':'bkg_g_holder','field':'namedNew','onChain':!![]}],[{'type':ObjectType['Guard'],'object':GUARD_ADDR,'change':'created'}],'guard',a);expect(await a['getAddress']('bkg_g_holder'))['toBe'](GUARD_ADDR),expect(b['written'])['toEqual'](['bkg_g_holder']),expect(b['failed'])['toEqual']([]);}),it('is\x20idempotent\x20—\x20a\x20name\x20already\x20bound\x20to\x20the\x20same\x20address\x20is\x20not\x20rewritten',async()=>{const a=fakeMarkStore({'bkg_g_holder':GUARD_ADDR}),b=await registerLocalMarksForCreatedObjects([{'name':'bkg_g_holder','field':'namedNew','onChain':!![]}],[{'type':ObjectType['Guard'],'object':GUARD_ADDR,'change':'created'}],'guard',a);expect(a['writes'])['toEqual']([]),expect(b['written'])['toEqual']([]),expect(b['resolved'])['toEqual'](['bkg_g_holder']);}),it('rebinds\x20a\x20stale\x20address\x20(SDK\x20left\x20the\x20name\x20pointing\x20at\x20an\x20older\x20object)',async()=>{const a='0x9999999999999999999999999999999999999999999999999999999999999999',b=fakeMarkStore({'g':a});await registerLocalMarksForCreatedObjects([{'name':'g','field':'namedNew','onChain':!![]}],[{'type':ObjectType['Guard'],'object':GUARD_ADDR,'change':'created'}],'guard',b),expect(await b['getAddress']('g'))['toBe'](GUARD_ADDR);}),it('reports\x20a\x20failed\x20write\x20instead\x20of\x20throwing\x20(chain\x20effect\x20already\x20succeeded)',async()=>{const a=fakeMarkStore();a['put']=async()=>{throw new Error('LocalMarkNameExist');};const b=await registerLocalMarksForCreatedObjects([{'name':'g','field':'namedNew','onChain':!![]}],[{'type':ObjectType['Guard'],'object':GUARD_ADDR,'change':'created'}],'guard',a);expect(b['failed'])['toEqual']([{'name':'g','error':'LocalMarkNameExist'}]),expect(b['resolved'])['toEqual']([]);}),it('does\x20nothing\x20when\x20the\x20request\x20list\x20is\x20empty',async()=>{const a=fakeMarkStore(),b=await registerLocalMarksForCreatedObjects([],[{'type':ObjectType['Guard'],'object':GUARD_ADDR,'change':'created'}],'guard',a);expect(a['writes'])['toEqual']([]),expect(b)['toEqual']({'resolved':[],'written':[],'failed':[]});}),it('propagates\x20replaceExistName\x20so\x20a\x20forced\x20claim\x20still\x20works',async()=>{const a=fakeMarkStore();await registerLocalMarksForCreatedObjects([{'name':'g','field':'namedNew','onChain':!![],'replaceExistName':!![]}],[{'type':ObjectType['Guard'],'object':GUARD_ADDR,'change':'created'}],'guard',a),expect(a['writes'][0x0]['name'])['toEqual']({'value':'g','replaceExistName':!![]});});});
|