@muxoai/platform 1.4.2 → 1.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/.agents/plugins/marketplace.json +1 -1
- package/.claude-plugin/marketplace.json +2 -2
- package/README.md +1 -1
- package/dist/cli.js +88 -0
- package/dist/durable-workflow.d.ts +71 -4
- package/dist/durable-workflow.js +199 -5
- package/dist/engine.d.ts +64 -2
- package/dist/engine.js +147 -6
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/mcp-schema.js +22 -1
- package/dist/mcp.js +62 -3
- package/dist/memory-graph.d.ts +26 -2
- package/dist/memory-graph.js +127 -7
- package/dist/oss-suite.d.ts +217 -0
- package/dist/oss-suite.js +836 -0
- package/dist/sdk.d.ts +24 -1
- package/dist/sdk.js +53 -2
- package/dist/server.js +128 -3
- package/dist/types.d.ts +19 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/plugins/muxo/.claude-plugin/plugin.json +1 -1
- package/plugins/muxo/.codex-plugin/plugin.json +2 -2
- package/plugins/muxo/.cursor-plugin/plugin.json +1 -1
- package/plugins/muxo/plugin.json +2 -2
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Open-Source & Commercial Enterprise Suite (Runtime-Agnostic: Node.js + Cloudflare Workers):
|
|
3
|
+
* 1. AWS Cedar & Open Policy Agent (OPA / Rego) Policy-as-Code Compiler & Evaluator
|
|
4
|
+
* 2. OpenTelemetry (OTel GenAI / MCP Semantic Conventions) OTLP JSON & Langfuse Trace Exporter
|
|
5
|
+
* 3. Turnkey Commercial Business Saga Playbooks (backed by Temporal-compatible DurableWorkflows)
|
|
6
|
+
* 4. FinOps & Commercial ROI Unit-Economics Analytics
|
|
7
|
+
*/
|
|
8
|
+
import { type DurableWorkflow } from "./durable-workflow.js";
|
|
9
|
+
import type { ActionPlan, ByokKeyRecord, ExecutionReceipt, ExecutionRun, GovernancePolicy, HumanFriendlyExplanation, ProviderLane, ProvisionedResource, RiskLevel, TemporalGraphFact, Workspace } from "./types.js";
|
|
10
|
+
export interface CompiledPolicyAsCodeBundle {
|
|
11
|
+
workspaceId: string;
|
|
12
|
+
workspaceSlug: string;
|
|
13
|
+
generatedAt: string;
|
|
14
|
+
engines: ["aws-cedar-4.x", "open-policy-agent-rego-v1"];
|
|
15
|
+
cedarSchemaVersion: "4.0";
|
|
16
|
+
cedarPolicyText: string;
|
|
17
|
+
opaRegoText: string;
|
|
18
|
+
statements: Array<{
|
|
19
|
+
id: string;
|
|
20
|
+
effect: "permit" | "forbid";
|
|
21
|
+
description: string;
|
|
22
|
+
statement: string;
|
|
23
|
+
}>;
|
|
24
|
+
cedar: {
|
|
25
|
+
schemaNamespace: "Muxo";
|
|
26
|
+
statementsCount: number;
|
|
27
|
+
policyText: string;
|
|
28
|
+
statements: Array<{
|
|
29
|
+
id: string;
|
|
30
|
+
effect: "permit" | "forbid";
|
|
31
|
+
description: string;
|
|
32
|
+
statement: string;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
opa: {
|
|
36
|
+
packageName: "muxo.authz";
|
|
37
|
+
rulesCount: number;
|
|
38
|
+
regoText: string;
|
|
39
|
+
};
|
|
40
|
+
plainEnglishSummary: string[];
|
|
41
|
+
explanation: HumanFriendlyExplanation;
|
|
42
|
+
}
|
|
43
|
+
export interface PolicyAsCodeEvaluationResult {
|
|
44
|
+
workspaceId: string;
|
|
45
|
+
toolSlug: string;
|
|
46
|
+
riskLevel: RiskLevel;
|
|
47
|
+
creditCost: number;
|
|
48
|
+
allowed: boolean;
|
|
49
|
+
decision: "ALLOW" | "DENY" | "REQUIRE_APPROVAL";
|
|
50
|
+
policyDecision: "allow" | "deny" | "require_approval";
|
|
51
|
+
cedarResult: {
|
|
52
|
+
decision: "ALLOW" | "DENY";
|
|
53
|
+
determiningPolicies: string[];
|
|
54
|
+
errors: string[];
|
|
55
|
+
};
|
|
56
|
+
opaResult: {
|
|
57
|
+
allow: boolean;
|
|
58
|
+
decision: "allow" | "deny" | "review";
|
|
59
|
+
denyReasons: string[];
|
|
60
|
+
reviewReasons: string[];
|
|
61
|
+
};
|
|
62
|
+
matchedStatements: string[];
|
|
63
|
+
remediationForLlm: string;
|
|
64
|
+
compiledBundle: CompiledPolicyAsCodeBundle;
|
|
65
|
+
}
|
|
66
|
+
export declare function compileWorkspacePolicyToCedarAndRego(policy: GovernancePolicy, workspace: Pick<Workspace, "id" | "slug" | "name">): CompiledPolicyAsCodeBundle;
|
|
67
|
+
export declare function evaluateCedarAndOpaPolicy(params: {
|
|
68
|
+
policy: GovernancePolicy;
|
|
69
|
+
workspace: Pick<Workspace, "id" | "slug" | "name">;
|
|
70
|
+
toolSlug: string;
|
|
71
|
+
input?: Record<string, unknown>;
|
|
72
|
+
riskLevel?: RiskLevel;
|
|
73
|
+
creditCost?: number;
|
|
74
|
+
lane?: string;
|
|
75
|
+
}): PolicyAsCodeEvaluationResult;
|
|
76
|
+
export interface OtelSpanAttribute {
|
|
77
|
+
key: string;
|
|
78
|
+
value: {
|
|
79
|
+
stringValue?: string;
|
|
80
|
+
intValue?: number;
|
|
81
|
+
boolValue?: boolean;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export interface OtelTraceExportBundle {
|
|
85
|
+
workspaceId: string;
|
|
86
|
+
workspaceSlug: string;
|
|
87
|
+
exportedAt: string;
|
|
88
|
+
protocol: "OTLP/HTTP-JSON-v1";
|
|
89
|
+
semanticConventions: ["gen_ai.1.29.0", "mcp.2026-07-28", "muxo.governance.v5"];
|
|
90
|
+
w3cTraceParent: string;
|
|
91
|
+
w3cTraceContextSample: string;
|
|
92
|
+
spansCount: number;
|
|
93
|
+
otlpPayload: {
|
|
94
|
+
resourceSpans: OtelTraceExportBundle["resourceSpans"];
|
|
95
|
+
};
|
|
96
|
+
resourceSpans: Array<{
|
|
97
|
+
resource: {
|
|
98
|
+
attributes: OtelSpanAttribute[];
|
|
99
|
+
};
|
|
100
|
+
scopeSpans: Array<{
|
|
101
|
+
scope: {
|
|
102
|
+
name: string;
|
|
103
|
+
version: string;
|
|
104
|
+
};
|
|
105
|
+
spans: Array<{
|
|
106
|
+
traceId: string;
|
|
107
|
+
spanId: string;
|
|
108
|
+
parentSpanId?: string;
|
|
109
|
+
traceparent: string;
|
|
110
|
+
name: string;
|
|
111
|
+
kind: "SPAN_KIND_SERVER" | "SPAN_KIND_CLIENT";
|
|
112
|
+
startTimeUnixNano: string;
|
|
113
|
+
endTimeUnixNano: string;
|
|
114
|
+
status: {
|
|
115
|
+
code: "STATUS_CODE_OK" | "STATUS_CODE_ERROR";
|
|
116
|
+
message?: string;
|
|
117
|
+
};
|
|
118
|
+
attributes: OtelSpanAttribute[];
|
|
119
|
+
}>;
|
|
120
|
+
}>;
|
|
121
|
+
}>;
|
|
122
|
+
langfuseBatch: Array<{
|
|
123
|
+
id: string;
|
|
124
|
+
type: "trace-create" | "span-create";
|
|
125
|
+
timestamp: string;
|
|
126
|
+
body: Record<string, unknown>;
|
|
127
|
+
}>;
|
|
128
|
+
}
|
|
129
|
+
export declare function buildOtelTraceExport(params: {
|
|
130
|
+
workspace: Pick<Workspace, "id" | "slug" | "name" | "tier">;
|
|
131
|
+
runs: ExecutionRun[];
|
|
132
|
+
receipts: ExecutionReceipt[];
|
|
133
|
+
plans?: ActionPlan[];
|
|
134
|
+
version?: string;
|
|
135
|
+
}): OtelTraceExportBundle;
|
|
136
|
+
export interface CommercialPlaybookDefinition {
|
|
137
|
+
slug: "fullstack-cloud-bootstrap" | "competitor-seo-growth-brief" | "incident-containment-audit" | "customer-release-readiness";
|
|
138
|
+
name: string;
|
|
139
|
+
persona: "Engineering & DevOps" | "Marketing & Growth" | "SecOps & Compliance" | "Product & Founders";
|
|
140
|
+
summary: string;
|
|
141
|
+
commercialValue: string;
|
|
142
|
+
estimatedMinutesSaved: number;
|
|
143
|
+
creditCost: number;
|
|
144
|
+
defaultProvider: string;
|
|
145
|
+
defaultServiceRef: string;
|
|
146
|
+
steps: Array<{
|
|
147
|
+
name: string;
|
|
148
|
+
toolSlug: string;
|
|
149
|
+
primitive: "step.do" | "step.waitForEvent";
|
|
150
|
+
compensationAction?: string;
|
|
151
|
+
description: string;
|
|
152
|
+
}>;
|
|
153
|
+
}
|
|
154
|
+
export declare const MUXO_COMMERCIAL_PLAYBOOKS: CommercialPlaybookDefinition[];
|
|
155
|
+
export declare function getCommercialPlaybook(slug: string): CommercialPlaybookDefinition | null;
|
|
156
|
+
export declare function buildPlaybookSagaExecution(params: {
|
|
157
|
+
id: string;
|
|
158
|
+
workspaceId: string;
|
|
159
|
+
workspaceSlug: string;
|
|
160
|
+
playbook: CommercialPlaybookDefinition;
|
|
161
|
+
input?: Record<string, unknown>;
|
|
162
|
+
}): {
|
|
163
|
+
playbook: CommercialPlaybookDefinition;
|
|
164
|
+
workflow: DurableWorkflow;
|
|
165
|
+
temporalFact: {
|
|
166
|
+
subject: string;
|
|
167
|
+
predicate: string;
|
|
168
|
+
object: string;
|
|
169
|
+
summary: string;
|
|
170
|
+
episodeId: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
export interface CommercialRoiReport {
|
|
174
|
+
workspaceId: string;
|
|
175
|
+
workspaceSlug: string;
|
|
176
|
+
workspaceName: string;
|
|
177
|
+
tier: string;
|
|
178
|
+
generatedAt: string;
|
|
179
|
+
unitEconomics: {
|
|
180
|
+
creditsBalance: number;
|
|
181
|
+
totalRunsAnalyzed: number;
|
|
182
|
+
succeededRunsCount: number;
|
|
183
|
+
byokZeroCreditRunsCount: number;
|
|
184
|
+
managedFundedRunsCount: number;
|
|
185
|
+
totalCreditsConsumed: number;
|
|
186
|
+
byokCreditsSaved: number;
|
|
187
|
+
byokDollarsSavedUsd: number;
|
|
188
|
+
estimatedEngineeringMinutesSaved: number;
|
|
189
|
+
estimatedEngineeringHoursSaved: number;
|
|
190
|
+
estimatedLaborValueSavedUsd: number;
|
|
191
|
+
preventedPolicyViolationsCount: number;
|
|
192
|
+
activeCloudResourcesCount: number;
|
|
193
|
+
activeBiTemporalFactsCount: number;
|
|
194
|
+
configuredByokProviders: string[];
|
|
195
|
+
};
|
|
196
|
+
laneBreakdown: Record<ProviderLane, {
|
|
197
|
+
runsCount: number;
|
|
198
|
+
creditsConsumed: number;
|
|
199
|
+
estimatedMinutesSaved: number;
|
|
200
|
+
}>;
|
|
201
|
+
recommendations: Array<{
|
|
202
|
+
id: string;
|
|
203
|
+
category: "byok_savings" | "cloud_consolidation" | "governance_safety" | "playbook_automation";
|
|
204
|
+
title: string;
|
|
205
|
+
impact: string;
|
|
206
|
+
actionCommand: string;
|
|
207
|
+
}>;
|
|
208
|
+
explanation: HumanFriendlyExplanation;
|
|
209
|
+
}
|
|
210
|
+
export declare function buildCommercialRoiReport(params: {
|
|
211
|
+
workspace: Workspace;
|
|
212
|
+
runs: ExecutionRun[];
|
|
213
|
+
plans?: ActionPlan[];
|
|
214
|
+
resources: ProvisionedResource[];
|
|
215
|
+
byokKeys: ByokKeyRecord[];
|
|
216
|
+
temporalFacts: TemporalGraphFact[];
|
|
217
|
+
}): CommercialRoiReport;
|