openclaw-swarm-layer 0.1.0 → 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.
|
@@ -27,7 +27,7 @@ export async function runSwarmPlan(options, context) {
|
|
|
27
27
|
const report = await writeWorkflowReport(options.project, nextWorkflow, reportConfig);
|
|
28
28
|
// Obsidian journal: spec archive
|
|
29
29
|
const paths = resolveSwarmPaths(options.project, reportConfig);
|
|
30
|
-
await journalSpecArchive(paths, stateStore.config.
|
|
30
|
+
await journalSpecArchive(paths, stateStore.config.journal, spec);
|
|
31
31
|
return {
|
|
32
32
|
ok: true,
|
|
33
33
|
specId: spec.specId,
|
|
@@ -16,12 +16,12 @@ export async function runSwarmReview(options, context) {
|
|
|
16
16
|
const report = await writeWorkflowReport(options.project, result.workflow, reportConfig);
|
|
17
17
|
// Obsidian journal: review log
|
|
18
18
|
const paths = resolveSwarmPaths(options.project, reportConfig);
|
|
19
|
-
await journalReviewEntry(paths, stateStore.config.
|
|
19
|
+
await journalReviewEntry(paths, stateStore.config.journal, options.task, decision, options.note);
|
|
20
20
|
// Obsidian journal: completion summary (when all tasks done)
|
|
21
21
|
const allDone = result.workflow.tasks.every((t) => t.status === "done" || t.status === "dead_letter");
|
|
22
22
|
if (allDone && result.workflow.tasks.length > 0) {
|
|
23
23
|
const runs = await stateStore.loadRuns(options.project);
|
|
24
|
-
await journalCompletionSummary(paths, stateStore.config.
|
|
24
|
+
await journalCompletionSummary(paths, stateStore.config.journal, result.workflow, runs);
|
|
25
25
|
}
|
|
26
26
|
return {
|
|
27
27
|
ok: true,
|
|
@@ -26,7 +26,7 @@ export async function runSwarmRun(options, context) {
|
|
|
26
26
|
const runRecord = runs.find((r) => r.runId === result.runIds?.[0]);
|
|
27
27
|
if (runRecord) {
|
|
28
28
|
const paths = resolveSwarmPaths(options.project, reportConfig);
|
|
29
|
-
await journalRunEntry(paths, stateStore.config.
|
|
29
|
+
await journalRunEntry(paths, stateStore.config.journal, runRecord);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
return {
|
package/dist/src/config.d.ts
CHANGED
|
@@ -18,17 +18,19 @@ export type SwarmAcpConfig = {
|
|
|
18
18
|
defaultTimeoutSeconds?: number;
|
|
19
19
|
experimentalControlPlaneAdapter: boolean;
|
|
20
20
|
};
|
|
21
|
-
export type
|
|
21
|
+
export type JournalConfig = {
|
|
22
22
|
enableRunLog: boolean;
|
|
23
23
|
enableReviewLog: boolean;
|
|
24
24
|
enableSpecArchive: boolean;
|
|
25
25
|
enableCompletionSummary: boolean;
|
|
26
26
|
};
|
|
27
|
+
/** @deprecated Use JournalConfig */
|
|
28
|
+
export type ObsidianJournalConfig = JournalConfig;
|
|
27
29
|
export type SwarmPluginConfig = {
|
|
28
30
|
stateRoot?: string;
|
|
29
31
|
defaultProjectRoot?: string;
|
|
30
32
|
obsidianRoot?: string;
|
|
31
|
-
|
|
33
|
+
journal: JournalConfig;
|
|
32
34
|
enableCli: boolean;
|
|
33
35
|
enableTools: boolean;
|
|
34
36
|
enableService: boolean;
|
package/dist/src/config.js
CHANGED
|
@@ -7,11 +7,11 @@ export const defaultSwarmPluginConfig = {
|
|
|
7
7
|
defaultRunner: "manual",
|
|
8
8
|
maxParallelTasks: 1,
|
|
9
9
|
reviewRequiredByDefault: true,
|
|
10
|
-
|
|
11
|
-
enableRunLog:
|
|
12
|
-
enableReviewLog:
|
|
13
|
-
enableSpecArchive:
|
|
14
|
-
enableCompletionSummary:
|
|
10
|
+
journal: {
|
|
11
|
+
enableRunLog: true,
|
|
12
|
+
enableReviewLog: true,
|
|
13
|
+
enableSpecArchive: true,
|
|
14
|
+
enableCompletionSummary: true,
|
|
15
15
|
},
|
|
16
16
|
acp: {
|
|
17
17
|
enabled: false,
|
|
@@ -40,7 +40,7 @@ const allowedConfigKeys = new Set([
|
|
|
40
40
|
"defaultRunner",
|
|
41
41
|
"maxParallelTasks",
|
|
42
42
|
"reviewRequiredByDefault",
|
|
43
|
-
"
|
|
43
|
+
"journal",
|
|
44
44
|
"acp",
|
|
45
45
|
"bridge",
|
|
46
46
|
]);
|
|
@@ -230,19 +230,19 @@ export function resolveSwarmPluginConfig(rawConfig) {
|
|
|
230
230
|
reviewRequiredByDefault: typeof input.reviewRequiredByDefault === "boolean"
|
|
231
231
|
? input.reviewRequiredByDefault
|
|
232
232
|
: defaultSwarmPluginConfig.reviewRequiredByDefault,
|
|
233
|
-
|
|
234
|
-
enableRunLog: Boolean(input.
|
|
235
|
-
? input.
|
|
236
|
-
: defaultSwarmPluginConfig.
|
|
237
|
-
enableReviewLog: Boolean(input.
|
|
238
|
-
? input.
|
|
239
|
-
: defaultSwarmPluginConfig.
|
|
240
|
-
enableSpecArchive: Boolean(input.
|
|
241
|
-
? input.
|
|
242
|
-
: defaultSwarmPluginConfig.
|
|
243
|
-
enableCompletionSummary: Boolean(input.
|
|
244
|
-
? input.
|
|
245
|
-
: defaultSwarmPluginConfig.
|
|
233
|
+
journal: {
|
|
234
|
+
enableRunLog: Boolean(input.journal) && typeof input.journal.enableRunLog === "boolean"
|
|
235
|
+
? input.journal.enableRunLog
|
|
236
|
+
: defaultSwarmPluginConfig.journal.enableRunLog,
|
|
237
|
+
enableReviewLog: Boolean(input.journal) && typeof input.journal.enableReviewLog === "boolean"
|
|
238
|
+
? input.journal.enableReviewLog
|
|
239
|
+
: defaultSwarmPluginConfig.journal.enableReviewLog,
|
|
240
|
+
enableSpecArchive: Boolean(input.journal) && typeof input.journal.enableSpecArchive === "boolean"
|
|
241
|
+
? input.journal.enableSpecArchive
|
|
242
|
+
: defaultSwarmPluginConfig.journal.enableSpecArchive,
|
|
243
|
+
enableCompletionSummary: Boolean(input.journal) && typeof input.journal.enableCompletionSummary === "boolean"
|
|
244
|
+
? input.journal.enableCompletionSummary
|
|
245
|
+
: defaultSwarmPluginConfig.journal.enableCompletionSummary,
|
|
246
246
|
},
|
|
247
247
|
acp: {
|
|
248
248
|
enabled: Boolean(input.acp) && typeof input.acp.enabled === "boolean"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { JournalConfig } from "../config.js";
|
|
2
2
|
import type { SwarmPaths } from "../lib/paths.js";
|
|
3
3
|
import type { RunRecord, SpecDoc, WorkflowState } from "../types.js";
|
|
4
|
-
export declare function journalRunEntry(paths: SwarmPaths, journal:
|
|
5
|
-
export declare function journalReviewEntry(paths: SwarmPaths, journal:
|
|
6
|
-
export declare function journalSpecArchive(paths: SwarmPaths, journal:
|
|
7
|
-
export declare function journalCompletionSummary(paths: SwarmPaths, journal:
|
|
4
|
+
export declare function journalRunEntry(paths: SwarmPaths, journal: JournalConfig, runRecord: RunRecord): Promise<void>;
|
|
5
|
+
export declare function journalReviewEntry(paths: SwarmPaths, journal: JournalConfig, taskId: string, decision: "approve" | "reject", note?: string): Promise<void>;
|
|
6
|
+
export declare function journalSpecArchive(paths: SwarmPaths, journal: JournalConfig, spec: SpecDoc): Promise<void>;
|
|
7
|
+
export declare function journalCompletionSummary(paths: SwarmPaths, journal: JournalConfig, workflow: WorkflowState, runs: RunRecord[]): Promise<void>;
|