@axiom-lattice/core 3.0.7 → 3.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/dist/index.d.mts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +83 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +82 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2646,6 +2646,7 @@ var InMemoryTaskStore = class {
|
|
|
2646
2646
|
projectId: params.projectId,
|
|
2647
2647
|
dueDate: params.dueDate,
|
|
2648
2648
|
metadata: params.metadata,
|
|
2649
|
+
files: params.files,
|
|
2649
2650
|
parentId: params.parentId,
|
|
2650
2651
|
sourceId: params.sourceId,
|
|
2651
2652
|
context: params.context,
|
|
@@ -2703,6 +2704,7 @@ var InMemoryTaskStore = class {
|
|
|
2703
2704
|
const updated = {
|
|
2704
2705
|
...existing,
|
|
2705
2706
|
...updates,
|
|
2707
|
+
files: updates.files !== void 0 ? updates.files : existing.files,
|
|
2706
2708
|
updatedAt: /* @__PURE__ */ new Date()
|
|
2707
2709
|
};
|
|
2708
2710
|
tenantTasks.set(id, updated);
|
|
@@ -14207,6 +14209,11 @@ var manageTaskSchema = z41.object({
|
|
|
14207
14209
|
dependencies: z41.array(z41.string()).optional().describe("List of task IDs that must be completed before this task can start"),
|
|
14208
14210
|
result: z41.string().optional().describe("Result summary when task is completed"),
|
|
14209
14211
|
failureReason: z41.string().optional().describe("Reason for failure (use when status='failed')"),
|
|
14212
|
+
files: z41.array(z41.object({
|
|
14213
|
+
uri: z41.string().describe("Uniquely locates the resource: http(s):// URL, /s/:token share, or sandbox path"),
|
|
14214
|
+
name: z41.string().optional().describe("Display name"),
|
|
14215
|
+
addedBy: z41.enum(["user", "agent"]).optional().describe("Who attached the file")
|
|
14216
|
+
})).optional().describe("File references attached to this task"),
|
|
14210
14217
|
summary: z41.string().optional().describe("Brief summary of the operation")
|
|
14211
14218
|
});
|
|
14212
14219
|
function buildReviewMarkdown(task) {
|
|
@@ -14265,7 +14272,8 @@ function createTaskMiddleware() {
|
|
|
14265
14272
|
requireReview: input.requireReview,
|
|
14266
14273
|
dependencies: input.dependencies,
|
|
14267
14274
|
workspaceId,
|
|
14268
|
-
projectId
|
|
14275
|
+
projectId,
|
|
14276
|
+
files: input.files
|
|
14269
14277
|
});
|
|
14270
14278
|
return JSON.stringify({ success: true, data: task });
|
|
14271
14279
|
}
|
|
@@ -14344,7 +14352,8 @@ function createTaskMiddleware() {
|
|
|
14344
14352
|
"result",
|
|
14345
14353
|
"failureReason",
|
|
14346
14354
|
"requireReview",
|
|
14347
|
-
"dependencies"
|
|
14355
|
+
"dependencies",
|
|
14356
|
+
"files"
|
|
14348
14357
|
];
|
|
14349
14358
|
for (const field of settableFields) {
|
|
14350
14359
|
if (input[field] !== void 0) {
|
|
@@ -18182,11 +18191,11 @@ ${BASE_PROMPT}` : BASE_PROMPT;
|
|
|
18182
18191
|
defaultInterruptOn: interruptOn,
|
|
18183
18192
|
subagents,
|
|
18184
18193
|
generalPurposeAgent: true
|
|
18185
|
-
}),
|
|
18186
|
-
// Enables Anthropic prompt caching for improved performance and reduced costs
|
|
18187
|
-
anthropicPromptCachingMiddleware({
|
|
18188
|
-
unsupportedModelBehavior: "ignore"
|
|
18189
18194
|
})
|
|
18195
|
+
// Enables Anthropic prompt caching for improved performance and reduced costs
|
|
18196
|
+
// anthropicPromptCachingMiddleware({
|
|
18197
|
+
// unsupportedModelBehavior: "ignore",
|
|
18198
|
+
// })
|
|
18190
18199
|
];
|
|
18191
18200
|
if (interruptOn) {
|
|
18192
18201
|
middleware.push(humanInTheLoopMiddleware2({ interruptOn }));
|
|
@@ -21789,7 +21798,7 @@ registerToolLattice(
|
|
|
21789
21798
|
"update_agent",
|
|
21790
21799
|
{
|
|
21791
21800
|
name: "update_agent",
|
|
21792
|
-
description: "Update an existing agent's configuration. Provide the agent ID and the fields to change. Returns the updated agent's ID and name. NOTE: For user approval/confirmation scenarios, add middleware with type: 'ask_user_to_clarify'.",
|
|
21801
|
+
description: "Update an existing agent's configuration. Provide the agent ID and the fields to change. Returns the updated agent's ID and name. NOTE: For user approval/confirmation scenarios, add middleware with type: 'ask_user_to_clarify'. IMPORTANT: do NOT set 'modelKey' unless the user explicitly specified a model \u2014 leaving it unset makes the runtime use the 'default' model.",
|
|
21793
21802
|
schema: updateAgentSchema
|
|
21794
21803
|
},
|
|
21795
21804
|
async (input, exeConfig) => {
|
|
@@ -21864,6 +21873,27 @@ registerToolLattice(
|
|
|
21864
21873
|
}
|
|
21865
21874
|
}
|
|
21866
21875
|
);
|
|
21876
|
+
registerToolLattice(
|
|
21877
|
+
"list_models",
|
|
21878
|
+
{
|
|
21879
|
+
name: "list_models",
|
|
21880
|
+
description: "List all registered models. Returns each model's key (use this string as modelKey when creating eval projects via manage_eval create_project, or as an agent's modelKey in create_agent/update_agent) and its display name.",
|
|
21881
|
+
schema: z49.object({})
|
|
21882
|
+
},
|
|
21883
|
+
async (_input) => {
|
|
21884
|
+
try {
|
|
21885
|
+
const lattices = modelLatticeManager.getAllLattices();
|
|
21886
|
+
return JSON.stringify({
|
|
21887
|
+
models: lattices.map((l) => ({
|
|
21888
|
+
key: l.key,
|
|
21889
|
+
name: l.client.name ?? l.key
|
|
21890
|
+
}))
|
|
21891
|
+
});
|
|
21892
|
+
} catch (error) {
|
|
21893
|
+
return JSON.stringify({ error: `Failed to list models: ${error.message}` });
|
|
21894
|
+
}
|
|
21895
|
+
}
|
|
21896
|
+
);
|
|
21867
21897
|
registerToolLattice(
|
|
21868
21898
|
"invoke_agent",
|
|
21869
21899
|
{
|
|
@@ -21995,6 +22025,24 @@ The skills document WHY and HOW; these gates are the unskippable
|
|
|
21995
22025
|
minimum. If you cannot satisfy a gate (e.g. user says skip), record it
|
|
21996
22026
|
and proceed only on the user's explicit instruction.
|
|
21997
22027
|
|
|
22028
|
+
LEARNING ROUND KICKOFF \u2014 a message that names an existing target agent
|
|
22029
|
+
id AND an existing tracking task id (a "learning round"). This protocol
|
|
22030
|
+
OVERRIDES the defaults above:
|
|
22031
|
+
- The target agent ALREADY EXISTS (an empty placeholder). Build and
|
|
22032
|
+
refine it via update_agent on that exact id. NEVER call create_agent \u2014
|
|
22033
|
+
a new agent would disconnect the round's tracking.
|
|
22034
|
+
- The parent task ALREADY EXISTS \u2014 your create-a-task-first duty is
|
|
22035
|
+
satisfied by it. Create subtasks with manage_task under its id
|
|
22036
|
+
(parentId); NEVER create a new parent task for the round.
|
|
22037
|
+
- The round is pre-approved \u2014 skip the DESIGN\u2192CONFIRM gates: show the
|
|
22038
|
+
design in your reply, then build directly.
|
|
22039
|
+
- Do NOT set modelKey in update_agent unless the user explicitly named a
|
|
22040
|
+
model \u2014 leaving it unset makes the runtime use the 'default' model.
|
|
22041
|
+
- Every update_agent call must be mirrored by a manage_task work item
|
|
22042
|
+
whose summary names the changed keys (e.g. "update_agent: prompt,
|
|
22043
|
+
modelKey") \u2014 the round feed highlights these so the user can see what
|
|
22044
|
+
changed between iterations.
|
|
22045
|
+
|
|
21998
22046
|
Your sub-skills (accessible via the MOC or direct loading):
|
|
21999
22047
|
- [[learn-capability]] \u2014 Learn from any source material \u2192 skills + agents
|
|
22000
22048
|
- [[agent-build]] \u2014 Design and build single agents (REACT/DEEP_AGENT)
|
|
@@ -22109,6 +22157,7 @@ var agentArchitectConfig = {
|
|
|
22109
22157
|
tools: [
|
|
22110
22158
|
"list_agents",
|
|
22111
22159
|
"list_tools",
|
|
22160
|
+
"list_models",
|
|
22112
22161
|
"list_middleware_types",
|
|
22113
22162
|
"list_connections",
|
|
22114
22163
|
"get_agent",
|
|
@@ -26578,14 +26627,22 @@ var DEFAULT_CALIBRATION_PROBES = [
|
|
|
26578
26627
|
expectedPass: false
|
|
26579
26628
|
}
|
|
26580
26629
|
];
|
|
26630
|
+
function resolveJudgeModelKey(explicitKey, manager) {
|
|
26631
|
+
if (explicitKey) return explicitKey;
|
|
26632
|
+
const models = manager.getAllLattices();
|
|
26633
|
+
const defaultModel = models.find((m) => m.key === "default");
|
|
26634
|
+
if (defaultModel) return defaultModel.key;
|
|
26635
|
+
const first = models[0];
|
|
26636
|
+
if (!first) {
|
|
26637
|
+
throw new Error("No model registered \u2014 register a model or provide a judgeModelKey");
|
|
26638
|
+
}
|
|
26639
|
+
return first.key;
|
|
26640
|
+
}
|
|
26581
26641
|
var LatticeEvalProject = class {
|
|
26582
26642
|
constructor(project, onCaseComplete) {
|
|
26583
26643
|
this.suites = /* @__PURE__ */ new Map();
|
|
26584
26644
|
this.project = project;
|
|
26585
|
-
const judgeModelKey = this.project.judge_agent_config.modelKey;
|
|
26586
|
-
if (!judgeModelKey) {
|
|
26587
|
-
throw new Error("judge_agent_config.modelKey is required \u2014 only pre-registered models are allowed");
|
|
26588
|
-
}
|
|
26645
|
+
const judgeModelKey = resolveJudgeModelKey(this.project.judge_agent_config.modelKey, modelLatticeManager);
|
|
26589
26646
|
if (!modelLatticeManager.hasLattice(judgeModelKey)) {
|
|
26590
26647
|
throw new Error(
|
|
26591
26648
|
`Judge model "${judgeModelKey}" not found. Register it first or provide a valid modelKey.`
|
|
@@ -28987,6 +29044,7 @@ function createManageEvalTool() {
|
|
|
28987
29044
|
description: z66.string().optional(),
|
|
28988
29045
|
judgeModelKey: z66.string().optional(),
|
|
28989
29046
|
concurrency: z66.number().optional(),
|
|
29047
|
+
targetAgentId: z66.string().optional().describe("Optional for create_project \u2014 the agent this eval project verifies. Recorded in targetServerConfig so the agent's detail page can find its eval data without relying on project naming."),
|
|
28990
29048
|
suiteId: z66.string().optional(),
|
|
28991
29049
|
caseId: z66.string().optional(),
|
|
28992
29050
|
inputMessage: z66.string().optional(),
|
|
@@ -29015,10 +29073,16 @@ function createManageEvalTool() {
|
|
|
29015
29073
|
data = await store.createProject(tid, uuidv48(), {
|
|
29016
29074
|
name: input.name,
|
|
29017
29075
|
description: input.description,
|
|
29018
|
-
|
|
29076
|
+
// No judge key given → default to the 'default' model key (the same
|
|
29077
|
+
// convention the UI model selector uses); never an empty modelKey.
|
|
29078
|
+
judgeModelConfig: { modelKey: input.judgeModelKey ?? "default" },
|
|
29019
29079
|
targetServerConfig: {
|
|
29020
29080
|
workspace_id: ctx.workspaceId,
|
|
29021
|
-
project_id: ctx.projectId
|
|
29081
|
+
project_id: ctx.projectId,
|
|
29082
|
+
// The project↔agent association lives here (not in the project
|
|
29083
|
+
// name): an eval project is agent-agnostic by design, this
|
|
29084
|
+
// pointer is merely the agent's designated verifier.
|
|
29085
|
+
...input.targetAgentId ? { targetAgentId: input.targetAgentId } : {}
|
|
29022
29086
|
},
|
|
29023
29087
|
concurrency: input.concurrency ?? 3
|
|
29024
29088
|
});
|
|
@@ -29085,8 +29149,8 @@ function createManageEvalTool() {
|
|
|
29085
29149
|
name: "manage_eval",
|
|
29086
29150
|
description: `Create, update, delete evaluation projects, suites, and test cases.
|
|
29087
29151
|
|
|
29088
|
-
Project: create_project(name, description?, judgeModelKey?, concurrency?) | update_project | delete_project
|
|
29089
|
-
judgeModelKey defaults to
|
|
29152
|
+
Project: create_project(name, description?, judgeModelKey?, concurrency?, targetAgentId?) | update_project | delete_project
|
|
29153
|
+
judgeModelKey defaults to the "default" model. concurrency defaults to 3.
|
|
29090
29154
|
delete_project rejected if active runs exist.
|
|
29091
29155
|
**When creating a project from within a workspace, the workspace/project context is
|
|
29092
29156
|
automatically bound \u2014 eval runs will execute in the same workspace.**
|
|
@@ -29109,6 +29173,7 @@ function createRunEvalTool() {
|
|
|
29109
29173
|
suiteIds: z66.array(z66.string()).optional().describe("Optional for start \u2014 only run these suites (e.g. dev set only). Omit to run all."),
|
|
29110
29174
|
caseIds: z66.array(z66.string()).optional().describe("Optional for start \u2014 only run these cases across the selected suites. Omit to run all cases in those suites."),
|
|
29111
29175
|
runId: z66.string().optional().describe("Required for status, resume, abort"),
|
|
29176
|
+
taskId: z66.string().optional().describe("Optional for start \u2014 training task ID this run belongs to (round association)"),
|
|
29112
29177
|
sleepMs: z66.number().int().min(0).max(12e4).optional().describe("Optional for status \u2014 sleep this many ms BEFORE checking the run, to pace polling (e.g. 15000 \u2192 30000 \u2192 60000 \u2192 120000). Omit to check immediately."),
|
|
29113
29178
|
wait: z66.boolean().optional().describe("Optional for start \u2014 defaults to true: block synchronously (up to ~150s) and return final results in one call. Set false to return the runId immediately and poll.")
|
|
29114
29179
|
});
|
|
@@ -29126,7 +29191,7 @@ function createRunEvalTool() {
|
|
|
29126
29191
|
switch (input.action) {
|
|
29127
29192
|
case "start": {
|
|
29128
29193
|
const ctx = workspaceContext(exeConfig);
|
|
29129
|
-
const runId = await svc.startRun(tid, input.projectId, input.suiteIds, input.caseIds, ctx);
|
|
29194
|
+
const runId = await svc.startRun(tid, input.projectId, input.suiteIds, input.caseIds, ctx, input.taskId);
|
|
29130
29195
|
if (input.wait === false) {
|
|
29131
29196
|
data = sanitize({ runId, message: "Run started. Poll with run_eval status (backoff: 15s\u219230s\u219260s\u2192max 120s)." });
|
|
29132
29197
|
break;
|
|
@@ -31363,6 +31428,7 @@ export {
|
|
|
31363
31428
|
registerWorkflowRun,
|
|
31364
31429
|
removeCollectionVectorStore,
|
|
31365
31430
|
renderTemplate,
|
|
31431
|
+
resolveJudgeModelKey,
|
|
31366
31432
|
resolvePath,
|
|
31367
31433
|
sandboxLatticeManager,
|
|
31368
31434
|
sanitizeToolCallId,
|