@muxoai/platform 1.4.3 → 1.4.5

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.
@@ -6,7 +6,7 @@
6
6
  * 4. FinOps & Commercial ROI Unit-Economics Analytics
7
7
  */
8
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";
9
+ import type { ActionPlan, ApprovalImpactPreview, BusinessReceiptSummary, ByokKeyRecord, ExecutionReceipt, ExecutionRun, GovernanceDecisionRecord, GovernancePolicy, HumanFriendlyExplanation, ProviderLane, ProvisionedResource, RiskLevel, SupplierSettlement, TemporalGraphFact, Workspace } from "./types.js";
10
10
  export interface CompiledPolicyAsCodeBundle {
11
11
  workspaceId: string;
12
12
  workspaceSlug: string;
@@ -134,15 +134,23 @@ export declare function buildOtelTraceExport(params: {
134
134
  version?: string;
135
135
  }): OtelTraceExportBundle;
136
136
  export interface CommercialPlaybookDefinition {
137
- slug: "fullstack-cloud-bootstrap" | "competitor-seo-growth-brief" | "incident-containment-audit" | "customer-release-readiness";
137
+ slug: string;
138
138
  name: string;
139
- persona: "Engineering & DevOps" | "Marketing & Growth" | "SecOps & Compliance" | "Product & Founders";
139
+ persona: "Customer Operations & Support" | "Engineering & DevOps" | "Marketing & Growth" | "SecOps & Compliance" | "Product & Founders" | "Custom Workspace Saga";
140
140
  summary: string;
141
141
  commercialValue: string;
142
142
  estimatedMinutesSaved: number;
143
143
  creditCost: number;
144
+ expectedCostUsd: number;
144
145
  defaultProvider: string;
145
146
  defaultServiceRef: string;
147
+ requiredConnections: string[];
148
+ explicitPermissions: string[];
149
+ approvalRules: string[];
150
+ failureAndRecoveryBehavior: string;
151
+ usableBusinessOutcome: string;
152
+ naturalLanguageTriggers?: string[];
153
+ custom?: boolean;
146
154
  steps: Array<{
147
155
  name: string;
148
156
  toolSlug: string;
@@ -152,7 +160,8 @@ export interface CommercialPlaybookDefinition {
152
160
  }>;
153
161
  }
154
162
  export declare const MUXO_COMMERCIAL_PLAYBOOKS: CommercialPlaybookDefinition[];
155
- export declare function getCommercialPlaybook(slug: string): CommercialPlaybookDefinition | null;
163
+ export declare function getCommercialPlaybook(slugOrQuery: string, customPlaybooks?: CommercialPlaybookDefinition[]): CommercialPlaybookDefinition | null;
164
+ export declare function parseNaturalLanguageCustomPlaybook(prompt: string, explicitInput?: Record<string, unknown>): CommercialPlaybookDefinition;
156
165
  export declare function buildPlaybookSagaExecution(params: {
157
166
  id: string;
158
167
  workspaceId: string;
@@ -162,6 +171,21 @@ export declare function buildPlaybookSagaExecution(params: {
162
171
  }): {
163
172
  playbook: CommercialPlaybookDefinition;
164
173
  workflow: DurableWorkflow;
174
+ usableResult: {
175
+ playbookSlug: string;
176
+ playbookName: string;
177
+ status: "completed";
178
+ summary: string;
179
+ deliverableOutcome: string;
180
+ targetProvider: string;
181
+ targetEntity: string;
182
+ completedStepsCount: number;
183
+ registeredCompensationsCount: number;
184
+ estimatedCostUsd: number;
185
+ creditsMetered: number;
186
+ estimatedMinutesSaved: number;
187
+ recoveryGuarantee: string;
188
+ };
165
189
  temporalFact: {
166
190
  subject: string;
167
191
  predicate: string;
@@ -183,6 +207,7 @@ export interface CommercialRoiReport {
183
207
  byokZeroCreditRunsCount: number;
184
208
  managedFundedRunsCount: number;
185
209
  totalCreditsConsumed: number;
210
+ totalMonetarySpendUsd: number;
186
211
  byokCreditsSaved: number;
187
212
  byokDollarsSavedUsd: number;
188
213
  estimatedEngineeringMinutesSaved: number;
@@ -193,9 +218,28 @@ export interface CommercialRoiReport {
193
218
  activeBiTemporalFactsCount: number;
194
219
  configuredByokProviders: string[];
195
220
  };
221
+ validationMetrics: {
222
+ timeToFirstSuccessfulActionSeconds: number;
223
+ completionRateWithoutManualRepairPct: number;
224
+ avgTimeSavedPerWorkflowMinutes: number;
225
+ avgCostPerCompletedWorkflowUsd: number;
226
+ repeatWorkflowExecutionsCount: number;
227
+ zeroChargeFailedRunsCount: number;
228
+ };
229
+ workflowBreakdown: Array<{
230
+ toolSlug: string;
231
+ lane: ProviderLane;
232
+ runsCount: number;
233
+ succeededCount: number;
234
+ completionRatePct: number;
235
+ creditsConsumed: number;
236
+ costUsd: number;
237
+ estimatedMinutesSaved: number;
238
+ }>;
196
239
  laneBreakdown: Record<ProviderLane, {
197
240
  runsCount: number;
198
241
  creditsConsumed: number;
242
+ costUsd: number;
199
243
  estimatedMinutesSaved: number;
200
244
  }>;
201
245
  recommendations: Array<{
@@ -215,3 +259,143 @@ export declare function buildCommercialRoiReport(params: {
215
259
  byokKeys: ByokKeyRecord[];
216
260
  temporalFacts: TemporalGraphFact[];
217
261
  }): CommercialRoiReport;
262
+ export type HarnessPresetSlug = "startup-builder" | "strict-production" | "read-only-auditor" | "finops-byok-zero-cost";
263
+ export interface HarnessPresetDefinition {
264
+ slug: HarnessPresetSlug;
265
+ name: string;
266
+ summary: string;
267
+ recommendedFor: string;
268
+ naturalLanguageTriggers: string[];
269
+ policyPatch: Partial<GovernancePolicy>;
270
+ }
271
+ export declare const MUXO_HARNESS_PRESETS: HarnessPresetDefinition[];
272
+ export declare function resolveHarnessPreset(presetOrPrompt?: string | null): HarnessPresetDefinition | null;
273
+ export interface HarnessConfigurationBundle {
274
+ ok: true;
275
+ workspaceId: string;
276
+ workspaceSlug: string;
277
+ targetHarness: string;
278
+ appliedPreset: HarnessPresetDefinition | null;
279
+ availablePresets: HarnessPresetDefinition[];
280
+ policy: GovernancePolicy;
281
+ harnessConfigs: {
282
+ claudeCode: {
283
+ installPluginCommand: string;
284
+ addMcpCommand: string;
285
+ mcpJson: Record<string, unknown>;
286
+ };
287
+ cursor: {
288
+ filePath: ".cursor/mcp.json";
289
+ mcpJson: Record<string, unknown>;
290
+ };
291
+ codex: {
292
+ filePath: "~/.codex/config.toml";
293
+ toml: string;
294
+ };
295
+ chatgpt: {
296
+ mcpServerUrl: string;
297
+ authMode: string;
298
+ instructions: string;
299
+ };
300
+ claudeDesktop: {
301
+ filePath: "claude_desktop_config.json";
302
+ mcpJson: Record<string, unknown>;
303
+ };
304
+ factoryDroid: {
305
+ mcpServerUrl: string;
306
+ skillCommand: string;
307
+ };
308
+ };
309
+ systemPromptDirective: string;
310
+ naturalLanguageCheatsheet: Array<{
311
+ category: string;
312
+ sayInPlainEnglish: string;
313
+ mcpEquivalent: Record<string, unknown>;
314
+ restEndpoint: string;
315
+ }>;
316
+ explanation: HumanFriendlyExplanation;
317
+ humanMessage: string;
318
+ }
319
+ export declare function buildHarnessConfigurationBundle(params: {
320
+ workspace: Pick<Workspace, "id" | "slug" | "name" | "tier" | "policy">;
321
+ baseUrl?: string;
322
+ targetHarness?: string;
323
+ appliedPreset?: HarnessPresetDefinition | null;
324
+ }): HarnessConfigurationBundle;
325
+ export type NaturalLanguageOssIntentKind = "list_playbooks" | "run_playbook" | "create_playbook" | "rollback_workflow" | "signal_workflow" | "workflow_history" | "memory_graph" | "cedar_compile" | "cedar_evaluate" | "otel_traces" | "roi_analytics" | "configure_harness";
326
+ export interface ParsedNaturalLanguageOssIntent {
327
+ matched: boolean;
328
+ kind: NaturalLanguageOssIntentKind | null;
329
+ playbookSlug?: string;
330
+ playbookInput?: Record<string, unknown>;
331
+ customPlaybook?: CommercialPlaybookDefinition;
332
+ workflowId?: string;
333
+ workflowReason?: string;
334
+ signalName?: string;
335
+ signalPayload?: Record<string, unknown>;
336
+ asOf?: string | null;
337
+ focalEntity?: string | null;
338
+ maxHops?: number;
339
+ toolSlug?: string;
340
+ evaluationInput?: Record<string, unknown>;
341
+ preset?: HarnessPresetDefinition | null;
342
+ targetHarness?: string;
343
+ extraGuardrailPrompt?: string | null;
344
+ limit?: number;
345
+ summary: string;
346
+ }
347
+ export declare function extractPlaybookInputFromNaturalLanguage(prompt: string, explicitInput?: Record<string, unknown>): Record<string, unknown>;
348
+ export declare function parseNaturalLanguageOssIntent(prompt: string, options?: {
349
+ customPlaybooks?: CommercialPlaybookDefinition[];
350
+ explicitInput?: Record<string, unknown>;
351
+ }): ParsedNaturalLanguageOssIntent;
352
+ export declare function buildApprovalImpactPreview(params: {
353
+ toolSlug: string;
354
+ lane: ProviderLane;
355
+ riskLevel: RiskLevel;
356
+ input: Record<string, unknown>;
357
+ reason?: string;
358
+ creditCost: number;
359
+ fundingMode?: "muxo_funded" | "byok";
360
+ supplierSettlement?: SupplierSettlement | null;
361
+ decisionRecord?: GovernanceDecisionRecord | null;
362
+ workspaceName?: string;
363
+ }): ApprovalImpactPreview;
364
+ export declare function buildBusinessReceiptSummary(params: {
365
+ toolSlug: string;
366
+ lane: ProviderLane;
367
+ riskLevel: RiskLevel;
368
+ status: "succeeded" | "failed" | "cancelled";
369
+ creditsMetered: number;
370
+ input?: Record<string, unknown>;
371
+ output?: unknown;
372
+ error?: string | null;
373
+ approvedBy?: string | null;
374
+ actorId?: string;
375
+ decisionRecord?: GovernanceDecisionRecord | null;
376
+ supplierSettlement?: SupplierSettlement | null;
377
+ }): BusinessReceiptSummary;
378
+ export interface RunReconciliationReport {
379
+ ok: true;
380
+ runId: string;
381
+ planId: string;
382
+ workspaceId: string;
383
+ toolSlug: string;
384
+ status: ExecutionRun["status"];
385
+ reconciliationStatus: "verified_complete" | "failed_zero_charge" | "cancelled" | "needs_reconciliation";
386
+ executeOnceEnforced: boolean;
387
+ idempotentReplaySafe: boolean;
388
+ zeroChargeOnFailureVerified: boolean;
389
+ creditsMetered: number;
390
+ estimatedCostUsd: number;
391
+ receiptVerified: boolean;
392
+ receiptId: string | null;
393
+ businessSummary: BusinessReceiptSummary;
394
+ recommendedNextAction: string;
395
+ }
396
+ export declare function buildRunReconciliationReport(params: {
397
+ run?: ExecutionRun | null;
398
+ plan?: ActionPlan | null;
399
+ receipt?: ExecutionReceipt | null;
400
+ signatureValid?: boolean;
401
+ }): RunReconciliationReport;