@useorgx/openclaw-plugin 0.4.0 → 0.4.3
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/README.md +4 -0
- package/dashboard/dist/assets/BqukHQH-.js +8 -0
- package/dashboard/dist/assets/{motion-x9c01cgK.js → CE5pVdev.js} +1 -1
- package/dashboard/dist/assets/Cpr7n8fE.js +1 -0
- package/dashboard/dist/assets/Nip3CrNC.js +1 -0
- package/dashboard/dist/assets/TN5wE36J.js +1 -0
- package/dashboard/dist/assets/X6IcjS74.js +212 -0
- package/dashboard/dist/assets/jyFhCND-.css +1 -0
- package/dashboard/dist/index.html +9 -6
- package/dist/adapters/outbox.d.ts +0 -1
- package/dist/adapters/outbox.js +0 -1
- package/dist/agent-context-store.d.ts +0 -1
- package/dist/agent-context-store.js +0 -1
- package/dist/agent-run-store.d.ts +0 -1
- package/dist/agent-run-store.js +0 -1
- package/dist/api.d.ts +0 -1
- package/dist/api.js +0 -1
- package/dist/auth-store.d.ts +0 -1
- package/dist/auth-store.js +0 -1
- package/dist/byok-store.d.ts +0 -1
- package/dist/byok-store.js +181 -55
- package/dist/contracts/client.d.ts +0 -1
- package/dist/contracts/client.js +0 -1
- package/dist/contracts/types.d.ts +0 -1
- package/dist/contracts/types.js +0 -1
- package/dist/dashboard-api.d.ts +0 -1
- package/dist/dashboard-api.js +0 -1
- package/dist/fs-utils.d.ts +0 -1
- package/dist/fs-utils.js +0 -1
- package/dist/gateway-watchdog-runner.d.ts +1 -0
- package/dist/gateway-watchdog-runner.js +6 -0
- package/dist/gateway-watchdog.d.ts +11 -0
- package/dist/gateway-watchdog.js +221 -0
- package/dist/http-handler.d.ts +0 -1
- package/dist/http-handler.js +729 -79
- package/dist/index.d.ts +0 -1
- package/dist/index.js +7 -1
- package/dist/local-openclaw.d.ts +0 -1
- package/dist/local-openclaw.js +0 -1
- package/dist/openclaw-settings.d.ts +17 -0
- package/dist/openclaw-settings.js +118 -0
- package/dist/outbox.d.ts +0 -1
- package/dist/outbox.js +0 -1
- package/dist/paths.d.ts +0 -1
- package/dist/paths.js +0 -1
- package/dist/reporting/outbox-replay.d.ts +0 -1
- package/dist/reporting/outbox-replay.js +0 -1
- package/dist/reporting/rollups.d.ts +0 -1
- package/dist/reporting/rollups.js +0 -1
- package/dist/runtime-instance-store.d.ts +0 -1
- package/dist/runtime-instance-store.js +0 -1
- package/dist/snapshot-store.d.ts +0 -1
- package/dist/snapshot-store.js +0 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.js +0 -1
- package/package.json +2 -2
- package/dashboard/dist/assets/MissionControlView-DVNfDWKZ.js +0 -1
- package/dashboard/dist/assets/SessionInspector-BaqnAys4.js +0 -1
- package/dashboard/dist/assets/index-B4Yix84X.js +0 -212
- package/dashboard/dist/assets/index-BWSvw1HR.css +0 -1
- package/dashboard/dist/assets/react-vendor-C2t2w4r2.js +0 -32
- package/dashboard/dist/assets/vendor-C-AHK0Ly.js +0 -9
- package/dist/adapters/outbox.d.ts.map +0 -1
- package/dist/adapters/outbox.js.map +0 -1
- package/dist/agent-context-store.d.ts.map +0 -1
- package/dist/agent-context-store.js.map +0 -1
- package/dist/agent-run-store.d.ts.map +0 -1
- package/dist/agent-run-store.js.map +0 -1
- package/dist/api.d.ts.map +0 -1
- package/dist/api.js.map +0 -1
- package/dist/auth-store.d.ts.map +0 -1
- package/dist/auth-store.js.map +0 -1
- package/dist/byok-store.d.ts.map +0 -1
- package/dist/byok-store.js.map +0 -1
- package/dist/contracts/client.d.ts.map +0 -1
- package/dist/contracts/client.js.map +0 -1
- package/dist/contracts/types.d.ts.map +0 -1
- package/dist/contracts/types.js.map +0 -1
- package/dist/dashboard-api.d.ts.map +0 -1
- package/dist/dashboard-api.js.map +0 -1
- package/dist/fs-utils.d.ts.map +0 -1
- package/dist/fs-utils.js.map +0 -1
- package/dist/http-handler.d.ts.map +0 -1
- package/dist/http-handler.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/local-openclaw.d.ts.map +0 -1
- package/dist/local-openclaw.js.map +0 -1
- package/dist/mcp-apps/orgx-live.html +0 -690
- package/dist/outbox.d.ts.map +0 -1
- package/dist/outbox.js.map +0 -1
- package/dist/paths.d.ts.map +0 -1
- package/dist/paths.js.map +0 -1
- package/dist/reporting/outbox-replay.d.ts.map +0 -1
- package/dist/reporting/outbox-replay.js.map +0 -1
- package/dist/reporting/rollups.d.ts.map +0 -1
- package/dist/reporting/rollups.js.map +0 -1
- package/dist/runtime-instance-store.d.ts.map +0 -1
- package/dist/runtime-instance-store.js.map +0 -1
- package/dist/snapshot-store.d.ts.map +0 -1
- package/dist/snapshot-store.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- /package/dashboard/dist/assets/{tanstack-C-KIc3Wc.js → C-KIc3Wc.js} +0 -0
- /package/dashboard/dist/assets/{orgx-logo-Fm0FhtnV.png → Fm0FhtnV.png} +0 -0
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ import { clearPersistedApiKey, loadAuthStore, resolveInstallationId, saveAuthSto
|
|
|
21
21
|
import { clearPersistedSnapshot, readPersistedSnapshot, writePersistedSnapshot, } from "./snapshot-store.js";
|
|
22
22
|
import { appendToOutbox, readOutbox, readOutboxSummary, replaceOutbox, } from "./outbox.js";
|
|
23
23
|
import { extractProgressOutboxMessage } from "./reporting/outbox-replay.js";
|
|
24
|
+
import { ensureGatewayWatchdog } from "./gateway-watchdog.js";
|
|
24
25
|
export { OrgXClient } from "./api.js";
|
|
25
26
|
const DEFAULT_BASE_URL = "https://www.useorgx.com";
|
|
26
27
|
const DEFAULT_DOCS_URL = "https://orgx.mintlify.site/guides/openclaw-plugin-setup";
|
|
@@ -1077,6 +1078,12 @@ export default function register(api) {
|
|
|
1077
1078
|
id: "orgx-sync",
|
|
1078
1079
|
start: async () => {
|
|
1079
1080
|
syncServiceRunning = true;
|
|
1081
|
+
const watchdog = ensureGatewayWatchdog(api.log ?? {});
|
|
1082
|
+
if (watchdog.started) {
|
|
1083
|
+
api.log?.info?.("[orgx] Gateway watchdog started", {
|
|
1084
|
+
pid: watchdog.pid,
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1080
1087
|
api.log?.info?.("[orgx] Starting sync service", {
|
|
1081
1088
|
interval: config.syncIntervalMs,
|
|
1082
1089
|
});
|
|
@@ -2190,4 +2197,3 @@ export default function register(api) {
|
|
|
2190
2197
|
// NAMED EXPORT FOR FLEXIBILITY
|
|
2191
2198
|
// =============================================================================
|
|
2192
2199
|
export { register };
|
|
2193
|
-
//# sourceMappingURL=index.js.map
|
package/dist/local-openclaw.d.ts
CHANGED
package/dist/local-openclaw.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type OpenClawProvider = "anthropic" | "openrouter" | "openai";
|
|
2
|
+
export interface OpenClawSettingsSnapshot {
|
|
3
|
+
path: string;
|
|
4
|
+
raw: Record<string, unknown> | null;
|
|
5
|
+
}
|
|
6
|
+
export interface OpenClawProviderModelStats {
|
|
7
|
+
provider: OpenClawProvider;
|
|
8
|
+
total: number;
|
|
9
|
+
sonnetCount: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function readOpenClawSettingsSnapshot(): OpenClawSettingsSnapshot;
|
|
12
|
+
export declare function listOpenClawConfiguredModelKeys(raw: Record<string, unknown> | null): string[];
|
|
13
|
+
export declare function classifyProviderFromModelKey(modelKey: string): OpenClawProvider | null;
|
|
14
|
+
export declare function summarizeOpenClawProviderModels(raw: Record<string, unknown> | null): Record<OpenClawProvider, OpenClawProviderModelStats>;
|
|
15
|
+
export declare function resolvePreferredOpenClawProvider(raw: Record<string, unknown> | null): OpenClawProvider | null;
|
|
16
|
+
export declare function readOpenClawPrimaryModel(raw: Record<string, unknown> | null): string | null;
|
|
17
|
+
export declare function readOpenClawGatewayPort(raw: Record<string, unknown> | null): number;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { getOpenClawDir } from "./paths.js";
|
|
4
|
+
function readObject(value) {
|
|
5
|
+
return value && typeof value === "object" && !Array.isArray(value)
|
|
6
|
+
? value
|
|
7
|
+
: {};
|
|
8
|
+
}
|
|
9
|
+
function parseJsonObject(value) {
|
|
10
|
+
try {
|
|
11
|
+
const parsed = JSON.parse(value);
|
|
12
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed)
|
|
13
|
+
? parsed
|
|
14
|
+
: null;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function readOpenClawSettingsSnapshot() {
|
|
21
|
+
const path = join(getOpenClawDir(), "openclaw.json");
|
|
22
|
+
if (!existsSync(path)) {
|
|
23
|
+
return { path, raw: null };
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
const rawText = readFileSync(path, "utf8");
|
|
27
|
+
return { path, raw: parseJsonObject(rawText) };
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return { path, raw: null };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export function listOpenClawConfiguredModelKeys(raw) {
|
|
34
|
+
if (!raw)
|
|
35
|
+
return [];
|
|
36
|
+
const agents = readObject(raw.agents);
|
|
37
|
+
const defaults = readObject(agents.defaults);
|
|
38
|
+
const models = readObject(defaults.models);
|
|
39
|
+
const keys = Object.keys(models)
|
|
40
|
+
.map((key) => key.trim())
|
|
41
|
+
.filter((key) => key.length > 0);
|
|
42
|
+
keys.sort((a, b) => a.localeCompare(b));
|
|
43
|
+
return keys;
|
|
44
|
+
}
|
|
45
|
+
export function classifyProviderFromModelKey(modelKey) {
|
|
46
|
+
const normalized = modelKey.trim().toLowerCase();
|
|
47
|
+
if (!normalized)
|
|
48
|
+
return null;
|
|
49
|
+
if (normalized.startsWith("openrouter/"))
|
|
50
|
+
return "openrouter";
|
|
51
|
+
if (normalized.startsWith("anthropic/") || normalized.startsWith("claude/")) {
|
|
52
|
+
return "anthropic";
|
|
53
|
+
}
|
|
54
|
+
if (normalized.startsWith("openai/") ||
|
|
55
|
+
normalized.startsWith("openai-") ||
|
|
56
|
+
normalized.startsWith("gpt")) {
|
|
57
|
+
return "openai";
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
export function summarizeOpenClawProviderModels(raw) {
|
|
62
|
+
const summary = {
|
|
63
|
+
anthropic: { provider: "anthropic", total: 0, sonnetCount: 0 },
|
|
64
|
+
openrouter: { provider: "openrouter", total: 0, sonnetCount: 0 },
|
|
65
|
+
openai: { provider: "openai", total: 0, sonnetCount: 0 },
|
|
66
|
+
};
|
|
67
|
+
for (const key of listOpenClawConfiguredModelKeys(raw)) {
|
|
68
|
+
const provider = classifyProviderFromModelKey(key);
|
|
69
|
+
if (!provider)
|
|
70
|
+
continue;
|
|
71
|
+
const bucket = summary[provider];
|
|
72
|
+
bucket.total += 1;
|
|
73
|
+
if (key.toLowerCase().includes("sonnet")) {
|
|
74
|
+
bucket.sonnetCount += 1;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return summary;
|
|
78
|
+
}
|
|
79
|
+
export function resolvePreferredOpenClawProvider(raw) {
|
|
80
|
+
const summary = summarizeOpenClawProviderModels(raw);
|
|
81
|
+
const order = ["openrouter", "anthropic", "openai"];
|
|
82
|
+
for (const provider of order) {
|
|
83
|
+
if (summary[provider].sonnetCount > 0) {
|
|
84
|
+
return provider;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
for (const provider of order) {
|
|
88
|
+
if (summary[provider].total > 0) {
|
|
89
|
+
return provider;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
export function readOpenClawPrimaryModel(raw) {
|
|
95
|
+
if (!raw)
|
|
96
|
+
return null;
|
|
97
|
+
const agents = readObject(raw.agents);
|
|
98
|
+
const defaults = readObject(agents.defaults);
|
|
99
|
+
const model = readObject(defaults.model);
|
|
100
|
+
const primary = typeof model.primary === "string" ? model.primary.trim() : "";
|
|
101
|
+
return primary || null;
|
|
102
|
+
}
|
|
103
|
+
export function readOpenClawGatewayPort(raw) {
|
|
104
|
+
if (!raw)
|
|
105
|
+
return 18789;
|
|
106
|
+
const gateway = readObject(raw.gateway);
|
|
107
|
+
const port = gateway.port;
|
|
108
|
+
if (typeof port === "number" && Number.isFinite(port) && port > 0) {
|
|
109
|
+
return Math.floor(port);
|
|
110
|
+
}
|
|
111
|
+
if (typeof port === "string") {
|
|
112
|
+
const parsed = Number.parseInt(port, 10);
|
|
113
|
+
if (Number.isFinite(parsed) && parsed > 0) {
|
|
114
|
+
return parsed;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return 18789;
|
|
118
|
+
}
|
package/dist/outbox.d.ts
CHANGED
|
@@ -24,4 +24,3 @@ export declare function replaceOutbox(sessionId: string, events: OutboxEvent[]):
|
|
|
24
24
|
export declare function readAllOutboxItems(): Promise<LiveActivityItem[]>;
|
|
25
25
|
export declare function readOutboxSummary(): Promise<OutboxSummary>;
|
|
26
26
|
export declare function clearOutbox(sessionId: string): Promise<void>;
|
|
27
|
-
//# sourceMappingURL=outbox.d.ts.map
|
package/dist/outbox.js
CHANGED
package/dist/paths.d.ts
CHANGED
package/dist/paths.js
CHANGED
package/dist/snapshot-store.d.ts
CHANGED
|
@@ -7,4 +7,3 @@ export declare function readPersistedSnapshot(): PersistedSnapshot | null;
|
|
|
7
7
|
export declare function writePersistedSnapshot(snapshot: OrgSnapshot): PersistedSnapshot;
|
|
8
8
|
export declare function clearPersistedSnapshot(): void;
|
|
9
9
|
export {};
|
|
10
|
-
//# sourceMappingURL=snapshot-store.d.ts.map
|
package/dist/snapshot-store.js
CHANGED
package/dist/types.d.ts
CHANGED
package/dist/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useorgx/openclaw-plugin",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "OrgX plugin for OpenClaw — agent orchestration, quality gates, model routing, and live dashboard",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"ops:launch-checklist": "node ./scripts/run-launch-checklist.mjs",
|
|
42
42
|
"install:dashboard": "npm --prefix dashboard ci",
|
|
43
43
|
"build:dashboard": "npm run install:dashboard && npm --prefix dashboard run build",
|
|
44
|
-
"build:core": "tsc && node ./scripts/copy-manifest.mjs",
|
|
44
|
+
"build:core": "rm -rf dist && tsc && node ./scripts/copy-manifest.mjs",
|
|
45
45
|
"build": "npm run build:dashboard && npm run build:core",
|
|
46
46
|
"clean": "rm -rf dist",
|
|
47
47
|
"pack": "npm run build && mkdir -p artifacts && npm pack --pack-destination artifacts",
|