@omnicross/contracts 0.1.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.
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/account-tokens-types.cjs +18 -0
- package/dist/account-tokens-types.d.cts +142 -0
- package/dist/account-tokens-types.d.ts +142 -0
- package/dist/account-tokens-types.js +0 -0
- package/dist/canonical-models.cjs +262 -0
- package/dist/canonical-models.d.cts +107 -0
- package/dist/canonical-models.d.ts +107 -0
- package/dist/canonical-models.js +232 -0
- package/dist/completion-types.cjs +18 -0
- package/dist/completion-types.d.cts +324 -0
- package/dist/completion-types.d.ts +324 -0
- package/dist/completion-types.js +0 -0
- package/dist/endpoint-resolver.cjs +54 -0
- package/dist/endpoint-resolver.d.cts +43 -0
- package/dist/endpoint-resolver.d.ts +43 -0
- package/dist/endpoint-resolver.js +29 -0
- package/dist/extended-context.cjs +39 -0
- package/dist/extended-context.d.cts +21 -0
- package/dist/extended-context.d.ts +21 -0
- package/dist/extended-context.js +13 -0
- package/dist/index.cjs +2724 -0
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +2656 -0
- package/dist/llm-config-CQjOimv2.d.cts +390 -0
- package/dist/llm-config-D1jKQLVp.d.ts +390 -0
- package/dist/llm-config.cjs +18 -0
- package/dist/llm-config.d.cts +2 -0
- package/dist/llm-config.d.ts +2 -0
- package/dist/llm-config.js +0 -0
- package/dist/mcp-types.cjs +33 -0
- package/dist/mcp-types.d.cts +131 -0
- package/dist/mcp-types.d.ts +131 -0
- package/dist/mcp-types.js +8 -0
- package/dist/message-blocks.cjs +18 -0
- package/dist/message-blocks.d.cts +44 -0
- package/dist/message-blocks.d.ts +44 -0
- package/dist/message-blocks.js +0 -0
- package/dist/provider-presets/index.cjs +2183 -0
- package/dist/provider-presets/index.d.cts +104 -0
- package/dist/provider-presets/index.d.ts +104 -0
- package/dist/provider-presets/index.js +2143 -0
- package/dist/subscription-types.cjs +48 -0
- package/dist/subscription-types.d.cts +149 -0
- package/dist/subscription-types.d.ts +149 -0
- package/dist/subscription-types.js +22 -0
- package/dist/thinking-CBWSLel8.d.cts +33 -0
- package/dist/thinking-CBWSLel8.d.ts +33 -0
- package/dist/thinking-config.cjs +243 -0
- package/dist/thinking-config.d.cts +71 -0
- package/dist/thinking-config.d.ts +71 -0
- package/dist/thinking-config.js +205 -0
- package/dist/usage-types.cjs +18 -0
- package/dist/usage-types.d.cts +41 -0
- package/dist/usage-types.d.ts +41 -0
- package/dist/usage-types.js +0 -0
- package/dist/websearch-types.cjs +37 -0
- package/dist/websearch-types.d.cts +76 -0
- package/dist/websearch-types.d.ts +76 -0
- package/dist/websearch-types.js +11 -0
- package/package.json +116 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
type McpServerScope = 'user' | 'local';
|
|
2
|
+
type McpServerTransport = 'stdio' | 'http' | 'sse';
|
|
3
|
+
type McpServerConfig = {
|
|
4
|
+
command?: string;
|
|
5
|
+
args?: string[];
|
|
6
|
+
env?: Record<string, string>;
|
|
7
|
+
url?: string;
|
|
8
|
+
headers?: Record<string, string>;
|
|
9
|
+
transport?: string;
|
|
10
|
+
};
|
|
11
|
+
type McpServerRecord = {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
scope: McpServerScope | string;
|
|
15
|
+
type: McpServerTransport | string;
|
|
16
|
+
projectPath?: string;
|
|
17
|
+
status?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
config: McpServerConfig;
|
|
20
|
+
raw?: Record<string, unknown>;
|
|
21
|
+
isActive?: boolean;
|
|
22
|
+
isTrusted?: boolean;
|
|
23
|
+
trustedAt?: number;
|
|
24
|
+
disabledTools?: string[];
|
|
25
|
+
disabledAutoApproveTools?: string[];
|
|
26
|
+
installSource?: 'builtin' | 'manual' | 'protocol' | 'unknown';
|
|
27
|
+
createdAt?: number;
|
|
28
|
+
updatedAt?: number;
|
|
29
|
+
};
|
|
30
|
+
type McpServerList = {
|
|
31
|
+
servers: McpServerRecord[];
|
|
32
|
+
};
|
|
33
|
+
type McpServerInput = {
|
|
34
|
+
name: string;
|
|
35
|
+
scope?: 'user' | 'local';
|
|
36
|
+
type: McpServerTransport;
|
|
37
|
+
projectPath?: string | null;
|
|
38
|
+
config: McpServerConfig;
|
|
39
|
+
command?: string;
|
|
40
|
+
args?: string[];
|
|
41
|
+
env?: Record<string, string>;
|
|
42
|
+
url?: string;
|
|
43
|
+
headers?: Record<string, string>;
|
|
44
|
+
};
|
|
45
|
+
type McpServerJsonInput = {
|
|
46
|
+
json: string;
|
|
47
|
+
scope?: 'user' | 'local';
|
|
48
|
+
projectPath?: string | null;
|
|
49
|
+
};
|
|
50
|
+
type McpServerRemoveInput = {
|
|
51
|
+
id?: string;
|
|
52
|
+
name?: string;
|
|
53
|
+
scope?: 'user' | 'local';
|
|
54
|
+
projectPath?: string | null;
|
|
55
|
+
};
|
|
56
|
+
type McpActionResult = {
|
|
57
|
+
success: boolean;
|
|
58
|
+
message?: string;
|
|
59
|
+
output?: string;
|
|
60
|
+
};
|
|
61
|
+
type McpTestResult = {
|
|
62
|
+
success: boolean;
|
|
63
|
+
message: string;
|
|
64
|
+
details?: string[];
|
|
65
|
+
status?: string;
|
|
66
|
+
description?: string;
|
|
67
|
+
};
|
|
68
|
+
type McpToolInfo = {
|
|
69
|
+
name: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
};
|
|
72
|
+
type McpDiscoverResult = {
|
|
73
|
+
success: boolean;
|
|
74
|
+
message?: string;
|
|
75
|
+
tools: McpToolInfo[];
|
|
76
|
+
resources: McpToolInfo[];
|
|
77
|
+
prompts: McpToolInfo[];
|
|
78
|
+
rawOutput?: string;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* MCP mode controls how MCP servers are used in chat sessions
|
|
82
|
+
* - disabled: MCP is completely disabled
|
|
83
|
+
* - auto: Automatically use all active MCP servers
|
|
84
|
+
* - manual: User manually selects which servers to use
|
|
85
|
+
*/
|
|
86
|
+
type McpMode = 'disabled' | 'auto' | 'manual';
|
|
87
|
+
/**
|
|
88
|
+
* MCP configuration for a chat session
|
|
89
|
+
*/
|
|
90
|
+
type McpSessionConfig = {
|
|
91
|
+
/** MCP usage mode */
|
|
92
|
+
mode: McpMode;
|
|
93
|
+
/** Server IDs selected in manual mode */
|
|
94
|
+
selectedServers?: string[];
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Default MCP session configuration
|
|
98
|
+
*/
|
|
99
|
+
declare const DEFAULT_MCP_SESSION_CONFIG: McpSessionConfig;
|
|
100
|
+
/**
|
|
101
|
+
* MCP Tool definition
|
|
102
|
+
*/
|
|
103
|
+
type MCPTool = {
|
|
104
|
+
id: string;
|
|
105
|
+
serverId: string;
|
|
106
|
+
serverName: string;
|
|
107
|
+
name: string;
|
|
108
|
+
description?: string;
|
|
109
|
+
inputSchema: Record<string, any>;
|
|
110
|
+
outputSchema?: Record<string, any>;
|
|
111
|
+
type: 'mcp';
|
|
112
|
+
isBuiltIn?: boolean;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* MCP Tool call response content item
|
|
116
|
+
*/
|
|
117
|
+
type MCPToolResponseContent = {
|
|
118
|
+
type: 'text' | 'image' | 'audio';
|
|
119
|
+
text?: string;
|
|
120
|
+
mimeType?: string;
|
|
121
|
+
data?: string;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* MCP Tool call response
|
|
125
|
+
*/
|
|
126
|
+
type MCPCallToolResponse = {
|
|
127
|
+
isError: boolean;
|
|
128
|
+
content: MCPToolResponseContent[];
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export { DEFAULT_MCP_SESSION_CONFIG, type MCPCallToolResponse, type MCPTool, type MCPToolResponseContent, type McpActionResult, type McpDiscoverResult, type McpMode, type McpServerConfig, type McpServerInput, type McpServerJsonInput, type McpServerList, type McpServerRecord, type McpServerRemoveInput, type McpServerScope, type McpServerTransport, type McpSessionConfig, type McpTestResult, type McpToolInfo };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/message-blocks.ts
|
|
17
|
+
var message_blocks_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(message_blocks_exports);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message content blocks — the provider-neutral content-block shapes one
|
|
3
|
+
* assistant turn is composed of (thinking / text / tool_use / tool_result).
|
|
4
|
+
*
|
|
5
|
+
* These mirror the LLM wire-level content blocks and are consumed by the
|
|
6
|
+
* completion pipeline's stream parsing and tool loop. They carry NO host
|
|
7
|
+
* application semantics (no chat persistence, no UI state).
|
|
8
|
+
*
|
|
9
|
+
* @module message-blocks
|
|
10
|
+
*/
|
|
11
|
+
type MessageBlockType = 'thinking' | 'text' | 'tool_use' | 'tool_result';
|
|
12
|
+
interface MessageBlockBase {
|
|
13
|
+
id: string;
|
|
14
|
+
type: MessageBlockType;
|
|
15
|
+
}
|
|
16
|
+
interface ThinkingBlock extends MessageBlockBase {
|
|
17
|
+
type: 'thinking';
|
|
18
|
+
content: string;
|
|
19
|
+
durationMs?: number;
|
|
20
|
+
/** Cryptographic signature for Anthropic extended thinking (required for multi-turn) */
|
|
21
|
+
signature?: string;
|
|
22
|
+
}
|
|
23
|
+
interface TextBlock extends MessageBlockBase {
|
|
24
|
+
type: 'text';
|
|
25
|
+
content: string;
|
|
26
|
+
}
|
|
27
|
+
interface ToolUseBlock extends MessageBlockBase {
|
|
28
|
+
type: 'tool_use';
|
|
29
|
+
toolId: string;
|
|
30
|
+
toolName: string;
|
|
31
|
+
input: Record<string, unknown>;
|
|
32
|
+
status: 'pending' | 'running' | 'completed' | 'error';
|
|
33
|
+
}
|
|
34
|
+
interface ToolResultBlock extends MessageBlockBase {
|
|
35
|
+
type: 'tool_result';
|
|
36
|
+
toolId: string;
|
|
37
|
+
toolName: string;
|
|
38
|
+
output?: string;
|
|
39
|
+
error?: string;
|
|
40
|
+
isError?: boolean;
|
|
41
|
+
}
|
|
42
|
+
type MessageBlock = ThinkingBlock | TextBlock | ToolUseBlock | ToolResultBlock;
|
|
43
|
+
|
|
44
|
+
export type { MessageBlock, MessageBlockBase, MessageBlockType, TextBlock, ThinkingBlock, ToolResultBlock, ToolUseBlock };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message content blocks — the provider-neutral content-block shapes one
|
|
3
|
+
* assistant turn is composed of (thinking / text / tool_use / tool_result).
|
|
4
|
+
*
|
|
5
|
+
* These mirror the LLM wire-level content blocks and are consumed by the
|
|
6
|
+
* completion pipeline's stream parsing and tool loop. They carry NO host
|
|
7
|
+
* application semantics (no chat persistence, no UI state).
|
|
8
|
+
*
|
|
9
|
+
* @module message-blocks
|
|
10
|
+
*/
|
|
11
|
+
type MessageBlockType = 'thinking' | 'text' | 'tool_use' | 'tool_result';
|
|
12
|
+
interface MessageBlockBase {
|
|
13
|
+
id: string;
|
|
14
|
+
type: MessageBlockType;
|
|
15
|
+
}
|
|
16
|
+
interface ThinkingBlock extends MessageBlockBase {
|
|
17
|
+
type: 'thinking';
|
|
18
|
+
content: string;
|
|
19
|
+
durationMs?: number;
|
|
20
|
+
/** Cryptographic signature for Anthropic extended thinking (required for multi-turn) */
|
|
21
|
+
signature?: string;
|
|
22
|
+
}
|
|
23
|
+
interface TextBlock extends MessageBlockBase {
|
|
24
|
+
type: 'text';
|
|
25
|
+
content: string;
|
|
26
|
+
}
|
|
27
|
+
interface ToolUseBlock extends MessageBlockBase {
|
|
28
|
+
type: 'tool_use';
|
|
29
|
+
toolId: string;
|
|
30
|
+
toolName: string;
|
|
31
|
+
input: Record<string, unknown>;
|
|
32
|
+
status: 'pending' | 'running' | 'completed' | 'error';
|
|
33
|
+
}
|
|
34
|
+
interface ToolResultBlock extends MessageBlockBase {
|
|
35
|
+
type: 'tool_result';
|
|
36
|
+
toolId: string;
|
|
37
|
+
toolName: string;
|
|
38
|
+
output?: string;
|
|
39
|
+
error?: string;
|
|
40
|
+
isError?: boolean;
|
|
41
|
+
}
|
|
42
|
+
type MessageBlock = ThinkingBlock | TextBlock | ToolUseBlock | ToolResultBlock;
|
|
43
|
+
|
|
44
|
+
export type { MessageBlock, MessageBlockBase, MessageBlockType, TextBlock, ThinkingBlock, ToolResultBlock, ToolUseBlock };
|
|
File without changes
|