@useorgx/openclaw-plugin 0.4.8 → 0.4.9
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/dashboard/dist/assets/B5NEElEI.css +1 -0
- package/dashboard/dist/assets/BhapSNAs.js +215 -0
- package/dashboard/dist/assets/{BNeJ0kpF.js → iFdvE7lx.js} +1 -1
- package/dashboard/dist/assets/{CUV9IHHi.js → jRJsmpYM.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dist/activity-store.js +4 -18
- package/dist/agent-context-store.js +5 -25
- package/dist/agent-run-store.js +5 -25
- package/dist/agent-suite.js +1 -8
- package/dist/auth/flows.d.ts +47 -0
- package/dist/auth/flows.js +169 -0
- package/dist/auth-store.js +6 -26
- package/dist/byok-store.js +5 -19
- package/dist/cli/orgx.d.ts +66 -0
- package/dist/cli/orgx.js +91 -0
- package/dist/config/refresh.d.ts +32 -0
- package/dist/config/refresh.js +55 -0
- package/dist/config/resolution.d.ts +37 -0
- package/dist/config/resolution.js +178 -0
- package/dist/contracts/shared-types.d.ts +147 -0
- package/dist/contracts/shared-types.js +3 -0
- package/dist/contracts/types.d.ts +1 -134
- package/dist/contracts/types.js +5 -0
- package/dist/entities/auto-assignment.d.ts +36 -0
- package/dist/entities/auto-assignment.js +115 -0
- package/dist/entity-comment-store.js +5 -25
- package/dist/hash-utils.d.ts +2 -0
- package/dist/hash-utils.js +12 -0
- package/dist/http/helpers/activity-headline.d.ts +10 -0
- package/dist/http/helpers/activity-headline.js +192 -0
- package/dist/http/helpers/artifact-fallback.d.ts +13 -0
- package/dist/http/helpers/artifact-fallback.js +148 -0
- package/dist/http/helpers/auto-continue-engine.d.ts +298 -0
- package/dist/http/helpers/auto-continue-engine.js +1218 -0
- package/dist/http/helpers/autopilot-operations.d.ts +157 -0
- package/dist/http/helpers/autopilot-operations.js +403 -0
- package/dist/http/helpers/autopilot-runtime.d.ts +42 -0
- package/dist/http/helpers/autopilot-runtime.js +319 -0
- package/dist/http/helpers/autopilot-slice-utils.d.ts +38 -0
- package/dist/http/helpers/autopilot-slice-utils.js +476 -0
- package/dist/http/helpers/decision-mapper.d.ts +12 -0
- package/dist/http/helpers/decision-mapper.js +44 -0
- package/dist/http/helpers/dispatch-lifecycle.d.ts +102 -0
- package/dist/http/helpers/dispatch-lifecycle.js +604 -0
- package/dist/http/helpers/hash-utils.d.ts +1 -0
- package/dist/http/helpers/hash-utils.js +1 -0
- package/dist/http/helpers/kickoff-context.d.ts +12 -0
- package/dist/http/helpers/kickoff-context.js +154 -0
- package/dist/http/helpers/mission-control.d.ts +94 -0
- package/dist/http/helpers/mission-control.js +894 -0
- package/dist/http/helpers/openclaw-cli.d.ts +37 -0
- package/dist/http/helpers/openclaw-cli.js +283 -0
- package/dist/http/helpers/runtime-sse.d.ts +20 -0
- package/dist/http/helpers/runtime-sse.js +110 -0
- package/dist/http/helpers/value-utils.d.ts +6 -0
- package/dist/http/helpers/value-utils.js +67 -0
- package/dist/http/index.d.ts +88 -0
- package/dist/http/index.js +2353 -0
- package/dist/http/router.d.ts +23 -0
- package/dist/http/router.js +23 -0
- package/dist/http/routes/agent-control.d.ts +79 -0
- package/dist/http/routes/agent-control.js +684 -0
- package/dist/http/routes/agent-suite.d.ts +29 -0
- package/dist/http/routes/agent-suite.js +198 -0
- package/dist/http/routes/agents-catalog.d.ts +40 -0
- package/dist/http/routes/agents-catalog.js +83 -0
- package/dist/http/routes/billing.d.ts +23 -0
- package/dist/http/routes/billing.js +55 -0
- package/dist/http/routes/debug.d.ts +14 -0
- package/dist/http/routes/debug.js +21 -0
- package/dist/http/routes/decision-actions.d.ts +13 -0
- package/dist/http/routes/decision-actions.js +66 -0
- package/dist/http/routes/delegation.d.ts +19 -0
- package/dist/http/routes/delegation.js +32 -0
- package/dist/http/routes/entities.d.ts +47 -0
- package/dist/http/routes/entities.js +152 -0
- package/dist/http/routes/entity-dynamic.d.ts +25 -0
- package/dist/http/routes/entity-dynamic.js +191 -0
- package/dist/http/routes/health.d.ts +22 -0
- package/dist/http/routes/health.js +49 -0
- package/dist/http/routes/live-legacy.d.ts +110 -0
- package/dist/http/routes/live-legacy.js +598 -0
- package/dist/http/routes/live-misc.d.ts +69 -0
- package/dist/http/routes/live-misc.js +206 -0
- package/dist/http/routes/live-snapshot.d.ts +90 -0
- package/dist/http/routes/live-snapshot.js +297 -0
- package/dist/http/routes/mission-control-actions.d.ts +83 -0
- package/dist/http/routes/mission-control-actions.js +541 -0
- package/dist/http/routes/mission-control-read.d.ts +28 -0
- package/dist/http/routes/mission-control-read.js +67 -0
- package/dist/http/routes/onboarding.d.ts +34 -0
- package/dist/http/routes/onboarding.js +101 -0
- package/dist/http/routes/run-control.d.ts +24 -0
- package/dist/http/routes/run-control.js +86 -0
- package/dist/http/routes/runtime-hooks.d.ts +69 -0
- package/dist/http/routes/runtime-hooks.js +437 -0
- package/dist/http/routes/settings-byok.d.ts +23 -0
- package/dist/http/routes/settings-byok.js +163 -0
- package/dist/http/routes/summary.d.ts +18 -0
- package/dist/http/routes/summary.js +42 -0
- package/dist/http/routes/work-artifacts.d.ts +9 -0
- package/dist/http/routes/work-artifacts.js +36 -0
- package/dist/http/shared-state.d.ts +16 -0
- package/dist/http/shared-state.js +1 -0
- package/dist/http-handler.d.ts +1 -88
- package/dist/http-handler.js +1 -10605
- package/dist/index.js +108 -2243
- package/dist/json-utils.d.ts +1 -0
- package/dist/json-utils.js +8 -0
- package/dist/next-up-queue-store.js +4 -18
- package/dist/runtime-instance-store.js +5 -31
- package/dist/services/background.d.ts +23 -0
- package/dist/services/background.js +23 -0
- package/dist/services/instrumentation.d.ts +29 -0
- package/dist/services/instrumentation.js +136 -0
- package/dist/snapshot-store.js +5 -25
- package/dist/stores/json-store.d.ts +11 -0
- package/dist/stores/json-store.js +42 -0
- package/dist/sync/outbox-replay.d.ts +55 -0
- package/dist/sync/outbox-replay.js +514 -0
- package/dist/tools/core-tools.d.ts +76 -0
- package/dist/tools/core-tools.js +1005 -0
- package/package.json +1 -1
- package/dashboard/dist/assets/BzkiMPmM.js +0 -215
- package/dashboard/dist/assets/Ie7d9Iq2.css +0 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
function normalizeKickoffContextResponse(value) {
|
|
2
|
+
if (!value || typeof value !== "object")
|
|
3
|
+
return null;
|
|
4
|
+
const record = value;
|
|
5
|
+
if (typeof record.context_hash === "string" && record.context_hash.trim().length > 0) {
|
|
6
|
+
return record;
|
|
7
|
+
}
|
|
8
|
+
if (record.ok === true && record.data && typeof record.data === "object") {
|
|
9
|
+
const data = record.data;
|
|
10
|
+
if (typeof data.context_hash === "string" && data.context_hash.trim().length > 0) {
|
|
11
|
+
return data;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
export async function fetchKickoffContextSafe(client, payload) {
|
|
17
|
+
try {
|
|
18
|
+
const anyClient = client;
|
|
19
|
+
if (typeof anyClient.getKickoffContext === "function") {
|
|
20
|
+
const resp = await anyClient.getKickoffContext(payload);
|
|
21
|
+
return normalizeKickoffContextResponse(resp);
|
|
22
|
+
}
|
|
23
|
+
if (typeof anyClient.rawRequest === "function") {
|
|
24
|
+
const resp = await anyClient.rawRequest("POST", "/api/client/kickoff-context", payload ?? {});
|
|
25
|
+
return normalizeKickoffContextResponse(resp);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
// best effort: fall back to local kickoff message
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
function normalizeKickoffLines(input) {
|
|
34
|
+
if (!Array.isArray(input))
|
|
35
|
+
return [];
|
|
36
|
+
return input
|
|
37
|
+
.map((line) => (typeof line === "string" ? line.trim() : ""))
|
|
38
|
+
.filter((line) => line.length > 0);
|
|
39
|
+
}
|
|
40
|
+
export function renderKickoffMessage(input) {
|
|
41
|
+
const base = input.baseMessage.trim();
|
|
42
|
+
const kickoff = input.kickoff;
|
|
43
|
+
if (!kickoff)
|
|
44
|
+
return { message: base, contextHash: null };
|
|
45
|
+
const title = (kickoff.task?.title ??
|
|
46
|
+
kickoff.workstream?.title ??
|
|
47
|
+
kickoff.initiative?.title ??
|
|
48
|
+
"").trim();
|
|
49
|
+
const overview = (kickoff.overview ?? "").trim();
|
|
50
|
+
const acceptance = normalizeKickoffLines(kickoff.acceptance_criteria ?? null);
|
|
51
|
+
const constraints = normalizeKickoffLines(kickoff.constraints ?? null);
|
|
52
|
+
const risks = normalizeKickoffLines(kickoff.risks ?? null);
|
|
53
|
+
const reporting = normalizeKickoffLines(kickoff.reporting_expectations ?? null);
|
|
54
|
+
const decisions = Array.isArray(kickoff.decisions) ? kickoff.decisions : [];
|
|
55
|
+
const artifacts = Array.isArray(kickoff.artifacts) ? kickoff.artifacts : [];
|
|
56
|
+
const allow = normalizeKickoffLines(kickoff.tool_scope?.allow ?? null);
|
|
57
|
+
const deny = normalizeKickoffLines(kickoff.tool_scope?.deny ?? null);
|
|
58
|
+
const toolNotes = (kickoff.tool_scope?.notes ?? "").trim();
|
|
59
|
+
const contextHash = kickoff.context_hash?.trim() || null;
|
|
60
|
+
const schemaVersion = (kickoff.schema_version ?? "").trim();
|
|
61
|
+
const lines = [];
|
|
62
|
+
lines.push("# Kickoff");
|
|
63
|
+
lines.push("");
|
|
64
|
+
if (title) {
|
|
65
|
+
lines.push(`## Target`);
|
|
66
|
+
lines.push(`- ${title}`);
|
|
67
|
+
lines.push("");
|
|
68
|
+
}
|
|
69
|
+
if (overview) {
|
|
70
|
+
lines.push("## Overview");
|
|
71
|
+
lines.push(overview);
|
|
72
|
+
lines.push("");
|
|
73
|
+
}
|
|
74
|
+
else if (base) {
|
|
75
|
+
lines.push("## Objective");
|
|
76
|
+
lines.push(base);
|
|
77
|
+
lines.push("");
|
|
78
|
+
}
|
|
79
|
+
if (acceptance.length > 0) {
|
|
80
|
+
lines.push("## Acceptance Criteria");
|
|
81
|
+
for (const item of acceptance)
|
|
82
|
+
lines.push(`- ${item}`);
|
|
83
|
+
lines.push("");
|
|
84
|
+
}
|
|
85
|
+
if (constraints.length > 0) {
|
|
86
|
+
lines.push("## Constraints");
|
|
87
|
+
for (const item of constraints)
|
|
88
|
+
lines.push(`- ${item}`);
|
|
89
|
+
lines.push("");
|
|
90
|
+
}
|
|
91
|
+
if (risks.length > 0) {
|
|
92
|
+
lines.push("## Risks");
|
|
93
|
+
for (const item of risks)
|
|
94
|
+
lines.push(`- ${item}`);
|
|
95
|
+
lines.push("");
|
|
96
|
+
}
|
|
97
|
+
if (decisions.length > 0 || artifacts.length > 0) {
|
|
98
|
+
lines.push("## References");
|
|
99
|
+
for (const item of decisions) {
|
|
100
|
+
const decisionTitle = typeof item?.title === "string"
|
|
101
|
+
? String(item.title).trim()
|
|
102
|
+
: "";
|
|
103
|
+
const id = typeof item?.id === "string" ? String(item.id).trim() : "";
|
|
104
|
+
const label = decisionTitle || id || "decision";
|
|
105
|
+
lines.push(`- Decision: ${label}`);
|
|
106
|
+
}
|
|
107
|
+
for (const item of artifacts) {
|
|
108
|
+
const artifactTitle = typeof item?.title === "string"
|
|
109
|
+
? String(item.title).trim()
|
|
110
|
+
: "";
|
|
111
|
+
const id = typeof item?.id === "string" ? String(item.id).trim() : "";
|
|
112
|
+
const label = artifactTitle || id || "artifact";
|
|
113
|
+
lines.push(`- Artifact: ${label}`);
|
|
114
|
+
}
|
|
115
|
+
lines.push("");
|
|
116
|
+
}
|
|
117
|
+
lines.push("## Operating Mode");
|
|
118
|
+
if (input.domain)
|
|
119
|
+
lines.push(`- Domain: ${input.domain}`);
|
|
120
|
+
if (input.requiredSkills.length > 0) {
|
|
121
|
+
lines.push(`- Skills: ${input.requiredSkills.join(", ")}`);
|
|
122
|
+
}
|
|
123
|
+
lines.push("- Communicate early when blocked. Provide options, tradeoffs, and a recommendation.");
|
|
124
|
+
lines.push("- Verify before claiming done. Prefer proof (commands/tests) over confidence.");
|
|
125
|
+
lines.push("");
|
|
126
|
+
if (allow.length > 0 || deny.length > 0 || toolNotes) {
|
|
127
|
+
lines.push("## Tool Scope");
|
|
128
|
+
if (allow.length > 0)
|
|
129
|
+
lines.push(`- Allow: ${allow.join(", ")}`);
|
|
130
|
+
if (deny.length > 0)
|
|
131
|
+
lines.push(`- Deny: ${deny.join(", ")}`);
|
|
132
|
+
if (toolNotes)
|
|
133
|
+
lines.push(`- Notes: ${toolNotes}`);
|
|
134
|
+
lines.push("");
|
|
135
|
+
}
|
|
136
|
+
if (reporting.length > 0) {
|
|
137
|
+
lines.push("## Reporting");
|
|
138
|
+
for (const item of reporting)
|
|
139
|
+
lines.push(`- ${item}`);
|
|
140
|
+
lines.push("");
|
|
141
|
+
}
|
|
142
|
+
if (contextHash || schemaVersion) {
|
|
143
|
+
lines.push("## Provenance");
|
|
144
|
+
if (schemaVersion)
|
|
145
|
+
lines.push(`- kickoff_schema: ${schemaVersion}`);
|
|
146
|
+
if (contextHash)
|
|
147
|
+
lines.push(`- kickoff_context_hash: ${contextHash}`);
|
|
148
|
+
lines.push("");
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
message: lines.join("\n").trimEnd(),
|
|
152
|
+
contextHash,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { OrgXClient } from "../../api.js";
|
|
2
|
+
import type { Entity } from "../../types.js";
|
|
3
|
+
export type MissionControlNodeType = "initiative" | "workstream" | "milestone" | "task";
|
|
4
|
+
export interface MissionControlAssignedAgent {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
domain: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface MissionControlNode {
|
|
10
|
+
id: string;
|
|
11
|
+
type: MissionControlNodeType;
|
|
12
|
+
title: string;
|
|
13
|
+
status: string;
|
|
14
|
+
parentId: string | null;
|
|
15
|
+
initiativeId: string | null;
|
|
16
|
+
workstreamId: string | null;
|
|
17
|
+
milestoneId: string | null;
|
|
18
|
+
priorityNum: number;
|
|
19
|
+
priorityLabel: string | null;
|
|
20
|
+
dependencyIds: string[];
|
|
21
|
+
dueDate: string | null;
|
|
22
|
+
etaEndAt: string | null;
|
|
23
|
+
expectedDurationHours: number;
|
|
24
|
+
expectedBudgetUsd: number;
|
|
25
|
+
assignedAgents: MissionControlAssignedAgent[];
|
|
26
|
+
updatedAt: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface MissionControlEdge {
|
|
29
|
+
from: string;
|
|
30
|
+
to: string;
|
|
31
|
+
kind: "depends_on";
|
|
32
|
+
}
|
|
33
|
+
export declare const ORGX_SKILL_BY_DOMAIN: Record<string, string>;
|
|
34
|
+
interface BudgetEnvBounds {
|
|
35
|
+
min?: number;
|
|
36
|
+
max?: number;
|
|
37
|
+
}
|
|
38
|
+
export declare function readBudgetEnvNumber(name: string, fallback: number, bounds?: BudgetEnvBounds): number;
|
|
39
|
+
export declare const DEFAULT_TOKEN_BUDGET_ASSUMPTIONS: {
|
|
40
|
+
tokensPerHour: number;
|
|
41
|
+
inputShare: number;
|
|
42
|
+
cachedInputShare: number;
|
|
43
|
+
contingencyMultiplier: number;
|
|
44
|
+
roundingStepUsd: number;
|
|
45
|
+
};
|
|
46
|
+
export declare function pickStringArray(record: Record<string, unknown>, keys: string[]): string[];
|
|
47
|
+
export declare function dedupeStrings(items: string[]): string[];
|
|
48
|
+
export declare function isTodoStatus(status: string): boolean;
|
|
49
|
+
export declare function isInProgressStatus(status: string): boolean;
|
|
50
|
+
export declare function isDispatchableWorkstreamStatus(status: string): boolean;
|
|
51
|
+
export declare function isDoneStatus(status: string): boolean;
|
|
52
|
+
export declare function listEntitiesSafe(client: OrgXClient, type: MissionControlNodeType, filters: Record<string, unknown>): Promise<{
|
|
53
|
+
items: Entity[];
|
|
54
|
+
warning: string | null;
|
|
55
|
+
}>;
|
|
56
|
+
export declare function buildMissionControlGraph(client: OrgXClient, initiativeId: string, options?: {
|
|
57
|
+
initiativeEntity?: Entity | null;
|
|
58
|
+
}): Promise<{
|
|
59
|
+
initiative: {
|
|
60
|
+
id: string;
|
|
61
|
+
title: string;
|
|
62
|
+
status: string;
|
|
63
|
+
summary: string | null;
|
|
64
|
+
assignedAgents: MissionControlAssignedAgent[];
|
|
65
|
+
};
|
|
66
|
+
nodes: MissionControlNode[];
|
|
67
|
+
edges: MissionControlEdge[];
|
|
68
|
+
recentTodos: string[];
|
|
69
|
+
degraded: string[];
|
|
70
|
+
}>;
|
|
71
|
+
export declare function normalizeEntityMutationPayload(payload: Record<string, unknown>): Record<string, unknown>;
|
|
72
|
+
export declare function resolveAutoAssignments(input: {
|
|
73
|
+
client: OrgXClient;
|
|
74
|
+
entityId: string;
|
|
75
|
+
entityType: string;
|
|
76
|
+
initiativeId: string | null;
|
|
77
|
+
title: string;
|
|
78
|
+
summary: string | null;
|
|
79
|
+
}): Promise<{
|
|
80
|
+
ok: boolean;
|
|
81
|
+
assignment_source: "orchestrator" | "fallback" | "manual";
|
|
82
|
+
assigned_agents: MissionControlAssignedAgent[];
|
|
83
|
+
warnings: string[];
|
|
84
|
+
updated_entity?: Entity;
|
|
85
|
+
}>;
|
|
86
|
+
export declare function normalizeExecutionDomain(value: string | null | undefined): string | null;
|
|
87
|
+
export declare function inferExecutionDomainFromText(...values: Array<string | null | undefined>): string;
|
|
88
|
+
export declare function deriveExecutionPolicy(taskNode: MissionControlNode, workstreamNode: MissionControlNode | null): {
|
|
89
|
+
domain: string;
|
|
90
|
+
requiredSkills: string[];
|
|
91
|
+
};
|
|
92
|
+
export declare function spawnGuardIsRateLimited(result: unknown): boolean;
|
|
93
|
+
export declare function summarizeSpawnGuardBlockReason(result: unknown): string;
|
|
94
|
+
export {};
|