memeloop 0.0.1 → 0.1.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 +63 -0
- package/dist/browser.cjs +1413 -0
- package/dist/browser.cjs.map +1 -0
- package/dist/browser.d.cts +3066 -0
- package/dist/browser.d.ts +3066 -0
- package/dist/browser.js +43 -0
- package/dist/chunk-2C6BJZI3.js +382 -0
- package/dist/chunk-2C6BJZI3.js.map +1 -0
- package/dist/chunk-426CJUZP.js +630 -0
- package/dist/chunk-426CJUZP.js.map +1 -0
- package/dist/chunk-7ZDTB4VZ.js +63 -0
- package/dist/chunk-7ZDTB4VZ.js.map +1 -0
- package/dist/chunk-AZFYDWIN.js +98 -0
- package/dist/chunk-AZFYDWIN.js.map +1 -0
- package/dist/chunk-BGPU4RR7.js +367 -0
- package/dist/chunk-BGPU4RR7.js.map +1 -0
- package/dist/chunk-CCEFAOSH.js +496 -0
- package/dist/chunk-CCEFAOSH.js.map +1 -0
- package/dist/chunk-FWSY5HOA.js +63 -0
- package/dist/chunk-FWSY5HOA.js.map +1 -0
- package/dist/chunk-GYIOMQMY.js +8726 -0
- package/dist/chunk-GYIOMQMY.js.map +1 -0
- package/dist/chunk-K6P63KD4.js +68 -0
- package/dist/chunk-K6P63KD4.js.map +1 -0
- package/dist/chunk-KFS2EJT6.js +42 -0
- package/dist/chunk-KFS2EJT6.js.map +1 -0
- package/dist/chunk-MAJWHAKR.js +3637 -0
- package/dist/chunk-MAJWHAKR.js.map +1 -0
- package/dist/chunk-MRKY4HGF.js +205 -0
- package/dist/chunk-MRKY4HGF.js.map +1 -0
- package/dist/chunk-T7FSXWFR.js +2744 -0
- package/dist/chunk-T7FSXWFR.js.map +1 -0
- package/dist/chunk-VZKQX5PP.js +1 -0
- package/dist/chunk-VZKQX5PP.js.map +1 -0
- package/dist/chunk-WAI6BODI.js +175 -0
- package/dist/chunk-WAI6BODI.js.map +1 -0
- package/dist/chunk-YMNXDNDW.js +798 -0
- package/dist/chunk-YMNXDNDW.js.map +1 -0
- package/dist/conversation.cjs +208 -0
- package/dist/conversation.cjs.map +1 -0
- package/dist/conversation.d.cts +100 -0
- package/dist/conversation.d.ts +100 -0
- package/dist/conversation.js +21 -0
- package/dist/conversation.js.map +1 -0
- package/dist/device-network-portable.cjs +702 -0
- package/dist/device-network-portable.cjs.map +1 -0
- package/dist/device-network-portable.d.cts +110 -0
- package/dist/device-network-portable.d.ts +110 -0
- package/dist/device-network-portable.js +53 -0
- package/dist/device-network-portable.js.map +1 -0
- package/dist/device-network.cjs +906 -0
- package/dist/device-network.cjs.map +1 -0
- package/dist/device-network.d.cts +6 -0
- package/dist/device-network.d.ts +6 -0
- package/dist/device-network.js +59 -0
- package/dist/device-network.js.map +1 -0
- package/dist/fetchProvider-WWnWnQFP.d.ts +91 -0
- package/dist/fetchProvider-toTHy5Nu.d.cts +91 -0
- package/dist/index.cjs +28051 -5459
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +94 -1320
- package/dist/index.d.ts +94 -1320
- package/dist/index.js +10616 -2420
- package/dist/index.js.map +1 -1
- package/dist/interface-IrKBFtL1.d.cts +493 -0
- package/dist/interface-IrKBFtL1.d.ts +493 -0
- package/dist/llm-providers.cjs +43 -8
- package/dist/llm-providers.cjs.map +1 -1
- package/dist/llm-providers.d.cts +2 -1
- package/dist/llm-providers.d.ts +2 -1
- package/dist/llm-providers.js +4 -2
- package/dist/llm-providers.js.map +1 -1
- package/dist/loop-api.cjs +5227 -2010
- package/dist/loop-api.cjs.map +1 -1
- package/dist/loop-api.d.cts +11 -5
- package/dist/loop-api.d.ts +11 -5
- package/dist/loop-api.js +86 -49
- package/dist/mobile.cjs +2711 -0
- package/dist/mobile.cjs.map +1 -0
- package/dist/mobile.d.cts +6 -0
- package/dist/mobile.d.ts +6 -0
- package/dist/mobile.js +22 -0
- package/dist/mobile.js.map +1 -0
- package/dist/orchestration-portable-BHB_YrNN.d.ts +2192 -0
- package/dist/orchestration-portable-mvYBvGBb.d.cts +2192 -0
- package/dist/orchestration-portable.cjs +9553 -0
- package/dist/orchestration-portable.cjs.map +1 -0
- package/dist/orchestration-portable.d.cts +5 -0
- package/dist/orchestration-portable.d.ts +5 -0
- package/dist/orchestration-portable.js +290 -0
- package/dist/orchestration-portable.js.map +1 -0
- package/dist/pairingInvite-BXPWY3aM.d.cts +149 -0
- package/dist/pairingInvite-Cuz0wuq9.d.ts +149 -0
- package/dist/promptConcat-0WNFTg4l.d.ts +516 -0
- package/dist/promptConcat-D6wr5V-V.d.cts +516 -0
- package/dist/providerRegistry-Bi6pAvSj.d.ts +86 -0
- package/dist/providerRegistry-CPsktuiX.d.cts +86 -0
- package/dist/registry-D0kbxksn.d.cts +393 -0
- package/dist/registry-DDbvhlhs.d.ts +393 -0
- package/dist/remoteClient-B_spK019.d.ts +87 -0
- package/dist/remoteClient-CBggnRy3.d.cts +87 -0
- package/dist/runtime-PGWR6FIV.js +18 -0
- package/dist/runtime-PGWR6FIV.js.map +1 -0
- package/dist/scriptDeploymentPipeline-CXJcC82H.d.ts +2464 -0
- package/dist/scriptDeploymentPipeline-yG1ZhVVI.d.cts +2464 -0
- package/dist/syncCloudDevices-BEqwgrhD.d.ts +49 -0
- package/dist/syncCloudDevices-Ds_Kcgrv.d.cts +49 -0
- package/dist/types-7pYti-k9.d.cts +255 -0
- package/dist/types-CdFVSntj.d.ts +255 -0
- package/package.json +110 -35
- package/dist/anthropic.cjs +0 -72
- package/dist/anthropic.cjs.map +0 -1
- package/dist/anthropic.d.cts +0 -21
- package/dist/anthropic.d.ts +0 -21
- package/dist/anthropic.js +0 -21
- package/dist/anthropic.js.map +0 -1
- package/dist/azure.cjs +0 -72
- package/dist/azure.cjs.map +0 -1
- package/dist/azure.d.cts +0 -21
- package/dist/azure.d.ts +0 -21
- package/dist/azure.js +0 -21
- package/dist/azure.js.map +0 -1
- package/dist/chunk-3CN7DFBL.js +0 -4894
- package/dist/chunk-3CN7DFBL.js.map +0 -1
- package/dist/chunk-4AZ4D7U5.js +0 -32
- package/dist/chunk-4AZ4D7U5.js.map +0 -1
- package/dist/chunk-6ON4XSOV.js +0 -63
- package/dist/chunk-6ON4XSOV.js.map +0 -1
- package/dist/chunk-DJQNGIXX.js +0 -4793
- package/dist/chunk-DJQNGIXX.js.map +0 -1
- package/dist/chunk-FKQP6AOQ.js +0 -32
- package/dist/chunk-FKQP6AOQ.js.map +0 -1
- package/dist/chunk-OVJ7JJBA.js +0 -35
- package/dist/chunk-OVJ7JJBA.js.map +0 -1
- package/dist/chunk-P4UZ7IXC.js +0 -42
- package/dist/chunk-YHJ2AEFR.js +0 -4933
- package/dist/chunk-YHJ2AEFR.js.map +0 -1
- package/dist/chunk-YVK7RYRO.js +0 -4973
- package/dist/chunk-YVK7RYRO.js.map +0 -1
- package/dist/code-assistant.json +0 -114
- package/dist/cohere.cjs +0 -72
- package/dist/cohere.cjs.map +0 -1
- package/dist/cohere.d.cts +0 -21
- package/dist/cohere.d.ts +0 -21
- package/dist/cohere.js +0 -21
- package/dist/cohere.js.map +0 -1
- package/dist/deepseek.cjs +0 -72
- package/dist/deepseek.cjs.map +0 -1
- package/dist/deepseek.d.cts +0 -21
- package/dist/deepseek.d.ts +0 -21
- package/dist/deepseek.js +0 -21
- package/dist/deepseek.js.map +0 -1
- package/dist/dist-65U7OYRG.js +0 -1257
- package/dist/dist-65U7OYRG.js.map +0 -1
- package/dist/fetchProvider-Cu4WkU5O.d.cts +0 -819
- package/dist/fetchProvider-Cu4WkU5O.d.ts +0 -819
- package/dist/frontend-ui-ux.json +0 -105
- package/dist/general-assistant.json +0 -95
- package/dist/git-master.json +0 -51
- package/dist/google-vertex.cjs +0 -72
- package/dist/google-vertex.cjs.map +0 -1
- package/dist/google-vertex.d.cts +0 -21
- package/dist/google-vertex.d.ts +0 -21
- package/dist/google-vertex.js +0 -21
- package/dist/google-vertex.js.map +0 -1
- package/dist/google.cjs +0 -72
- package/dist/google.cjs.map +0 -1
- package/dist/google.d.cts +0 -21
- package/dist/google.d.ts +0 -21
- package/dist/google.js +0 -21
- package/dist/google.js.map +0 -1
- package/dist/groq.cjs +0 -72
- package/dist/groq.cjs.map +0 -1
- package/dist/groq.d.cts +0 -21
- package/dist/groq.d.ts +0 -21
- package/dist/groq.js +0 -21
- package/dist/groq.js.map +0 -1
- package/dist/index.d.mts +0 -3203
- package/dist/index.mjs +0 -7064
- package/dist/index.mjs.map +0 -1
- package/dist/mistral.cjs +0 -72
- package/dist/mistral.cjs.map +0 -1
- package/dist/mistral.d.cts +0 -21
- package/dist/mistral.d.ts +0 -21
- package/dist/mistral.js +0 -21
- package/dist/mistral.js.map +0 -1
- package/dist/multipart-parser-EJCXIUHC.js +0 -372
- package/dist/multipart-parser-EJCXIUHC.js.map +0 -1
- package/dist/openai.cjs +0 -72
- package/dist/openai.cjs.map +0 -1
- package/dist/openai.d.cts +0 -21
- package/dist/openai.d.ts +0 -21
- package/dist/openai.js +0 -21
- package/dist/openai.js.map +0 -1
- package/dist/perplexity.cjs +0 -72
- package/dist/perplexity.cjs.map +0 -1
- package/dist/perplexity.d.cts +0 -21
- package/dist/perplexity.d.ts +0 -21
- package/dist/perplexity.js +0 -21
- package/dist/perplexity.js.map +0 -1
- package/dist/playwright.json +0 -52
- package/dist/promptConcat-BJdazTg5.d.cts +0 -1832
- package/dist/promptConcat-BJdazTg5.d.ts +0 -1832
- package/dist/promptConcat-CAkpni_8.d.cts +0 -1834
- package/dist/promptConcat-CAkpni_8.d.ts +0 -1834
- package/dist/promptConcat-CfH5-GAE.d.cts +0 -1036
- package/dist/promptConcat-ChcAZOOL.d.ts +0 -1036
- package/dist/promptConcat-G5TnJVRy.d.cts +0 -1800
- package/dist/promptConcat-G5TnJVRy.d.ts +0 -1800
- package/dist/promptConcat-L72eowzp.d.ts +0 -1090
- package/dist/promptConcat-eLHdN7K8.d.cts +0 -1090
- package/dist/src-VTSXKG72.js +0 -1409
- package/dist/src-VTSXKG72.js.map +0 -1
- package/dist/togetherai.cjs +0 -72
- package/dist/togetherai.cjs.map +0 -1
- package/dist/togetherai.d.cts +0 -21
- package/dist/togetherai.d.ts +0 -21
- package/dist/togetherai.js +0 -21
- package/dist/togetherai.js.map +0 -1
- package/dist/types-B0Jm2l38.d.cts +0 -767
- package/dist/types-B0Jm2l38.d.ts +0 -767
- package/dist/xai.cjs +0 -72
- package/dist/xai.cjs.map +0 -1
- package/dist/xai.d.cts +0 -21
- package/dist/xai.d.ts +0 -21
- package/dist/xai.js +0 -21
- package/dist/xai.js.map +0 -1
- /package/dist/{chunk-P4UZ7IXC.js.map → browser.js.map} +0 -0
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
declare const ORCHESTRATION_ERROR_CODES: readonly ["UNSUPPORTED", "FORBIDDEN", "CONFLICT", "STALE_EPOCH", "NOT_FOUND", "INVALID", "EXHAUSTED", "UNAVAILABLE", "TIMEOUT", "CANCELLED", "UNKNOWN_EFFECT", "WATCH_COMPACTED", "INTERNAL"];
|
|
2
|
+
type OrchestrationErrorCode = typeof ORCHESTRATION_ERROR_CODES[number];
|
|
3
|
+
interface OrchestrationErrorData {
|
|
4
|
+
code: OrchestrationErrorCode;
|
|
5
|
+
message: string;
|
|
6
|
+
retryable: boolean;
|
|
7
|
+
retryAfterMs?: number;
|
|
8
|
+
reason?: string;
|
|
9
|
+
details?: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
declare class OrchestrationError extends Error {
|
|
12
|
+
readonly code: OrchestrationErrorCode;
|
|
13
|
+
readonly retryable: boolean;
|
|
14
|
+
readonly retryAfterMs?: number;
|
|
15
|
+
readonly reason?: string;
|
|
16
|
+
readonly details?: Record<string, unknown>;
|
|
17
|
+
constructor(data: OrchestrationErrorData);
|
|
18
|
+
toJSON(): OrchestrationErrorData;
|
|
19
|
+
}
|
|
20
|
+
declare function isOrchestrationError(error: unknown): error is OrchestrationError;
|
|
21
|
+
declare function toOrchestrationErrorData(error: unknown, fallback?: Pick<OrchestrationErrorData, 'code' | 'retryable'>): OrchestrationErrorData;
|
|
22
|
+
|
|
23
|
+
interface OrchestrationTypeMeta {
|
|
24
|
+
apiVersion: string;
|
|
25
|
+
kind: string;
|
|
26
|
+
}
|
|
27
|
+
interface OrchestrationOwnerReference extends OrchestrationTypeMeta {
|
|
28
|
+
name: string;
|
|
29
|
+
uid: string;
|
|
30
|
+
controller?: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface OrchestrationManifestMetadata {
|
|
33
|
+
name?: string;
|
|
34
|
+
generateName?: string;
|
|
35
|
+
namespace?: string;
|
|
36
|
+
labels?: Record<string, string>;
|
|
37
|
+
annotations?: Record<string, string>;
|
|
38
|
+
ownerReferences?: OrchestrationOwnerReference[];
|
|
39
|
+
finalizers?: string[];
|
|
40
|
+
}
|
|
41
|
+
interface OrchestrationObjectMetadata extends OrchestrationManifestMetadata {
|
|
42
|
+
name: string;
|
|
43
|
+
uid: string;
|
|
44
|
+
generation: number;
|
|
45
|
+
resourceVersion: string;
|
|
46
|
+
creationTimestamp: string;
|
|
47
|
+
deletionTimestamp?: string;
|
|
48
|
+
deletionGracePeriodSeconds?: number;
|
|
49
|
+
}
|
|
50
|
+
type OrchestrationConditionStatus = 'True' | 'False' | 'Unknown';
|
|
51
|
+
interface OrchestrationCondition {
|
|
52
|
+
type: string;
|
|
53
|
+
status: OrchestrationConditionStatus;
|
|
54
|
+
reason: string;
|
|
55
|
+
lastTransitionTime: string;
|
|
56
|
+
message?: string;
|
|
57
|
+
observedGeneration?: number;
|
|
58
|
+
}
|
|
59
|
+
interface OrchestrationResourceStatus {
|
|
60
|
+
/** Generation observed by the controller that last wrote this status. */
|
|
61
|
+
observedGeneration?: number;
|
|
62
|
+
/** Conditions set by the controller or verifier. */
|
|
63
|
+
conditions?: OrchestrationCondition[];
|
|
64
|
+
/**
|
|
65
|
+
* Status reported by the actor (worker/node), kept separate from
|
|
66
|
+
* controller-observed fields so a compromised actor cannot overwrite
|
|
67
|
+
* controller decisions. Only the named actor may update this field.
|
|
68
|
+
*/
|
|
69
|
+
actorReportedStatus?: Record<string, unknown>;
|
|
70
|
+
}
|
|
71
|
+
interface OrchestrationResourceManifest<TSpec = Record<string, unknown>> extends OrchestrationTypeMeta {
|
|
72
|
+
metadata: OrchestrationManifestMetadata;
|
|
73
|
+
spec: TSpec;
|
|
74
|
+
}
|
|
75
|
+
interface OrchestrationResource<TSpec = Record<string, unknown>, TStatus = OrchestrationResourceStatus> extends OrchestrationTypeMeta {
|
|
76
|
+
metadata: OrchestrationObjectMetadata;
|
|
77
|
+
spec: TSpec;
|
|
78
|
+
status?: TStatus;
|
|
79
|
+
}
|
|
80
|
+
interface OrchestrationResourceReference extends OrchestrationTypeMeta {
|
|
81
|
+
name?: string;
|
|
82
|
+
namespace?: string;
|
|
83
|
+
uid?: string;
|
|
84
|
+
}
|
|
85
|
+
interface OrchestrationResourceQuery {
|
|
86
|
+
apiVersion?: string;
|
|
87
|
+
kind: string;
|
|
88
|
+
namespace?: string;
|
|
89
|
+
labels?: Record<string, string>;
|
|
90
|
+
}
|
|
91
|
+
type OrchestrationEventSeverity = 'Normal' | 'Warning';
|
|
92
|
+
interface OrchestrationEvent {
|
|
93
|
+
eventId: string;
|
|
94
|
+
involvedObject: OrchestrationResourceReference;
|
|
95
|
+
severity: OrchestrationEventSeverity;
|
|
96
|
+
reason: string;
|
|
97
|
+
message: string;
|
|
98
|
+
reportingController: string;
|
|
99
|
+
eventTime: string;
|
|
100
|
+
action?: string;
|
|
101
|
+
count?: number;
|
|
102
|
+
}
|
|
103
|
+
interface OrchestrationPreconditions {
|
|
104
|
+
uid?: string;
|
|
105
|
+
resourceVersion?: string;
|
|
106
|
+
generation?: number;
|
|
107
|
+
}
|
|
108
|
+
type AgentOrchestrationOperation = 'apply' | 'get' | 'list' | 'watch' | 'delete';
|
|
109
|
+
type AgentInfrastructureInterface = 'resource' | 'loop-runtime' | 'tool-execution' | 'model-provider' | 'network' | 'storage' | 'credential-broker' | 'artifact' | 'identity-attestation' | 'policy-approval' | 'audit-telemetry';
|
|
110
|
+
interface AgentOrchestrationCapabilities {
|
|
111
|
+
operations: AgentOrchestrationOperation[];
|
|
112
|
+
resourceKinds: string[];
|
|
113
|
+
/**
|
|
114
|
+
* Optional per-kind operation matrix when `operations` is not a Cartesian
|
|
115
|
+
* promise for every advertised kind. Hosts should publish this whenever
|
|
116
|
+
* controller-owned status resources are read-only to a caller.
|
|
117
|
+
*/
|
|
118
|
+
resourceOperations?: Record<string, AgentOrchestrationOperation[]>;
|
|
119
|
+
interfaces: AgentInfrastructureInterface[];
|
|
120
|
+
}
|
|
121
|
+
interface OrchestrationApplyOptions {
|
|
122
|
+
idempotencyKey?: string;
|
|
123
|
+
fieldManager?: string;
|
|
124
|
+
force?: boolean;
|
|
125
|
+
dryRun?: boolean;
|
|
126
|
+
preconditions?: OrchestrationPreconditions;
|
|
127
|
+
}
|
|
128
|
+
interface OrchestrationGetOptions {
|
|
129
|
+
resourceVersion?: string;
|
|
130
|
+
}
|
|
131
|
+
interface OrchestrationListOptions {
|
|
132
|
+
resourceVersion?: string;
|
|
133
|
+
resourceVersionMatch?: 'exact' | 'not-older-than';
|
|
134
|
+
limit?: number;
|
|
135
|
+
continueToken?: string;
|
|
136
|
+
}
|
|
137
|
+
interface OrchestrationResourceList<TSpec = Record<string, unknown>, TStatus = OrchestrationResourceStatus> {
|
|
138
|
+
items: Array<OrchestrationResource<TSpec, TStatus>>;
|
|
139
|
+
resourceVersion: string;
|
|
140
|
+
continueToken?: string;
|
|
141
|
+
}
|
|
142
|
+
type OrchestrationResourceWatchEventType = 'ADDED' | 'MODIFIED' | 'DELETED';
|
|
143
|
+
interface OrchestrationResourceWatchEvent<TSpec = Record<string, unknown>, TStatus = OrchestrationResourceStatus> {
|
|
144
|
+
type: OrchestrationResourceWatchEventType;
|
|
145
|
+
resourceVersion: string;
|
|
146
|
+
resource: OrchestrationResource<TSpec, TStatus>;
|
|
147
|
+
}
|
|
148
|
+
interface OrchestrationBookmarkWatchEvent {
|
|
149
|
+
type: 'BOOKMARK';
|
|
150
|
+
resourceVersion: string;
|
|
151
|
+
}
|
|
152
|
+
interface OrchestrationErrorWatchEvent {
|
|
153
|
+
type: 'ERROR';
|
|
154
|
+
resourceVersion: string;
|
|
155
|
+
terminal: boolean;
|
|
156
|
+
error: OrchestrationErrorData;
|
|
157
|
+
}
|
|
158
|
+
type OrchestrationWatchEvent<TSpec = Record<string, unknown>, TStatus = OrchestrationResourceStatus> = OrchestrationResourceWatchEvent<TSpec, TStatus> | OrchestrationBookmarkWatchEvent | OrchestrationErrorWatchEvent;
|
|
159
|
+
interface OrchestrationWatchOptions {
|
|
160
|
+
resourceVersion?: string;
|
|
161
|
+
timeoutMs?: number;
|
|
162
|
+
signal?: AbortSignal;
|
|
163
|
+
allowBookmarks?: boolean;
|
|
164
|
+
sendInitialEvents?: boolean;
|
|
165
|
+
}
|
|
166
|
+
interface OrchestrationDeleteOptions {
|
|
167
|
+
idempotencyKey?: string;
|
|
168
|
+
preconditions?: OrchestrationPreconditions;
|
|
169
|
+
propagationPolicy?: 'orphan' | 'background' | 'foreground';
|
|
170
|
+
dryRun?: boolean;
|
|
171
|
+
}
|
|
172
|
+
interface OrchestrationDeleteResult {
|
|
173
|
+
accepted: boolean;
|
|
174
|
+
reference: OrchestrationResourceReference;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Policy-scoped facade exposed to Agent loops and Agent-facing tools.
|
|
178
|
+
*
|
|
179
|
+
* Hosts bind actor identity, admission, quotas, and grants when constructing the
|
|
180
|
+
* facade. Callers receive declarative resource operations only, never raw
|
|
181
|
+
* infrastructure drivers, platform handles, or credentials.
|
|
182
|
+
*/
|
|
183
|
+
interface AgentOrchestrationClient {
|
|
184
|
+
getCapabilities(): Promise<AgentOrchestrationCapabilities>;
|
|
185
|
+
apply<TSpec = Record<string, unknown>, TStatus = OrchestrationResourceStatus>(resource: OrchestrationResourceManifest<TSpec>, options?: OrchestrationApplyOptions): Promise<OrchestrationResource<TSpec, TStatus>>;
|
|
186
|
+
get<TSpec = Record<string, unknown>, TStatus = OrchestrationResourceStatus>(reference: OrchestrationResourceReference, options?: OrchestrationGetOptions): Promise<OrchestrationResource<TSpec, TStatus> | null>;
|
|
187
|
+
list<TSpec = Record<string, unknown>, TStatus = OrchestrationResourceStatus>(query: OrchestrationResourceQuery, options?: OrchestrationListOptions): Promise<OrchestrationResourceList<TSpec, TStatus>>;
|
|
188
|
+
watch<TSpec = Record<string, unknown>, TStatus = OrchestrationResourceStatus>(query: OrchestrationResourceQuery, options?: OrchestrationWatchOptions): AsyncIterable<OrchestrationWatchEvent<TSpec, TStatus>>;
|
|
189
|
+
delete(reference: OrchestrationResourceReference, options?: OrchestrationDeleteOptions): Promise<OrchestrationDeleteResult>;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
interface PromptNode {
|
|
193
|
+
id: string;
|
|
194
|
+
text?: string;
|
|
195
|
+
/** TidGi IPrompt 兼容 */
|
|
196
|
+
caption?: string;
|
|
197
|
+
role?: 'system' | 'user' | 'assistant' | 'tool';
|
|
198
|
+
enabled?: boolean;
|
|
199
|
+
children?: PromptNode[];
|
|
200
|
+
/** UI 溯源,可选 */
|
|
201
|
+
source?: unknown;
|
|
202
|
+
/**
|
|
203
|
+
* 与插件 `dynamicPosition` 配合:用户轮次 ≥2 时将根级该节点移到列表末尾。
|
|
204
|
+
*/
|
|
205
|
+
dynamicPosition?: 'deferToEnd';
|
|
206
|
+
}
|
|
207
|
+
/** 与 TidGi `IPrompt` 对齐的别名 */
|
|
208
|
+
type IPrompt = PromptNode;
|
|
209
|
+
interface PromptPluginConfig {
|
|
210
|
+
id: string;
|
|
211
|
+
toolId: string;
|
|
212
|
+
enabled?: boolean;
|
|
213
|
+
/** defineTool:`approval`(mode / allowPatterns / denyPatterns)等,类型见 `tools/types` */
|
|
214
|
+
[key: string]: unknown;
|
|
215
|
+
}
|
|
216
|
+
interface AgentFrameworkConfig {
|
|
217
|
+
prompts: PromptNode[];
|
|
218
|
+
response?: unknown[];
|
|
219
|
+
plugins: PromptPluginConfig[];
|
|
220
|
+
}
|
|
221
|
+
interface AgentPromptDescription {
|
|
222
|
+
agentFrameworkConfig?: AgentFrameworkConfig;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
interface AgentDefinitionModelConfig {
|
|
226
|
+
provider?: string;
|
|
227
|
+
model?: string;
|
|
228
|
+
temperature?: number;
|
|
229
|
+
maxTokens?: number;
|
|
230
|
+
}
|
|
231
|
+
interface ModelSelection {
|
|
232
|
+
provider: string;
|
|
233
|
+
model: string;
|
|
234
|
+
[key: string]: unknown;
|
|
235
|
+
}
|
|
236
|
+
interface ModelParameters {
|
|
237
|
+
temperature?: number;
|
|
238
|
+
maxTokens?: number;
|
|
239
|
+
topP?: number;
|
|
240
|
+
[key: string]: unknown;
|
|
241
|
+
}
|
|
242
|
+
interface AiAPIConfig {
|
|
243
|
+
default?: ModelSelection;
|
|
244
|
+
embedding?: ModelSelection;
|
|
245
|
+
speech?: ModelSelection;
|
|
246
|
+
imageGeneration?: ModelSelection;
|
|
247
|
+
transcriptions?: ModelSelection;
|
|
248
|
+
free?: ModelSelection;
|
|
249
|
+
modelParameters: ModelParameters;
|
|
250
|
+
[key: string]: unknown;
|
|
251
|
+
}
|
|
252
|
+
interface AgentHeartbeatConfig {
|
|
253
|
+
enabled: boolean;
|
|
254
|
+
intervalSeconds: number;
|
|
255
|
+
message: string;
|
|
256
|
+
activeHoursStart?: string;
|
|
257
|
+
activeHoursEnd?: string;
|
|
258
|
+
}
|
|
259
|
+
interface AgentDefinitionToolConfig {
|
|
260
|
+
toolId: string;
|
|
261
|
+
enabled?: boolean;
|
|
262
|
+
parameters?: Record<string, unknown>;
|
|
263
|
+
tags?: string[];
|
|
264
|
+
}
|
|
265
|
+
type HostAgentToolConfig = AgentDefinitionToolConfig;
|
|
266
|
+
interface AgentDefinition {
|
|
267
|
+
id: string;
|
|
268
|
+
name: string;
|
|
269
|
+
description: string;
|
|
270
|
+
systemPrompt: string;
|
|
271
|
+
tools: string[];
|
|
272
|
+
modelConfig?: AgentDefinitionModelConfig;
|
|
273
|
+
promptSchema?: unknown;
|
|
274
|
+
/**
|
|
275
|
+
* TidGi-Desktop / memeloop:prompt 树、插件、maxIterations 等(结构见 memeloop prompt 类型)
|
|
276
|
+
* Typed as `AgentFrameworkConfig` so all hosts share a single canonical shape.
|
|
277
|
+
*/
|
|
278
|
+
agentFrameworkConfig?: AgentFrameworkConfig;
|
|
279
|
+
/** Host-specific explicit tool configuration. Hosts map this to prompt plugins at runtime. */
|
|
280
|
+
agentTools?: AgentDefinitionToolConfig[];
|
|
281
|
+
/** Host-specific avatar or icon URL. */
|
|
282
|
+
avatarUrl?: string;
|
|
283
|
+
/** Host-specific agent handler / framework ID. */
|
|
284
|
+
agentFrameworkID?: string;
|
|
285
|
+
/** Periodic auto-wake configuration. */
|
|
286
|
+
heartbeat?: AgentHeartbeatConfig;
|
|
287
|
+
/** Host-specific AI API config override. */
|
|
288
|
+
aiApiConfig?: AiAPIConfig;
|
|
289
|
+
version: string;
|
|
290
|
+
}
|
|
291
|
+
interface AgentInstanceMeta {
|
|
292
|
+
instanceId: string;
|
|
293
|
+
definitionId: string;
|
|
294
|
+
nodeId: string;
|
|
295
|
+
conversationId: string;
|
|
296
|
+
createdAt: number;
|
|
297
|
+
updatedAt: number;
|
|
298
|
+
definitionDelta?: Partial<AgentDefinition>;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
interface AttachmentReference {
|
|
302
|
+
contentHash: string;
|
|
303
|
+
filename: string;
|
|
304
|
+
mimeType: string;
|
|
305
|
+
size: number;
|
|
306
|
+
}
|
|
307
|
+
type ChatRole = 'user' | 'assistant' | 'tool' | 'agent' | 'error';
|
|
308
|
+
interface ChatTextPart {
|
|
309
|
+
type: 'text';
|
|
310
|
+
text: string;
|
|
311
|
+
}
|
|
312
|
+
interface ChatReasoningPart {
|
|
313
|
+
type: 'reasoning';
|
|
314
|
+
text: string;
|
|
315
|
+
}
|
|
316
|
+
interface ToolCall {
|
|
317
|
+
id: string;
|
|
318
|
+
toolName: string;
|
|
319
|
+
arguments: unknown;
|
|
320
|
+
}
|
|
321
|
+
interface ChatToolCallPart {
|
|
322
|
+
type: 'tool-call';
|
|
323
|
+
toolCallId: string;
|
|
324
|
+
toolName: string;
|
|
325
|
+
arguments: unknown;
|
|
326
|
+
}
|
|
327
|
+
/** Points to large tool output stored elsewhere (agent-run log, terminal session, file). */
|
|
328
|
+
type DetailRefType = 'agent-run' | 'terminal-session' | 'file';
|
|
329
|
+
interface DetailReference {
|
|
330
|
+
type: DetailRefType;
|
|
331
|
+
/** Delegated agent / spawn / remote conversation id */
|
|
332
|
+
conversationId?: string;
|
|
333
|
+
/** Terminal session id (often paired with `terminal:<sessionId>` conversation) */
|
|
334
|
+
sessionId?: string;
|
|
335
|
+
/** Node that holds the detail payload */
|
|
336
|
+
nodeId?: string;
|
|
337
|
+
/** e.g. `memeloop://node/.../file/...` from `buildMemeloopFileUri` in `../network/uri.js` */
|
|
338
|
+
fileUri?: string;
|
|
339
|
+
exitCode?: number;
|
|
340
|
+
}
|
|
341
|
+
interface ChatAttachmentPart {
|
|
342
|
+
type: 'attachment';
|
|
343
|
+
attachment: AttachmentReference;
|
|
344
|
+
}
|
|
345
|
+
interface ChatToolResultPart {
|
|
346
|
+
type: 'tool-result';
|
|
347
|
+
toolCallId?: string;
|
|
348
|
+
toolName: string;
|
|
349
|
+
parameters?: unknown;
|
|
350
|
+
result: string;
|
|
351
|
+
isError?: boolean;
|
|
352
|
+
payload?: unknown;
|
|
353
|
+
detailRef?: DetailReference;
|
|
354
|
+
}
|
|
355
|
+
type ChatMessagePart = ChatTextPart | ChatReasoningPart | ChatToolCallPart | ChatAttachmentPart | ChatToolResultPart;
|
|
356
|
+
interface ChatMessage {
|
|
357
|
+
messageId: string;
|
|
358
|
+
conversationId: string;
|
|
359
|
+
originNodeId: string;
|
|
360
|
+
timestamp: number;
|
|
361
|
+
lamportClock: number;
|
|
362
|
+
role: ChatRole;
|
|
363
|
+
/** Canonical structured message payload used for rendering and protocol projection. */
|
|
364
|
+
parts?: ChatMessagePart[];
|
|
365
|
+
/** Summary / fallback text projection of `parts` for hosts that only need plain text. */
|
|
366
|
+
content: string;
|
|
367
|
+
/** Materialized tool-call projection derived from `parts`. */
|
|
368
|
+
toolCalls?: ToolCall[];
|
|
369
|
+
/** Materialized attachment projection derived from `parts`. */
|
|
370
|
+
attachments?: AttachmentReference[];
|
|
371
|
+
/** Summary lives in `content`; full payload fetched via detail ref (plan §5.2.1). */
|
|
372
|
+
detailRef?: DetailReference;
|
|
373
|
+
/** Materialized reasoning projection derived from `parts`. */
|
|
374
|
+
reasoning_content?: string;
|
|
375
|
+
/** Content MIME type */
|
|
376
|
+
contentType?: string;
|
|
377
|
+
/** Whether message should be hidden in UI */
|
|
378
|
+
hidden?: boolean;
|
|
379
|
+
/** Message processing duration in ms */
|
|
380
|
+
duration?: number | null;
|
|
381
|
+
/** Additional metadata */
|
|
382
|
+
metadata?: Record<string, unknown>;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
type IMPlatformType = 'telegram' | 'discord' | 'lark' | 'wecom' | 'slack' | 'line' | 'qq';
|
|
386
|
+
interface IMChannel {
|
|
387
|
+
channelId: string;
|
|
388
|
+
platform: IMPlatformType;
|
|
389
|
+
nodeId: string;
|
|
390
|
+
webhookMode: 'cloud-relay' | 'direct';
|
|
391
|
+
webhookUrl?: string;
|
|
392
|
+
defaultDefinitionId?: string;
|
|
393
|
+
status: 'active' | 'inactive' | 'error';
|
|
394
|
+
}
|
|
395
|
+
interface IMChannelBinding {
|
|
396
|
+
channelId: string;
|
|
397
|
+
imUserId: string;
|
|
398
|
+
activeConversationId: string;
|
|
399
|
+
createdAt: number;
|
|
400
|
+
defaultDefinitionId?: string;
|
|
401
|
+
/** When set, the user's next inbound message is treated as an askQuestion answer (plan §20.3). */
|
|
402
|
+
pendingQuestionId?: string;
|
|
403
|
+
}
|
|
404
|
+
/** @deprecated Use IMChannelBinding */
|
|
405
|
+
type ImChannelBindingRecord = IMChannelBinding;
|
|
406
|
+
|
|
407
|
+
type VersionVector = Record<string, number>;
|
|
408
|
+
interface ConversationMeta {
|
|
409
|
+
conversationId: string;
|
|
410
|
+
title: string;
|
|
411
|
+
lastMessagePreview: string;
|
|
412
|
+
lastMessageTimestamp: number;
|
|
413
|
+
messageCount: number;
|
|
414
|
+
originNodeId: string;
|
|
415
|
+
definitionId: string;
|
|
416
|
+
instanceDelta?: Record<string, unknown>;
|
|
417
|
+
isUserInitiated: boolean;
|
|
418
|
+
sourceChannel?: {
|
|
419
|
+
channelId: string;
|
|
420
|
+
platform: string;
|
|
421
|
+
imUserId: string;
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
declare function isConversationMeta(value: unknown): value is ConversationMeta;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Narrow logical storage ports (plan 24.41).
|
|
428
|
+
*
|
|
429
|
+
* Loop/runtime code depends on these small portable interfaces instead of a
|
|
430
|
+
* monolithic storage facade. Hosts (CLI SQLite, Desktop repositories, browser
|
|
431
|
+
* IndexedDB, remote adapters) implement any combination; binary payloads are
|
|
432
|
+
* `Uint8Array` only, keeping the ports usable in browsers and edge runtimes.
|
|
433
|
+
*/
|
|
434
|
+
type ConversationQueryMode = 'metadata-only' | 'full-content' | 'on-demand';
|
|
435
|
+
interface ListConversationsOptions {
|
|
436
|
+
limit?: number;
|
|
437
|
+
offset?: number;
|
|
438
|
+
}
|
|
439
|
+
interface GetMessagesOptions {
|
|
440
|
+
mode?: ConversationQueryMode;
|
|
441
|
+
}
|
|
442
|
+
/** Append-only conversation event log. */
|
|
443
|
+
interface ConversationEventStore {
|
|
444
|
+
listConversations(options?: ListConversationsOptions): Promise<ConversationMeta[]>;
|
|
445
|
+
getMessages(conversationId: string, options?: GetMessagesOptions): Promise<ChatMessage[]>;
|
|
446
|
+
appendMessage(message: ChatMessage): Promise<void>;
|
|
447
|
+
/** Merge remote/peer events; refreshes per-conversation messageCount. */
|
|
448
|
+
insertMessagesIfAbsent(messages: ChatMessage[]): Promise<void>;
|
|
449
|
+
/** Optional optimization: `SELECT MAX(lamportClock)` instead of scanning. */
|
|
450
|
+
getMaxLamportClockForConversation?(conversationId: string): Promise<number>;
|
|
451
|
+
}
|
|
452
|
+
/** Conversation directory/metadata rows (sync and peer metadata). */
|
|
453
|
+
interface ConversationDirectoryStore {
|
|
454
|
+
upsertConversationMetadata(meta: ConversationMeta): Promise<void>;
|
|
455
|
+
/** Read the conversation metadata row used to resolve `definitionId`. */
|
|
456
|
+
getConversationMeta(conversationId: string): Promise<ConversationMeta | null>;
|
|
457
|
+
}
|
|
458
|
+
/** Content-addressed binary storage. Bytes are `Uint8Array` on every path. */
|
|
459
|
+
interface BlobStore {
|
|
460
|
+
getAttachment(contentHash: string): Promise<AttachmentReference | null>;
|
|
461
|
+
saveAttachment(reference: AttachmentReference, data: Uint8Array): Promise<void>;
|
|
462
|
+
/** Read persisted attachment bytes (cross-node blob transfer). */
|
|
463
|
+
readAttachmentData?(contentHash: string): Promise<Uint8Array | null>;
|
|
464
|
+
}
|
|
465
|
+
/** Agent definition lookup. */
|
|
466
|
+
interface DefinitionStore {
|
|
467
|
+
getAgentDefinition(id: string): Promise<AgentDefinition | null>;
|
|
468
|
+
}
|
|
469
|
+
/** Agent run/instance state. */
|
|
470
|
+
interface AgentInstanceStore {
|
|
471
|
+
saveAgentInstance(meta: AgentInstanceMeta): Promise<void>;
|
|
472
|
+
}
|
|
473
|
+
/** IM user-to-conversation binding persistence. */
|
|
474
|
+
interface ImBindingStore {
|
|
475
|
+
getImBinding?(channelId: string, imUserId: string): Promise<IMChannelBinding | null>;
|
|
476
|
+
setImBinding?(record: IMChannelBinding): Promise<void>;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Convenience composition for hosts that provide every port (the previous
|
|
480
|
+
* `IAgentStorage` shape). New consumers should depend on the narrow port they
|
|
481
|
+
* actually use.
|
|
482
|
+
*/
|
|
483
|
+
interface FullAgentStorage extends ConversationEventStore, ConversationDirectoryStore, BlobStore, DefinitionStore, AgentInstanceStore, ImBindingStore {
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Monolithic storage facade (legacy shape: every port combined). Prefer the
|
|
488
|
+
* narrow ports in `./ports.js` for new code so hosts can implement only the
|
|
489
|
+
* capabilities they actually have.
|
|
490
|
+
*/
|
|
491
|
+
type IAgentStorage = FullAgentStorage;
|
|
492
|
+
|
|
493
|
+
export { type AgentOrchestrationCapabilities as $, type AttachmentReference as A, type OrchestrationGetOptions as B, type ConversationMeta as C, type DetailRefType as D, type OrchestrationResource as E, type OrchestrationResourceQuery as F, type GetMessagesOptions as G, type HostAgentToolConfig as H, type IAgentStorage as I, type OrchestrationListOptions as J, type OrchestrationResourceList as K, type ListConversationsOptions as L, type ModelParameters as M, type OrchestrationWatchOptions as N, type OrchestrationErrorData as O, type OrchestrationWatchEvent as P, type OrchestrationDeleteOptions as Q, type OrchestrationDeleteResult as R, type AgentFrameworkConfig as S, type ToolCall as T, type IPrompt as U, type VersionVector as V, type PromptNode as W, type AgentPromptDescription as X, type FullAgentStorage as Y, type AgentInfrastructureInterface as Z, type AgentInstanceStore as _, type ChatAttachmentPart as a, type AgentOrchestrationOperation as a0, type BlobStore as a1, type ConversationDirectoryStore as a2, type DefinitionStore as a3, type IMChannel as a4, type IMChannelBinding as a5, type IMPlatformType as a6, type ImBindingStore as a7, type ImChannelBindingRecord as a8, ORCHESTRATION_ERROR_CODES as a9, type OrchestrationApplyOptions as aa, type OrchestrationBookmarkWatchEvent as ab, type OrchestrationCondition as ac, type OrchestrationConditionStatus as ad, OrchestrationError as ae, type OrchestrationErrorCode as af, type OrchestrationErrorWatchEvent as ag, type OrchestrationEvent as ah, type OrchestrationEventSeverity as ai, type OrchestrationManifestMetadata as aj, type OrchestrationPreconditions as ak, type OrchestrationResourceWatchEvent as al, type OrchestrationResourceWatchEventType as am, type PromptPluginConfig as an, isOrchestrationError as ao, toOrchestrationErrorData as ap, type ChatMessage as b, type ChatMessagePart as c, type ChatReasoningPart as d, type ChatRole as e, type ChatTextPart as f, type ChatToolCallPart as g, type ChatToolResultPart as h, isConversationMeta as i, type ConversationQueryMode as j, type DetailReference as k, type ConversationEventStore as l, type AgentDefinition as m, type AgentDefinitionModelConfig as n, type AgentDefinitionToolConfig as o, type AgentHeartbeatConfig as p, type AgentInstanceMeta as q, type AiAPIConfig as r, type ModelSelection as s, type AgentOrchestrationClient as t, type OrchestrationResourceManifest as u, type OrchestrationOwnerReference as v, type OrchestrationTypeMeta as w, type OrchestrationObjectMetadata as x, type OrchestrationResourceStatus as y, type OrchestrationResourceReference as z };
|
package/dist/llm-providers.cjs
CHANGED
|
@@ -54,27 +54,60 @@ var import_ai = require("ai");
|
|
|
54
54
|
function createFetchLLMProvider(config) {
|
|
55
55
|
return {
|
|
56
56
|
name: config.name,
|
|
57
|
+
...config.modelId !== void 0 ? { modelId: config.modelId } : {},
|
|
57
58
|
// Store the factory so hosts can introspect or extend
|
|
58
59
|
model: config.createModel,
|
|
59
60
|
async chat(request) {
|
|
60
61
|
const body = typeof request === "object" && request !== null ? request : {};
|
|
61
62
|
const model = config.createModel(body.model);
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
const specificationVersion = model?.specificationVersion;
|
|
64
|
+
if (model === null || typeof model !== "object" || !["v2", "v3", "v4"].includes(String(specificationVersion))) {
|
|
65
|
+
throw new Error(
|
|
66
|
+
`LLM provider '${config.name}' returned an incompatible AI SDK model for '${typeof body.model === "string" ? body.model : config.modelId ?? "default"}' (expected specificationVersion v2, v3, or v4; received ${String(specificationVersion)})`
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
const systemMessages = (body.messages ?? []).filter((message) => message.role === "system").map((message) => message.content);
|
|
70
|
+
const messages = (body.messages ?? []).filter((message) => message.role !== "system").map((message) => {
|
|
71
|
+
const role = message.role === "tool" ? "user" : message.role;
|
|
72
|
+
return {
|
|
73
|
+
role,
|
|
74
|
+
content: message.content
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
const system = body.system ?? (systemMessages.length > 0 ? systemMessages.join("\n\n") : void 0);
|
|
67
78
|
const temperature = body.temperature;
|
|
68
79
|
const abortSignal = body.abortSignal;
|
|
80
|
+
const maxOutputTokens = body.max_tokens;
|
|
69
81
|
if (body.stream !== false) {
|
|
70
|
-
|
|
82
|
+
let streamingError;
|
|
83
|
+
const result2 = (0, import_ai.streamText)({
|
|
84
|
+
model,
|
|
85
|
+
instructions: system,
|
|
86
|
+
messages,
|
|
87
|
+
maxOutputTokens,
|
|
88
|
+
temperature,
|
|
89
|
+
abortSignal,
|
|
90
|
+
onError: ({ error }) => {
|
|
91
|
+
streamingError = error;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
71
94
|
return (async function* () {
|
|
72
95
|
for await (const chunk of result2.textStream) {
|
|
73
96
|
yield chunk;
|
|
74
97
|
}
|
|
98
|
+
if (streamingError !== void 0) {
|
|
99
|
+
throw streamingError instanceof Error ? streamingError : new Error("The model stream failed", { cause: streamingError });
|
|
100
|
+
}
|
|
75
101
|
})();
|
|
76
102
|
}
|
|
77
|
-
const result = await (0, import_ai.generateText)({
|
|
103
|
+
const result = await (0, import_ai.generateText)({
|
|
104
|
+
model,
|
|
105
|
+
instructions: system,
|
|
106
|
+
messages,
|
|
107
|
+
maxOutputTokens,
|
|
108
|
+
temperature,
|
|
109
|
+
abortSignal
|
|
110
|
+
});
|
|
78
111
|
return result.text;
|
|
79
112
|
}
|
|
80
113
|
};
|
|
@@ -102,7 +135,7 @@ async function loadProviderFactory(provider) {
|
|
|
102
135
|
const { createOpenAI } = await import("@ai-sdk/openai");
|
|
103
136
|
return (apiKey, baseUrl, options) => {
|
|
104
137
|
const sdk = createOpenAI({ apiKey, baseURL: baseUrl, ...options });
|
|
105
|
-
return (modelId) => sdk(modelId);
|
|
138
|
+
return (modelId) => sdk.chat(modelId);
|
|
106
139
|
};
|
|
107
140
|
}
|
|
108
141
|
case "anthropic": {
|
|
@@ -204,6 +237,7 @@ async function createLLMProvider(config) {
|
|
|
204
237
|
const modelFactory = createProviderModel(config.apiKey, config.baseUrl, config.options);
|
|
205
238
|
return createFetchLLMProvider({
|
|
206
239
|
name,
|
|
240
|
+
modelId: resolveModel(),
|
|
207
241
|
createModel: (modelId) => modelFactory(resolveModel(modelId))
|
|
208
242
|
});
|
|
209
243
|
}
|
|
@@ -221,6 +255,7 @@ async function createOpenAICompatibleProvider(config) {
|
|
|
221
255
|
});
|
|
222
256
|
return createFetchLLMProvider({
|
|
223
257
|
name,
|
|
258
|
+
modelId: resolveModel(),
|
|
224
259
|
createModel: (modelId) => sdk(resolveModel(modelId))
|
|
225
260
|
});
|
|
226
261
|
}
|