@clinebot/shared 0.0.18 → 0.0.21
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.browser.d.ts +4 -1
- package/dist/index.browser.js +21 -21
- package/dist/index.d.ts +4 -1
- package/dist/index.js +27 -27
- package/dist/parse/shell.d.ts +2 -0
- package/dist/parse/string.d.ts +1 -0
- package/dist/session/index.d.ts +1 -0
- package/dist/storage/index.js +1 -1
- package/package.json +2 -3
- package/src/auth/constants.ts +0 -41
- package/src/connectors/adapters.ts +0 -152
- package/src/connectors/events.ts +0 -73
- package/src/db/index.ts +0 -14
- package/src/db/sqlite-db.ts +0 -329
- package/src/index.browser.ts +0 -187
- package/src/index.ts +0 -187
- package/src/llms/model-id.ts +0 -154
- package/src/llms/tools.ts +0 -137
- package/src/logging/logger.ts +0 -9
- package/src/parse/json.ts +0 -43
- package/src/parse/time.ts +0 -21
- package/src/parse/zod.ts +0 -23
- package/src/prompt/format.ts +0 -22
- package/src/remote-config/constants.ts +0 -5
- package/src/remote-config/schema.test.ts +0 -1004
- package/src/remote-config/schema.ts +0 -263
- package/src/rpc/index.ts +0 -4
- package/src/rpc/runtime.ts +0 -317
- package/src/rpc/team-progress.ts +0 -71
- package/src/services/telemetry-config.ts +0 -55
- package/src/services/telemetry.ts +0 -141
- package/src/session/hook-context.ts +0 -54
- package/src/session/records.ts +0 -40
- package/src/session/runtime-config.ts +0 -24
- package/src/session/runtime-env.ts +0 -8
- package/src/storage/index.ts +0 -37
- package/src/storage/paths.test.ts +0 -99
- package/src/storage/paths.ts +0 -400
- package/src/vcr.ts +0 -717
package/src/index.browser.ts
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
export type { OAuthProviderId } from "./auth/constants";
|
|
2
|
-
export {
|
|
3
|
-
AUTH_ERROR_PATTERNS,
|
|
4
|
-
isLikelyAuthError,
|
|
5
|
-
isOAuthProviderId,
|
|
6
|
-
OAUTH_PROVIDER_IDS,
|
|
7
|
-
} from "./auth/constants";
|
|
8
|
-
export type * from "./connectors/adapters";
|
|
9
|
-
export type {
|
|
10
|
-
ConnectorAuthorizationDecision,
|
|
11
|
-
ConnectorAuthorizationRequest,
|
|
12
|
-
ConnectorEventActor,
|
|
13
|
-
ConnectorEventContext,
|
|
14
|
-
ConnectorHookEvent,
|
|
15
|
-
ConnectorHookEventName,
|
|
16
|
-
} from "./connectors/events";
|
|
17
|
-
export {
|
|
18
|
-
ConnectorAuthorizationDecisionSchema,
|
|
19
|
-
ConnectorAuthorizationRequestSchema,
|
|
20
|
-
ConnectorEventActorSchema,
|
|
21
|
-
ConnectorEventContextSchema,
|
|
22
|
-
ConnectorHookEventNameSchema,
|
|
23
|
-
ConnectorHookEventSchema,
|
|
24
|
-
} from "./connectors/events";
|
|
25
|
-
export {
|
|
26
|
-
MODELS_DEV_PROVIDER_KEY_ENTRIES,
|
|
27
|
-
MODELS_DEV_PROVIDER_KEY_MAP,
|
|
28
|
-
resolveProviderModelCatalogKeys,
|
|
29
|
-
} from "./llms/model-id";
|
|
30
|
-
export type {
|
|
31
|
-
Tool,
|
|
32
|
-
ToolApprovalRequest,
|
|
33
|
-
ToolApprovalResult,
|
|
34
|
-
ToolCallRecord,
|
|
35
|
-
ToolContext,
|
|
36
|
-
ToolPolicy,
|
|
37
|
-
} from "./llms/tools";
|
|
38
|
-
export { ToolCallRecordSchema, ToolContextSchema } from "./llms/tools";
|
|
39
|
-
export type { BasicLogger } from "./logging/logger";
|
|
40
|
-
export { parseJsonStream, safeJsonStringify } from "./parse/json";
|
|
41
|
-
export { formatHumanReadableDate } from "./parse/time";
|
|
42
|
-
export { validateWithZod, zodToJsonSchema } from "./parse/zod";
|
|
43
|
-
export {
|
|
44
|
-
formatFileContentBlock,
|
|
45
|
-
formatUserInputBlock,
|
|
46
|
-
normalizeUserInput,
|
|
47
|
-
xmlTagsRemoval,
|
|
48
|
-
} from "./prompt/format";
|
|
49
|
-
export { REMOTE_URI_SCHEME } from "./remote-config/constants";
|
|
50
|
-
export type {
|
|
51
|
-
AnthropicModel,
|
|
52
|
-
AnthropicSettings,
|
|
53
|
-
APIKeySettings,
|
|
54
|
-
AwsBedrockCustomModel,
|
|
55
|
-
AwsBedrockModel,
|
|
56
|
-
AwsBedrockSettings,
|
|
57
|
-
EnterpriseTelemetry,
|
|
58
|
-
GlobalInstructionsFile,
|
|
59
|
-
LiteLLMModel,
|
|
60
|
-
LiteLLMSettings,
|
|
61
|
-
MCPServer,
|
|
62
|
-
OpenAiCompatible,
|
|
63
|
-
OpenAiCompatibleModel,
|
|
64
|
-
PromptUploading,
|
|
65
|
-
ProviderSettings,
|
|
66
|
-
RemoteConfig,
|
|
67
|
-
RemoteMCPServer,
|
|
68
|
-
S3AccessKeySettings,
|
|
69
|
-
VertexModel,
|
|
70
|
-
VertexSettings,
|
|
71
|
-
} from "./remote-config/schema";
|
|
72
|
-
export {
|
|
73
|
-
AllowedMCPServerSchema,
|
|
74
|
-
AnthropicModelSchema,
|
|
75
|
-
AnthropicSchema,
|
|
76
|
-
APIKeySchema,
|
|
77
|
-
AwsBedrockCustomModelSchema,
|
|
78
|
-
AwsBedrockModelSchema,
|
|
79
|
-
AwsBedrockSettingsSchema,
|
|
80
|
-
ClineModelSchema,
|
|
81
|
-
ClineSettingsSchema,
|
|
82
|
-
EnterpriseTelemetrySchema,
|
|
83
|
-
GlobalInstructionsFileSchema,
|
|
84
|
-
LiteLLMModelSchema,
|
|
85
|
-
LiteLLMSchema,
|
|
86
|
-
OpenAiCompatibleModelSchema,
|
|
87
|
-
OpenAiCompatibleSchema,
|
|
88
|
-
PromptUploadingSchema,
|
|
89
|
-
RemoteConfigSchema,
|
|
90
|
-
RemoteMCPServerSchema,
|
|
91
|
-
S3AccessKeySettingsSchema,
|
|
92
|
-
VertexModelSchema,
|
|
93
|
-
VertexSettingsSchema,
|
|
94
|
-
} from "./remote-config/schema";
|
|
95
|
-
export { CLINE_DEFAULT_RPC_ADDRESS, CLINE_DEFAULT_RPC_PORT } from "./rpc";
|
|
96
|
-
export type {
|
|
97
|
-
RpcAddProviderActionRequest,
|
|
98
|
-
RpcAgentMode,
|
|
99
|
-
RpcChatAttachmentFile,
|
|
100
|
-
RpcChatAttachments,
|
|
101
|
-
RpcChatMessage,
|
|
102
|
-
RpcChatRunTurnRequest,
|
|
103
|
-
RpcChatRuntimeConfigBase,
|
|
104
|
-
RpcChatRuntimeLoggerConfig,
|
|
105
|
-
RpcChatStartSessionArtifacts,
|
|
106
|
-
RpcChatStartSessionRequest,
|
|
107
|
-
RpcChatStartSessionResponse,
|
|
108
|
-
RpcChatToolCallResult,
|
|
109
|
-
RpcChatTurnResult,
|
|
110
|
-
RpcClineAccountActionRequest,
|
|
111
|
-
RpcClineAccountBalance,
|
|
112
|
-
RpcClineAccountOrganization,
|
|
113
|
-
RpcClineAccountOrganizationBalance,
|
|
114
|
-
RpcClineAccountOrganizationUsageTransaction,
|
|
115
|
-
RpcClineAccountPaymentTransaction,
|
|
116
|
-
RpcClineAccountUsageTransaction,
|
|
117
|
-
RpcClineAccountUser,
|
|
118
|
-
RpcGetProviderModelsActionRequest,
|
|
119
|
-
RpcListProvidersActionRequest,
|
|
120
|
-
RpcOAuthProviderId,
|
|
121
|
-
RpcProviderActionRequest,
|
|
122
|
-
RpcProviderCapability,
|
|
123
|
-
RpcProviderCatalogResponse,
|
|
124
|
-
RpcProviderListItem,
|
|
125
|
-
RpcProviderModel,
|
|
126
|
-
RpcProviderModelsResponse,
|
|
127
|
-
RpcProviderOAuthLoginResponse,
|
|
128
|
-
RpcProviderSettingsActionRequest,
|
|
129
|
-
RpcSaveProviderSettingsActionRequest,
|
|
130
|
-
RpcSessionStorageOptions,
|
|
131
|
-
} from "./rpc/runtime";
|
|
132
|
-
export type {
|
|
133
|
-
TeamProgressCounts,
|
|
134
|
-
TeamProgressLifecycleEvent,
|
|
135
|
-
TeamProgressMemberRole,
|
|
136
|
-
TeamProgressMemberStatus,
|
|
137
|
-
TeamProgressOutcomeFragmentStatus,
|
|
138
|
-
TeamProgressOutcomeStatus,
|
|
139
|
-
TeamProgressProjectionEvent,
|
|
140
|
-
TeamProgressRunStatus,
|
|
141
|
-
TeamProgressSummary,
|
|
142
|
-
TeamProgressTaskStatus,
|
|
143
|
-
} from "./rpc/team-progress";
|
|
144
|
-
export {
|
|
145
|
-
RPC_TEAM_LIFECYCLE_EVENT_TYPE,
|
|
146
|
-
RPC_TEAM_PROGRESS_EVENT_TYPE,
|
|
147
|
-
} from "./rpc/team-progress";
|
|
148
|
-
export type {
|
|
149
|
-
ITelemetryService,
|
|
150
|
-
OpenTelemetryClientConfig,
|
|
151
|
-
TelemetryArray,
|
|
152
|
-
TelemetryMetadata,
|
|
153
|
-
TelemetryObject,
|
|
154
|
-
TelemetryPrimitive,
|
|
155
|
-
TelemetryProperties,
|
|
156
|
-
TelemetryValue,
|
|
157
|
-
} from "./services/telemetry";
|
|
158
|
-
export type { ClineTelemetryServiceConfig } from "./services/telemetry-config";
|
|
159
|
-
export {
|
|
160
|
-
createClineTelemetryServiceConfig,
|
|
161
|
-
createClineTelemetryServiceMetadata,
|
|
162
|
-
} from "./services/telemetry-config";
|
|
163
|
-
export type {
|
|
164
|
-
HookSessionContext,
|
|
165
|
-
HookSessionContextLookup,
|
|
166
|
-
HookSessionContextProvider,
|
|
167
|
-
} from "./session/hook-context";
|
|
168
|
-
export {
|
|
169
|
-
resolveHookLogPath,
|
|
170
|
-
resolveHookSessionContext,
|
|
171
|
-
resolveRootSessionId,
|
|
172
|
-
} from "./session/hook-context";
|
|
173
|
-
export type {
|
|
174
|
-
SessionLineage,
|
|
175
|
-
SessionRuntimeRecordShape,
|
|
176
|
-
SharedSessionStatus,
|
|
177
|
-
} from "./session/records";
|
|
178
|
-
export { SESSION_STATUS_VALUES } from "./session/records";
|
|
179
|
-
export type {
|
|
180
|
-
AgentMode,
|
|
181
|
-
SessionExecutionConfig,
|
|
182
|
-
SessionPromptConfig,
|
|
183
|
-
SessionWorkspaceConfig,
|
|
184
|
-
} from "./session/runtime-config";
|
|
185
|
-
export type { RuntimeEnv } from "./session/runtime-env";
|
|
186
|
-
// VCR is Node-only (uses node:fs, node:path) — excluded from browser build
|
|
187
|
-
export type { VcrRecording } from "./vcr";
|
package/src/index.ts
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
export type { OAuthProviderId } from "./auth/constants";
|
|
2
|
-
export {
|
|
3
|
-
AUTH_ERROR_PATTERNS,
|
|
4
|
-
isLikelyAuthError,
|
|
5
|
-
isOAuthProviderId,
|
|
6
|
-
OAUTH_PROVIDER_IDS,
|
|
7
|
-
} from "./auth/constants";
|
|
8
|
-
export type * from "./connectors/adapters";
|
|
9
|
-
export type {
|
|
10
|
-
ConnectorAuthorizationDecision,
|
|
11
|
-
ConnectorAuthorizationRequest,
|
|
12
|
-
ConnectorEventActor,
|
|
13
|
-
ConnectorEventContext,
|
|
14
|
-
ConnectorHookEvent,
|
|
15
|
-
ConnectorHookEventName,
|
|
16
|
-
} from "./connectors/events";
|
|
17
|
-
export {
|
|
18
|
-
ConnectorAuthorizationDecisionSchema,
|
|
19
|
-
ConnectorAuthorizationRequestSchema,
|
|
20
|
-
ConnectorEventActorSchema,
|
|
21
|
-
ConnectorEventContextSchema,
|
|
22
|
-
ConnectorHookEventNameSchema,
|
|
23
|
-
ConnectorHookEventSchema,
|
|
24
|
-
} from "./connectors/events";
|
|
25
|
-
export {
|
|
26
|
-
MODELS_DEV_PROVIDER_KEY_ENTRIES,
|
|
27
|
-
MODELS_DEV_PROVIDER_KEY_MAP,
|
|
28
|
-
resolveProviderModelCatalogKeys,
|
|
29
|
-
} from "./llms/model-id";
|
|
30
|
-
export type {
|
|
31
|
-
Tool,
|
|
32
|
-
ToolApprovalRequest,
|
|
33
|
-
ToolApprovalResult,
|
|
34
|
-
ToolCallRecord,
|
|
35
|
-
ToolContext,
|
|
36
|
-
ToolPolicy,
|
|
37
|
-
} from "./llms/tools";
|
|
38
|
-
export { ToolCallRecordSchema, ToolContextSchema } from "./llms/tools";
|
|
39
|
-
export type { BasicLogger } from "./logging/logger";
|
|
40
|
-
export { parseJsonStream, safeJsonStringify } from "./parse/json";
|
|
41
|
-
export { formatHumanReadableDate } from "./parse/time";
|
|
42
|
-
export { validateWithZod, zodToJsonSchema } from "./parse/zod";
|
|
43
|
-
export {
|
|
44
|
-
formatFileContentBlock,
|
|
45
|
-
formatUserInputBlock,
|
|
46
|
-
normalizeUserInput,
|
|
47
|
-
xmlTagsRemoval,
|
|
48
|
-
} from "./prompt/format";
|
|
49
|
-
export { REMOTE_URI_SCHEME } from "./remote-config/constants";
|
|
50
|
-
export type {
|
|
51
|
-
AnthropicModel,
|
|
52
|
-
AnthropicSettings,
|
|
53
|
-
APIKeySettings,
|
|
54
|
-
AwsBedrockCustomModel,
|
|
55
|
-
AwsBedrockModel,
|
|
56
|
-
AwsBedrockSettings,
|
|
57
|
-
EnterpriseTelemetry,
|
|
58
|
-
GlobalInstructionsFile,
|
|
59
|
-
LiteLLMModel,
|
|
60
|
-
LiteLLMSettings,
|
|
61
|
-
MCPServer,
|
|
62
|
-
OpenAiCompatible,
|
|
63
|
-
OpenAiCompatibleModel,
|
|
64
|
-
PromptUploading,
|
|
65
|
-
ProviderSettings,
|
|
66
|
-
RemoteConfig,
|
|
67
|
-
RemoteMCPServer,
|
|
68
|
-
S3AccessKeySettings,
|
|
69
|
-
VertexModel,
|
|
70
|
-
VertexSettings,
|
|
71
|
-
} from "./remote-config/schema";
|
|
72
|
-
export {
|
|
73
|
-
AllowedMCPServerSchema,
|
|
74
|
-
AnthropicModelSchema,
|
|
75
|
-
AnthropicSchema,
|
|
76
|
-
APIKeySchema,
|
|
77
|
-
AwsBedrockCustomModelSchema,
|
|
78
|
-
AwsBedrockModelSchema,
|
|
79
|
-
AwsBedrockSettingsSchema,
|
|
80
|
-
ClineModelSchema,
|
|
81
|
-
ClineSettingsSchema,
|
|
82
|
-
EnterpriseTelemetrySchema,
|
|
83
|
-
GlobalInstructionsFileSchema,
|
|
84
|
-
LiteLLMModelSchema,
|
|
85
|
-
LiteLLMSchema,
|
|
86
|
-
OpenAiCompatibleModelSchema,
|
|
87
|
-
OpenAiCompatibleSchema,
|
|
88
|
-
PromptUploadingSchema,
|
|
89
|
-
RemoteConfigSchema,
|
|
90
|
-
RemoteMCPServerSchema,
|
|
91
|
-
S3AccessKeySettingsSchema,
|
|
92
|
-
VertexModelSchema,
|
|
93
|
-
VertexSettingsSchema,
|
|
94
|
-
} from "./remote-config/schema";
|
|
95
|
-
export { CLINE_DEFAULT_RPC_ADDRESS, CLINE_DEFAULT_RPC_PORT } from "./rpc";
|
|
96
|
-
export type {
|
|
97
|
-
RpcAddProviderActionRequest,
|
|
98
|
-
RpcAgentMode,
|
|
99
|
-
RpcChatAttachmentFile,
|
|
100
|
-
RpcChatAttachments,
|
|
101
|
-
RpcChatMessage,
|
|
102
|
-
RpcChatRunTurnRequest,
|
|
103
|
-
RpcChatRuntimeConfigBase,
|
|
104
|
-
RpcChatRuntimeLoggerConfig,
|
|
105
|
-
RpcChatStartSessionArtifacts,
|
|
106
|
-
RpcChatStartSessionRequest,
|
|
107
|
-
RpcChatStartSessionResponse,
|
|
108
|
-
RpcChatToolCallResult,
|
|
109
|
-
RpcChatTurnResult,
|
|
110
|
-
RpcClineAccountActionRequest,
|
|
111
|
-
RpcClineAccountBalance,
|
|
112
|
-
RpcClineAccountOrganization,
|
|
113
|
-
RpcClineAccountOrganizationBalance,
|
|
114
|
-
RpcClineAccountOrganizationUsageTransaction,
|
|
115
|
-
RpcClineAccountPaymentTransaction,
|
|
116
|
-
RpcClineAccountUsageTransaction,
|
|
117
|
-
RpcClineAccountUser,
|
|
118
|
-
RpcGetProviderModelsActionRequest,
|
|
119
|
-
RpcListProvidersActionRequest,
|
|
120
|
-
RpcOAuthProviderId,
|
|
121
|
-
RpcProviderActionRequest,
|
|
122
|
-
RpcProviderCapability,
|
|
123
|
-
RpcProviderCatalogResponse,
|
|
124
|
-
RpcProviderListItem,
|
|
125
|
-
RpcProviderModel,
|
|
126
|
-
RpcProviderModelsResponse,
|
|
127
|
-
RpcProviderOAuthLoginResponse,
|
|
128
|
-
RpcProviderSettingsActionRequest,
|
|
129
|
-
RpcSaveProviderSettingsActionRequest,
|
|
130
|
-
RpcSessionStorageOptions,
|
|
131
|
-
} from "./rpc/runtime";
|
|
132
|
-
export type {
|
|
133
|
-
TeamProgressCounts,
|
|
134
|
-
TeamProgressLifecycleEvent,
|
|
135
|
-
TeamProgressMemberRole,
|
|
136
|
-
TeamProgressMemberStatus,
|
|
137
|
-
TeamProgressOutcomeFragmentStatus,
|
|
138
|
-
TeamProgressOutcomeStatus,
|
|
139
|
-
TeamProgressProjectionEvent,
|
|
140
|
-
TeamProgressRunStatus,
|
|
141
|
-
TeamProgressSummary,
|
|
142
|
-
TeamProgressTaskStatus,
|
|
143
|
-
} from "./rpc/team-progress";
|
|
144
|
-
export {
|
|
145
|
-
RPC_TEAM_LIFECYCLE_EVENT_TYPE,
|
|
146
|
-
RPC_TEAM_PROGRESS_EVENT_TYPE,
|
|
147
|
-
} from "./rpc/team-progress";
|
|
148
|
-
export type {
|
|
149
|
-
ITelemetryService,
|
|
150
|
-
OpenTelemetryClientConfig,
|
|
151
|
-
TelemetryArray,
|
|
152
|
-
TelemetryMetadata,
|
|
153
|
-
TelemetryObject,
|
|
154
|
-
TelemetryPrimitive,
|
|
155
|
-
TelemetryProperties,
|
|
156
|
-
TelemetryValue,
|
|
157
|
-
} from "./services/telemetry";
|
|
158
|
-
export type { ClineTelemetryServiceConfig } from "./services/telemetry-config";
|
|
159
|
-
export {
|
|
160
|
-
createClineTelemetryServiceConfig,
|
|
161
|
-
createClineTelemetryServiceMetadata,
|
|
162
|
-
} from "./services/telemetry-config";
|
|
163
|
-
export type {
|
|
164
|
-
HookSessionContext,
|
|
165
|
-
HookSessionContextLookup,
|
|
166
|
-
HookSessionContextProvider,
|
|
167
|
-
} from "./session/hook-context";
|
|
168
|
-
export {
|
|
169
|
-
resolveHookLogPath,
|
|
170
|
-
resolveHookSessionContext,
|
|
171
|
-
resolveRootSessionId,
|
|
172
|
-
} from "./session/hook-context";
|
|
173
|
-
export type {
|
|
174
|
-
SessionLineage,
|
|
175
|
-
SessionRuntimeRecordShape,
|
|
176
|
-
SharedSessionStatus,
|
|
177
|
-
} from "./session/records";
|
|
178
|
-
export { SESSION_STATUS_VALUES } from "./session/records";
|
|
179
|
-
export type {
|
|
180
|
-
AgentMode,
|
|
181
|
-
SessionExecutionConfig,
|
|
182
|
-
SessionPromptConfig,
|
|
183
|
-
SessionWorkspaceConfig,
|
|
184
|
-
} from "./session/runtime-config";
|
|
185
|
-
export type { RuntimeEnv } from "./session/runtime-env";
|
|
186
|
-
export type { VcrRecording } from "./vcr";
|
|
187
|
-
export { initVcr } from "./vcr";
|
package/src/llms/model-id.ts
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
export const MODELS_DEV_PROVIDER_KEY_ENTRIES: ReadonlyArray<{
|
|
2
|
-
modelsDevKey: string;
|
|
3
|
-
generatedProviderId?: string;
|
|
4
|
-
runtimeProviderId?: string;
|
|
5
|
-
}> = [
|
|
6
|
-
{
|
|
7
|
-
modelsDevKey: "openai",
|
|
8
|
-
generatedProviderId: "openai",
|
|
9
|
-
runtimeProviderId: "openai-native",
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
modelsDevKey: "openai",
|
|
13
|
-
generatedProviderId: "openai",
|
|
14
|
-
runtimeProviderId: "openai-codex",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
modelsDevKey: "anthropic",
|
|
18
|
-
generatedProviderId: "anthropic",
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
modelsDevKey: "anthropic",
|
|
22
|
-
generatedProviderId: "anthropic",
|
|
23
|
-
runtimeProviderId: "claude-code",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
modelsDevKey: "google",
|
|
27
|
-
generatedProviderId: "gemini",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
modelsDevKey: "deepseek",
|
|
31
|
-
generatedProviderId: "deepseek",
|
|
32
|
-
},
|
|
33
|
-
{ modelsDevKey: "xai", generatedProviderId: "xai" },
|
|
34
|
-
{
|
|
35
|
-
modelsDevKey: "togetherai",
|
|
36
|
-
runtimeProviderId: "together",
|
|
37
|
-
generatedProviderId: "together",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
modelsDevKey: "sap-ai-core",
|
|
41
|
-
runtimeProviderId: "sapaicore",
|
|
42
|
-
generatedProviderId: "sapaicore",
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
modelsDevKey: "fireworks-ai",
|
|
46
|
-
runtimeProviderId: "fireworks",
|
|
47
|
-
generatedProviderId: "fireworks",
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
modelsDevKey: "groq",
|
|
51
|
-
runtimeProviderId: "groq",
|
|
52
|
-
generatedProviderId: "groq",
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
modelsDevKey: "cerebras",
|
|
56
|
-
runtimeProviderId: "cerebras",
|
|
57
|
-
generatedProviderId: "cerebras",
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
modelsDevKey: "sambanova",
|
|
61
|
-
runtimeProviderId: "sambanova",
|
|
62
|
-
generatedProviderId: "sambanova",
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
modelsDevKey: "nebius",
|
|
66
|
-
runtimeProviderId: "nebius",
|
|
67
|
-
generatedProviderId: "nebius",
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
modelsDevKey: "huggingface",
|
|
71
|
-
runtimeProviderId: "huggingface",
|
|
72
|
-
generatedProviderId: "huggingface",
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
modelsDevKey: "openrouter",
|
|
76
|
-
runtimeProviderId: "cline",
|
|
77
|
-
generatedProviderId: "openrouter",
|
|
78
|
-
},
|
|
79
|
-
{ modelsDevKey: "ollama", runtimeProviderId: "ollama-cloud" },
|
|
80
|
-
{ modelsDevKey: "ollama-cloud", generatedProviderId: "ollama" },
|
|
81
|
-
{
|
|
82
|
-
modelsDevKey: "vercel",
|
|
83
|
-
runtimeProviderId: "dify",
|
|
84
|
-
generatedProviderId: "vercel-ai-gateway",
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
modelsDevKey: "vercel",
|
|
88
|
-
generatedProviderId: "vercel-ai-gateway",
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
modelsDevKey: "aihubmix",
|
|
92
|
-
runtimeProviderId: "aihubmix",
|
|
93
|
-
generatedProviderId: "aihubmix",
|
|
94
|
-
},
|
|
95
|
-
{ modelsDevKey: "hicap", runtimeProviderId: "hicap" },
|
|
96
|
-
{ modelsDevKey: "nous-research", runtimeProviderId: "nousResearch" },
|
|
97
|
-
{ modelsDevKey: "huawei-cloud-maas", runtimeProviderId: "huawei-cloud-maas" },
|
|
98
|
-
{
|
|
99
|
-
modelsDevKey: "baseten",
|
|
100
|
-
runtimeProviderId: "baseten",
|
|
101
|
-
generatedProviderId: "baseten",
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
modelsDevKey: "google-vertex-anthropic",
|
|
105
|
-
generatedProviderId: "vertex",
|
|
106
|
-
},
|
|
107
|
-
{ modelsDevKey: "lmstudio", generatedProviderId: "lmstudio" },
|
|
108
|
-
{ modelsDevKey: "zai", generatedProviderId: "zai" },
|
|
109
|
-
{ modelsDevKey: "requesty", generatedProviderId: "requesty" },
|
|
110
|
-
{ modelsDevKey: "amazon-bedrock", generatedProviderId: "bedrock" },
|
|
111
|
-
{ modelsDevKey: "moonshotai", generatedProviderId: "moonshot" },
|
|
112
|
-
{ modelsDevKey: "minimax", generatedProviderId: "minimax" },
|
|
113
|
-
];
|
|
114
|
-
|
|
115
|
-
function buildProviderKeyMap(
|
|
116
|
-
key: "modelsDevKey" | "generatedProviderId",
|
|
117
|
-
): Record<string, string> {
|
|
118
|
-
return Object.fromEntries(
|
|
119
|
-
MODELS_DEV_PROVIDER_KEY_ENTRIES.flatMap((entry) => {
|
|
120
|
-
const providerId =
|
|
121
|
-
key === "modelsDevKey" ? entry.modelsDevKey : entry.generatedProviderId;
|
|
122
|
-
return providerId ? [[entry.modelsDevKey, providerId]] : [];
|
|
123
|
-
}),
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export const MODELS_DEV_PROVIDER_KEY_MAP = buildProviderKeyMap(
|
|
128
|
-
"generatedProviderId",
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
function dedupe(values: readonly string[]): string[] {
|
|
132
|
-
return [...new Set(values)];
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export function resolveProviderModelCatalogKeys(providerId: string): string[] {
|
|
136
|
-
const mapped = MODELS_DEV_PROVIDER_KEY_ENTRIES.flatMap((entry) => {
|
|
137
|
-
if (!entry.generatedProviderId) {
|
|
138
|
-
return [];
|
|
139
|
-
}
|
|
140
|
-
if (
|
|
141
|
-
entry.generatedProviderId === providerId ||
|
|
142
|
-
entry.runtimeProviderId === providerId
|
|
143
|
-
) {
|
|
144
|
-
return [entry.generatedProviderId];
|
|
145
|
-
}
|
|
146
|
-
return [];
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
if (providerId === "nousResearch") {
|
|
150
|
-
return dedupe([...mapped, "nousresearch", providerId]);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return dedupe([...mapped, providerId]);
|
|
154
|
-
}
|
package/src/llms/tools.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Types and Zod Schemas for the Agent Package
|
|
3
|
-
*
|
|
4
|
-
* This module defines all TypeScript types and Zod validation schemas
|
|
5
|
-
* for agent configuration, tools, events, and results.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { z } from "zod";
|
|
9
|
-
|
|
10
|
-
// =============================================================================
|
|
11
|
-
// Tool Context
|
|
12
|
-
// =============================================================================
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Context passed to tool execution functions
|
|
16
|
-
*/
|
|
17
|
-
export interface ToolContext {
|
|
18
|
-
/** Unique identifier for the agent instance */
|
|
19
|
-
agentId: string;
|
|
20
|
-
/** Unique identifier for the current conversation */
|
|
21
|
-
conversationId: string;
|
|
22
|
-
/** Current iteration number in the agentic loop */
|
|
23
|
-
iteration: number;
|
|
24
|
-
/** Abort signal for cancellation */
|
|
25
|
-
abortSignal?: AbortSignal;
|
|
26
|
-
/** Optional metadata for the tool execution */
|
|
27
|
-
metadata?: Record<string, unknown>;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface ToolPolicy {
|
|
31
|
-
/**
|
|
32
|
-
* Whether the tool can be executed at all.
|
|
33
|
-
* @default true
|
|
34
|
-
*/
|
|
35
|
-
enabled?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Whether this tool can run without asking the client for approval.
|
|
38
|
-
* @default true
|
|
39
|
-
*/
|
|
40
|
-
autoApprove?: boolean;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export const ToolContextSchema = z.object({
|
|
44
|
-
agentId: z.string(),
|
|
45
|
-
conversationId: z.string(),
|
|
46
|
-
iteration: z.number(),
|
|
47
|
-
abortSignal: z.custom<AbortSignal>().optional(),
|
|
48
|
-
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// =============================================================================
|
|
52
|
-
// Tool Definition
|
|
53
|
-
// =============================================================================
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* A tool that the agent can use
|
|
57
|
-
*
|
|
58
|
-
* @template TInput - The type of the input to the tool
|
|
59
|
-
* @template TOutput - The type of the output from the tool
|
|
60
|
-
*/
|
|
61
|
-
export interface Tool<TInput = unknown, TOutput = unknown> {
|
|
62
|
-
/** Unique name for the tool */
|
|
63
|
-
name: string;
|
|
64
|
-
/** Human-readable description of what the tool does */
|
|
65
|
-
description: string;
|
|
66
|
-
/** JSON Schema defining the tool's input parameters */
|
|
67
|
-
inputSchema: Record<string, unknown>;
|
|
68
|
-
/** The function that executes the tool */
|
|
69
|
-
execute: (input: TInput, context: ToolContext) => Promise<TOutput>;
|
|
70
|
-
/**
|
|
71
|
-
* Optional timeout in milliseconds for tool execution
|
|
72
|
-
* @default 30000 (30 seconds)
|
|
73
|
-
*/
|
|
74
|
-
timeoutMs?: number;
|
|
75
|
-
/**
|
|
76
|
-
* Whether the tool can be retried on failure
|
|
77
|
-
* @default true
|
|
78
|
-
*/
|
|
79
|
-
retryable?: boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Maximum number of retries for this tool
|
|
82
|
-
* @default 2
|
|
83
|
-
*/
|
|
84
|
-
maxRetries?: number;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// =============================================================================
|
|
88
|
-
// Tool Call Record
|
|
89
|
-
// =============================================================================
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Record of a tool call execution
|
|
93
|
-
*/
|
|
94
|
-
export interface ToolCallRecord {
|
|
95
|
-
/** Unique identifier for this tool call */
|
|
96
|
-
id: string;
|
|
97
|
-
/** Name of the tool that was called */
|
|
98
|
-
name: string;
|
|
99
|
-
/** Input passed to the tool */
|
|
100
|
-
input: unknown;
|
|
101
|
-
/** Output returned from the tool (if successful) */
|
|
102
|
-
output: unknown;
|
|
103
|
-
/** Error message (if the tool failed) */
|
|
104
|
-
error?: string;
|
|
105
|
-
/** Time taken to execute the tool in milliseconds */
|
|
106
|
-
durationMs: number;
|
|
107
|
-
/** Timestamp when the tool call started */
|
|
108
|
-
startedAt: Date;
|
|
109
|
-
/** Timestamp when the tool call ended */
|
|
110
|
-
endedAt: Date;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export interface ToolApprovalRequest {
|
|
114
|
-
agentId: string;
|
|
115
|
-
conversationId: string;
|
|
116
|
-
iteration: number;
|
|
117
|
-
toolCallId: string;
|
|
118
|
-
toolName: string;
|
|
119
|
-
input: unknown;
|
|
120
|
-
policy: ToolPolicy;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export interface ToolApprovalResult {
|
|
124
|
-
approved: boolean;
|
|
125
|
-
reason?: string;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export const ToolCallRecordSchema = z.object({
|
|
129
|
-
id: z.string(),
|
|
130
|
-
name: z.string(),
|
|
131
|
-
input: z.unknown(),
|
|
132
|
-
output: z.unknown(),
|
|
133
|
-
error: z.string().optional(),
|
|
134
|
-
durationMs: z.number(),
|
|
135
|
-
startedAt: z.date(),
|
|
136
|
-
endedAt: z.date(),
|
|
137
|
-
});
|
package/src/logging/logger.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface BasicLogger {
|
|
2
|
-
debug?: (message: string, metadata?: Record<string, unknown>) => void;
|
|
3
|
-
info?: (message: string, metadata?: Record<string, unknown>) => void;
|
|
4
|
-
warn?: (message: string, metadata?: Record<string, unknown>) => void;
|
|
5
|
-
error?: (
|
|
6
|
-
message: string,
|
|
7
|
-
metadata?: Record<string, unknown> & { error?: unknown },
|
|
8
|
-
) => void;
|
|
9
|
-
}
|