@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,23 @@
|
|
|
1
|
+
import type { SharedState } from "./shared-state.js";
|
|
2
|
+
export type RouteMethod = "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "*";
|
|
3
|
+
export interface RouteContext<TState = SharedState, TReq = unknown, TRes = unknown> {
|
|
4
|
+
req: TReq;
|
|
5
|
+
res: TRes;
|
|
6
|
+
path: string;
|
|
7
|
+
query: URLSearchParams;
|
|
8
|
+
body: unknown;
|
|
9
|
+
state: TState;
|
|
10
|
+
}
|
|
11
|
+
export type RouteHandler<TState = SharedState, TReq = unknown, TRes = unknown> = (ctx: RouteContext<TState, TReq, TRes>) => Promise<void> | void;
|
|
12
|
+
export interface RouteDefinition<TState = SharedState, TReq = unknown, TRes = unknown> {
|
|
13
|
+
method: RouteMethod;
|
|
14
|
+
pattern: string;
|
|
15
|
+
handler: RouteHandler<TState, TReq, TRes>;
|
|
16
|
+
description?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface Router<TState = SharedState, TReq = unknown, TRes = unknown> {
|
|
19
|
+
add: (method: RouteMethod, pattern: string, handler: RouteHandler<TState, TReq, TRes>, description?: string) => void;
|
|
20
|
+
match: (method: string, path: string) => RouteDefinition<TState, TReq, TRes> | undefined;
|
|
21
|
+
routes: () => readonly RouteDefinition<TState, TReq, TRes>[];
|
|
22
|
+
}
|
|
23
|
+
export declare function createRouter<TState = SharedState, TReq = unknown, TRes = unknown>(): Router<TState, TReq, TRes>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function isPatternMatch(pattern, path) {
|
|
2
|
+
if (pattern.endsWith("/*")) {
|
|
3
|
+
return path.startsWith(pattern.slice(0, -1));
|
|
4
|
+
}
|
|
5
|
+
return pattern === path;
|
|
6
|
+
}
|
|
7
|
+
export function createRouter() {
|
|
8
|
+
const entries = [];
|
|
9
|
+
function add(method, pattern, handler, description) {
|
|
10
|
+
entries.push({ method, pattern, handler, description });
|
|
11
|
+
}
|
|
12
|
+
function match(method, path) {
|
|
13
|
+
const normalizedMethod = method.toUpperCase();
|
|
14
|
+
return entries.find((route) => {
|
|
15
|
+
const methodMatches = route.method === "*" || route.method === normalizedMethod;
|
|
16
|
+
return methodMatches && isPatternMatch(route.pattern, path);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function routes() {
|
|
20
|
+
return entries;
|
|
21
|
+
}
|
|
22
|
+
return { add, match, routes };
|
|
23
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Router } from "../router.js";
|
|
2
|
+
type JsonRecord = Record<string, unknown>;
|
|
3
|
+
type SpawnGuardResult = {
|
|
4
|
+
allowed: boolean;
|
|
5
|
+
retryable: boolean;
|
|
6
|
+
blockedReason: string | null;
|
|
7
|
+
spawnGuardResult: unknown | null;
|
|
8
|
+
};
|
|
9
|
+
type DispatchExecutionPolicy = {
|
|
10
|
+
domain: string | null;
|
|
11
|
+
requiredSkills: string[];
|
|
12
|
+
};
|
|
13
|
+
type DispatchResolution = {
|
|
14
|
+
executionPolicy: DispatchExecutionPolicy;
|
|
15
|
+
taskTitle: string | null;
|
|
16
|
+
workstreamTitle: string | null;
|
|
17
|
+
};
|
|
18
|
+
type BillingStatus = {
|
|
19
|
+
plan?: string;
|
|
20
|
+
};
|
|
21
|
+
type AgentRunRecord = {
|
|
22
|
+
runId: string;
|
|
23
|
+
agentId: string;
|
|
24
|
+
pid: number | null;
|
|
25
|
+
message: string | null;
|
|
26
|
+
provider: string | null;
|
|
27
|
+
model: string | null;
|
|
28
|
+
initiativeId: string | null;
|
|
29
|
+
initiativeTitle: string | null;
|
|
30
|
+
workstreamId: string | null;
|
|
31
|
+
taskId: string | null;
|
|
32
|
+
};
|
|
33
|
+
type RegisterAgentControlRoutesDeps<TReq, TRes> = {
|
|
34
|
+
parseJsonRequest: (req: TReq) => Promise<JsonRecord>;
|
|
35
|
+
pickString: (record: Record<string, unknown>, keys: string[]) => string | null;
|
|
36
|
+
parseBooleanQuery: (value: string | null) => boolean | null;
|
|
37
|
+
randomUUID: () => string;
|
|
38
|
+
normalizeOpenClawProvider: (value: string | null) => string | null;
|
|
39
|
+
resolveAutoOpenClawProvider: () => string | null;
|
|
40
|
+
modelImpliesByok: (model: string | null) => boolean;
|
|
41
|
+
listAgents: () => Promise<Array<Record<string, unknown>>>;
|
|
42
|
+
fetchBillingStatusSafe: (client: any) => Promise<BillingStatus | null>;
|
|
43
|
+
client: any;
|
|
44
|
+
resolveDispatchExecutionPolicy: (input: any) => Promise<DispatchResolution>;
|
|
45
|
+
fetchKickoffContextSafe: (client: any, payload: any) => Promise<unknown>;
|
|
46
|
+
renderKickoffMessage: (input: any) => {
|
|
47
|
+
message: string;
|
|
48
|
+
contextHash: string | null;
|
|
49
|
+
};
|
|
50
|
+
posthogCapture: (input: any) => Promise<void>;
|
|
51
|
+
telemetryDistinctId: string;
|
|
52
|
+
pluginVersion: string | null;
|
|
53
|
+
enforceSpawnGuardForDispatch: (input: any) => Promise<SpawnGuardResult>;
|
|
54
|
+
extractSpawnGuardModelTier: (value: any) => string | null;
|
|
55
|
+
buildPolicyEnforcedMessage: (input: any) => string;
|
|
56
|
+
syncParentRollupsForTask: (input: any) => Promise<void>;
|
|
57
|
+
emitActivitySafe: (input: any) => Promise<void>;
|
|
58
|
+
configureOpenClawProviderRouting: (input: any) => Promise<{
|
|
59
|
+
provider: string;
|
|
60
|
+
model: string;
|
|
61
|
+
}>;
|
|
62
|
+
upsertAgentContext: (input: any) => unknown;
|
|
63
|
+
upsertRunContext: (input: any) => unknown;
|
|
64
|
+
spawnAgentTurn: (input: any) => {
|
|
65
|
+
pid: number | null;
|
|
66
|
+
};
|
|
67
|
+
upsertAgentRun: (input: any) => unknown;
|
|
68
|
+
getAgentRun: (runId: string) => AgentRunRecord | null | any;
|
|
69
|
+
stopProcess: (pid: number) => Promise<{
|
|
70
|
+
stopped: boolean;
|
|
71
|
+
wasRunning: boolean;
|
|
72
|
+
}>;
|
|
73
|
+
markAgentRunStopped: (runId: string) => unknown;
|
|
74
|
+
writeRuntimeEvent: (input: any) => void;
|
|
75
|
+
sendJson: (res: TRes, status: number, payload: unknown) => void;
|
|
76
|
+
safeErrorMessage: (err: unknown) => string;
|
|
77
|
+
};
|
|
78
|
+
export declare function registerAgentControlRoutes<TReq, TRes>(router: Router<Record<string, never>, TReq, TRes>, deps: RegisterAgentControlRoutesDeps<TReq, TRes>): void;
|
|
79
|
+
export {};
|