@femtomc/mu-orchestrator 26.2.56 → 26.2.57
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/dag_runner.d.ts +7 -1
- package/dist/dag_runner.d.ts.map +1 -1
- package/dist/dag_runner.js +19 -3
- package/package.json +5 -5
package/dist/dag_runner.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { type BackendRunner } from "@femtomc/mu-agent";
|
|
1
2
|
import { type EventLog } from "@femtomc/mu-core/node";
|
|
2
3
|
import type { ForumStore } from "@femtomc/mu-forum";
|
|
3
4
|
import type { IssueStore } from "@femtomc/mu-issue";
|
|
4
5
|
import type { ModelOverrides } from "./model_resolution.js";
|
|
5
|
-
import { type BackendRunner } from "@femtomc/mu-agent";
|
|
6
6
|
export type DagResult = {
|
|
7
7
|
status: "root_final" | "no_executable_leaf" | "max_steps_exhausted" | "error";
|
|
8
8
|
steps: number;
|
|
@@ -38,6 +38,11 @@ export type DagRunnerHooks = {
|
|
|
38
38
|
export type DagRunnerRunOpts = {
|
|
39
39
|
hooks?: DagRunnerHooks;
|
|
40
40
|
};
|
|
41
|
+
type AgentSelfMetadata = {
|
|
42
|
+
model?: string | null;
|
|
43
|
+
thinkingLevel?: string | null;
|
|
44
|
+
};
|
|
45
|
+
export declare function renderAgentSelfMetadata(meta: AgentSelfMetadata): string;
|
|
41
46
|
export declare class DagRunner {
|
|
42
47
|
#private;
|
|
43
48
|
constructor(store: IssueStore, forum: ForumStore, repoRoot: string, opts?: {
|
|
@@ -47,4 +52,5 @@ export declare class DagRunner {
|
|
|
47
52
|
});
|
|
48
53
|
run(rootId: string, maxSteps?: number, opts?: DagRunnerRunOpts): Promise<DagResult>;
|
|
49
54
|
}
|
|
55
|
+
export {};
|
|
50
56
|
//# sourceMappingURL=dag_runner.d.ts.map
|
package/dist/dag_runner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dag_runner.d.ts","sourceRoot":"","sources":["../src/dag_runner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dag_runner.d.ts","sourceRoot":"","sources":["../src/dag_runner.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAgE,MAAM,mBAAmB,CAAC;AAErH,OAAO,EAEN,KAAK,QAAQ,EAKb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,uBAAuB,CAAC;AAGjF,MAAM,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE,YAAY,GAAG,oBAAoB,GAAG,qBAAqB,GAAG,OAAO,CAAC;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,uBAAuB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,qBAAqB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,yBAAyB,KAAK,IAAI,CAAC;CACxD,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,KAAK,CAAC,EAAE,cAAc,CAAC;CACvB,CAAC;AAIF,KAAK,iBAAiB,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC;AAwBF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAIvE;AAED,qBAAa,SAAS;;gBAYpB,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE;QAAE,OAAO,CAAC,EAAE,aAAa,CAAC;QAAC,MAAM,CAAC,EAAE,QAAQ,CAAC;QAAC,cAAc,CAAC,EAAE,cAAc,CAAA;KAAO;IAuLrF,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAW,EAAE,IAAI,GAAE,gBAAqB,GAAG,OAAO,CAAC,SAAS,CAAC;CAiNjG"}
|
package/dist/dag_runner.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { mkdir } from "node:fs/promises";
|
|
2
2
|
import { join, relative } from "node:path";
|
|
3
|
+
import { PiSdkBackend, roleFromTags, systemPromptForRole } from "@femtomc/mu-agent";
|
|
3
4
|
import { currentRunId, fsEventLogFromRepoRoot, getStorePaths, newRunId, runContext, } from "@femtomc/mu-core/node";
|
|
4
5
|
import { resolveModelConfig } from "./model_resolution.js";
|
|
5
|
-
import { PiSdkBackend, roleFromTags, systemPromptForRole } from "@femtomc/mu-agent";
|
|
6
6
|
function roundTo(n, digits) {
|
|
7
7
|
const f = 10 ** digits;
|
|
8
8
|
return Math.round(n * f) / f;
|
|
@@ -16,6 +16,18 @@ function relPath(repoRoot, path) {
|
|
|
16
16
|
return path;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
+
function normalizeSelfMetadataValue(value) {
|
|
20
|
+
if (typeof value !== "string") {
|
|
21
|
+
return "unknown";
|
|
22
|
+
}
|
|
23
|
+
const trimmed = value.trim();
|
|
24
|
+
return trimmed.length > 0 ? trimmed : "unknown";
|
|
25
|
+
}
|
|
26
|
+
export function renderAgentSelfMetadata(meta) {
|
|
27
|
+
const model = normalizeSelfMetadataValue(meta.model);
|
|
28
|
+
const thinkingLevel = normalizeSelfMetadataValue(meta.thinkingLevel);
|
|
29
|
+
return `Model: ${model}\nThinking level: ${thinkingLevel}\n`;
|
|
30
|
+
}
|
|
19
31
|
export class DagRunner {
|
|
20
32
|
#store;
|
|
21
33
|
#forum;
|
|
@@ -36,7 +48,7 @@ export class DagRunner {
|
|
|
36
48
|
async #resolveConfig() {
|
|
37
49
|
return resolveModelConfig(this.#modelOverrides);
|
|
38
50
|
}
|
|
39
|
-
async #renderUserPrompt(issue, rootId, step, attempt = 1) {
|
|
51
|
+
async #renderUserPrompt(issue, rootId, step, attempt = 1, selfMetadata = {}) {
|
|
40
52
|
let rendered = issue.title ?? "";
|
|
41
53
|
if (issue.body) {
|
|
42
54
|
rendered += `\n\n${issue.body}`;
|
|
@@ -46,6 +58,7 @@ export class DagRunner {
|
|
|
46
58
|
if (runId) {
|
|
47
59
|
rendered += `Run: ${runId}\n`;
|
|
48
60
|
}
|
|
61
|
+
rendered += renderAgentSelfMetadata(selfMetadata);
|
|
49
62
|
if (attempt > 1) {
|
|
50
63
|
rendered += `\nAttempt: ${attempt} (previous attempt failed — check \`mu forum read issue:${issue.id}\` for context)\n`;
|
|
51
64
|
}
|
|
@@ -54,7 +67,10 @@ export class DagRunner {
|
|
|
54
67
|
async #executeBackend(issue, cfg, rootId, step, opts = {}) {
|
|
55
68
|
const role = roleFromTags(issue.tags);
|
|
56
69
|
const logSuffix = opts.logSuffix ?? "";
|
|
57
|
-
const rendered = await this.#renderUserPrompt(issue, rootId, step, opts.attempt ?? 1
|
|
70
|
+
const rendered = await this.#renderUserPrompt(issue, rootId, step, opts.attempt ?? 1, {
|
|
71
|
+
model: cfg.model,
|
|
72
|
+
thinkingLevel: cfg.reasoning,
|
|
73
|
+
});
|
|
58
74
|
const systemPrompt = await systemPromptForRole(role, this.#repoRoot);
|
|
59
75
|
const { logsDir } = getStorePaths(this.#repoRoot);
|
|
60
76
|
const rootLogsDir = join(logsDir, rootId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@femtomc/mu-orchestrator",
|
|
3
|
-
"version": "26.2.
|
|
3
|
+
"version": "26.2.57",
|
|
4
4
|
"description": "Long-running execution engine for mu work plans.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mu",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"dist/**"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@femtomc/mu-agent": "
|
|
25
|
-
"@femtomc/mu-core": "
|
|
26
|
-
"@femtomc/mu-forum": "
|
|
27
|
-
"@femtomc/mu-issue": "
|
|
24
|
+
"@femtomc/mu-agent": "workspace:*",
|
|
25
|
+
"@femtomc/mu-core": "workspace:*",
|
|
26
|
+
"@femtomc/mu-forum": "workspace:*",
|
|
27
|
+
"@femtomc/mu-issue": "workspace:*",
|
|
28
28
|
"@mariozechner/pi-coding-agent": "^0.52.12",
|
|
29
29
|
"@mariozechner/pi-ai": "^0.52.12"
|
|
30
30
|
}
|