@juspay/neurolink 9.51.4 → 9.53.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/CHANGELOG.md +12 -0
- package/README.md +19 -0
- package/dist/agent/directTools.d.ts +2 -2
- package/dist/auth/errors.d.ts +1 -1
- package/dist/auth/middleware/AuthMiddleware.d.ts +1 -1
- package/dist/auth/providers/BaseAuthProvider.d.ts +1 -1
- package/dist/autoresearch/config.d.ts +11 -0
- package/dist/autoresearch/config.js +108 -0
- package/dist/autoresearch/errors.d.ts +40 -0
- package/dist/autoresearch/errors.js +20 -0
- package/dist/autoresearch/index.d.ts +23 -0
- package/dist/autoresearch/index.js +34 -0
- package/dist/autoresearch/phasePolicy.d.ts +9 -0
- package/dist/autoresearch/phasePolicy.js +69 -0
- package/dist/autoresearch/promptCompiler.d.ts +15 -0
- package/dist/autoresearch/promptCompiler.js +120 -0
- package/dist/autoresearch/repoPolicy.d.ts +32 -0
- package/dist/autoresearch/repoPolicy.js +128 -0
- package/dist/autoresearch/resultRecorder.d.ts +20 -0
- package/dist/autoresearch/resultRecorder.js +130 -0
- package/dist/autoresearch/runner.d.ts +10 -0
- package/dist/autoresearch/runner.js +102 -0
- package/dist/autoresearch/stateStore.d.ts +12 -0
- package/dist/autoresearch/stateStore.js +163 -0
- package/dist/autoresearch/summaryParser.d.ts +16 -0
- package/dist/autoresearch/summaryParser.js +94 -0
- package/dist/autoresearch/tools.d.ts +257 -0
- package/dist/autoresearch/tools.js +617 -0
- package/dist/autoresearch/worker.d.ts +71 -0
- package/dist/autoresearch/worker.js +417 -0
- package/dist/browser/neurolink.min.js +340 -324
- package/dist/cli/commands/autoresearch.d.ts +41 -0
- package/dist/cli/commands/autoresearch.js +487 -0
- package/dist/cli/commands/config.d.ts +1 -1
- package/dist/cli/commands/task.d.ts +2 -0
- package/dist/cli/commands/task.js +32 -3
- package/dist/cli/loop/optionsSchema.d.ts +1 -1
- package/dist/cli/parser.js +4 -1
- package/dist/core/baseProvider.js +18 -0
- package/dist/core/factory.d.ts +2 -2
- package/dist/core/factory.js +4 -4
- package/dist/evaluation/errors/EvaluationError.d.ts +1 -1
- package/dist/factories/providerFactory.d.ts +4 -4
- package/dist/factories/providerFactory.js +20 -7
- package/dist/factories/providerRegistry.d.ts +5 -0
- package/dist/factories/providerRegistry.js +45 -26
- package/dist/lib/agent/directTools.d.ts +2 -2
- package/dist/lib/auth/errors.d.ts +1 -1
- package/dist/lib/auth/middleware/AuthMiddleware.d.ts +1 -1
- package/dist/lib/auth/providers/BaseAuthProvider.d.ts +1 -1
- package/dist/lib/autoresearch/config.d.ts +11 -0
- package/dist/lib/autoresearch/config.js +109 -0
- package/dist/lib/autoresearch/errors.d.ts +40 -0
- package/dist/lib/autoresearch/errors.js +21 -0
- package/dist/lib/autoresearch/index.d.ts +23 -0
- package/dist/lib/autoresearch/index.js +35 -0
- package/dist/lib/autoresearch/phasePolicy.d.ts +9 -0
- package/dist/lib/autoresearch/phasePolicy.js +70 -0
- package/dist/lib/autoresearch/promptCompiler.d.ts +15 -0
- package/dist/lib/autoresearch/promptCompiler.js +121 -0
- package/dist/lib/autoresearch/repoPolicy.d.ts +32 -0
- package/dist/lib/autoresearch/repoPolicy.js +129 -0
- package/dist/lib/autoresearch/resultRecorder.d.ts +20 -0
- package/dist/lib/autoresearch/resultRecorder.js +131 -0
- package/dist/lib/autoresearch/runner.d.ts +10 -0
- package/dist/lib/autoresearch/runner.js +103 -0
- package/dist/lib/autoresearch/stateStore.d.ts +12 -0
- package/dist/lib/autoresearch/stateStore.js +164 -0
- package/dist/lib/autoresearch/summaryParser.d.ts +16 -0
- package/dist/lib/autoresearch/summaryParser.js +95 -0
- package/dist/lib/autoresearch/tools.d.ts +257 -0
- package/dist/lib/autoresearch/tools.js +618 -0
- package/dist/lib/autoresearch/worker.d.ts +71 -0
- package/dist/lib/autoresearch/worker.js +418 -0
- package/dist/lib/core/baseProvider.js +18 -0
- package/dist/lib/core/factory.d.ts +2 -2
- package/dist/lib/core/factory.js +4 -4
- package/dist/lib/evaluation/errors/EvaluationError.d.ts +1 -1
- package/dist/lib/factories/providerFactory.d.ts +4 -4
- package/dist/lib/factories/providerFactory.js +20 -7
- package/dist/lib/factories/providerRegistry.d.ts +5 -0
- package/dist/lib/factories/providerRegistry.js +45 -26
- package/dist/lib/files/fileTools.d.ts +1 -1
- package/dist/lib/neurolink.d.ts +21 -0
- package/dist/lib/neurolink.js +91 -8
- package/dist/lib/providers/amazonBedrock.d.ts +6 -1
- package/dist/lib/providers/amazonBedrock.js +14 -2
- package/dist/lib/providers/amazonSagemaker.d.ts +7 -1
- package/dist/lib/providers/amazonSagemaker.js +21 -3
- package/dist/lib/providers/anthropic.d.ts +4 -1
- package/dist/lib/providers/anthropic.js +18 -5
- package/dist/lib/providers/azureOpenai.d.ts +2 -1
- package/dist/lib/providers/azureOpenai.js +10 -5
- package/dist/lib/providers/googleAiStudio.d.ts +4 -1
- package/dist/lib/providers/googleAiStudio.js +6 -7
- package/dist/lib/providers/googleVertex.d.ts +3 -1
- package/dist/lib/providers/googleVertex.js +96 -17
- package/dist/lib/providers/huggingFace.d.ts +2 -1
- package/dist/lib/providers/huggingFace.js +4 -4
- package/dist/lib/providers/litellm.d.ts +5 -1
- package/dist/lib/providers/litellm.js +16 -11
- package/dist/lib/providers/mistral.d.ts +2 -1
- package/dist/lib/providers/mistral.js +2 -2
- package/dist/lib/providers/ollama.d.ts +3 -1
- package/dist/lib/providers/ollama.js +2 -2
- package/dist/lib/providers/openAI.d.ts +5 -1
- package/dist/lib/providers/openAI.js +15 -5
- package/dist/lib/providers/openRouter.d.ts +5 -1
- package/dist/lib/providers/openRouter.js +19 -7
- package/dist/lib/providers/openaiCompatible.d.ts +4 -1
- package/dist/lib/providers/openaiCompatible.js +18 -4
- package/dist/lib/tasks/autoresearchTaskExecutor.d.ts +32 -0
- package/dist/lib/tasks/autoresearchTaskExecutor.js +303 -0
- package/dist/lib/tasks/errors.d.ts +3 -1
- package/dist/lib/tasks/errors.js +1 -0
- package/dist/lib/tasks/taskExecutor.d.ts +4 -2
- package/dist/lib/tasks/taskExecutor.js +8 -1
- package/dist/lib/tasks/taskManager.js +27 -3
- package/dist/lib/tasks/tools/taskTools.d.ts +1 -1
- package/dist/lib/telemetry/attributes.d.ts +15 -0
- package/dist/lib/telemetry/attributes.js +16 -0
- package/dist/lib/telemetry/tracers.d.ts +1 -0
- package/dist/lib/telemetry/tracers.js +1 -0
- package/dist/lib/types/autoresearchTypes.d.ts +194 -0
- package/dist/lib/types/autoresearchTypes.js +18 -0
- package/dist/lib/types/common.d.ts +11 -0
- package/dist/lib/types/configTypes.d.ts +7 -0
- package/dist/lib/types/generateTypes.d.ts +13 -0
- package/dist/lib/types/index.d.ts +16 -14
- package/dist/lib/types/index.js +21 -17
- package/dist/lib/types/providers.d.ts +75 -0
- package/dist/lib/types/streamTypes.d.ts +7 -1
- package/dist/lib/types/taskTypes.d.ts +38 -0
- package/dist/lib/workflow/config.d.ts +3 -3
- package/dist/neurolink.d.ts +21 -0
- package/dist/neurolink.js +91 -8
- package/dist/providers/amazonBedrock.d.ts +6 -1
- package/dist/providers/amazonBedrock.js +14 -2
- package/dist/providers/amazonSagemaker.d.ts +7 -1
- package/dist/providers/amazonSagemaker.js +21 -3
- package/dist/providers/anthropic.d.ts +4 -1
- package/dist/providers/anthropic.js +18 -5
- package/dist/providers/azureOpenai.d.ts +2 -1
- package/dist/providers/azureOpenai.js +10 -5
- package/dist/providers/googleAiStudio.d.ts +4 -1
- package/dist/providers/googleAiStudio.js +6 -7
- package/dist/providers/googleVertex.d.ts +3 -1
- package/dist/providers/googleVertex.js +96 -17
- package/dist/providers/huggingFace.d.ts +2 -1
- package/dist/providers/huggingFace.js +4 -4
- package/dist/providers/litellm.d.ts +5 -1
- package/dist/providers/litellm.js +16 -11
- package/dist/providers/mistral.d.ts +2 -1
- package/dist/providers/mistral.js +2 -2
- package/dist/providers/ollama.d.ts +3 -1
- package/dist/providers/ollama.js +2 -2
- package/dist/providers/openAI.d.ts +5 -1
- package/dist/providers/openAI.js +15 -5
- package/dist/providers/openRouter.d.ts +5 -1
- package/dist/providers/openRouter.js +19 -7
- package/dist/providers/openaiCompatible.d.ts +4 -1
- package/dist/providers/openaiCompatible.js +18 -4
- package/dist/rag/errors/RAGError.d.ts +1 -1
- package/dist/tasks/autoresearchTaskExecutor.d.ts +32 -0
- package/dist/tasks/autoresearchTaskExecutor.js +302 -0
- package/dist/tasks/errors.d.ts +3 -1
- package/dist/tasks/errors.js +1 -0
- package/dist/tasks/taskExecutor.d.ts +4 -2
- package/dist/tasks/taskExecutor.js +8 -1
- package/dist/tasks/taskManager.js +27 -3
- package/dist/tasks/tools/taskTools.d.ts +1 -1
- package/dist/telemetry/attributes.d.ts +15 -0
- package/dist/telemetry/attributes.js +16 -0
- package/dist/telemetry/tracers.d.ts +1 -0
- package/dist/telemetry/tracers.js +1 -0
- package/dist/types/autoresearchTypes.d.ts +194 -0
- package/dist/types/autoresearchTypes.js +17 -0
- package/dist/types/common.d.ts +11 -0
- package/dist/types/configTypes.d.ts +7 -0
- package/dist/types/generateTypes.d.ts +13 -0
- package/dist/types/index.d.ts +16 -14
- package/dist/types/index.js +21 -17
- package/dist/types/providers.d.ts +75 -0
- package/dist/types/streamTypes.d.ts +7 -1
- package/dist/types/taskTypes.d.ts +38 -0
- package/package.json +3 -2
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for the NeuroLink AutoResearch system.
|
|
3
|
+
*
|
|
4
|
+
* An autonomous experiment loop that proposes code changes, executes
|
|
5
|
+
* experiments, evaluates results against a deterministic metric, and
|
|
6
|
+
* keeps or discards each change — running unattended for hours.
|
|
7
|
+
*/
|
|
8
|
+
import type { ThinkingLevel } from "./configTypes.js";
|
|
9
|
+
export type MetricDirection = "lower" | "higher";
|
|
10
|
+
export type MetricConfig = {
|
|
11
|
+
name: string;
|
|
12
|
+
direction: MetricDirection;
|
|
13
|
+
pattern: string;
|
|
14
|
+
};
|
|
15
|
+
export type MemoryMetricConfig = {
|
|
16
|
+
name: string;
|
|
17
|
+
pattern: string;
|
|
18
|
+
};
|
|
19
|
+
export type ResearchConfig = {
|
|
20
|
+
repoPath: string;
|
|
21
|
+
programPath: string;
|
|
22
|
+
mutablePaths: string[];
|
|
23
|
+
immutablePaths: string[];
|
|
24
|
+
resultsPath: string;
|
|
25
|
+
statePath: string;
|
|
26
|
+
runCommand: string;
|
|
27
|
+
logPath: string;
|
|
28
|
+
metric: MetricConfig;
|
|
29
|
+
memoryMetric?: MemoryMetricConfig;
|
|
30
|
+
timeoutMs: number;
|
|
31
|
+
branchPrefix: string;
|
|
32
|
+
provider?: string;
|
|
33
|
+
model?: string;
|
|
34
|
+
maxExperiments?: number;
|
|
35
|
+
thinkingLevel?: ThinkingLevel;
|
|
36
|
+
};
|
|
37
|
+
export type ExperimentStatus = "keep" | "discard" | "crash" | "timeout";
|
|
38
|
+
export type ExperimentPhase = "bootstrap" | "baseline" | "propose" | "edit" | "commit" | "run" | "evaluate" | "record" | "accept_or_revert";
|
|
39
|
+
export type ResearchState = {
|
|
40
|
+
branch: string;
|
|
41
|
+
acceptedCommit: string | null;
|
|
42
|
+
baselineMetric: number | null;
|
|
43
|
+
bestMetric: number | null;
|
|
44
|
+
candidateCommit: string | null;
|
|
45
|
+
runCount: number;
|
|
46
|
+
keepCount: number;
|
|
47
|
+
lastStatus: ExperimentStatus | null;
|
|
48
|
+
currentPhase: ExperimentPhase;
|
|
49
|
+
tag: string;
|
|
50
|
+
startedAt: string;
|
|
51
|
+
updatedAt: string;
|
|
52
|
+
lastSummary?: ExperimentSummary | null;
|
|
53
|
+
};
|
|
54
|
+
export type ExperimentSummary = {
|
|
55
|
+
crashed: boolean;
|
|
56
|
+
timedOut: boolean;
|
|
57
|
+
metric: number | null;
|
|
58
|
+
memoryValue: number | null;
|
|
59
|
+
trainingSeconds: number | null;
|
|
60
|
+
rawTail: string;
|
|
61
|
+
};
|
|
62
|
+
export type ExperimentRecord = {
|
|
63
|
+
commit: string;
|
|
64
|
+
metric: number | null;
|
|
65
|
+
memoryGb: number | null;
|
|
66
|
+
status: ExperimentStatus;
|
|
67
|
+
description: string;
|
|
68
|
+
timestamp: string;
|
|
69
|
+
};
|
|
70
|
+
export type ExperimentStats = {
|
|
71
|
+
total: number;
|
|
72
|
+
keepCount: number;
|
|
73
|
+
discardCount: number;
|
|
74
|
+
crashCount: number;
|
|
75
|
+
timeoutCount: number;
|
|
76
|
+
keepRate: number;
|
|
77
|
+
bestMetric: number | null;
|
|
78
|
+
bestCommit: string | null;
|
|
79
|
+
};
|
|
80
|
+
export type ResearchWorkerConfig = Omit<Partial<ResearchConfig>, "repoPath" | "mutablePaths" | "runCommand" | "metric"> & {
|
|
81
|
+
repoPath: string;
|
|
82
|
+
mutablePaths: string[];
|
|
83
|
+
runCommand: string;
|
|
84
|
+
metric: MetricConfig;
|
|
85
|
+
};
|
|
86
|
+
export type PhaseToolPolicy = {
|
|
87
|
+
activeTools: string[];
|
|
88
|
+
forcedTool?: string;
|
|
89
|
+
};
|
|
90
|
+
export type AutoresearchInitializedEvent = {
|
|
91
|
+
tag: string;
|
|
92
|
+
branch: string;
|
|
93
|
+
config: {
|
|
94
|
+
repoPath: string;
|
|
95
|
+
runCommand: string;
|
|
96
|
+
metric: MetricConfig;
|
|
97
|
+
timeoutMs: number;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
export type AutoresearchResumedEvent = {
|
|
101
|
+
tag: string;
|
|
102
|
+
branch: string;
|
|
103
|
+
runCount: number;
|
|
104
|
+
currentPhase: ExperimentPhase;
|
|
105
|
+
};
|
|
106
|
+
export type AutoresearchPhaseChangedEvent = {
|
|
107
|
+
from: ExperimentPhase;
|
|
108
|
+
to: ExperimentPhase;
|
|
109
|
+
runCount: number;
|
|
110
|
+
tag: string;
|
|
111
|
+
};
|
|
112
|
+
export type AutoresearchExperimentStartedEvent = {
|
|
113
|
+
tag: string;
|
|
114
|
+
runCount: number;
|
|
115
|
+
description: string;
|
|
116
|
+
};
|
|
117
|
+
export type AutoresearchExperimentCompletedEvent = {
|
|
118
|
+
tag: string;
|
|
119
|
+
runCount: number;
|
|
120
|
+
status: ExperimentStatus;
|
|
121
|
+
metric: number | null;
|
|
122
|
+
commit: string;
|
|
123
|
+
description: string;
|
|
124
|
+
durationMs: number;
|
|
125
|
+
};
|
|
126
|
+
export type AutoresearchMetricImprovedEvent = {
|
|
127
|
+
tag: string;
|
|
128
|
+
previousBest: number | null;
|
|
129
|
+
newBest: number;
|
|
130
|
+
commit: string;
|
|
131
|
+
direction: MetricDirection;
|
|
132
|
+
runCount: number;
|
|
133
|
+
};
|
|
134
|
+
export type AutoresearchRevertEvent = {
|
|
135
|
+
tag: string;
|
|
136
|
+
targetCommit: string;
|
|
137
|
+
reason: ExperimentStatus;
|
|
138
|
+
runCount: number;
|
|
139
|
+
};
|
|
140
|
+
export type AutoresearchRevertFailedEvent = {
|
|
141
|
+
tag: string;
|
|
142
|
+
targetCommit: string;
|
|
143
|
+
error: string;
|
|
144
|
+
runCount: number;
|
|
145
|
+
};
|
|
146
|
+
export type AutoresearchStateUpdatedEvent = {
|
|
147
|
+
tag: string;
|
|
148
|
+
phase: ExperimentPhase;
|
|
149
|
+
runCount: number;
|
|
150
|
+
keepCount: number;
|
|
151
|
+
bestMetric: number | null;
|
|
152
|
+
};
|
|
153
|
+
export type AutoresearchErrorEvent = {
|
|
154
|
+
tag: string;
|
|
155
|
+
error: string;
|
|
156
|
+
code?: string;
|
|
157
|
+
phase?: ExperimentPhase;
|
|
158
|
+
runCount?: number;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Union map of all autoresearch event names to their payload types.
|
|
162
|
+
* Used by TypedEventEmitter consumers for documentation;
|
|
163
|
+
* NeuroLinkEvents uses `unknown` payloads for flexibility.
|
|
164
|
+
*/
|
|
165
|
+
export type AutoresearchEventMap = {
|
|
166
|
+
"autoresearch:initialized": AutoresearchInitializedEvent;
|
|
167
|
+
"autoresearch:resumed": AutoresearchResumedEvent;
|
|
168
|
+
"autoresearch:phase-changed": AutoresearchPhaseChangedEvent;
|
|
169
|
+
"autoresearch:experiment-started": AutoresearchExperimentStartedEvent;
|
|
170
|
+
"autoresearch:experiment-completed": AutoresearchExperimentCompletedEvent;
|
|
171
|
+
"autoresearch:metric-improved": AutoresearchMetricImprovedEvent;
|
|
172
|
+
"autoresearch:revert": AutoresearchRevertEvent;
|
|
173
|
+
"autoresearch:revert-failed": AutoresearchRevertFailedEvent;
|
|
174
|
+
"autoresearch:state-updated": AutoresearchStateUpdatedEvent;
|
|
175
|
+
"autoresearch:error": AutoresearchErrorEvent;
|
|
176
|
+
};
|
|
177
|
+
/** All known autoresearch event names. */
|
|
178
|
+
export type AutoresearchEventName = keyof AutoresearchEventMap;
|
|
179
|
+
/**
|
|
180
|
+
* Minimal emitter interface accepted by autoresearch subsystems.
|
|
181
|
+
* Matches the shape injected by NeuroLink via setEmitter().
|
|
182
|
+
*/
|
|
183
|
+
export type AutoresearchEmitter = {
|
|
184
|
+
emit(event: string, ...args: unknown[]): boolean;
|
|
185
|
+
};
|
|
186
|
+
export declare const AUTORESEARCH_DEFAULTS: {
|
|
187
|
+
readonly programPath: "program.md";
|
|
188
|
+
readonly resultsPath: "results.tsv";
|
|
189
|
+
readonly statePath: ".autoresearch/state.json";
|
|
190
|
+
readonly logPath: "run.log";
|
|
191
|
+
readonly timeoutMs: 600000;
|
|
192
|
+
readonly branchPrefix: "autoresearch/";
|
|
193
|
+
readonly thinkingLevel: ThinkingLevel;
|
|
194
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for the NeuroLink AutoResearch system.
|
|
3
|
+
*
|
|
4
|
+
* An autonomous experiment loop that proposes code changes, executes
|
|
5
|
+
* experiments, evaluates results against a deterministic metric, and
|
|
6
|
+
* keeps or discards each change — running unattended for hours.
|
|
7
|
+
*/
|
|
8
|
+
// ── Defaults ─────────────────────────────────────────────
|
|
9
|
+
export const AUTORESEARCH_DEFAULTS = {
|
|
10
|
+
programPath: "program.md",
|
|
11
|
+
resultsPath: "results.tsv",
|
|
12
|
+
statePath: ".autoresearch/state.json",
|
|
13
|
+
logPath: "run.log",
|
|
14
|
+
timeoutMs: 600_000,
|
|
15
|
+
branchPrefix: "autoresearch/",
|
|
16
|
+
thinkingLevel: "medium",
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=autoresearchTypes.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Common utility types for NeuroLink
|
|
3
3
|
*/
|
|
4
|
+
import type { AutoresearchErrorEvent, AutoresearchExperimentCompletedEvent, AutoresearchExperimentStartedEvent, AutoresearchInitializedEvent, AutoresearchMetricImprovedEvent, AutoresearchPhaseChangedEvent, AutoresearchResumedEvent, AutoresearchRevertEvent, AutoresearchRevertFailedEvent, AutoresearchStateUpdatedEvent } from "./autoresearchTypes.js";
|
|
4
5
|
/**
|
|
5
6
|
* Type-safe unknown value - use when type is truly unknown
|
|
6
7
|
*/
|
|
@@ -115,6 +116,16 @@ export type NeuroLinkEvents = {
|
|
|
115
116
|
error: unknown;
|
|
116
117
|
log: unknown;
|
|
117
118
|
"log-event": unknown;
|
|
119
|
+
"autoresearch:initialized": AutoresearchInitializedEvent;
|
|
120
|
+
"autoresearch:resumed": AutoresearchResumedEvent;
|
|
121
|
+
"autoresearch:phase-changed": AutoresearchPhaseChangedEvent;
|
|
122
|
+
"autoresearch:experiment-started": AutoresearchExperimentStartedEvent;
|
|
123
|
+
"autoresearch:experiment-completed": AutoresearchExperimentCompletedEvent;
|
|
124
|
+
"autoresearch:metric-improved": AutoresearchMetricImprovedEvent;
|
|
125
|
+
"autoresearch:revert": AutoresearchRevertEvent;
|
|
126
|
+
"autoresearch:revert-failed": AutoresearchRevertFailedEvent;
|
|
127
|
+
"autoresearch:state-updated": AutoresearchStateUpdatedEvent;
|
|
128
|
+
"autoresearch:error": AutoresearchErrorEvent;
|
|
118
129
|
[key: string]: unknown;
|
|
119
130
|
};
|
|
120
131
|
/**
|
|
@@ -11,6 +11,7 @@ import type { RoutingStrategy } from "../mcp/routing/index.js";
|
|
|
11
11
|
import type { CacheStrategy } from "../mcp/caching/index.js";
|
|
12
12
|
import type { ToolMiddleware } from "../mcp/toolIntegration.js";
|
|
13
13
|
import type { MastraAuthProvider, AuthProviderType, AuthProviderConfig, Auth0Config, ClerkConfig, FirebaseConfig, SupabaseConfig, WorkOSConfig, BetterAuthConfig, JWTConfig, OAuth2Config, CognitoConfig, KeycloakConfig, AuthenticatedContext } from "./authTypes.js";
|
|
14
|
+
import type { NeurolinkCredentials } from "./providers.js";
|
|
14
15
|
/**
|
|
15
16
|
* Main NeuroLink configuration type
|
|
16
17
|
*/
|
|
@@ -39,6 +40,12 @@ export type NeurolinkConstructorConfig = {
|
|
|
39
40
|
auth?: NeuroLinkAuthConfig;
|
|
40
41
|
/** TaskManager configuration (scheduled and self-running tasks) */
|
|
41
42
|
tasks?: TaskManagerConfig;
|
|
43
|
+
/**
|
|
44
|
+
* Per-provider credential overrides.
|
|
45
|
+
* When set here, applies as the default for all generate()/stream() calls
|
|
46
|
+
* from this NeuroLink instance. Per-call credentials override these.
|
|
47
|
+
*/
|
|
48
|
+
credentials?: NeurolinkCredentials;
|
|
42
49
|
};
|
|
43
50
|
/**
|
|
44
51
|
* Configuration for MCP enhancement modules wired into generate()/stream() paths.
|
|
@@ -11,6 +11,7 @@ import type { DirectorModeOptions, DirectorSegment, VideoGenerationResult, Video
|
|
|
11
11
|
import type { PPTGenerationResult, PPTOutputOptions } from "./pptTypes.js";
|
|
12
12
|
import type { TTSOptions, TTSResult } from "./ttsTypes.js";
|
|
13
13
|
import type { StandardRecord, ValidationSchema, ZodUnknownSchema } from "./typeAliases.js";
|
|
14
|
+
import type { NeurolinkCredentials } from "./providers.js";
|
|
14
15
|
/**
|
|
15
16
|
* Generate function options type - Primary method for content generation
|
|
16
17
|
* Supports multimodal content while maintaining backward compatibility
|
|
@@ -424,6 +425,12 @@ export type GenerateOptions = {
|
|
|
424
425
|
auth?: {
|
|
425
426
|
token: string;
|
|
426
427
|
};
|
|
428
|
+
/**
|
|
429
|
+
* Per-provider credential overrides for this request.
|
|
430
|
+
* Overrides instance-level credentials set in `new NeuroLink({ credentials })`.
|
|
431
|
+
* Unset providers fall through to instance credentials, then environment variables.
|
|
432
|
+
*/
|
|
433
|
+
credentials?: NeurolinkCredentials;
|
|
427
434
|
/**
|
|
428
435
|
* Per-call memory control.
|
|
429
436
|
*
|
|
@@ -942,6 +949,12 @@ export type TextGenerationOptions = {
|
|
|
942
949
|
/** Thinking level (Gemini 3: minimal|low|medium|high). Ignored for Anthropic. */
|
|
943
950
|
thinkingLevel?: "minimal" | "low" | "medium" | "high";
|
|
944
951
|
};
|
|
952
|
+
/**
|
|
953
|
+
* Per-provider credential overrides for this request.
|
|
954
|
+
* Overrides instance-level credentials set in `new NeuroLink({ credentials })`.
|
|
955
|
+
* Unset providers fall through to instance credentials, then environment variables.
|
|
956
|
+
*/
|
|
957
|
+
credentials?: NeurolinkCredentials;
|
|
945
958
|
/**
|
|
946
959
|
* Optional request identifier for observability and log correlation.
|
|
947
960
|
* When provided, this ID is forwarded to spans, logs, and telemetry so
|
|
@@ -19,35 +19,37 @@ export { PROCESSOR_PRIORITIES } from "../processors/base/types.js";
|
|
|
19
19
|
export type { ActionAWSConfig, ActionCommentResult, ActionEvaluation, ActionExecutionResult, ActionGoogleCloudConfig, ActionInputs, ActionInputValidation, ActionMultimodalInputs, ActionOutput, ActionProviderKeys, ActionThinkingConfig, ActionTokenUsage, CliAnalytics, CliEvaluation, CliResponse, CliTokenUsage, ProviderKeyMapping, } from "./actionTypes.js";
|
|
20
20
|
export type { AnalyticsData, AnalyticsErrorInfo, PerformanceMetrics, StreamAnalyticsData, TokenUsage, } from "./analytics.js";
|
|
21
21
|
export * from "./multimodal.js";
|
|
22
|
+
export type { Auth0Config, AuthCacheConfig, AuthErrorCode, AuthErrorInfo, AuthErrorInfo as AuthErrorType, AuthEventData, AuthEventHandler, AuthEvents, AuthEventType, AuthenticatedContext, AuthHealthCheck, AuthLifecycle, AuthMiddlewareConfig, AuthMiddlewareOptions, AuthorizationResult, AuthProviderConfig, AuthProviderFactoryFn, AuthProviderHealthCheck, AuthProviderHealthStatus, AuthProviderMetadata, AuthProviderRegistration, AuthProviderType, AuthRequestContext, AuthRequestHandler, AuthSession, AuthSessionManager, AuthTokenValidator, AuthUser, AuthUserAuthorizer, AuthUserManager, BaseAuthProviderConfig, BetterAuthConfig, ClerkConfig, CognitoConfig, CustomAuthConfig, FirebaseConfig, JWK, JWKS, JWTConfig, KeycloakConfig, MastraAuthProvider, OAuth2Config, PermissionDefinition, RBACConfig, RBACMiddlewareConfig, SessionConfig, SessionStorage, SessionStorageType, SessionValidationResult, SupabaseConfig, TokenClaims, TokenExtractionConfig, TokenExtractionStrategy, TokenRefreshResult, TokenType, TokenValidationConfig, TokenValidationResult as AuthTokenValidationResult, WorkOSConfig, } from "./authTypes.js";
|
|
23
|
+
export type { AutoresearchEmitter, AutoresearchErrorEvent, AutoresearchEventMap, AutoresearchEventName, AutoresearchExperimentCompletedEvent, AutoresearchExperimentStartedEvent, AutoresearchInitializedEvent, AutoresearchMetricImprovedEvent, AutoresearchPhaseChangedEvent, AutoresearchResumedEvent, AutoresearchRevertEvent, AutoresearchRevertFailedEvent, AutoresearchStateUpdatedEvent, ExperimentPhase, ExperimentRecord, ExperimentStats, ExperimentStatus, ExperimentSummary, MemoryMetricConfig, MetricConfig, MetricDirection, PhaseToolPolicy, ResearchConfig, ResearchState, ResearchWorkerConfig, } from "./autoresearchTypes.js";
|
|
24
|
+
export { AUTORESEARCH_DEFAULTS } from "./autoresearchTypes.js";
|
|
25
|
+
export type { AgentExecuteOptions as ClientAgentExecuteOptions, AgentExecuteResult as ClientAgentExecuteResult, AgentInfo as ClientAgentInfo, ApiError as ClientApiError, AuthConfig as ClientAuthConfig, ClientApiResponse, ClientChatMessage, ClientConfig, ClientMiddlewareContext, ClientOAuth2Config, ClientProviderStatus, ClientRetryConfig, ClientStreamEvent, ClientStreamResult, ClientTokenRefreshResult, GenerateRequestOptions as ClientGenerateRequestOptions, GenerateResponse as ClientGenerateResponse, LanguageModel as ClientLanguageModel, LanguageModelCallOptions as ClientLanguageModelCallOptions, LanguageModelResponse as ClientLanguageModelResponse, LanguageModelStreamResponse as ClientLanguageModelStreamResponse, Middleware as ClientMiddleware, MiddlewareRequest as ClientMiddlewareRequest, MiddlewareResponse as ClientMiddlewareResponse, ModelOptions as ClientModelOptions, NeuroLinkProviderOptions, RequestOptions as ClientRequestOptions, SpeechRecognitionResult as ClientSpeechRecognitionResult, SpeechSynthesisOptions as ClientSpeechSynthesisOptions, StreamCallbacks as ClientStreamCallbacks, StreamEventType as ClientStreamEventType, StreamRequestOptions as ClientStreamRequestOptions, ToolInfo as ClientToolInfo, UseAgentOptions, UseAgentReturn, UseChatOptions, UseChatReturn, UseStreamOptions, UseStreamReturn, UseToolsOptions, UseToolsReturn, UseVoiceOptions, UseVoiceReturn, UseWorkflowOptions, UseWorkflowReturn, WebSocketMessageHandler as ClientWebSocketMessageHandler, WebSocketOptions as ClientWebSocketOptions, WebSocketState as ClientWebSocketState, WorkflowExecuteOptions as ClientWorkflowExecuteOptions, WorkflowExecuteResult as ClientWorkflowExecuteResult, WorkflowInfo as ClientWorkflowInfo, WSClientConfig, WSClientEventHandlers, WSClientMessage, WSClientState, } from "./clientTypes.js";
|
|
26
|
+
export * from "./contextTypes.js";
|
|
27
|
+
export type { ConversationData, ConversationSummary, NeurolinkOptions, StorageConfig, } from "./conversation.js";
|
|
28
|
+
export * from "./conversationMemoryInterface.js";
|
|
22
29
|
export type { DomainConfig, DomainConfigOptions, DomainEvaluationCriteria, DomainTemplate, DomainType, DomainValidationRule, } from "./domainTypes.js";
|
|
30
|
+
export { AuthenticationError, AuthorizationError, NetworkError, RateLimitError, } from "./errors.js";
|
|
23
31
|
export * from "./evaluation.js";
|
|
24
32
|
export * from "./evaluationProviders.js";
|
|
33
|
+
export * from "./fileReferenceTypes.js";
|
|
25
34
|
export * from "./fileTypes.js";
|
|
26
35
|
export type { AdditionalMemoryUser, EnhancedGenerateResult, EnhancedProvider, FactoryEnhancedProvider, GenerateOptions, GenerateResult as GenerateApiResult, // Renamed to avoid conflict with cli.js GenerateResult
|
|
27
36
|
TextGenerationOptions, TextGenerationResult, UnifiedGenerationOptions, } from "./generateTypes.js";
|
|
28
37
|
export * from "./hitlTypes.js";
|
|
29
38
|
export * from "./middlewareTypes.js";
|
|
30
39
|
export * from "./modelTypes.js";
|
|
40
|
+
export * from "./proxyTypes.js";
|
|
41
|
+
export * from "./ragTypes.js";
|
|
31
42
|
export * from "./scorerTypes.js";
|
|
32
43
|
export * from "./sdkTypes.js";
|
|
44
|
+
export type { AgentExecuteRequest, AgentExecuteResponse, AuthConfig as ServerAuthConfig, AuthenticatedUser, AuthStrategy, BodyParserConfig, CORSConfig, DataStreamWriter, EmbedManyRequest, EmbedManyResponse, EmbedRequest, EmbedResponse, ErrorCategory, ErrorCategoryType, ErrorSeverity, ErrorSeverityType, HealthResponse, HttpMethod, LoggingConfig, MCPServerStatusResponse, MiddlewareDefinition, MiddlewareHandler, RateLimitConfig as ServerRateLimitConfig, ReadyResponse, RedactionConfig, RequiredBodyParserConfig, RequiredCORSConfig, RequiredLoggingConfig, RequiredRateLimitConfig, RequiredRedactionConfig, RequiredServerAdapterConfig, RequiredShutdownConfig, RouteDefinition, RouteDeprecation, RouteGroup, RouteHandler, ServerAdapterConfig, ServerAdapterErrorCode, ServerAdapterErrorCodeType, ServerAdapterErrorContext, ServerAdapterEvents, ServerAdapterFactoryOptions, ServerContext, ServerFramework, ServerLifecycleState, ServerResponse, ServerStatus, ShutdownConfig, SSEWriteOptions, StreamingConfig, ToolExecuteRequest, ToolExecuteResponse, TrackedConnection, WebSocketConfig, WebSocketConnection, WebSocketHandler, WebSocketMessage, WebSocketMessageType, } from "./serverTypes.js";
|
|
33
45
|
export * from "./serviceTypes.js";
|
|
34
46
|
export type { EnhancedStreamProvider, ProgressCallback, StreamingMetadata, StreamingOptions, StreamingProgressData, StreamOptions, StreamResult, ToolCall as StreamToolCall, // Renamed to avoid conflict with tools.js ToolCall
|
|
35
47
|
ToolCallResults, ToolCalls, ToolResult as StreamToolResult, } from "./streamTypes.js";
|
|
48
|
+
export type { TokenRefresher } from "./subscriptionTypes.js";
|
|
49
|
+
export * from "./subscriptionTypes.js";
|
|
50
|
+
export type { AutoresearchTaskConfig, ConversationEntry as TaskConversationEntry, CronSchedule, IntervalSchedule, OnceSchedule, ScheduledTaskType, Task, TaskBackend, TaskBackendName, TaskDefinition, TaskExecutionMode, TaskManagerConfig, TaskRetentionConfig, TaskRunError, TaskRunResult, TaskSchedule, TaskScheduleType, TaskStatus, TaskStore, WorkerState, } from "./taskTypes.js";
|
|
51
|
+
export { TASK_DEFAULTS } from "./taskTypes.js";
|
|
36
52
|
export * from "./ttsTypes.js";
|
|
37
53
|
export * from "./utilities.js";
|
|
38
54
|
export type { AggregatedUsage, ConditioningConfig, ConditionOptions, ConditionResult, EnsembleExecutionResult, EnsembleResponse, ExecuteEnsembleOptions, ExecuteLayerOptions, ExecuteModelOptions, ExecutionConfig, ExecutionStrategy, JudgeConfig, JudgeOutputFormat, JudgeScores, LayerExecutionResult, ListOptions, ModelGroup, MultiJudgeScores, ParsedJudgeResponse, RegisterOptions, RegisterResult, RegistryEntry, RegistryStats, ScoreOptions, ScoreResult as WorkflowScoreResult, SummaryStats, ToneAdjustment, ValidationIssues, WorkflowAnalytics, WorkflowComparison, WorkflowConfig, WorkflowErrorDetails, WorkflowEvaluationData, WorkflowExecutionMetrics, WorkflowGenerateOptions, WorkflowInput, WorkflowMetadata, WorkflowModelConfig, WorkflowResult, WorkflowType, WorkflowValidationError, WorkflowValidationResult, WorkflowValidationWarning, } from "./workflowTypes.js";
|
|
39
55
|
export { WorkflowError } from "./workflowTypes.js";
|
|
40
|
-
export * from "./contextTypes.js";
|
|
41
|
-
export * from "./fileReferenceTypes.js";
|
|
42
|
-
export * from "./ragTypes.js";
|
|
43
|
-
export type { AgentExecuteRequest, AgentExecuteResponse, AuthConfig as ServerAuthConfig, AuthenticatedUser, AuthStrategy, BodyParserConfig, CORSConfig, DataStreamWriter, EmbedManyRequest, EmbedManyResponse, EmbedRequest, EmbedResponse, ErrorCategory, ErrorCategoryType, ErrorSeverity, ErrorSeverityType, HealthResponse, HttpMethod, LoggingConfig, MCPServerStatusResponse, MiddlewareDefinition, MiddlewareHandler, RateLimitConfig as ServerRateLimitConfig, ReadyResponse, RedactionConfig, RequiredBodyParserConfig, RequiredCORSConfig, RequiredLoggingConfig, RequiredRateLimitConfig, RequiredRedactionConfig, RequiredServerAdapterConfig, RequiredShutdownConfig, RouteDefinition, RouteDeprecation, RouteGroup, RouteHandler, ServerAdapterConfig, ServerAdapterErrorCode, ServerAdapterErrorCodeType, ServerAdapterErrorContext, ServerAdapterEvents, ServerAdapterFactoryOptions, ServerContext, ServerFramework, ServerLifecycleState, ServerResponse, ServerStatus, ShutdownConfig, SSEWriteOptions, StreamingConfig, ToolExecuteRequest, ToolExecuteResponse, TrackedConnection, WebSocketConfig, WebSocketConnection, WebSocketHandler, WebSocketMessage, WebSocketMessageType, } from "./serverTypes.js";
|
|
44
|
-
export * from "./conversationMemoryInterface.js";
|
|
45
|
-
export type { StorageConfig, ConversationData, ConversationSummary, NeurolinkOptions, } from "./conversation.js";
|
|
46
|
-
export { AuthenticationError, AuthorizationError, NetworkError, RateLimitError, } from "./errors.js";
|
|
47
|
-
export * from "./subscriptionTypes.js";
|
|
48
|
-
export type { ClientConfig, RequestOptions as ClientRequestOptions, ClientRetryConfig, ClientApiResponse, ApiError as ClientApiError, ClientProviderStatus, StreamEventType as ClientStreamEventType, ClientStreamEvent, StreamCallbacks as ClientStreamCallbacks, ClientStreamResult, GenerateRequestOptions as ClientGenerateRequestOptions, GenerateResponse as ClientGenerateResponse, StreamRequestOptions as ClientStreamRequestOptions, AgentExecuteOptions as ClientAgentExecuteOptions, AgentExecuteResult as ClientAgentExecuteResult, AgentInfo as ClientAgentInfo, WorkflowExecuteOptions as ClientWorkflowExecuteOptions, WorkflowExecuteResult as ClientWorkflowExecuteResult, WorkflowInfo as ClientWorkflowInfo, ToolInfo as ClientToolInfo, Middleware as ClientMiddleware, MiddlewareRequest as ClientMiddlewareRequest, MiddlewareResponse as ClientMiddlewareResponse, ClientMiddlewareContext, ClientChatMessage, UseChatOptions, UseChatReturn, UseAgentOptions, UseAgentReturn, UseWorkflowOptions, UseWorkflowReturn, UseVoiceOptions, UseVoiceReturn, UseStreamOptions, UseStreamReturn, UseToolsOptions, UseToolsReturn, LanguageModel as ClientLanguageModel, LanguageModelCallOptions as ClientLanguageModelCallOptions, LanguageModelResponse as ClientLanguageModelResponse, LanguageModelStreamResponse as ClientLanguageModelStreamResponse, NeuroLinkProviderOptions, ModelOptions as ClientModelOptions, WebSocketOptions as ClientWebSocketOptions, WebSocketState as ClientWebSocketState, WebSocketMessageHandler as ClientWebSocketMessageHandler, WSClientState, WSClientConfig, WSClientMessage, WSClientEventHandlers, SpeechRecognitionResult as ClientSpeechRecognitionResult, SpeechSynthesisOptions as ClientSpeechSynthesisOptions, AuthConfig as ClientAuthConfig, ClientOAuth2Config, ClientTokenRefreshResult, } from "./clientTypes.js";
|
|
49
|
-
export type { TokenRefresher } from "./subscriptionTypes.js";
|
|
50
|
-
export * from "./proxyTypes.js";
|
|
51
|
-
export type { AuthProviderType, AuthProviderConfig, MastraAuthProvider, BetterAuthConfig, Auth0Config, ClerkConfig, FirebaseConfig, SupabaseConfig, WorkOSConfig, JWTConfig, OAuth2Config, CognitoConfig, KeycloakConfig, CustomAuthConfig, BaseAuthProviderConfig, AuthUser, AuthSession, TokenType, TokenValidationResult as AuthTokenValidationResult, TokenClaims, JWK, JWKS, TokenRefreshResult, TokenValidationConfig, TokenExtractionConfig, SessionValidationResult, SessionStorage, AuthorizationResult, AuthRequestContext, AuthenticatedContext, TokenExtractionStrategy, SessionConfig, SessionStorageType, RBACConfig, PermissionDefinition, AuthCacheConfig, AuthMiddlewareOptions, AuthMiddlewareConfig, RBACMiddlewareConfig, AuthErrorCode, AuthErrorInfo, AuthErrorInfo as AuthErrorType, AuthEventType, AuthEventData, AuthEventHandler, AuthProviderFactoryFn, AuthProviderRegistration, AuthHealthCheck, AuthProviderHealthCheck, AuthEvents, AuthProviderMetadata, AuthProviderHealthStatus, AuthTokenValidator, AuthUserAuthorizer, AuthSessionManager, AuthRequestHandler, AuthUserManager, AuthLifecycle, } from "./authTypes.js";
|
|
52
|
-
export type { Task, TaskDefinition, TaskSchedule, TaskScheduleType, CronSchedule, IntervalSchedule, OnceSchedule, TaskExecutionMode, TaskStatus, TaskRunResult, TaskRunError, TaskStore, TaskBackend, TaskBackendName, TaskManagerConfig, TaskRetentionConfig, WorkerState, ConversationEntry as TaskConversationEntry, } from "./taskTypes.js";
|
|
53
|
-
export { TASK_DEFAULTS } from "./taskTypes.js";
|
package/dist/lib/types/index.js
CHANGED
|
@@ -16,10 +16,22 @@ export * from "./tools.js";
|
|
|
16
16
|
export { PROCESSOR_PRIORITIES } from "../processors/base/types.js";
|
|
17
17
|
// Content types for multimodal support (direct export from canonical source)
|
|
18
18
|
export * from "./multimodal.js";
|
|
19
|
+
export { AUTORESEARCH_DEFAULTS } from "./autoresearchTypes.js";
|
|
20
|
+
// Content types: canonical source is ./multimodal.js (already exported above).
|
|
21
|
+
// ./content.js re-exports from multimodal for backward compat but is NOT
|
|
22
|
+
// re-exported here to avoid duplicate symbol collisions.
|
|
23
|
+
// Context compaction types
|
|
24
|
+
export * from "./contextTypes.js";
|
|
25
|
+
// Conversation memory manager type
|
|
26
|
+
export * from "./conversationMemoryInterface.js";
|
|
27
|
+
// Error classes
|
|
28
|
+
export { AuthenticationError, AuthorizationError, NetworkError, RateLimitError, } from "./errors.js";
|
|
19
29
|
// Evaluation types - NEW
|
|
20
30
|
export * from "./evaluation.js";
|
|
21
31
|
// Evaluation provider types - NEW
|
|
22
32
|
export * from "./evaluationProviders.js";
|
|
33
|
+
// File reference types
|
|
34
|
+
export * from "./fileReferenceTypes.js";
|
|
23
35
|
// File detection and processing types
|
|
24
36
|
export * from "./fileTypes.js";
|
|
25
37
|
// HITL (Human-in-the-Loop) types
|
|
@@ -28,6 +40,10 @@ export * from "./hitlTypes.js";
|
|
|
28
40
|
export * from "./middlewareTypes.js";
|
|
29
41
|
// Model types - NEW
|
|
30
42
|
export * from "./modelTypes.js";
|
|
43
|
+
// Proxy types (Claude API format, cloaking, routing, config, stats, server adapters)
|
|
44
|
+
export * from "./proxyTypes.js";
|
|
45
|
+
// RAG types
|
|
46
|
+
export * from "./ragTypes.js";
|
|
31
47
|
// Scorer types for evaluation system
|
|
32
48
|
export * from "./scorerTypes.js";
|
|
33
49
|
// SDK Types - Core types for external developers
|
|
@@ -36,27 +52,15 @@ export * from "./scorerTypes.js";
|
|
|
36
52
|
export * from "./sdkTypes.js";
|
|
37
53
|
// Service types - NEW
|
|
38
54
|
export * from "./serviceTypes.js";
|
|
39
|
-
// TTS (Text-to-Speech) types
|
|
40
|
-
export * from "./ttsTypes.js";
|
|
41
|
-
// Utilities Types - Utility module types (selective export to avoid conflicts)
|
|
42
|
-
export * from "./utilities.js";
|
|
43
|
-
export { WorkflowError } from "./workflowTypes.js";
|
|
44
|
-
// Context compaction types
|
|
45
|
-
export * from "./contextTypes.js";
|
|
46
|
-
// File reference types
|
|
47
|
-
export * from "./fileReferenceTypes.js";
|
|
48
|
-
// RAG types
|
|
49
|
-
export * from "./ragTypes.js";
|
|
50
|
-
// Conversation memory manager type
|
|
51
|
-
export * from "./conversationMemoryInterface.js";
|
|
52
|
-
// Error classes
|
|
53
|
-
export { AuthenticationError, AuthorizationError, NetworkError, RateLimitError, } from "./errors.js";
|
|
54
55
|
// Subscription types (Claude subscription tiers, authentication, usage tracking)
|
|
55
56
|
// NOTE: subscriptionTypes.ts re-exports auth types from ./authTypes.ts for
|
|
56
57
|
// backward compatibility. Import StoredOAuthTokens, TokenRefresher, etc.
|
|
57
58
|
// from authTypes.ts for new code.
|
|
58
59
|
export * from "./subscriptionTypes.js";
|
|
59
|
-
// Proxy types (Claude API format, cloaking, routing, config, stats, server adapters)
|
|
60
|
-
export * from "./proxyTypes.js";
|
|
61
60
|
export { TASK_DEFAULTS } from "./taskTypes.js";
|
|
61
|
+
// TTS (Text-to-Speech) types
|
|
62
|
+
export * from "./ttsTypes.js";
|
|
63
|
+
// Utilities Types - Utility module types (selective export to avoid conflicts)
|
|
64
|
+
export * from "./utilities.js";
|
|
65
|
+
export { WorkflowError } from "./workflowTypes.js";
|
|
62
66
|
//# sourceMappingURL=index.js.map
|
|
@@ -71,6 +71,81 @@ export type AWSCredentialConfig = {
|
|
|
71
71
|
/** Optional service endpoint override (e.g., VPC/Gov endpoints) */
|
|
72
72
|
endpoint?: string;
|
|
73
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* Per-provider credential overrides for generate() / stream() calls.
|
|
76
|
+
*
|
|
77
|
+
* When set on `NeurolinkConstructorConfig.credentials`, applies as the default
|
|
78
|
+
* for all calls from that NeuroLink instance. When set on
|
|
79
|
+
* `GenerateOptions.credentials` or `StreamOptions.credentials`, overrides the
|
|
80
|
+
* instance default for that single call.
|
|
81
|
+
*
|
|
82
|
+
* Unset providers fall through to environment variables (existing behaviour).
|
|
83
|
+
*/
|
|
84
|
+
export type NeurolinkCredentials = {
|
|
85
|
+
openai?: {
|
|
86
|
+
apiKey?: string;
|
|
87
|
+
baseURL?: string;
|
|
88
|
+
};
|
|
89
|
+
anthropic?: {
|
|
90
|
+
apiKey?: string;
|
|
91
|
+
oauthToken?: string;
|
|
92
|
+
};
|
|
93
|
+
googleAiStudio?: {
|
|
94
|
+
apiKey?: string;
|
|
95
|
+
};
|
|
96
|
+
vertex?: {
|
|
97
|
+
projectId?: string;
|
|
98
|
+
location?: string;
|
|
99
|
+
/** Vertex Express Mode — simplified API-key auth */
|
|
100
|
+
apiKey?: string;
|
|
101
|
+
/** Full service-account JSON string */
|
|
102
|
+
serviceAccountKey?: string;
|
|
103
|
+
/** Inline service-account fields (alternative to serviceAccountKey) */
|
|
104
|
+
clientEmail?: string;
|
|
105
|
+
privateKey?: string;
|
|
106
|
+
};
|
|
107
|
+
bedrock?: {
|
|
108
|
+
accessKeyId?: string;
|
|
109
|
+
secretAccessKey?: string;
|
|
110
|
+
sessionToken?: string;
|
|
111
|
+
region?: string;
|
|
112
|
+
};
|
|
113
|
+
sagemaker?: {
|
|
114
|
+
accessKeyId?: string;
|
|
115
|
+
secretAccessKey?: string;
|
|
116
|
+
sessionToken?: string;
|
|
117
|
+
region?: string;
|
|
118
|
+
endpoint?: string;
|
|
119
|
+
};
|
|
120
|
+
azure?: {
|
|
121
|
+
apiKey?: string;
|
|
122
|
+
resourceName?: string;
|
|
123
|
+
deploymentName?: string;
|
|
124
|
+
apiVersion?: string;
|
|
125
|
+
};
|
|
126
|
+
mistral?: {
|
|
127
|
+
apiKey?: string;
|
|
128
|
+
};
|
|
129
|
+
huggingFace?: {
|
|
130
|
+
apiKey?: string;
|
|
131
|
+
baseURL?: string;
|
|
132
|
+
};
|
|
133
|
+
openrouter?: {
|
|
134
|
+
apiKey?: string;
|
|
135
|
+
baseURL?: string;
|
|
136
|
+
};
|
|
137
|
+
litellm?: {
|
|
138
|
+
apiKey?: string;
|
|
139
|
+
baseURL?: string;
|
|
140
|
+
};
|
|
141
|
+
openaiCompatible?: {
|
|
142
|
+
apiKey?: string;
|
|
143
|
+
baseURL?: string;
|
|
144
|
+
};
|
|
145
|
+
ollama?: {
|
|
146
|
+
baseURL?: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
74
149
|
/**
|
|
75
150
|
* AWS Credential Validation Result
|
|
76
151
|
*/
|
|
@@ -9,7 +9,7 @@ import type { JsonValue, UnknownRecord } from "./common.js";
|
|
|
9
9
|
import type { Content, ImageWithAltText } from "./content.js";
|
|
10
10
|
import type { ChatMessage } from "./conversation.js";
|
|
11
11
|
import type { AdditionalMemoryUser } from "./generateTypes.js";
|
|
12
|
-
import type { AIModelProviderConfig } from "./providers.js";
|
|
12
|
+
import type { AIModelProviderConfig, NeurolinkCredentials } from "./providers.js";
|
|
13
13
|
import type { TTSChunk, TTSOptions } from "./ttsTypes.js";
|
|
14
14
|
import type { StandardRecord, ValidationSchema } from "./typeAliases.js";
|
|
15
15
|
/**
|
|
@@ -444,6 +444,12 @@ export type StreamOptions = {
|
|
|
444
444
|
auth?: {
|
|
445
445
|
token: string;
|
|
446
446
|
};
|
|
447
|
+
/**
|
|
448
|
+
* Per-provider credential overrides for this request.
|
|
449
|
+
* Overrides instance-level credentials set in `new NeuroLink({ credentials })`.
|
|
450
|
+
* Unset providers fall through to instance credentials, then environment variables.
|
|
451
|
+
*/
|
|
452
|
+
credentials?: NeurolinkCredentials;
|
|
447
453
|
/**
|
|
448
454
|
* Per-call memory control.
|
|
449
455
|
*
|
|
@@ -6,7 +6,37 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { Cron } from "croner";
|
|
8
8
|
import type { createClient } from "redis";
|
|
9
|
+
import type { MemoryMetricConfig, MetricConfig } from "./autoresearchTypes.js";
|
|
9
10
|
import type { ThinkingLevel } from "./configTypes.js";
|
|
11
|
+
/**
|
|
12
|
+
* Discriminator for standard vs autoresearch tasks.
|
|
13
|
+
* - "standard": Normal prompt-based task (default)
|
|
14
|
+
* - "autoresearch": Autonomous experiment loop task
|
|
15
|
+
*/
|
|
16
|
+
export type ScheduledTaskType = "standard" | "autoresearch";
|
|
17
|
+
/**
|
|
18
|
+
* Configuration for autoresearch tasks.
|
|
19
|
+
* Embedded in TaskDefinition/Task when type === "autoresearch".
|
|
20
|
+
*/
|
|
21
|
+
export type AutoresearchTaskConfig = {
|
|
22
|
+
repoPath: string;
|
|
23
|
+
mutablePaths: string[];
|
|
24
|
+
runCommand: string;
|
|
25
|
+
metric: MetricConfig;
|
|
26
|
+
immutablePaths?: string[];
|
|
27
|
+
timeoutMs?: number;
|
|
28
|
+
maxExperiments?: number;
|
|
29
|
+
provider?: string;
|
|
30
|
+
model?: string;
|
|
31
|
+
thinkingLevel?: ThinkingLevel;
|
|
32
|
+
maxBudgetUsd?: number;
|
|
33
|
+
programPath?: string;
|
|
34
|
+
resultsPath?: string;
|
|
35
|
+
statePath?: string;
|
|
36
|
+
logPath?: string;
|
|
37
|
+
branchPrefix?: string;
|
|
38
|
+
memoryMetric?: MemoryMetricConfig;
|
|
39
|
+
};
|
|
10
40
|
export type TaskScheduleType = "cron" | "interval" | "once";
|
|
11
41
|
export type CronSchedule = {
|
|
12
42
|
type: "cron";
|
|
@@ -37,6 +67,10 @@ export type TaskDefinition = {
|
|
|
37
67
|
prompt: string;
|
|
38
68
|
schedule: TaskSchedule;
|
|
39
69
|
mode?: TaskExecutionMode;
|
|
70
|
+
/** Task type discriminator. Default: "standard" */
|
|
71
|
+
type?: ScheduledTaskType;
|
|
72
|
+
/** Autoresearch config (required when type === "autoresearch") */
|
|
73
|
+
autoresearch?: AutoresearchTaskConfig;
|
|
40
74
|
provider?: string;
|
|
41
75
|
model?: string;
|
|
42
76
|
thinkingLevel?: ThinkingLevel;
|
|
@@ -67,7 +101,11 @@ export type Task = {
|
|
|
67
101
|
prompt: string;
|
|
68
102
|
schedule: TaskSchedule;
|
|
69
103
|
mode: TaskExecutionMode;
|
|
104
|
+
/** Task type discriminator. Default: "standard" */
|
|
105
|
+
type: ScheduledTaskType;
|
|
70
106
|
status: TaskStatus;
|
|
107
|
+
/** Autoresearch config (present when type === "autoresearch") */
|
|
108
|
+
autoresearch?: AutoresearchTaskConfig;
|
|
71
109
|
provider?: string;
|
|
72
110
|
model?: string;
|
|
73
111
|
thinkingLevel?: ThinkingLevel;
|
|
@@ -41,8 +41,8 @@ export declare const JudgeConfigSchema: z.ZodObject<{
|
|
|
41
41
|
model: z.ZodString;
|
|
42
42
|
criteria: z.ZodArray<z.ZodString>;
|
|
43
43
|
outputFormat: z.ZodEnum<{
|
|
44
|
-
detailed: "detailed";
|
|
45
44
|
scores: "scores";
|
|
45
|
+
detailed: "detailed";
|
|
46
46
|
ranking: "ranking";
|
|
47
47
|
best: "best";
|
|
48
48
|
}>;
|
|
@@ -195,8 +195,8 @@ export declare const WorkflowConfigSchema: z.ZodObject<{
|
|
|
195
195
|
model: z.ZodString;
|
|
196
196
|
criteria: z.ZodArray<z.ZodString>;
|
|
197
197
|
outputFormat: z.ZodEnum<{
|
|
198
|
-
detailed: "detailed";
|
|
199
198
|
scores: "scores";
|
|
199
|
+
detailed: "detailed";
|
|
200
200
|
ranking: "ranking";
|
|
201
201
|
best: "best";
|
|
202
202
|
}>;
|
|
@@ -219,8 +219,8 @@ export declare const WorkflowConfigSchema: z.ZodObject<{
|
|
|
219
219
|
model: z.ZodString;
|
|
220
220
|
criteria: z.ZodArray<z.ZodString>;
|
|
221
221
|
outputFormat: z.ZodEnum<{
|
|
222
|
-
detailed: "detailed";
|
|
223
222
|
scores: "scores";
|
|
223
|
+
detailed: "detailed";
|
|
224
224
|
ranking: "ranking";
|
|
225
225
|
best: "best";
|
|
226
226
|
}>;
|
package/dist/neurolink.d.ts
CHANGED
|
@@ -73,6 +73,27 @@ export declare class NeuroLink {
|
|
|
73
73
|
private authProvider?;
|
|
74
74
|
private pendingAuthConfig?;
|
|
75
75
|
private authInitPromise?;
|
|
76
|
+
private credentials?;
|
|
77
|
+
/**
|
|
78
|
+
* Merge instance-level credentials with per-call credentials.
|
|
79
|
+
*
|
|
80
|
+
* Semantics: **deep merge at the provider level.** For each provider key
|
|
81
|
+
* present in both `this.credentials` and `callCredentials`, the per-call
|
|
82
|
+
* fields are merged ON TOP of the instance-level fields, so fields not
|
|
83
|
+
* mentioned in the per-call slice are preserved.
|
|
84
|
+
*
|
|
85
|
+
* Example:
|
|
86
|
+
* ```
|
|
87
|
+
* instance: { openai: { apiKey: "key1", baseURL: "url1" } }
|
|
88
|
+
* per-call: { openai: { apiKey: "key2" } }
|
|
89
|
+
* merged: { openai: { apiKey: "key2", baseURL: "url1" } } // baseURL preserved
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* Providers present only in one source are carried through unchanged.
|
|
93
|
+
* Unrelated providers (not overridden in callCredentials) are carried through
|
|
94
|
+
* from instance credentials unchanged.
|
|
95
|
+
*/
|
|
96
|
+
private resolveCredentials;
|
|
76
97
|
private hitlManager?;
|
|
77
98
|
private _sessionCostUsd;
|
|
78
99
|
private fileRegistry;
|