@anonx3247/universal-agent-harness 1.0.1 → 1.0.2
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/db/schema.d.ts +5 -5
- package/dist/lib/advisory.js +1 -1
- package/dist/lib/mcp-config.d.ts.map +1 -1
- package/dist/lib/mcp-config.js +3 -5
- package/dist/lib/mcp-config.js.map +1 -1
- package/dist/models/anthropic.js +3 -3
- package/dist/models/deepseek/index.js +3 -3
- package/dist/models/gemini.js +3 -3
- package/dist/models/mistral.js +3 -3
- package/dist/models/moonshotai.js +3 -3
- package/dist/models/openai.js +2 -2
- package/dist/models/provider.js +1 -1
- package/dist/models/redpill.js +3 -3
- package/dist/resources/advisory.js +2 -2
- package/dist/resources/messages.js +2 -2
- package/dist/resources/run.d.ts +4 -4
- package/dist/resources/run.js +4 -4
- package/dist/runner/index.js +9 -9
- package/package.json +1 -1
package/dist/db/schema.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Model } from "
|
|
1
|
+
import { Model } from "@app/models/provider";
|
|
2
2
|
export declare const runs: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
3
3
|
name: "runs";
|
|
4
4
|
schema: undefined;
|
|
@@ -262,7 +262,7 @@ export declare const messages: import("drizzle-orm/sqlite-core").SQLiteTableWith
|
|
|
262
262
|
tableName: "messages";
|
|
263
263
|
dataType: "string";
|
|
264
264
|
columnType: "SQLiteText";
|
|
265
|
-
data: "
|
|
265
|
+
data: "user" | "agent";
|
|
266
266
|
driverParam: string;
|
|
267
267
|
notNull: true;
|
|
268
268
|
hasDefault: false;
|
|
@@ -275,14 +275,14 @@ export declare const messages: import("drizzle-orm/sqlite-core").SQLiteTableWith
|
|
|
275
275
|
generated: undefined;
|
|
276
276
|
}, {}, {
|
|
277
277
|
length: number | undefined;
|
|
278
|
-
$type: "
|
|
278
|
+
$type: "user" | "agent";
|
|
279
279
|
}>;
|
|
280
280
|
content: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
281
281
|
name: "content";
|
|
282
282
|
tableName: "messages";
|
|
283
283
|
dataType: "json";
|
|
284
284
|
columnType: "SQLiteTextJson";
|
|
285
|
-
data: (import("
|
|
285
|
+
data: (import("@app/models").TextContent | import("@app/models").ToolUse | import("@app/models").ToolResult | import("@app/models").Thinking)[];
|
|
286
286
|
driverParam: string;
|
|
287
287
|
notNull: true;
|
|
288
288
|
hasDefault: false;
|
|
@@ -294,7 +294,7 @@ export declare const messages: import("drizzle-orm/sqlite-core").SQLiteTableWith
|
|
|
294
294
|
identity: undefined;
|
|
295
295
|
generated: undefined;
|
|
296
296
|
}, {}, {
|
|
297
|
-
$type: (import("
|
|
297
|
+
$type: (import("@app/models").TextContent | import("@app/models").ToolUse | import("@app/models").ToolResult | import("@app/models").Thinking)[];
|
|
298
298
|
}>;
|
|
299
299
|
total_tokens: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
300
300
|
name: "total_tokens";
|
package/dist/lib/advisory.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from "events";
|
|
2
|
-
import { AdvisoryResource } from "
|
|
2
|
+
import { AdvisoryResource } from "@app/resources/advisory";
|
|
3
3
|
export class TypedEventEmitter extends EventEmitter {
|
|
4
4
|
on(event, listener) {
|
|
5
5
|
return super.on(event, listener);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-config.d.ts","sourceRoot":"","sources":["../../src/lib/mcp-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-config.d.ts","sourceRoot":"","sources":["../../src/lib/mcp-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,MAAM,EAAE,MAAM,SAAS,CAAC;AAG1C;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,EAAE,OAAO,GAAG,KAAK,CAAC;IAE3B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,eAAe,EAAE,CAAC,CAiD/E;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIpD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CAiCzE"}
|
package/dist/lib/mcp-config.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { readFileSync, existsSync } from "fs";
|
|
2
|
-
import { join
|
|
3
|
-
import { fileURLToPath } from "url";
|
|
2
|
+
import { join } from "path";
|
|
4
3
|
import { err, ok } from "./error";
|
|
5
|
-
|
|
6
|
-
const __dirname = dirname(__filename);
|
|
4
|
+
import { getProfilesDir } from "./profiles";
|
|
7
5
|
/**
|
|
8
6
|
* Load MCP server configuration from profile
|
|
9
7
|
*/
|
|
10
8
|
export function loadProfileMCPConfig(profile) {
|
|
11
|
-
const configPath = join(
|
|
9
|
+
const configPath = join(getProfilesDir(), profile, "settings.json");
|
|
12
10
|
// If no settings file, return empty array (just computer tool)
|
|
13
11
|
if (!existsSync(configPath)) {
|
|
14
12
|
return ok([]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-config.js","sourceRoot":"","sources":["../../src/lib/mcp-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"mcp-config.js","sourceRoot":"","sources":["../../src/lib/mcp-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,GAAG,EAAE,EAAE,EAAU,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAwD5C;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;IAEpE,+DAA+D;IAC/D,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;IAChB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAClD,MAAM,MAAM,GAAkB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAElD,yBAAyB;QACzB,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,MAAM,CAC9C,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,KAAK,KAAK,CACrC,CAAC;QAEF,8BAA8B;QAC9B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;gBACjB,OAAO,GAAG,CACR,sBAAsB,EACtB,wCAAwC,CACz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S,CAAC,IAAI,EAAE,CAAC;QACnB,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACtD,CAAC;IAED,4CAA4C;IAC5C,IAAI,SAAS,CAAC,GAAG,EAAE,CAAC;QAClB,MAAM,WAAW,GAA2B,EAAE,CAAC;QAC/C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;YACzD,WAAW,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC;QACD,SAAS,CAAC,GAAG,GAAG,WAAW,CAAC;IAC9B,CAAC;IAED,gBAAgB;IAChB,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;QACpB,SAAS,CAAC,KAAK,GAAG,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/models/anthropic.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LLM } from "./index";
|
|
2
2
|
import Anthropic from "@anthropic-ai/sdk";
|
|
3
|
-
import { err, ok } from "
|
|
4
|
-
import { assertNever } from "
|
|
5
|
-
import { removeNulls } from "
|
|
3
|
+
import { err, ok } from "@app/lib/error";
|
|
4
|
+
import { assertNever } from "@app/lib/assert";
|
|
5
|
+
import { removeNulls } from "@app/lib/utils";
|
|
6
6
|
const DEFAULT_TIMEOUT = 600000 * 2; // 20 minutes (double the default)
|
|
7
7
|
const DEFAULT_MAX_TOKENS = 8192;
|
|
8
8
|
const DEFAULT_THINKING_TOKENS = 8192;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { LLM, } from "../index";
|
|
2
2
|
import { PreTrainedTokenizer } from "@huggingface/transformers";
|
|
3
3
|
import OpenAI from "openai";
|
|
4
|
-
import { err, ok } from "
|
|
5
|
-
import { assertNever } from "
|
|
6
|
-
import { removeNulls } from "
|
|
4
|
+
import { err, ok } from "@app/lib/error";
|
|
5
|
+
import { assertNever } from "@app/lib/assert";
|
|
6
|
+
import { removeNulls } from "@app/lib/utils";
|
|
7
7
|
export function isDeepseekModel(model) {
|
|
8
8
|
return ["deepseek-chat", "deepseek-reasoner"].includes(model);
|
|
9
9
|
}
|
package/dist/models/gemini.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FunctionCallingConfigMode, GoogleGenAI, } from "@google/genai";
|
|
2
2
|
import { LLM, } from "./index";
|
|
3
|
-
import { err, ok } from "
|
|
4
|
-
import { assertNever } from "
|
|
5
|
-
import { removeNulls } from "
|
|
3
|
+
import { err, ok } from "@app/lib/error";
|
|
4
|
+
import { assertNever } from "@app/lib/assert";
|
|
5
|
+
import { removeNulls } from "@app/lib/utils";
|
|
6
6
|
export function isGeminiModel(model) {
|
|
7
7
|
return [
|
|
8
8
|
"gemini-3-pro-preview",
|
package/dist/models/mistral.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LLM, } from "./index";
|
|
2
|
-
import { err, ok } from "
|
|
3
|
-
import { assertNever } from "
|
|
2
|
+
import { err, ok } from "@app/lib/error";
|
|
3
|
+
import { assertNever } from "@app/lib/assert";
|
|
4
4
|
import { Mistral } from "@mistralai/mistralai";
|
|
5
|
-
import { isString, removeNulls } from "
|
|
5
|
+
import { isString, removeNulls } from "@app/lib/utils";
|
|
6
6
|
function normalizeTokenPrices(costPerMillionInputTokens, costPerMillionOutputTokens) {
|
|
7
7
|
return {
|
|
8
8
|
input: costPerMillionInputTokens / 1_000_000,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LLM } from "./index";
|
|
2
2
|
import OpenAI from "openai";
|
|
3
|
-
import { err, ok } from "
|
|
4
|
-
import { assertNever } from "
|
|
5
|
-
import { removeNulls } from "
|
|
3
|
+
import { err, ok } from "@app/lib/error";
|
|
4
|
+
import { assertNever } from "@app/lib/assert";
|
|
5
|
+
import { removeNulls } from "@app/lib/utils";
|
|
6
6
|
import { convertThinking } from "./openai";
|
|
7
7
|
export function isMoonshotAIModel(model) {
|
|
8
8
|
return ["kimi-k2-thinking"].includes(model);
|
package/dist/models/openai.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LLM } from "./index";
|
|
2
2
|
import OpenAI from "openai";
|
|
3
|
-
import { err, ok } from "
|
|
4
|
-
import { assertNever } from "
|
|
3
|
+
import { err, ok } from "@app/lib/error";
|
|
4
|
+
import { assertNever } from "@app/lib/assert";
|
|
5
5
|
function normalizeTokenPrices(costPerMillionInputTokens, costPerMillionOutputTokens, costPerMillionCachedTokens) {
|
|
6
6
|
return {
|
|
7
7
|
input: costPerMillionInputTokens / 1_000_000,
|
package/dist/models/provider.js
CHANGED
package/dist/models/redpill.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LLM, } from "./index";
|
|
2
2
|
import OpenAI from "openai";
|
|
3
|
-
import { err, ok } from "
|
|
4
|
-
import { assertNever } from "
|
|
5
|
-
import { removeNulls } from "
|
|
3
|
+
import { err, ok } from "@app/lib/error";
|
|
4
|
+
import { assertNever } from "@app/lib/assert";
|
|
5
|
+
import { removeNulls } from "@app/lib/utils";
|
|
6
6
|
export function isRedPillModel(model) {
|
|
7
7
|
return [
|
|
8
8
|
"kimi-k2.5",
|
package/dist/resources/run.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { runs } from "
|
|
2
|
-
import { Result } from "
|
|
1
|
+
import { runs } from "@app/db/schema";
|
|
2
|
+
import { Result } from "@app/lib/error";
|
|
3
3
|
import { InferInsertModel } from "drizzle-orm";
|
|
4
4
|
export declare class RunResource {
|
|
5
5
|
private data;
|
|
@@ -11,13 +11,13 @@ export declare class RunResource {
|
|
|
11
11
|
update(data: Partial<Omit<InferInsertModel<typeof runs>, "id" | "created">>): Promise<RunResource>;
|
|
12
12
|
delete(): Promise<void>;
|
|
13
13
|
toJSON(): {
|
|
14
|
-
name: string;
|
|
15
14
|
id: number;
|
|
15
|
+
name: string;
|
|
16
|
+
model: import("..").Model;
|
|
16
17
|
created: Date;
|
|
17
18
|
updated: Date;
|
|
18
19
|
problem_id: string;
|
|
19
20
|
profile: string;
|
|
20
|
-
model: import("..").Model;
|
|
21
21
|
agent_count: number;
|
|
22
22
|
};
|
|
23
23
|
getAgentIndices(): number[];
|
package/dist/resources/run.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { db } from "
|
|
2
|
-
import { runs } from "
|
|
3
|
-
import { err, ok } from "
|
|
1
|
+
import { db } from "@app/db";
|
|
2
|
+
import { runs } from "@app/db/schema";
|
|
3
|
+
import { err, ok } from "@app/lib/error";
|
|
4
4
|
import { eq } from "drizzle-orm";
|
|
5
5
|
export class RunResource {
|
|
6
6
|
data;
|
|
@@ -64,7 +64,7 @@ export async function cleanRun(runName) {
|
|
|
64
64
|
const run = runRes.data;
|
|
65
65
|
const runId = run.toJSON().id;
|
|
66
66
|
// Delete messages first
|
|
67
|
-
const { messages } = await import("
|
|
67
|
+
const { messages } = await import("@app/db/schema");
|
|
68
68
|
db.delete(messages).where(eq(messages.run, runId)).run();
|
|
69
69
|
// Delete run
|
|
70
70
|
await run.delete();
|
package/dist/runner/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { withRetries, err, ok } from "
|
|
2
|
-
import { MessageResource } from "
|
|
1
|
+
import { withRetries, err, ok } from "@app/lib/error";
|
|
2
|
+
import { MessageResource } from "@app/resources/messages";
|
|
3
3
|
import assert from "assert";
|
|
4
|
-
import { errorToCallToolResult, createClientFromConfig } from "
|
|
5
|
-
import { loadProfileMCPConfig } from "
|
|
6
|
-
import { concurrentExecutor } from "
|
|
7
|
-
import { assertNever } from "
|
|
8
|
-
import { createLLM } from "
|
|
4
|
+
import { errorToCallToolResult, createClientFromConfig } from "@app/lib/mcp";
|
|
5
|
+
import { loadProfileMCPConfig } from "@app/lib/mcp-config";
|
|
6
|
+
import { concurrentExecutor } from "@app/lib/async";
|
|
7
|
+
import { assertNever } from "@app/lib/assert";
|
|
8
|
+
import { createLLM } from "@app/models/provider";
|
|
9
9
|
import { readFileSync } from "fs";
|
|
10
10
|
import { dirname } from "path";
|
|
11
11
|
import { fileURLToPath } from "url";
|
|
12
|
-
import { getProblemContent } from "
|
|
13
|
-
import { getProfilePath } from "
|
|
12
|
+
import { getProblemContent } from "@app/lib/problems";
|
|
13
|
+
import { getProfilePath } from "@app/lib/profiles";
|
|
14
14
|
const __filename = fileURLToPath(import.meta.url);
|
|
15
15
|
const __dirname = dirname(__filename);
|
|
16
16
|
function loadPromptForProfile(profile) {
|