@nahisaho/musubix-yata-client 1.0.0

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 (49) hide show
  1. package/dist/__tests__/index.test.d.ts +2 -0
  2. package/dist/__tests__/index.test.d.ts.map +1 -0
  3. package/dist/__tests__/index.test.js +58 -0
  4. package/dist/__tests__/index.test.js.map +1 -0
  5. package/dist/index.d.ts +42 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +45 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/knowledge/index.d.ts +11 -0
  10. package/dist/knowledge/index.d.ts.map +1 -0
  11. package/dist/knowledge/index.js +11 -0
  12. package/dist/knowledge/index.js.map +1 -0
  13. package/dist/knowledge/ontology.d.ts +192 -0
  14. package/dist/knowledge/ontology.d.ts.map +1 -0
  15. package/dist/knowledge/ontology.js +261 -0
  16. package/dist/knowledge/ontology.js.map +1 -0
  17. package/dist/knowledge/query.d.ts +111 -0
  18. package/dist/knowledge/query.d.ts.map +1 -0
  19. package/dist/knowledge/query.js +207 -0
  20. package/dist/knowledge/query.js.map +1 -0
  21. package/dist/mcp/client.d.ts +128 -0
  22. package/dist/mcp/client.d.ts.map +1 -0
  23. package/dist/mcp/client.js +294 -0
  24. package/dist/mcp/client.js.map +1 -0
  25. package/dist/mcp/index.d.ts +8 -0
  26. package/dist/mcp/index.d.ts.map +1 -0
  27. package/dist/mcp/index.js +8 -0
  28. package/dist/mcp/index.js.map +1 -0
  29. package/dist/reasoning/confidence.d.ts +175 -0
  30. package/dist/reasoning/confidence.d.ts.map +1 -0
  31. package/dist/reasoning/confidence.js +278 -0
  32. package/dist/reasoning/confidence.js.map +1 -0
  33. package/dist/reasoning/contradiction.d.ts +236 -0
  34. package/dist/reasoning/contradiction.d.ts.map +1 -0
  35. package/dist/reasoning/contradiction.js +487 -0
  36. package/dist/reasoning/contradiction.js.map +1 -0
  37. package/dist/reasoning/index.d.ts +12 -0
  38. package/dist/reasoning/index.d.ts.map +1 -0
  39. package/dist/reasoning/index.js +15 -0
  40. package/dist/reasoning/index.js.map +1 -0
  41. package/dist/reasoning/integrator.d.ts +230 -0
  42. package/dist/reasoning/integrator.d.ts.map +1 -0
  43. package/dist/reasoning/integrator.js +364 -0
  44. package/dist/reasoning/integrator.js.map +1 -0
  45. package/dist/types.d.ts +171 -0
  46. package/dist/types.d.ts.map +1 -0
  47. package/dist/types.js +22 -0
  48. package/dist/types.js.map +1 -0
  49. package/package.json +68 -0
@@ -0,0 +1,171 @@
1
+ /**
2
+ * YATA Client Types
3
+ *
4
+ * Type definitions for YATA MCP client
5
+ *
6
+ * @packageDocumentation
7
+ * @module types
8
+ *
9
+ * @see REQ-INT-102 - MCP Server
10
+ */
11
+ /**
12
+ * MCP Transport type
13
+ */
14
+ export type MCPTransport = 'stdio' | 'sse';
15
+ /**
16
+ * YATA Client configuration
17
+ */
18
+ export interface YataClientConfig {
19
+ /** Transport type */
20
+ transport: MCPTransport;
21
+ /** Server command (for stdio) or URL (for SSE) */
22
+ server: string;
23
+ /** Server arguments (for stdio) */
24
+ args?: string[];
25
+ /** Connection timeout in milliseconds */
26
+ timeout: number;
27
+ /** Auto-reconnect on connection loss */
28
+ autoReconnect: boolean;
29
+ /** Maximum reconnect attempts */
30
+ maxReconnectAttempts: number;
31
+ /** Reconnect delay in milliseconds */
32
+ reconnectDelay: number;
33
+ }
34
+ /**
35
+ * Default YATA client configuration
36
+ */
37
+ export declare const DEFAULT_YATA_CONFIG: YataClientConfig;
38
+ /**
39
+ * Connection state
40
+ */
41
+ export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting' | 'error';
42
+ /**
43
+ * YATA tool names
44
+ */
45
+ export type YataToolName = 'query_knowledge' | 'add_knowledge' | 'update_knowledge' | 'delete_knowledge' | 'search_patterns' | 'validate_constraints' | 'infer_relationships' | 'get_reasoning_chain';
46
+ /**
47
+ * Tool call request
48
+ */
49
+ export interface ToolCallRequest {
50
+ /** Tool name */
51
+ name: YataToolName | string;
52
+ /** Tool arguments */
53
+ arguments: Record<string, unknown>;
54
+ }
55
+ /**
56
+ * Tool call response
57
+ */
58
+ export interface ToolCallResponse<T = unknown> {
59
+ /** Whether call succeeded */
60
+ success: boolean;
61
+ /** Result data */
62
+ result?: T;
63
+ /** Error message if failed */
64
+ error?: string;
65
+ /** Execution time in milliseconds */
66
+ executionTime: number;
67
+ }
68
+ /**
69
+ * Knowledge node
70
+ */
71
+ export interface KnowledgeNode {
72
+ /** Node identifier */
73
+ id: string;
74
+ /** Node type */
75
+ type: string;
76
+ /** Node label */
77
+ label: string;
78
+ /** Node properties */
79
+ properties: Record<string, unknown>;
80
+ /** Creation timestamp */
81
+ createdAt: string;
82
+ /** Update timestamp */
83
+ updatedAt: string;
84
+ }
85
+ /**
86
+ * Knowledge edge (relationship)
87
+ */
88
+ export interface KnowledgeEdge {
89
+ /** Edge identifier */
90
+ id: string;
91
+ /** Source node ID */
92
+ sourceId: string;
93
+ /** Target node ID */
94
+ targetId: string;
95
+ /** Relationship type */
96
+ type: string;
97
+ /** Edge properties */
98
+ properties: Record<string, unknown>;
99
+ }
100
+ /**
101
+ * Knowledge query result
102
+ */
103
+ export interface KnowledgeQueryResult {
104
+ /** Matched nodes */
105
+ nodes: KnowledgeNode[];
106
+ /** Matched edges */
107
+ edges: KnowledgeEdge[];
108
+ /** Total count */
109
+ totalCount: number;
110
+ /** Query execution time */
111
+ executionTime: number;
112
+ }
113
+ /**
114
+ * Pattern match result
115
+ */
116
+ export interface PatternMatchResult {
117
+ /** Pattern name */
118
+ pattern: string;
119
+ /** Match confidence */
120
+ confidence: number;
121
+ /** Matched elements */
122
+ matches: Array<{
123
+ nodeId: string;
124
+ role: string;
125
+ }>;
126
+ }
127
+ /**
128
+ * Constraint validation result
129
+ */
130
+ export interface ConstraintValidationResult {
131
+ /** Whether all constraints are satisfied */
132
+ valid: boolean;
133
+ /** Violations found */
134
+ violations: Array<{
135
+ constraint: string;
136
+ message: string;
137
+ severity: 'error' | 'warning';
138
+ affectedNodes: string[];
139
+ }>;
140
+ }
141
+ /**
142
+ * Reasoning step
143
+ */
144
+ export interface ReasoningStep {
145
+ /** Step number */
146
+ step: number;
147
+ /** Reasoning type */
148
+ type: 'deduction' | 'induction' | 'abduction' | 'analogy';
149
+ /** Premises used */
150
+ premises: string[];
151
+ /** Conclusion drawn */
152
+ conclusion: string;
153
+ /** Confidence score */
154
+ confidence: number;
155
+ }
156
+ /**
157
+ * Reasoning chain result
158
+ */
159
+ export interface ReasoningChainResult {
160
+ /** Query that initiated reasoning */
161
+ query: string;
162
+ /** Reasoning steps */
163
+ steps: ReasoningStep[];
164
+ /** Final conclusion */
165
+ conclusion: string;
166
+ /** Overall confidence */
167
+ confidence: number;
168
+ /** Supporting evidence */
169
+ evidence: string[];
170
+ }
171
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,KAAK,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,qBAAqB;IACrB,SAAS,EAAE,YAAY,CAAC;IACxB,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,aAAa,EAAE,OAAO,CAAC;IACvB,iCAAiC;IACjC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,sCAAsC;IACtC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAOjC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB,cAAc,GACd,YAAY,GACZ,WAAW,GACX,cAAc,GACd,OAAO,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UAAU,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB"}
package/dist/types.js ADDED
@@ -0,0 +1,22 @@
1
+ /**
2
+ * YATA Client Types
3
+ *
4
+ * Type definitions for YATA MCP client
5
+ *
6
+ * @packageDocumentation
7
+ * @module types
8
+ *
9
+ * @see REQ-INT-102 - MCP Server
10
+ */
11
+ /**
12
+ * Default YATA client configuration
13
+ */
14
+ export const DEFAULT_YATA_CONFIG = {
15
+ transport: 'stdio',
16
+ server: 'yata-mcp',
17
+ timeout: 30000,
18
+ autoReconnect: true,
19
+ maxReconnectAttempts: 3,
20
+ reconnectDelay: 1000,
21
+ };
22
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA2BH;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAqB;IACnD,SAAS,EAAE,OAAO;IAClB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,KAAK;IACd,aAAa,EAAE,IAAI;IACnB,oBAAoB,EAAE,CAAC;IACvB,cAAc,EAAE,IAAI;CACrB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@nahisaho/musubix-yata-client",
3
+ "version": "1.0.0",
4
+ "description": "MUSUBIX YATA Client - Knowledge Graph Client Library",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ },
13
+ "./knowledge": {
14
+ "import": "./dist/knowledge/index.js",
15
+ "types": "./dist/knowledge/index.d.ts"
16
+ },
17
+ "./reasoning": {
18
+ "import": "./dist/reasoning/index.js",
19
+ "types": "./dist/reasoning/index.d.ts"
20
+ },
21
+ "./mcp": {
22
+ "import": "./dist/mcp/index.js",
23
+ "types": "./dist/mcp/index.d.ts"
24
+ }
25
+ },
26
+ "bin": {
27
+ "musubix-yata": "./bin/musubix-yata.js"
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "bin"
32
+ ],
33
+ "scripts": {
34
+ "build": "tsc -p tsconfig.json",
35
+ "clean": "rm -rf dist *.tsbuildinfo",
36
+ "test": "vitest run",
37
+ "test:unit": "vitest run --dir __tests__/unit",
38
+ "test:integration": "vitest run --dir __tests__/integration",
39
+ "test:watch": "vitest",
40
+ "typecheck": "tsc --noEmit"
41
+ },
42
+ "dependencies": {
43
+ "@modelcontextprotocol/sdk": "^0.5.0",
44
+ "zod": "^3.22.0"
45
+ },
46
+ "devDependencies": {
47
+ "@types/node": "^20.10.0",
48
+ "typescript": "^5.3.0",
49
+ "vitest": "^1.0.0"
50
+ },
51
+ "keywords": [
52
+ "musubix",
53
+ "yata",
54
+ "knowledge-graph",
55
+ "symbolic-reasoning",
56
+ "mcp-client"
57
+ ],
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "https://github.com/nahisaho/MUSUBIX.git",
61
+ "directory": "packages/yata-client"
62
+ },
63
+ "homepage": "https://github.com/nahisaho/MUSUBIX/tree/main/packages/yata-client",
64
+ "publishConfig": {
65
+ "access": "public"
66
+ },
67
+ "license": "MIT"
68
+ }