@bpmsoftwaresolutions/ai-engine-client 1.1.88 → 1.1.90

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.
Files changed (37) hide show
  1. package/package.json +1 -1
  2. package/src/client.js +282 -2369
  3. package/src/domains/actions.js +19 -1
  4. package/src/domains/benchmarks.js +9 -9
  5. package/src/domains/capabilities.js +3 -3
  6. package/src/domains/charters.js +5 -0
  7. package/src/domains/claims.js +58 -0
  8. package/src/domains/commit-governance.js +68 -0
  9. package/src/domains/context-assembly.js +16 -6
  10. package/src/domains/context-orientation.js +48 -0
  11. package/src/domains/context-sessions.js +46 -0
  12. package/src/domains/database.js +136 -7
  13. package/src/domains/design-intelligence.js +12 -12
  14. package/src/domains/execution-eligibility.js +44 -0
  15. package/src/domains/execution-telemetry.js +14 -4
  16. package/src/domains/governed-implementation.js +7 -0
  17. package/src/domains/health.js +12 -1
  18. package/src/domains/loga.js +54 -9
  19. package/src/domains/notes-lab.js +3 -3
  20. package/src/domains/operator-status.js +31 -11
  21. package/src/domains/performance.js +15 -4
  22. package/src/domains/projections.js +65 -9
  23. package/src/domains/reports.js +16 -1
  24. package/src/domains/script-discovery.js +8 -5
  25. package/src/domains/scripts.js +45 -4
  26. package/src/domains/search-contacts.js +3 -3
  27. package/src/domains/self-learning.js +29 -6
  28. package/src/domains/self-optimization.js +15 -4
  29. package/src/domains/session-governance.js +64 -0
  30. package/src/domains/skill-governance.js +5 -3
  31. package/src/domains/skills.js +22 -9
  32. package/src/domains/tool-binding-approvals.js +102 -0
  33. package/src/domains/tool-registry.js +18 -10
  34. package/src/domains/verified-mutations.js +7 -0
  35. package/src/domains/work-start.js +192 -0
  36. package/src/domains/workflow-turns.js +6 -0
  37. package/src/index.js +1 -1
package/src/client.js CHANGED
@@ -1,4 +1,4 @@
1
- import { AI_ENGINE_CLIENT_CAPABILITIES, GOVERNED_MUTATION_REQUIRED_CAPABILITIES, TASK_BOUND_SUBSTRATE_EXECUTION_POLICY } from './constants/governance.js';
1
+ import { AI_ENGINE_CLIENT_CAPABILITIES } from './constants/governance.js';
2
2
  import { AGENT_COMMUNICATION_CONTRACT_VERSION, AGENT_COMMUNICATION_MESSAGE_KINDS, AGENT_COMMUNICATION_RECIPIENT_MODES, AGENT_COMMUNICATION_THREAD_TYPES, AGENT_COMMUNICATION_TRANSFER_KINDS, AGENT_COMMUNICATION_TRANSFER_LIFECYCLE_STATES, AGENT_COMMUNICATION_TRANSFER_MODES, AGENT_COMMUNICATION_TRANSFER_RECEIPT_TYPES } from './constants/agent-communications.js';
3
3
  import { AI_ENGINE_CLIENT_VERSION, DEFAULT_TIMEOUT_MS } from './constants/client.js';
4
4
  import { LOGA_CONTRACT, LOGA_INTERACTION_CONTRACT, LOGA_NAVIGATION_CONTRACT, LOGA_PROJECTION_WORKFLOW } from './constants/loga.js';
@@ -18,6 +18,7 @@ import { createNotesLabDomain } from './domains/notes-lab.js';
18
18
  import { createPortfolioDomain } from './domains/portfolio.js';
19
19
  import { createProjectReportsDomain } from './domains/project-reports.js';
20
20
  import { createProjectResumeDomain } from './domains/project-resume.js';
21
+ import { createGovernedImplementationDomain } from './domains/governed-implementation.js';
21
22
  import { createProjectionsDomain } from './domains/projections.js';
22
23
  import { createReportsDomain } from './domains/reports.js';
23
24
  import { createRoadmapReportsDomain } from './domains/roadmap-reports.js';
@@ -43,6 +44,17 @@ import { createSkillGovernanceDomain } from './domains/skill-governance.js';
43
44
  import { createSkillsDomain } from './domains/skills.js';
44
45
  import { createSearchContactsDomain } from './domains/search-contacts.js';
45
46
  import { createAgentCommunicationsFacade, createCollaborationFacade } from './compat/facades.js';
47
+ import { createClaimsDomain } from './domains/claims.js';
48
+ import { createSessionGovernanceDomain } from './domains/session-governance.js';
49
+ import { createContextSessionsDomain } from './domains/context-sessions.js';
50
+ import { createContextOrientationDomain } from './domains/context-orientation.js';
51
+ import { createCommitGovernanceDomain } from './domains/commit-governance.js';
52
+ import { createExecutionEligibilityDomain } from './domains/execution-eligibility.js';
53
+ import { createToolBindingApprovalsDomain } from './domains/tool-binding-approvals.js';
54
+ import { createVerifiedMutationsDomain } from './domains/verified-mutations.js';
55
+ import { createWorkflowTurnsDomain } from './domains/workflow-turns.js';
56
+ import { createChartersDomain } from './domains/charters.js';
57
+ import { createWorkStartDomain } from './domains/work-start.js';
46
58
  import { createCollaborationDomain } from './domains/collaboration.js';
47
59
  import { createMessageWatchDomain } from './domains/message-watch.js';
48
60
  import { createPingPongDomain } from './domains/ping-pong.js';
@@ -55,8 +67,6 @@ import { createWorkflowsDomain } from './domains/workflows.js';
55
67
  import { createWarehouseDomain } from './domains/warehouse.js';
56
68
  import { buildHeaders, requestBinary, requestJson, requestLogaProjection, requestText, resolveAccessToken } from './transport/index.js';
57
69
  import { normalizeEnum, trimTrailingSlash } from './utils/text.js';
58
- import { normalizeMetadataTaskBinding, normalizeTaskBindingPolicy } from './utils/task-binding.js';
59
- import { executeVerifiedMutation } from './utils/verified-mutations.js';
60
70
 
61
71
  function normalizeThreadType(value) {
62
72
  return normalizeEnum(value, AGENT_COMMUNICATION_THREAD_TYPES, 'coordination', 'thread_type', {
@@ -234,58 +244,6 @@ function isPlainObject(value) {
234
244
  return value !== null && typeof value === 'object' && !Array.isArray(value);
235
245
  }
236
246
 
237
- function isActiveBinding(binding) {
238
- return isPlainObject(binding) && (
239
- binding.is_active === true ||
240
- binding.is_active === 1 ||
241
- binding.is_active === 'true' ||
242
- binding.is_active === 'True'
243
- );
244
- }
245
-
246
- function activeToolKeysFromRegistry(registry) {
247
- const bindings = Array.isArray(registry?.bindings) ? registry.bindings : [];
248
- const seen = new Set();
249
- const keys = [];
250
- for (const binding of bindings) {
251
- if (!isActiveBinding(binding)) continue;
252
- const key = cleanText(binding.tool_key);
253
- if (!key || seen.has(key)) continue;
254
- seen.add(key);
255
- keys.push(key);
256
- }
257
- return keys;
258
- }
259
-
260
- function reminderTokens(reminders) {
261
- const tokens = [];
262
- for (const reminder of Array.isArray(reminders) ? reminders : []) {
263
- if (!isPlainObject(reminder)) continue;
264
- for (const value of [reminder.reminder_key, reminder.reminder_id]) {
265
- const token = cleanText(value);
266
- if (token && !tokens.includes(token)) tokens.push(token);
267
- }
268
- }
269
- return tokens;
270
- }
271
-
272
- function contextSessionIdFromInput(input) {
273
- if (isPlainObject(input)) {
274
- return cleanText(input.contextSessionId)
275
- || cleanText(input.context_session_id)
276
- || cleanText(input.context_session?.context_session_id)
277
- || cleanText(input.claim?.context_session_id);
278
- }
279
- return cleanText(input);
280
- }
281
-
282
- function buildEligibilityError(message, details = {}) {
283
- const error = new Error(message);
284
- error.code = 'EXECUTION_ELIGIBILITY_FAILED';
285
- error.details = details;
286
- return error;
287
- }
288
-
289
247
  export class AIEngineClient {
290
248
  constructor({ baseUrl, accessToken, tokenProvider, apiKey, clientId, actorId, agentSessionId, fetchImpl, timeoutMs } = {}) {
291
249
  if (!baseUrl) throw new Error('baseUrl is required.');
@@ -314,6 +272,18 @@ export class AIEngineClient {
314
272
  this.projectChartering = createProjectCharteringDomain(this);
315
273
  this.projectReports = createProjectReportsDomain(this);
316
274
  this.projectResume = createProjectResumeDomain(this);
275
+ this.claims = createClaimsDomain(this);
276
+ this.sessionGovernance = createSessionGovernanceDomain(this);
277
+ this.executionEligibility = createExecutionEligibilityDomain(this);
278
+ this.toolBindingApprovals = createToolBindingApprovalsDomain(this);
279
+ this.workflowTurns = createWorkflowTurnsDomain(this);
280
+ this.contextSessions = createContextSessionsDomain(this);
281
+ this.contextOrientation = createContextOrientationDomain(this);
282
+ this.commitGovernance = createCommitGovernanceDomain(this);
283
+ this.verifiedMutations = createVerifiedMutationsDomain(this);
284
+ this.charters = createChartersDomain(this);
285
+ this.workStart = createWorkStartDomain(this);
286
+ this.governedImplementation = createGovernedImplementationDomain(this);
317
287
  this.roadmaps = createRoadmapsDomain(this);
318
288
  this.roadmapReports = createRoadmapReportsDomain(this);
319
289
  this.implementationPackets = createImplementationPacketsDomain(this);
@@ -375,251 +345,6 @@ export class AIEngineClient {
375
345
 
376
346
  // ─── Health ────────────────────────────────────────────────────────────────
377
347
 
378
- async ping() {
379
- const [health, workflow] = await Promise.all([
380
- this._request('/healthz'),
381
- this.currentWorkflowStatus(),
382
- ]);
383
- return {
384
- status: health.status || 'ok',
385
- workflow_name: workflow?.summary?.workflow_name || null,
386
- run_status: workflow?.summary?.run_status || null,
387
- base_url: this.baseUrl,
388
- };
389
- }
390
-
391
- // ─── Operator Status ───────────────────────────────────────────────────────
392
-
393
- async currentWorkflowStatus() {
394
- return this._request('/api/operator/current-workflow-status');
395
- }
396
-
397
- async currentArchitectureIntegrityStatus() {
398
- return this._request('/api/operator/current-architecture-integrity-status');
399
- }
400
-
401
- async currentSecurityGovernanceStatus({ environment, topN } = {}) {
402
- return this._request('/api/operator/current-security-governance-status', {
403
- query: { environment, top_n: topN },
404
- });
405
- }
406
-
407
- async getExecutionTelemetryCurrent() {
408
- return this._request('/api/operator/execution-telemetry/current');
409
- }
410
-
411
- async listExecutionProcessRuns({ limit, artifactKind, status, since } = {}) {
412
- return this._request('/api/operator/execution-telemetry/process-runs', {
413
- query: { limit, artifact_kind: artifactKind, status, since },
414
- });
415
- }
416
-
417
- async getExecutionProcessRun(processRunId) {
418
- return this._request(`/api/operator/execution-telemetry/process-runs/${processRunId}`);
419
- }
420
-
421
- async getGeneratedExecutionUsability({ artifactPath, limit } = {}) {
422
- return this._request('/api/operator/generated-execution-usability', {
423
- query: { artifact_path: artifactPath, limit },
424
- });
425
- }
426
-
427
- async getLogaGeneratedExecutionUsabilityProjection({ artifactPath, limit } = {}) {
428
- return this._requestLogaProjection('/api/loga/ai-engine/generated-execution-usability', {
429
- query: { artifact_path: artifactPath, limit },
430
- });
431
- }
432
-
433
- async getAntiPatternRules() {
434
- return this._request('/api/governance/anti-pattern-rules');
435
- }
436
-
437
- async currentCodebaseShapeStatus() {
438
- return this._request('/api/operator/current-codebase-shape-status');
439
- }
440
-
441
- async getLatestMemoryProjection() {
442
- return this._request('/api/v1/latest-memory-projection');
443
- }
444
-
445
- // ─── Data Access Gateway ──────────────────────────────────────────────────
446
-
447
- async query({
448
- surface,
449
- contractKey,
450
- parameters = {},
451
- fields = [],
452
- fieldAllowlist = [],
453
- actorScopes = [],
454
- requiredScopes = [],
455
- shape = 'json',
456
- requestedBy,
457
- } = {}) {
458
- const normalizedSurface = cleanText(surface) || cleanText(contractKey);
459
- if (!normalizedSurface) {
460
- throw new Error('surface is required.');
461
- }
462
- const normalizedShape = cleanText(shape) || 'json';
463
- if (!['json', 'table', 'cards', 'markdown'].includes(normalizedShape)) {
464
- throw new Error('shape must be one of json, table, cards, or markdown.');
465
- }
466
- const normalizedFields = cleanList(fields);
467
- const normalizedAllowlist = cleanList(fieldAllowlist);
468
- const disallowedFields = normalizedFields.filter((field) => !normalizedAllowlist.includes(field));
469
- if (normalizedAllowlist.length > 0 && disallowedFields.length > 0) {
470
- throw new Error(`Requested fields are not allowed: ${disallowedFields.join(', ')}.`);
471
- }
472
- const normalizedActorScopes = cleanList(actorScopes);
473
- const normalizedRequiredScopes = cleanList(requiredScopes);
474
- const missingScopes = normalizedRequiredScopes.filter((scope) => !normalizedActorScopes.includes(scope));
475
- if (missingScopes.length > 0) {
476
- throw new Error(`Missing required scopes: ${missingScopes.join(', ')}.`);
477
- }
478
- return this._request('/api/gateway/query', {
479
- method: 'POST',
480
- body: {
481
- surface: normalizedSurface,
482
- parameters: isPlainObject(parameters) ? parameters : {},
483
- fields: normalizedFields,
484
- field_allowlist: normalizedAllowlist,
485
- actor_scopes: normalizedActorScopes,
486
- required_scopes: normalizedRequiredScopes,
487
- shape: normalizedShape,
488
- requested_by: cleanText(requestedBy),
489
- },
490
- });
491
- }
492
-
493
- async runReportDefinition({ reportKey, definition = {}, requestedBy } = {}) {
494
- return this.reports.run({ reportKey, definition, requestedBy });
495
- }
496
-
497
- async renderProjection({ projectionType, viewContract = {}, requestedBy } = {}) {
498
- const normalizedProjectionType = cleanText(projectionType);
499
- if (!normalizedProjectionType) {
500
- throw new Error('projectionType is required.');
501
- }
502
- return this._request('/api/gateway/projections/render', {
503
- method: 'POST',
504
- body: {
505
- projection_type: normalizedProjectionType,
506
- view_contract: isPlainObject(viewContract) ? viewContract : {},
507
- requested_by: cleanText(requestedBy),
508
- },
509
- });
510
- }
511
-
512
- async submitActionIntent({ action, target = {}, payload = {}, requiredScope, requestedBy } = {}) {
513
- const normalizedAction = cleanText(action);
514
- if (!normalizedAction) {
515
- throw new Error('action is required.');
516
- }
517
- return this._request('/api/gateway/actions/submit', {
518
- method: 'POST',
519
- body: {
520
- action: normalizedAction,
521
- target: isPlainObject(target) ? target : {},
522
- payload: isPlainObject(payload) ? payload : {},
523
- required_scope: cleanText(requiredScope) || 'ai-engine.write',
524
- requested_by: cleanText(requestedBy),
525
- },
526
- });
527
- }
528
-
529
- async getCommunicationCapabilities() {
530
- return this._request('/api/agent-communications/capabilities');
531
- }
532
-
533
- async getCollaborationCapabilities() {
534
- return this._request('/api/agent-communications/collaboration-capabilities');
535
- }
536
-
537
- async getDeploymentCapabilities() {
538
- return this._request('/api/agent-communications/deployment-capabilities');
539
- }
540
-
541
- async checkCoordinationPingPongPreflight({
542
- packageVersion,
543
- } = {}) {
544
- return this.pingPong.checkCoordinationPingPongPreflight({ packageVersion });
545
- }
546
-
547
- async listCommunicationChannels(request = {}) {
548
- return this.transferChannels.listCommunicationChannels(request);
549
- }
550
-
551
- async listOpenCommunicationChannels(request = {}) {
552
- return this.transferChannels.listOpenCommunicationChannels(request);
553
- }
554
-
555
- async getCommunicationChannelStatus(request = {}) {
556
- return this.transferChannels.getCommunicationChannelStatus(request);
557
- }
558
-
559
- async getCommunicationChannelParticipants(request = {}) {
560
- return this.transferChannels.getCommunicationChannelParticipants(request);
561
- }
562
-
563
- async getPresenceBoard(request = {}) {
564
- return this.presence.getPresenceBoard(request);
565
- }
566
-
567
- async getChannelPresence(request = {}) {
568
- return this.presence.getChannelPresence(request);
569
- }
570
-
571
- async markParticipantOnline(request = {}) {
572
- return this.presence.markParticipantOnline(request);
573
- }
574
-
575
- async markParticipantOffline(request = {}) {
576
- return this.presence.markParticipantOffline(request);
577
- }
578
-
579
- async reviewCollaborationProposal(request = {}) {
580
- return this.collaborationDomain.reviewCollaborationProposal(request);
581
- }
582
-
583
- async connectToTransferChannel(request = {}) {
584
- return this.transferChannels.connectToTransferChannel(request);
585
- }
586
-
587
- async openAgentChannel(request = {}) {
588
- return this.transferChannels.openAgentChannel(request);
589
- }
590
-
591
- async openTransferChannel(request = {}) {
592
- return this.transferChannels.openTransferChannel(request);
593
- }
594
-
595
- async joinTransferChannel(request = {}) {
596
- return this.transferChannels.joinTransferChannel(request);
597
- }
598
-
599
- async resumeTransferChannel(request = {}) {
600
- return this.transferChannels.resumeTransferChannel(request);
601
- }
602
-
603
- async postCollaborationHeartbeat(request = {}) {
604
- return this.transferChannels.postAgentHeartbeat(request);
605
- }
606
-
607
- async replyToTransferChannel(request = {}) {
608
- return this.transferChannels.replyToTransferChannel(request);
609
- }
610
-
611
- async startMessageWatch(request = {}) {
612
- return this.messageWatch.startMessageWatch(request);
613
- }
614
-
615
- async acknowledgeExpectedMessage(request = {}) {
616
- return this.messageWatch.acknowledgeExpectedMessage(request);
617
- }
618
-
619
- async closeTransferChannel(request = {}) {
620
- return this.transferChannels.closeTransferChannel(request);
621
- }
622
-
623
348
  async startAgentConnection({
624
349
  workflowRunId,
625
350
  workflow_run_id,
@@ -2966,2128 +2691,316 @@ export class AIEngineClient {
2966
2691
  });
2967
2692
  }
2968
2693
 
2969
- async currentProjectStatus({ projectId } = {}) {
2970
- return this._request('/api/operator/current-project-status', {
2971
- query: { project_id: projectId },
2972
- });
2973
- }
2694
+ async getPortfolioClosureReadiness({
2695
+ projectLimit = 25,
2696
+ includeInactive = false,
2697
+ includeLogaPortfolioProjection = false,
2698
+ includeLogaRoadmapProjections = false,
2699
+ } = {}) {
2700
+ const portfolioBundle = await this._request('/api/operator/portfolio/bundle');
2701
+ const projectListPayload = await this.projects.listProjects({ limit: projectLimit, includeInactive });
2702
+
2703
+ const bundleProjects = Array.isArray(portfolioBundle?.projects)
2704
+ ? portfolioBundle.projects.filter((project) => isPlainObject(project))
2705
+ : [];
2706
+ const listedProjects = Array.isArray(projectListPayload?.projects)
2707
+ ? projectListPayload.projects.filter((project) => isPlainObject(project))
2708
+ : Array.isArray(projectListPayload)
2709
+ ? projectListPayload.filter((project) => isPlainObject(project))
2710
+ : [];
2711
+ const activeProjects = listedProjects.length > 0 ? listedProjects : bundleProjects;
2712
+ const logaPortfolioProjection = includeLogaPortfolioProjection
2713
+ ? await this.getLogaProjectPortfolioProjection()
2714
+ : null;
2715
+ const logaRoadmapProjections = {};
2974
2716
 
2975
- async createDatabaseBackup({ databaseName, outputName, noWait } = {}) {
2976
- return this._request('/api/operator/database/backups', {
2977
- method: 'POST',
2978
- body: {
2979
- database_name: databaseName,
2980
- output_name: outputName,
2981
- no_wait: noWait,
2982
- },
2983
- });
2717
+ const projectReadiness = [];
2718
+ for (const project of activeProjects) {
2719
+ const projectId = cleanText(project.project_id) || cleanText(project.projectId);
2720
+ if (!projectId) {
2721
+ continue;
2722
+ }
2723
+
2724
+ const roadmapSummaryPayload = await this.getProjectRoadmapSummary(projectId);
2725
+ const roadmapSummary = isPlainObject(roadmapSummaryPayload?.summary) ? roadmapSummaryPayload.summary : {};
2726
+ const activeItemPayload = await this.getProjectRoadmapActiveItem(projectId);
2727
+ const activeItem = isPlainObject(activeItemPayload?.active_item)
2728
+ ? activeItemPayload.active_item
2729
+ : isPlainObject(activeItemPayload)
2730
+ ? activeItemPayload
2731
+ : {};
2732
+ const openTasksPayload = await this.listProjectOpenTasks(projectId);
2733
+ const openTasks = Array.isArray(openTasksPayload?.tasks)
2734
+ ? openTasksPayload.tasks.filter((task) => isPlainObject(task))
2735
+ : Array.isArray(openTasksPayload)
2736
+ ? openTasksPayload.filter((task) => isPlainObject(task))
2737
+ : [];
2738
+
2739
+ const activeItemStatus = cleanText(activeItem.item_status) || cleanText(activeItem.status);
2740
+ const completionPercentage = Number(
2741
+ roadmapSummary.completion_percentage
2742
+ ?? roadmapSummary.completion_pct
2743
+ ?? roadmapSummary.progress_percentage
2744
+ ?? 0,
2745
+ );
2746
+ const totalItems = Number(
2747
+ roadmapSummary.total_items
2748
+ ?? roadmapSummary.item_count
2749
+ ?? roadmapSummary.total_count
2750
+ ?? 0,
2751
+ );
2752
+ const openItems = Number(
2753
+ roadmapSummary.open_items
2754
+ ?? roadmapSummary.open_item_count
2755
+ ?? roadmapSummary.remaining_items
2756
+ ?? openTasks.length,
2757
+ );
2758
+ const terminalStatuses = new Set(['accepted', 'verified', 'done', 'completed', 'closed']);
2759
+ const activeItemReady = !activeItemStatus || terminalStatuses.has(activeItemStatus.toLowerCase());
2760
+ const projectReady = openItems === 0 && openTasks.length === 0 && activeItemReady && completionPercentage >= 100;
2761
+ const blockingReason = projectReady
2762
+ ? null
2763
+ : [
2764
+ openTasks.length > 0 ? `${openTasks.length} open task(s) remain` : null,
2765
+ openItems > 0 ? `${openItems} roadmap item(s) remain open` : null,
2766
+ !activeItemReady ? `active item status is ${activeItemStatus || 'missing'}` : null,
2767
+ completionPercentage < 100 ? `completion is ${completionPercentage.toFixed(1)}%` : null,
2768
+ ].filter(Boolean).join('; ') || 'portfolio closure readiness is not satisfied';
2769
+
2770
+ const roadmapCompletion = {
2771
+ completion_percentage: completionPercentage,
2772
+ total_items: totalItems,
2773
+ open_items: openItems,
2774
+ completed_items: Math.max(totalItems - openItems, 0),
2775
+ };
2776
+ const projectReadinessEntry = {
2777
+ project: {
2778
+ project_id: projectId,
2779
+ project_name: cleanText(project.project_name) || cleanText(project.projectName) || null,
2780
+ project_slug: cleanText(project.project_slug) || cleanText(project.projectSlug) || null,
2781
+ process_status: cleanText(project.process_status) || cleanText(project.processStatus) || null,
2782
+ charter_status: cleanText(project.charter_status) || cleanText(project.charterStatus) || null,
2783
+ },
2784
+ roadmap_completion: roadmapCompletion,
2785
+ active_item: activeItem,
2786
+ open_task_count: openTasks.length,
2787
+ closure_ready: projectReady,
2788
+ blocking_reason: blockingReason,
2789
+ };
2790
+ if (includeLogaRoadmapProjections) {
2791
+ projectReadinessEntry.loga_roadmap_projection = await this.getLogaProjectRoadmapProjection(projectId);
2792
+ logaRoadmapProjections[projectId] = projectReadinessEntry.loga_roadmap_projection;
2793
+ }
2794
+ projectReadiness.push(projectReadinessEntry);
2795
+ }
2796
+
2797
+ const closureReady = projectReadiness.length === 0 || projectReadiness.every((project) => project.closure_ready === true);
2798
+ const blockingProject = projectReadiness.find((project) => project.closure_ready !== true);
2799
+
2800
+ return {
2801
+ portfolio_summary: isPlainObject(portfolioBundle?.summary) ? portfolioBundle.summary : {},
2802
+ portfolio_bundle: portfolioBundle,
2803
+ active_projects: projectReadiness,
2804
+ closure_readiness: closureReady,
2805
+ blocking_reason: closureReady ? null : `${cleanText(blockingProject?.project?.project_name) || cleanText(blockingProject?.project?.project_id) || 'project'}: ${blockingProject?.blocking_reason || 'closure readiness is not satisfied'}`,
2806
+ blocking_project_id: closureReady ? null : cleanText(blockingProject?.project?.project_id),
2807
+ blocking_project_name: closureReady ? null : cleanText(blockingProject?.project?.project_name),
2808
+ project_count: projectReadiness.length,
2809
+ open_task_count: projectReadiness.reduce((total, project) => total + Number(project.open_task_count || 0), 0),
2810
+ loga_portfolio_projection: logaPortfolioProjection,
2811
+ loga_roadmap_projections: includeLogaRoadmapProjections ? logaRoadmapProjections : null,
2812
+ };
2984
2813
  }
2985
2814
 
2986
- async listDatabaseBackups({ prefix, limit } = {}) {
2987
- return this._request('/api/operator/database/backups', {
2815
+ async getPortfolioStatus({
2816
+ projectId,
2817
+ project_id,
2818
+ } = {}) {
2819
+ return this._request('/api/operator/portfolio/status', {
2988
2820
  query: {
2989
- prefix,
2990
- limit,
2821
+ project_id: cleanText(project_id) || cleanText(projectId),
2991
2822
  },
2992
2823
  });
2993
2824
  }
2994
2825
 
2995
- async getDatabaseBackup({ backupId } = {}) {
2996
- return this._request(`/api/operator/database/backups/${encodeURIComponent(backupId)}`);
2826
+ async getPortfolioBundle() {
2827
+ return this._request('/api/operator/portfolio/bundle');
2997
2828
  }
2998
2829
 
2999
- async listDatabaseBackupOperations({ databaseName, operationFilter, limit } = {}) {
3000
- return this._request('/api/operator/database/backups/operations', {
3001
- query: {
3002
- database_name: databaseName,
3003
- operation_filter: operationFilter,
3004
- limit,
3005
- },
3006
- });
2830
+ async getExternalProjectStatus(projectId) {
2831
+ return this._request(`/api/v1/projects/${projectId}/status`);
3007
2832
  }
3008
2833
 
3009
- async runAzureSqlBacpacBackup({
3010
- databaseName,
3011
- storageAccount,
3012
- container,
3013
- resourceGroup,
3014
- serverName,
3015
- outputName,
3016
- adminUser,
3017
- adminPassword,
3018
- subscription,
3019
- storageKey,
3020
- skipContainerCreate,
3021
- noWait,
3022
- } = {}) {
3023
- return this._request('/api/operator/database/backups/azure-sql-bacpac', {
3024
- method: 'POST',
3025
- body: {
3026
- database_name: databaseName,
3027
- storage_account: storageAccount,
3028
- container,
3029
- resource_group: resourceGroup,
3030
- server_name: serverName,
3031
- output_name: outputName,
3032
- admin_user: adminUser,
3033
- admin_password: adminPassword,
3034
- subscription,
3035
- storage_key: storageKey,
3036
- skip_container_create: skipContainerCreate,
3037
- no_wait: noWait,
3038
- },
3039
- });
2834
+ async getExternalProjectRoadmapSummary(projectId) {
2835
+ return this._request(`/api/v1/projects/${projectId}/implementation-roadmap/summary`);
3040
2836
  }
3041
2837
 
3042
- async listAzureSqlBacpacBackups({
3043
- storageAccount,
3044
- container,
3045
- resourceGroup,
3046
- serverName,
3047
- subscription,
3048
- storageKey,
3049
- prefix,
3050
- limit,
3051
- } = {}) {
3052
- return this._request('/api/operator/database/backups/azure-sql-bacpac', {
3053
- query: {
3054
- storage_account: storageAccount,
3055
- container,
3056
- resource_group: resourceGroup,
3057
- server_name: serverName,
3058
- subscription,
3059
- storage_key: storageKey,
3060
- prefix,
3061
- limit,
3062
- },
3063
- });
2838
+ async getExternalProjectRoadmapActiveItem(projectId) {
2839
+ return this._request(`/api/v1/projects/${projectId}/implementation-roadmap/active-item`);
3064
2840
  }
3065
2841
 
3066
- async listAzureSqlBacpacBackupOperations({
3067
- databaseName,
3068
- resourceGroup,
3069
- serverName,
3070
- subscription,
3071
- operationFilter,
3072
- limit,
3073
- } = {}) {
3074
- return this._request('/api/operator/database/backups/azure-sql-bacpac/operations', {
3075
- query: {
3076
- database_name: databaseName,
3077
- resource_group: resourceGroup,
3078
- server_name: serverName,
3079
- subscription,
3080
- operation_filter: operationFilter,
3081
- limit,
3082
- },
3083
- });
2842
+ async listExternalProjectOpenTasks(projectId) {
2843
+ return this._request(`/api/v1/projects/${projectId}/open-tasks`);
3084
2844
  }
3085
2845
 
3086
- async getDashboard() {
3087
- return this._request('/api/dashboard');
2846
+ async getExternalProjectStatusBundle(projectId) {
2847
+ return this._request(`/api/v1/projects/${projectId}/status-bundle`);
3088
2848
  }
3089
2849
 
3090
- async startSessionGovernance({
3091
- intent,
3092
- objective,
3093
- allowedScopes,
3094
- allowedMutationSurfaces,
3095
- requiredToolKeys,
3096
- sessionKey,
3097
- workflowRunId,
3098
- workflowId,
3099
- workflowSlug,
3100
- governedScope,
3101
- successCriteria,
3102
- disallowedSurfaces,
3103
- ...rest
3104
- } = {}) {
3105
- return this._request('/api/v1/session-governance/startup', {
2850
+ async createExternalAudioRender({ text, voice, model, speed, file } = {}) {
2851
+ if (file) {
2852
+ const form = new FormData();
2853
+ form.append('file', file);
2854
+ if (voice !== undefined) form.append('voice', String(voice));
2855
+ if (model !== undefined) form.append('model', String(model));
2856
+ if (speed !== undefined) form.append('speed', String(speed));
2857
+ return this._request('/api/v1/audio-renders', { method: 'POST', body: form });
2858
+ }
2859
+ return this._request('/api/v1/audio-renders', {
3106
2860
  method: 'POST',
3107
- body: {
3108
- ...rest,
3109
- objective: objective ?? intent,
3110
- allowed_mutation_surfaces: allowedMutationSurfaces ?? allowedScopes,
3111
- required_tool_keys: requiredToolKeys,
3112
- session_key: sessionKey,
3113
- workflow_run_id: workflowRunId,
3114
- workflow_id: workflowId,
3115
- workflow_slug: workflowSlug,
3116
- governed_scope: governedScope,
3117
- success_criteria: successCriteria,
3118
- disallowed_surfaces: disallowedSurfaces,
3119
- },
2861
+ body: { text, voice, model, speed },
3120
2862
  });
3121
2863
  }
3122
2864
 
3123
- async startReviewGovernance({
3124
- intent,
3125
- objective,
3126
- readScope,
3127
- requiredToolKeys,
3128
- sessionKey,
3129
- workflowRunId,
3130
- workflowId,
3131
- workflowSlug,
3132
- turnPersisted,
3133
- ...rest
3134
- } = {}) {
3135
- return this._request('/api/v1/session-governance/review/startup', {
3136
- method: 'POST',
3137
- body: {
3138
- ...rest,
3139
- intent: intent ?? 'review code',
3140
- objective: objective ?? intent,
3141
- read_scope: readScope,
3142
- required_tool_keys: requiredToolKeys,
3143
- session_key: sessionKey,
3144
- workflow_run_id: workflowRunId,
3145
- workflow_id: workflowId,
3146
- workflow_slug: workflowSlug ?? 'code-review/read-only',
3147
- turn_persisted: turnPersisted,
3148
- },
3149
- });
2865
+ async getExternalAudioRender(audioRenderRunId) {
2866
+ return this._request(`/api/v1/audio-renders/${audioRenderRunId}`);
3150
2867
  }
3151
2868
 
3152
- async startWork(body = {}) {
3153
- return this._request('/api/work/start', { method: 'POST', body });
2869
+ async downloadExternalAudioRender(audioRenderRunId) {
2870
+ return this._requestBinary(`/api/v1/audio-renders/${audioRenderRunId}/download`);
3154
2871
  }
3155
2872
 
3156
- async startClaimedWork({
3157
- claimName,
3158
- actorId,
3159
- intentId,
3160
- declaredScopeFiles,
3161
- allowedMutationSurfaces,
3162
- runtimeSessionId,
3163
- executionPurpose,
3164
- successCriteria,
3165
- mutationAllowed,
3166
- metadata,
3167
- ...rest
3168
- } = {}) {
3169
- return this._request('/api/governance/claims/start-claimed-work', {
3170
- method: 'POST',
3171
- body: {
3172
- ...rest,
3173
- claim_name: claimName,
3174
- actor_id: actorId,
3175
- intent_id: intentId,
3176
- declared_scope_files: declaredScopeFiles,
3177
- allowed_mutation_surfaces: allowedMutationSurfaces,
3178
- runtime_session_id: runtimeSessionId,
3179
- execution_purpose: executionPurpose,
3180
- success_criteria: successCriteria,
3181
- mutation_allowed: mutationAllowed,
3182
- metadata: normalizeMetadataTaskBinding(metadata),
3183
- },
3184
- });
2873
+ async listExternalWorkflowRunArtifacts(workflowRunId) {
2874
+ return this._request(`/api/v1/runs/${workflowRunId}/artifacts`);
3185
2875
  }
3186
2876
 
3187
- async claimWorkItem(body = {}) {
3188
- const normalizedBody = isPlainObject(body)
3189
- ? {
3190
- ...body,
3191
- ...(isPlainObject(body.task_binding)
3192
- ? { task_binding: normalizeTaskBindingPolicy(body.task_binding) }
3193
- : {}),
3194
- metadata: normalizeMetadataTaskBinding(body.metadata),
3195
- }
3196
- : body;
3197
- return this._request('/api/governance/claims/claim-work-item', { method: 'POST', body: normalizedBody });
2877
+ async downloadExternalWorkflowRunArtifact(workflowRunId, artifactType) {
2878
+ return this._requestBinary(`/api/v1/runs/${workflowRunId}/artifacts/${artifactType}/download`);
3198
2879
  }
3199
2880
 
3200
- async bindClaimedWorkItem({
3201
- claimId,
3202
- contextSessionId,
3203
- workflowRunId,
3204
- agentSessionId,
3205
- claimedItemId,
3206
- claimedItemKey,
3207
- claimName,
3208
- actorId,
3209
- workflowId,
3210
- workflowSlug,
3211
- requiredToolKeys,
3212
- declaredScopeFiles,
3213
- allowedMutationSurfaces,
3214
- successCriteria,
3215
- acknowledgedReminders,
3216
- intentConfirmation,
3217
- actorSignature,
3218
- autoSignoff = true,
3219
- metadata,
3220
- } = {}) {
3221
- const normalizedContextSessionId = contextSessionIdFromInput({
3222
- contextSessionId,
3223
- context_session_id: contextSessionId,
3224
- claim: { context_session_id: contextSessionId },
3225
- });
3226
- const normalizedClaimId = cleanText(claimId);
3227
- const normalizedWorkflowRunId = cleanText(workflowRunId);
3228
- const normalizedAgentSessionId = cleanText(agentSessionId);
3229
- const normalizedClaimedItemId = cleanText(claimedItemId);
3230
- const normalizedClaimedItemKey = cleanText(claimedItemKey);
3231
- const normalizedClaimedItemRef = normalizedClaimedItemId || normalizedClaimedItemKey;
3232
- if (!normalizedContextSessionId) throw new Error('contextSessionId is required.');
3233
- if (!normalizedWorkflowRunId) throw new Error('workflowRunId is required.');
3234
- if (!normalizedAgentSessionId) throw new Error('agentSessionId is required.');
3235
- if (!normalizedClaimedItemRef) throw new Error('claimedItemId or claimedItemKey is required.');
3236
-
3237
- const normalizedWorkflowId = cleanText(workflowId);
3238
- const normalizedWorkflowSlug = cleanText(workflowSlug);
3239
- let normalizedRequiredToolKeys = cleanList(requiredToolKeys);
3240
- let workflowRegistry = null;
3241
- if (normalizedRequiredToolKeys.length === 0 && (normalizedWorkflowId || normalizedWorkflowSlug)) {
3242
- workflowRegistry = await this.getWorkflowToolRegistry({
3243
- workflowId: normalizedWorkflowId,
3244
- workflowSlug: normalizedWorkflowSlug,
3245
- });
3246
- normalizedRequiredToolKeys = activeToolKeysFromRegistry(workflowRegistry);
3247
- }
2881
+ // ─── Core HTTP ─────────────────────────────────────────────────────────────
3248
2882
 
3249
- const lockClaimResult = await this.lockContextSessionClaim(normalizedContextSessionId);
3250
- const lockedContextSession = lockClaimResult?.context_session || lockClaimResult;
3251
- const lockedContextSessionId = contextSessionIdFromInput(lockedContextSession) || normalizedContextSessionId;
3252
-
3253
- const claimWorkItemResult = await this.claimWorkItem({
3254
- context_session_id: lockedContextSessionId,
3255
- workflow_run_id: normalizedWorkflowRunId,
3256
- agent_session_id: normalizedAgentSessionId,
3257
- claimed_item_id: normalizedClaimedItemId,
3258
- claimed_item_key: normalizedClaimedItemKey,
3259
- claim_name: claimName,
3260
- actor_id: actorId,
3261
- workflow_id: normalizedWorkflowId,
3262
- workflow_slug: normalizedWorkflowSlug,
3263
- required_tool_keys: normalizedRequiredToolKeys,
3264
- declared_scope_files: cleanList(declaredScopeFiles).length > 0
3265
- ? cleanList(declaredScopeFiles)
3266
- : [normalizedClaimedItemRef],
3267
- allowed_mutation_surfaces: cleanList(allowedMutationSurfaces).length > 0
3268
- ? cleanList(allowedMutationSurfaces)
3269
- : ['project_roadmap_task'],
3270
- success_criteria: successCriteria,
3271
- metadata,
3272
- });
2883
+ async _resolveAccessToken() {
2884
+ return resolveAccessToken(this);
2885
+ }
3273
2886
 
3274
- let signedClaim = null;
3275
- const resolvedClaimId = cleanText(claimWorkItemResult?.claim_id) || normalizedClaimId;
3276
- if (autoSignoff && resolvedClaimId) {
3277
- const claimEnvelope = isPlainObject(claimWorkItemResult?.claim) ? claimWorkItemResult.claim : claimWorkItemResult;
3278
- const reminders = cleanList(acknowledgedReminders).length > 0
3279
- ? cleanList(acknowledgedReminders)
3280
- : reminderTokens(claimEnvelope?.required_reminders);
3281
- if (reminders.length > 0) {
3282
- signedClaim = await this.signoffClaim(resolvedClaimId, {
3283
- acknowledged_reminders: reminders,
3284
- intent_confirmation: cleanText(intentConfirmation) || 'I confirm this governed execution intent and scope.',
3285
- actor_signature: cleanText(actorSignature) || cleanText(actorId) || this.actorId,
3286
- });
3287
- }
3288
- }
2887
+ async _buildHeaders({ headers, body, accept }) {
2888
+ return buildHeaders(this, { headers, body, accept });
2889
+ }
3289
2890
 
3290
- return {
3291
- claim_id: resolvedClaimId,
3292
- context_session_id: lockedContextSessionId,
3293
- workflow_run_id: normalizedWorkflowRunId,
3294
- agent_session_id: normalizedAgentSessionId,
3295
- required_tool_keys: normalizedRequiredToolKeys,
3296
- workflow_registry: workflowRegistry,
3297
- lock_claim_result: lockClaimResult,
3298
- claim_work_item_result: claimWorkItemResult,
3299
- signed_claim: signedClaim,
3300
- approved_tool_keys: cleanList(
3301
- signedClaim?.approved_tool_keys ||
3302
- signedClaim?.claim?.approved_tool_keys ||
3303
- claimWorkItemResult?.approved_tool_keys ||
3304
- claimWorkItemResult?.claim?.approved_tool_keys
3305
- ),
3306
- };
2891
+ async _assertExecutionEligibility(body = {}) {
2892
+ return this.executionEligibility._assertExecutionEligibility(body);
3307
2893
  }
3308
2894
 
3309
- async getClaim(claimId) {
3310
- if (!claimId) throw new Error('claimId is required.');
3311
- return this._request(`/api/governance/claims/${encodeURIComponent(claimId)}`);
2895
+ async _request(path, { method = 'GET', query, headers, body } = {}) {
2896
+ return requestJson(this, path, { method, query, headers, body });
3312
2897
  }
3313
2898
 
3314
- async claimIsValid(claimId) {
3315
- const claim = await this.getClaim(claimId);
3316
- return cleanText(claim?.status) === 'active';
2899
+ async _requestText(path, { method = 'GET', query, headers, body } = {}) {
2900
+ return requestText(this, path, { method, query, headers, body });
3317
2901
  }
3318
2902
 
3319
- async getExecutionEligibility(body = {}) {
3320
- return this._request('/api/governance/execution-eligibility', {
3321
- method: 'POST',
3322
- body: {
3323
- required_capabilities: GOVERNED_MUTATION_REQUIRED_CAPABILITIES,
3324
- verification_required: true,
3325
- ...body,
3326
- },
3327
- });
2903
+ async _requestLogaProjection(path, options = {}) {
2904
+ return requestLogaProjection(this, path, options);
3328
2905
  }
3329
2906
 
3330
- async signoffClaim(claimId, body = {}) {
3331
- if (!claimId) throw new Error('claimId is required.');
3332
- return this._request(`/api/governance/claims/${encodeURIComponent(claimId)}/signoff`, {
3333
- method: 'POST',
3334
- body,
3335
- });
2907
+ async _requestBinary(path, { method = 'GET', query, headers, body } = {}) {
2908
+ return requestBinary(this, path, { method, query, headers, body });
3336
2909
  }
2910
+ }
3337
2911
 
3338
- /**
3339
- * Promote a governance claim from `missing_promoted_surface` to
3340
- * `promoted_surface_bound` by binding required tool definitions to the
3341
- * workflow and recording a completed claim signoff.
3342
- *
3343
- * @param {object} params
3344
- * @param {string} params.claimId - UUID of the claim to unblock.
3345
- * @param {string} params.workflowId - UUID of the target workflow.
3346
- * @param {string} params.contextSessionId - Oriented context session UUID.
3347
- * @param {string} params.actorId - Caller identity for audit trail.
3348
- * @param {string[]} params.requiredToolKeys - Tool keys to bind.
3349
- * @param {string} [params.intentId] - Default: 'code_mutation'.
3350
- * @param {string} [params.bindingScope] - Default: 'required'.
3351
- * @param {string} [params.usageMode] - Default: 'manual'.
3352
- * @param {string} [params.operatorScope]
3353
- * @param {object} [params.allowedArgumentPolicy]
3354
- * @returns {Promise<object>} Promotion result envelope.
3355
- */
3356
- async promoteClaimSurface({
3357
- claimId,
3358
- workflowId,
3359
- contextSessionId,
3360
- actorId,
3361
- requiredToolKeys,
3362
- intentId,
3363
- bindingScope,
3364
- usageMode,
3365
- operatorScope,
3366
- allowedArgumentPolicy,
3367
- ...rest
3368
- } = {}) {
3369
- if (!claimId) throw new Error('claimId is required.');
3370
- if (!workflowId) throw new Error('workflowId is required.');
3371
- if (!contextSessionId) throw new Error('contextSessionId is required.');
3372
- if (!actorId) throw new Error('actorId is required.');
3373
- if (!Array.isArray(requiredToolKeys) || requiredToolKeys.length === 0) {
3374
- throw new Error('requiredToolKeys must be a non-empty array.');
3375
- }
3376
- return this._request('/api/governance/claims/promote-surface', {
3377
- method: 'POST',
3378
- body: {
3379
- ...rest,
3380
- claim_id: claimId,
3381
- workflow_id: workflowId,
3382
- context_session_id: contextSessionId,
3383
- actor_id: actorId,
3384
- required_tool_keys: requiredToolKeys,
3385
- intent_id: intentId,
3386
- binding_scope: bindingScope,
3387
- usage_mode: usageMode,
3388
- operator_scope: operatorScope,
3389
- allowed_argument_policy: allowedArgumentPolicy,
3390
- },
3391
- });
3392
- }
3393
-
3394
- /**
3395
- * Bootstrap/admin surface for creating a governed workflow-tool-binding
3396
- * approval lane request. This call cannot approve or execute bindings.
3397
- *
3398
- * @param {object} params
3399
- * @param {string} params.operatorActorType
3400
- * @param {string} params.requesterActor
3401
- * @param {string[]} params.requestedToolKeys
3402
- * @param {string} params.blockedReason
3403
- * @param {string} params.rollbackPlan
3404
- * @param {string} [params.requesterActorType]
3405
- * @param {string} [params.operatorActorId]
3406
- * @param {string} [params.targetWorkflowId]
3407
- * @param {string} [params.targetWorkflowRunId]
3408
- * @param {string[]} [params.relatedGapRecordIds]
3409
- * @param {string} [params.requestedBindingScope]
3410
- * @param {string} [params.riskClassification]
3411
- * @param {object} [params.metadata]
3412
- * @returns {Promise<object>}
3413
- */
3414
- async createWorkflowToolBindingApprovalLane({
3415
- operatorActorType,
3416
- requesterActor,
3417
- requestedToolKeys,
3418
- blockedReason,
3419
- rollbackPlan,
3420
- requesterActorType,
3421
- operatorActorId,
3422
- targetWorkflowId,
3423
- targetWorkflowRunId,
3424
- relatedGapRecordIds,
3425
- requestedBindingScope,
3426
- riskClassification,
3427
- metadata,
3428
- ...rest
3429
- } = {}) {
3430
- if (!operatorActorType) throw new Error('operatorActorType is required.');
3431
- if (!requesterActor) throw new Error('requesterActor is required.');
3432
- if (!Array.isArray(requestedToolKeys) || requestedToolKeys.length === 0) {
3433
- throw new Error('requestedToolKeys must be a non-empty array.');
3434
- }
3435
- if (!blockedReason) throw new Error('blockedReason is required.');
3436
- if (!rollbackPlan) throw new Error('rollbackPlan is required.');
3437
- return this._request('/api/governance/bootstrap/workflow-tool-binding-approval/create', {
3438
- method: 'POST',
3439
- body: {
3440
- ...rest,
3441
- operator_actor_type: operatorActorType,
3442
- requester_actor: requesterActor,
3443
- requested_tool_keys: requestedToolKeys,
3444
- blocked_reason: blockedReason,
3445
- rollback_plan: rollbackPlan,
3446
- requester_actor_type: requesterActorType,
3447
- operator_actor_id: operatorActorId,
3448
- target_workflow_id: targetWorkflowId,
3449
- target_workflow_run_id: targetWorkflowRunId,
3450
- related_gap_record_ids: relatedGapRecordIds,
3451
- requested_binding_scope: requestedBindingScope,
3452
- risk_classification: riskClassification,
3453
- metadata,
3454
- },
3455
- });
3456
- }
3457
-
3458
- async recordWorkflowToolBindingApprovalDecision(approvalRequestId, {
3459
- operatorActorType,
3460
- decision,
3461
- operatorActorId,
3462
- decisionNotes,
3463
- decisionConditions,
3464
- ...rest
3465
- } = {}) {
3466
- if (!approvalRequestId) throw new Error('approvalRequestId is required.');
3467
- if (!operatorActorType) throw new Error('operatorActorType is required.');
3468
- if (!decision) throw new Error('decision is required.');
3469
- return this._request(`/api/governance/bootstrap/workflow-tool-binding-approval/${encodeURIComponent(approvalRequestId)}/approval-decision`, {
3470
- method: 'POST',
3471
- body: {
3472
- ...rest,
3473
- operator_actor_type: operatorActorType,
3474
- operator_actor_id: operatorActorId,
3475
- decision,
3476
- decision_notes: decisionNotes,
3477
- decision_conditions: decisionConditions,
3478
- },
3479
- });
3480
- }
3481
-
3482
- async executeWorkflowToolBindingApprovalBinding(approvalRequestId, {
3483
- operatorActorType,
3484
- operatorActorId,
3485
- ...rest
3486
- } = {}) {
3487
- if (!approvalRequestId) throw new Error('approvalRequestId is required.');
3488
- if (!operatorActorType) throw new Error('operatorActorType is required.');
3489
- return this._request(`/api/governance/bootstrap/workflow-tool-binding-approval/${encodeURIComponent(approvalRequestId)}/binding-execution`, {
3490
- method: 'POST',
3491
- body: {
3492
- ...rest,
3493
- operator_actor_type: operatorActorType,
3494
- operator_actor_id: operatorActorId,
3495
- },
3496
- });
3497
- }
3498
-
3499
- async revalidateWorkflowToolBindingStartup(approvalRequestId, {
3500
- operatorActorType,
3501
- operatorActorId,
3502
- ...rest
3503
- } = {}) {
3504
- if (!approvalRequestId) throw new Error('approvalRequestId is required.');
3505
- if (!operatorActorType) throw new Error('operatorActorType is required.');
3506
- return this._request(`/api/governance/bootstrap/workflow-tool-binding-approval/${encodeURIComponent(approvalRequestId)}/startup-revalidation`, {
3507
- method: 'POST',
3508
- body: {
3509
- ...rest,
3510
- operator_actor_type: operatorActorType,
3511
- operator_actor_id: operatorActorId,
3512
- },
3513
- });
3514
- }
3515
-
3516
- async completeTurn(body = {}) {
3517
- return this._request('/api/turns/complete', { method: 'POST', body });
3518
- }
3519
-
3520
- async evaluateTurnCompliance(sessionId) {
3521
- return this._request(`/api/v1/session-governance/${encodeURIComponent(sessionId)}/compliance`);
3522
- }
3523
-
3524
- async blockIfNonCompliant(sessionId) {
3525
- return this._request(`/api/v1/session-governance/${encodeURIComponent(sessionId)}/block-if-non-compliant`, {
3526
- method: 'POST',
3527
- });
3528
- }
3529
-
3530
- async runCharter(body = {}) {
3531
- return this._request('/api/charters/run', { method: 'POST', body });
3532
- }
3533
-
3534
- async createProjectDelivery(body = {}) {
3535
- return this.projectChartering.createProjectDelivery(body);
3536
- }
3537
-
3538
- async approveProjectCharterIntent(projectId, body = {}) {
3539
- return this.projectChartering.approveProjectCharterIntent(projectId, body);
3540
- }
3541
-
3542
- async approveImplementationRoadmap(projectId, body = {}) {
3543
- return this.projectChartering.approveImplementationRoadmap(projectId, body);
3544
- }
3545
-
3546
- async runProjectCharter(projectId, body = {}) {
3547
- return this.projectChartering.runProjectCharter(projectId, body);
3548
- }
3549
-
3550
- async beginImplementationRoadmap(projectId, body = {}) {
3551
- return this.projectChartering.beginImplementationRoadmap(projectId, body);
3552
- }
3553
-
3554
- async routeImplementationItem(implementationItemId, body = {}) {
3555
- return this.projectChartering.routeImplementationItem(implementationItemId, body);
3556
- }
3557
-
3558
- async persistAssistantTurn(body) {
3559
- return this._request('/api/v1/assistant-turns', { method: 'POST', body });
3560
- }
3561
-
3562
- async getExternalProjectStatus(projectId) {
3563
- return this._request(`/api/v1/projects/${projectId}/status`);
3564
- }
3565
-
3566
- async getExternalProjectRoadmapSummary(projectId) {
3567
- return this._request(`/api/v1/projects/${projectId}/implementation-roadmap/summary`);
3568
- }
3569
-
3570
- async getExternalProjectRoadmapActiveItem(projectId) {
3571
- return this._request(`/api/v1/projects/${projectId}/implementation-roadmap/active-item`);
3572
- }
3573
-
3574
- async listExternalProjectOpenTasks(projectId) {
3575
- return this._request(`/api/v1/projects/${projectId}/open-tasks`);
3576
- }
3577
-
3578
- async getExternalProjectStatusBundle(projectId) {
3579
- return this._request(`/api/v1/projects/${projectId}/status-bundle`);
3580
- }
3581
-
3582
- async createExternalAudioRender({ text, voice, model, speed, file } = {}) {
3583
- if (file) {
3584
- const form = new FormData();
3585
- form.append('file', file);
3586
- if (voice !== undefined) form.append('voice', String(voice));
3587
- if (model !== undefined) form.append('model', String(model));
3588
- if (speed !== undefined) form.append('speed', String(speed));
3589
- return this._request('/api/v1/audio-renders', { method: 'POST', body: form });
3590
- }
3591
- return this._request('/api/v1/audio-renders', {
3592
- method: 'POST',
3593
- body: { text, voice, model, speed },
3594
- });
3595
- }
3596
-
3597
- async getExternalAudioRender(audioRenderRunId) {
3598
- return this._request(`/api/v1/audio-renders/${audioRenderRunId}`);
3599
- }
3600
-
3601
- async downloadExternalAudioRender(audioRenderRunId) {
3602
- return this._requestBinary(`/api/v1/audio-renders/${audioRenderRunId}/download`);
3603
- }
3604
-
3605
- async listExternalWorkflowRunArtifacts(workflowRunId) {
3606
- return this._request(`/api/v1/runs/${workflowRunId}/artifacts`);
3607
- }
3608
-
3609
- async downloadExternalWorkflowRunArtifact(workflowRunId, artifactType) {
3610
- return this._requestBinary(`/api/v1/runs/${workflowRunId}/artifacts/${artifactType}/download`);
3611
- }
3612
-
3613
- // ─── Retrieval Wrapper ─────────────────────────────────────────────────────
3614
-
3615
- async getCommandCard({ commandKey, alias, intentText, requestedBy } = {}) {
3616
- return this.retrievalWrapper.getCommandCard({ commandKey, alias, intentText, requestedBy });
3617
- }
3618
-
3619
- async resolveOperatingProcedure({ procedureKey, intentText, requestedBy } = {}) {
3620
- return this.retrievalWrapper.resolveOperatingProcedure({ procedureKey, intentText, requestedBy });
3621
- }
3622
-
3623
- async getSymbolDefinition({ symbolKey, qualifiedName, symbolName, projectScope, includeCode = true, maxLines = 120, requestedBy } = {}) {
3624
- return this.retrievalWrapper.getSymbolDefinition({ symbolKey, qualifiedName, symbolName, projectScope, includeCode, maxLines, requestedBy });
3625
- }
3626
-
3627
- async getRelatedCode({ symbolKey, qualifiedName, relationshipType, depth = 1, includeCode = false, maxLines = 80, requestedBy } = {}) {
3628
- return this.retrievalWrapper.getRelatedCode({ symbolKey, qualifiedName, relationshipType, depth, includeCode, maxLines, requestedBy });
3629
- }
3630
-
3631
- // ─── Repo Inventory ───────────────────────────────────────────────────────
3632
-
3633
- async listRepositories({ limit } = {}) {
3634
- return this.repo.listRepositories({ limit });
3635
- }
3636
-
3637
- async getRepository(repositoryId) {
3638
- return this.repo.getRepository(repositoryId);
3639
- }
3640
-
3641
- async listProjects({ repositoryId, repoKey, limit } = {}) {
3642
- return this.repo.listProjects({ repositoryId, repoKey, limit });
3643
- }
3644
-
3645
- async getProject(projectId) {
3646
- return this.repo.getProject(projectId);
3647
- }
3648
-
3649
- async listCodeFiles({ repositoryId, projectId, language, pathPrefix, page = 1, pageSize = 50 } = {}) {
3650
- return this.repo.listCodeFiles({ repositoryId, projectId, language, pathPrefix, page, pageSize });
3651
- }
3652
-
3653
- async getCodeFile(fileId) {
3654
- return this.repo.getCodeFile(fileId);
3655
- }
3656
-
3657
- async getCodeFileContentWindow(fileId, { startLine = 1, endLine } = {}) {
3658
- return this.repo.getCodeFileContentWindow(fileId, { startLine, endLine });
3659
- }
3660
-
3661
- async listCodeSymbolsByFile(fileId, { limit = 500 } = {}) {
3662
- return this.repo.listCodeSymbolsByFile(fileId, { limit });
3663
- }
3664
-
3665
- async getCodeSymbol(symbolId, { includeCode = false, maxLines = 120 } = {}) {
3666
- return this.repo.getCodeSymbol(symbolId, { includeCode, maxLines });
3667
- }
3668
-
3669
- async searchSymbols({ query, projectScope, maxResults = 10 } = {}) {
3670
- return this.repo.searchSymbols({ query, projectScope, maxResults });
3671
- }
3672
-
3673
- async getSymbolRelationships(symbolId, { relationshipType, depth = 1 } = {}) {
3674
- return this.repo.getSymbolRelationships(symbolId, { relationshipType, depth });
3675
- }
3676
-
3677
- async listCodeRelationships({ repositoryId, projectId, relationshipType, limit = 100 } = {}) {
3678
- return this.repo.listCodeRelationships({ repositoryId, projectId, relationshipType, limit });
3679
- }
3680
-
3681
- async listActionObservations({ repositoryId, projectPath, filePath, symbolId, actionKind, limit = 100 } = {}) {
3682
- return this.repo.listActionObservations({ repositoryId, projectPath, filePath, symbolId, actionKind, limit });
3683
- }
3684
-
3685
- async listCodebaseShapeFindings({ repositoryId, projectPath, filePath, severity, status, limit = 100 } = {}) {
3686
- return this.repo.listCodebaseShapeFindings({ repositoryId, projectPath, filePath, severity, status, limit });
3687
- }
3688
-
3689
- async listObjectFlowObservations({ repositoryId, projectPath, filePath, objectKind, boundaryKind, limit = 100 } = {}) {
3690
- return this.repo.listObjectFlowObservations({ repositoryId, projectPath, filePath, objectKind, boundaryKind, limit });
3691
- }
3692
-
3693
- async getChangeAnalysis({ fileId, symbolId, limit = 25 } = {}) {
3694
- return this.repo.getChangeAnalysis({ fileId, symbolId, limit });
3695
- }
3696
-
3697
- async listRefactorCandidates({ repositoryRoot, limit = 10 } = {}) {
3698
- return this.repo.listRefactorCandidates({ repositoryRoot, limit });
3699
- }
3700
-
3701
- async analyzeRefactorCandidate({ filePath, requestedBy, packetId, refactorIntent } = {}) {
3702
- return this.repo.analyzeRefactorCandidate({ filePath, requestedBy, packetId, refactorIntent });
3703
- }
3704
-
3705
- async getRepoRetrievalPacket(retrievalPacketId) {
3706
- return this.repo.getRepoRetrievalPacket(retrievalPacketId);
3707
- }
3708
-
3709
- async getRepoRetrievalPacketFragments(retrievalPacketId) {
3710
- return this.repo.getRepoRetrievalPacketFragments(retrievalPacketId);
3711
- }
3712
-
3713
- async evaluateProposalScope({ filePath, projectId, changeType = 'refactor', requestedBy, refactorIntent } = {}) {
3714
- return this.repo.evaluateProposalScope({ filePath, projectId, changeType, requestedBy, refactorIntent });
3715
- }
3716
-
3717
- // ─── Retrieval Management ──────────────────────────────────────────────────
3718
-
3719
- async getRetrievalStatus() {
3720
- return this.retrievalManagement.getRetrievalStatus();
3721
- }
3722
-
3723
- async getRetrievalProfileMetrics() {
3724
- return this.retrievalManagement.getRetrievalProfileMetrics();
3725
- }
3726
-
3727
- async getRetrievalFeedbackMetrics() {
3728
- return this.retrievalManagement.getRetrievalFeedbackMetrics();
3729
- }
3730
-
3731
- async getRetrievalQuery(retrievalQueryId) {
3732
- return this.retrievalManagement.getRetrievalQuery(retrievalQueryId);
3733
- }
3734
-
3735
- async getRetrievalPacket(retrievalPacketId) {
3736
- return this.retrievalManagement.getRetrievalPacket(retrievalPacketId);
3737
- }
3738
-
3739
- async generateRetrievalCandidates(body) {
3740
- return this.retrievalManagement.generateRetrievalCandidates(body);
3741
- }
3742
-
3743
- async selectRetrievalPacket(body) {
3744
- return this.retrievalManagement.selectRetrievalPacket(body);
3745
- }
3746
-
3747
- async recordRetrievalFeedback(body) {
3748
- return this.retrievalManagement.recordRetrievalFeedback(body);
3749
- }
3750
-
3751
- async deriveRetrievalOptimizationCandidates(body) {
3752
- return this.retrievalManagement.deriveRetrievalOptimizationCandidates(body);
3753
- }
3754
-
3755
- async validatePromptAssembly(body) {
3756
- return this.retrievalManagement.validatePromptAssembly(body);
3757
- }
3758
-
3759
- // ─── Workflows ─────────────────────────────────────────────────────────────
3760
-
3761
- async listWorkflows({ status, includeSteps } = {}) {
3762
- return this.workflows.listWorkflows({ status, includeSteps });
3763
- }
3764
-
3765
- async createWorkflow({ name, slug, description, goal, governanceProfile, steps = [] } = {}) {
3766
- return this.workflows.createWorkflow({ name, slug, description, goal, governanceProfile, steps });
3767
- }
3768
-
3769
- async getWorkflow(workflowId) {
3770
- return this.workflows.getWorkflow(workflowId);
3771
- }
3772
-
3773
- async replaceWorkflowSteps(workflowId, steps) {
3774
- return this.workflows.replaceWorkflowSteps(workflowId, steps);
3775
- }
3776
-
3777
- async publishWorkflow(workflowId) {
3778
- return this.workflows.publishWorkflow(workflowId);
3779
- }
3780
-
3781
- async cloneWorkflow(workflowId) {
3782
- return this.workflows.cloneWorkflow(workflowId);
3783
- }
3784
-
3785
- // ─── Workflow Governance ───────────────────────────────────────────────────
3786
-
3787
- async evaluateWorkflowGovernance(workflowId) {
3788
- return this.workflows.evaluateWorkflowGovernance(workflowId);
3789
- }
3790
-
3791
- async listWorkflowGovernanceDecisions(workflowId) {
3792
- return this.workflows.listWorkflowGovernanceDecisions(workflowId);
3793
- }
3794
-
3795
- async getWorkflowGovernanceSimulation(workflowId) {
3796
- return this.workflows.getWorkflowGovernanceSimulation(workflowId);
3797
- }
3798
-
3799
- async listWorkflowGovernanceBundles(workflowId) {
3800
- return this.workflows.listWorkflowGovernanceBundles(workflowId);
3801
- }
3802
-
3803
- async listWorkflowGovernanceApprovals(workflowId) {
3804
- return this.workflows.listWorkflowGovernanceApprovals(workflowId);
3805
- }
3806
-
3807
- async listWorkflowGovernanceEvents(workflowId) {
3808
- return this.workflows.listWorkflowGovernanceEvents(workflowId);
3809
- }
3810
-
3811
- async getWorkflowGovernanceReview(workflowId) {
3812
- return this.workflows.getWorkflowGovernanceReview(workflowId);
3813
- }
3814
-
3815
- async createWorkflowGovernanceReviewDecision(workflowId, body) {
3816
- return this.workflows.createWorkflowGovernanceReviewDecision(workflowId, body);
3817
- }
3818
-
3819
- // ─── Workflow Runs ─────────────────────────────────────────────────────────
3820
-
3821
- async createWorkflowRun(body) {
3822
- return this.workflows.createWorkflowRun(body);
3823
- }
3824
-
3825
- async getWorkflowRun(workflowRunId) {
3826
- return this.workflows.getWorkflowRun(workflowRunId);
3827
- }
3828
-
3829
- async listWorkflowArtifacts(workflowRunId) {
3830
- return this.workflows.listWorkflowArtifacts(workflowRunId);
3831
- }
3832
-
3833
- async getWorkflowRunSubstrate(workflowRunId) {
3834
- return this.workflows.getWorkflowRunSubstrate(workflowRunId);
3835
- }
3836
-
3837
- async getWorkflowPlayback(workflowRunId) {
3838
- return this.workflows.getWorkflowPlayback(workflowRunId);
3839
- }
3840
-
3841
- async resumeWorkflowRun(workflowRunId, body = {}) {
3842
- return this.workflows.resumeWorkflowRun(workflowRunId, body);
3843
- }
3844
-
3845
- // ─── Workflow Inspector ────────────────────────────────────────────────────
3846
-
3847
- async listRecentInspectorRuns({ limit } = {}) {
3848
- return this.workflows.listRecentInspectorRuns({ limit });
3849
- }
3850
-
3851
- async inspectWorkflowRun(workflowRunId) {
3852
- return this.workflows.inspectWorkflowRun(workflowRunId);
3853
- }
3854
-
3855
- // ─── Manual & Approval Tasks ───────────────────────────────────────────────
3856
-
3857
- async listManualTasks() {
3858
- return this._request('/api/manual-tasks');
3859
- }
3860
-
3861
- async listApprovalTasks() {
3862
- return this._request('/api/approval-tasks');
3863
- }
3864
-
3865
- async completeManualTask(stepRunId, body = {}) {
3866
- return this._request(`/api/manual-tasks/${stepRunId}/complete`, { method: 'POST', body });
3867
- }
3868
-
3869
- async approveTask(stepRunId, body = {}) {
3870
- return this._request(`/api/approval-tasks/${stepRunId}/approve`, { method: 'POST', body });
3871
- }
3872
-
3873
- // ─── Projects & Chartering ─────────────────────────────────────────────────
3874
-
3875
- async createProjectCharter({
3876
- projectName,
3877
- objective,
3878
- businessContext,
3879
- successCriteria,
3880
- priority,
3881
- constraints = [],
3882
- inScope = [],
3883
- outOfScope = [],
3884
- assumptions = [],
3885
- linkedWorkflows = [],
3886
- linkedWorkflowSlug,
3887
- testingStrategy = {},
3888
- initialContext = {},
3889
- requestedBy,
3890
- ensureTaskSurface = true,
3891
- assignedTo,
3892
- createAcceptanceSubtasks = true,
3893
- } = {}) {
3894
- return this.projectChartering.createProjectCharter({
3895
- projectName,
3896
- objective,
3897
- businessContext,
3898
- successCriteria,
3899
- priority,
3900
- constraints,
3901
- inScope,
3902
- outOfScope,
3903
- assumptions,
3904
- linkedWorkflows,
3905
- linkedWorkflowSlug,
3906
- testingStrategy,
3907
- initialContext,
3908
- requestedBy,
3909
- ensureTaskSurface,
3910
- assignedTo,
3911
- createAcceptanceSubtasks,
3912
- });
3913
- }
3914
-
3915
- async listProjects({ limit, includeInactive, processStatus, charterStatus } = {}) {
3916
- return this.projects.listProjects({ limit, includeInactive, processStatus, charterStatus });
3917
- }
3918
-
3919
- async getProject(projectId) {
3920
- return this.projects.getProject(projectId);
3921
- }
3922
-
3923
- async listProjectWorkflowRuns(projectId, { limit = 25 } = {}) {
3924
- return this.projects.listProjectWorkflowRuns(projectId, { limit });
3925
- }
3926
-
3927
- async closeProject(projectId, options = {}) {
3928
- return this.projects.closeProject(projectId, options);
3929
- }
3930
-
3931
- async closeActiveProject(projectId, options = {}) {
3932
- return this.projects.closeActiveProject(projectId, options);
3933
- }
3934
-
3935
- async getProjectCharterReport(projectId) {
3936
- return this.projectReports.getProjectCharterReport(projectId);
3937
- }
3938
-
3939
- async createProjectMarkdownDownload(projectId, { reportType, includeMarkdown = false } = {}) {
3940
- return this.projectReports.createProjectMarkdownDownload(projectId, { reportType, includeMarkdown });
3941
- }
3942
-
3943
- async downloadProjectMarkdownReport(projectId, reportType) {
3944
- return this.projectReports.downloadProjectMarkdownReport(projectId, reportType);
3945
- }
3946
-
3947
- async downloadProjectCharterReportMarkdown(projectId) {
3948
- return this.projectReports.downloadProjectCharterReportMarkdown(projectId);
3949
- }
3950
-
3951
- async getProjectBundle(projectId) {
3952
- return this.projects.getProjectBundle(projectId);
3953
- }
3954
-
3955
- async listProjectOpenTasks(projectId) {
3956
- return this.projects.listProjectOpenTasks(projectId);
3957
- }
3958
-
3959
- async resumeProjectWork({
3960
- projectIdentifier,
3961
- projectId,
3962
- actorMode,
3963
- executionIntent,
3964
- requireClaim,
3965
- workflowRunLimit,
3966
- } = {}) {
3967
- return this.projectResume.resumeProjectWork({
3968
- projectIdentifier,
3969
- projectId,
3970
- actorMode,
3971
- executionIntent,
3972
- requireClaim,
3973
- workflowRunLimit,
3974
- });
3975
- }
3976
-
3977
- async closeRoadmapItemWorkflow(options = {}) {
3978
- return this.projects.closeRoadmapItemWorkflow(options);
3979
- }
3980
-
3981
- // LOGA projections are governed runtime documents, not static reports.
3982
-
3983
- async getLogaOperatorHomeProjection() {
3984
- return this._requestLogaProjection('/api/operator/projections/home');
3985
- }
3986
-
3987
- async getLogaProjectCatalogProjection() {
3988
- return this._requestLogaProjection('/api/operator/projections/project-catalog');
3989
- }
3990
-
3991
- async getLogaProjectPortfolioProjection() {
3992
- return this._requestLogaProjection('/api/operator/projections/project-portfolio');
3993
- }
3994
-
3995
- async getLogaProjectRoadmapProjection(projectId) {
3996
- return this._requestLogaProjection(`/api/operator/projections/projects/${projectId}/roadmap.md`);
3997
- }
3998
-
3999
- async getLogaRoadmapItemProjection(projectId, itemKey) {
4000
- return this._requestLogaProjection(`/api/operator/projections/projects/${projectId}/roadmap/items/${itemKey}`);
4001
- }
4002
-
4003
- async getLogaWorkflowRunProjection(workflowRunId) {
4004
- return this._requestLogaProjection(`/api/operator/projections/workflow-runs/${workflowRunId}`);
4005
- }
4006
-
4007
- async getLogaEvidencePacketProjection(packetKey) {
4008
- return this._requestLogaProjection(`/api/operator/projections/evidence-packets/${packetKey}`);
4009
- }
4010
-
4011
- async getLogaTransferHomeProjection() {
4012
- return this._requestLogaProjection('/api/operator/projections/transfers/home');
4013
- }
4014
-
4015
- async getLogaTransferInboxProjection({ workflowRunId, recipientAgentSessionId, recipientRoleKey } = {}) {
4016
- return this._requestLogaProjection('/api/operator/projections/transfers/inbox', {
4017
- query: {
4018
- workflow_run_id: workflowRunId,
4019
- recipient_agent_session_id: recipientAgentSessionId,
4020
- recipient_role_key: recipientRoleKey,
4021
- },
4022
- });
4023
- }
4024
-
4025
- async getLogaTransferPacketProjection(workTransferPacketId) {
4026
- return this._requestLogaProjection(`/api/operator/projections/transfers/${workTransferPacketId}`);
4027
- }
4028
-
4029
- async getLogaTransferNegotiationEventsProjection({ workTransferPacketId, workflowRunId } = {}) {
4030
- const path = workTransferPacketId
4031
- ? `/api/operator/projections/transfers/${workTransferPacketId}/negotiation-events`
4032
- : '/api/operator/projections/transfers/negotiation-events';
4033
- return this._requestLogaProjection(path, {
4034
- query: { workflow_run_id: workflowRunId },
4035
- });
4036
- }
4037
-
4038
- async getLogaTransferFrictionLaneProjection({ workflowRunId } = {}) {
4039
- return this._requestLogaProjection('/api/operator/projections/transfers/friction-lane', {
4040
- query: { workflow_run_id: workflowRunId },
4041
- });
4042
- }
4043
-
4044
- async getLogaTransferReceiptsProjection({ workTransferPacketId, workflowRunId } = {}) {
4045
- return this._requestLogaProjection('/api/operator/projections/transfers/receipts', {
4046
- query: {
4047
- work_transfer_packet_id: workTransferPacketId,
4048
- workflow_run_id: workflowRunId,
4049
- },
4050
- });
4051
- }
4052
-
4053
- async getLogaTransferClosureReviewProjection(workTransferPacketId) {
4054
- return this._requestLogaProjection(`/api/operator/projections/transfers/${workTransferPacketId}/closure-review`);
4055
- }
4056
-
4057
- async getLogaTransferChannelThreadProjection(transferChannelId) {
4058
- const normalizedTransferChannelId = cleanText(transferChannelId);
4059
- if (!normalizedTransferChannelId) {
4060
- throw new Error('transferChannelId is required.');
4061
- }
4062
- return this._requestLogaProjection(`/api/operator/projections/transfers/channels/${encodeURIComponent(normalizedTransferChannelId)}`);
4063
- }
4064
-
4065
- async getTransferChannelProjection(transferChannelId) {
4066
- return this.getLogaTransferChannelThreadProjection(transferChannelId);
4067
- }
4068
-
4069
- async submitUxGateRemediation({
4070
- projectionType,
4071
- projectionId,
4072
- gateRunId,
4073
- findingIds,
4074
- remediationPayload,
4075
- sourceTruth = 'sql',
4076
- clientEvidence,
4077
- createdBy,
4078
- } = {}) {
4079
- return this._request('/api/loga/ux-gate-remediations', {
4080
- method: 'POST',
4081
- body: {
4082
- projectionType,
4083
- projectionId,
4084
- gateRunId,
4085
- findingIds,
4086
- remediationPayload,
4087
- sourceTruth,
4088
- clientEvidence,
4089
- createdBy,
4090
- },
4091
- });
4092
- }
4093
-
4094
- async listUxGateRemediations({ projectionType, status } = {}) {
4095
- return this._request('/api/loga/ux-gate-remediations', {
4096
- query: { projectionType, status },
4097
- });
4098
- }
4099
-
4100
- async getUxGateRemediation(remediationId) {
4101
- return this._request(`/api/loga/ux-gate-remediations/${remediationId}`);
4102
- }
4103
-
4104
- async appendUxRemediationTicketNote(remediationId, {
4105
- noteKind,
4106
- body,
4107
- visibility,
4108
- authorActorId,
4109
- evidenceRefs,
4110
- metadata,
4111
- } = {}) {
4112
- return this._request(`/api/loga/ux-gate-remediations/${remediationId}/notes`, {
4113
- method: 'POST',
4114
- body: {
4115
- noteKind,
4116
- body,
4117
- visibility,
4118
- authorActorId,
4119
- evidenceRefs,
4120
- metadata,
4121
- },
4122
- });
4123
- }
4124
-
4125
- async listUxRemediationTicketNotes(remediationId) {
4126
- return this._request(`/api/loga/ux-gate-remediations/${remediationId}/notes`);
4127
- }
4128
-
4129
- async promoteUxGateRemediationImplementationCandidate(remediationId, { promotedBy } = {}) {
4130
- return this._request(`/api/loga/ux-gate-remediations/${remediationId}/implementation-candidate`, {
4131
- method: 'POST',
4132
- body: { promotedBy },
4133
- });
4134
- }
4135
-
4136
- async getLogaUxGateRemediationProjection(remediationId) {
4137
- return this._requestLogaProjection(`/api/operator/projections/ux-gate-remediations/${remediationId}`);
4138
- }
4139
-
4140
- async generateScript({
4141
- claimId,
4142
- contextSessionId,
4143
- workflowRunId,
4144
- intent = {},
4145
- renderSpec = {},
4146
- createdBy,
4147
- } = {}) {
4148
- return this._request('/api/scripts/generate', {
4149
- method: 'POST',
4150
- body: {
4151
- claimId,
4152
- contextSessionId,
4153
- workflowRunId,
4154
- intent,
4155
- renderSpec,
4156
- createdBy,
4157
- },
4158
- });
4159
- }
4160
-
4161
- async renderScript(scriptId) {
4162
- return this._request(`/api/scripts/${scriptId}/render`);
4163
- }
4164
-
4165
- async submitScriptArtifact(scriptId, {
4166
- workflowRunId,
4167
- output = {},
4168
- observations = [],
4169
- validation = {},
4170
- recordedBy,
4171
- } = {}) {
4172
- return this._request(`/api/scripts/${scriptId}/artifacts`, {
4173
- method: 'POST',
4174
- body: {
4175
- workflowRunId,
4176
- output,
4177
- observations,
4178
- validation,
4179
- recordedBy,
4180
- },
4181
- });
4182
- }
4183
-
4184
- async getScriptRunEvidence({ workflowRunId, scriptId } = {}) {
4185
- return this._request('/api/scripts/run-evidence', {
4186
- query: {
4187
- workflowRunId,
4188
- scriptId,
4189
- },
4190
- });
4191
- }
4192
-
4193
- // ─── Roadmaps ──────────────────────────────────────────────────────────────
4194
-
4195
- async listProjectRoadmaps({ includeInactive } = {}) {
4196
- return this.roadmaps.listProjectRoadmaps({ includeInactive });
4197
- }
4198
-
4199
- async getProjectRoadmap(projectId) {
4200
- return this.roadmaps.getProjectRoadmap(projectId);
4201
- }
4202
-
4203
- async getProjectRoadmapSummary(projectId) {
4204
- return this.roadmaps.getProjectRoadmapSummary(projectId);
4205
- }
4206
-
4207
- async getProjectRoadmapActiveItem(projectId) {
4208
- return this.roadmaps.getProjectRoadmapActiveItem(projectId);
4209
- }
4210
-
4211
- async getProjectImplementationRoadmapReport(projectId) {
4212
- return this.roadmapReports.getProjectImplementationRoadmapReport(projectId);
4213
- }
4214
-
4215
- async downloadProjectImplementationRoadmapReportMarkdown(projectId) {
4216
- return this.roadmapReports.downloadProjectImplementationRoadmapReportMarkdown(projectId);
4217
- }
4218
-
4219
- async ensureProjectRoadmapTaskSurface(projectId, {
4220
- requestedBy,
4221
- assignedTo,
4222
- createAcceptanceSubtasks = true,
4223
- } = {}) {
4224
- return this.roadmaps.ensureProjectRoadmapTaskSurface(projectId, {
4225
- requestedBy,
4226
- assignedTo,
4227
- createAcceptanceSubtasks,
4228
- });
4229
- }
4230
-
4231
- async importImplementationPacketAndMaterializeRoadmap(packetPayload, {
4232
- importedBy,
4233
- requestedBy,
4234
- createdBy,
4235
- workflowId,
4236
- bindingRole = 'active',
4237
- assignedTo,
4238
- notes,
4239
- createAcceptanceSubtasks = true,
4240
- } = {}) {
4241
- return this.implementationPackets.importImplementationPacketAndMaterializeRoadmap(packetPayload, {
4242
- importedBy,
4243
- requestedBy,
4244
- createdBy,
4245
- workflowId,
4246
- bindingRole,
4247
- assignedTo,
4248
- notes,
4249
- createAcceptanceSubtasks,
4250
- });
4251
- }
4252
-
4253
- // ─── Implementation Tasks ──────────────────────────────────────────────────
4254
-
4255
- async createImplementationTask(implementationItemId, {
4256
- title,
4257
- implementationPacketId,
4258
- description,
4259
- priority,
4260
- assignedTo,
4261
- assignedBy,
4262
- dueAt,
4263
- sortOrder,
4264
- notes,
4265
- createdBy,
4266
- parentTaskId,
4267
- claimId,
4268
- claimProjectId,
4269
- projectId,
4270
- claimedItemId,
4271
- workflowRunId,
4272
- agentSessionId,
4273
- allowedMutationSurfaces,
4274
- acknowledgedReminders,
4275
- executionIntent,
4276
- executionType,
4277
- executionPurpose,
4278
- } = {}) {
4279
- return this.implementationTasks.createImplementationTask(implementationItemId, {
4280
- title,
4281
- implementationPacketId,
4282
- description,
4283
- priority,
4284
- assignedTo,
4285
- assignedBy,
4286
- dueAt,
4287
- sortOrder,
4288
- notes,
4289
- createdBy,
4290
- parentTaskId,
4291
- claimId,
4292
- claimProjectId,
4293
- projectId,
4294
- claimedItemId,
4295
- workflowRunId,
4296
- agentSessionId,
4297
- allowedMutationSurfaces,
4298
- acknowledgedReminders,
4299
- executionIntent,
4300
- executionType,
4301
- executionPurpose,
4302
- });
4303
- }
4304
-
4305
- async listImplementationTasks(implementationItemId) {
4306
- return this.implementationTasks.listImplementationTasks(implementationItemId);
4307
- }
4308
-
4309
- async listImplementationSubtasks(taskId) {
4310
- return this.implementationTasks.listImplementationSubtasks(taskId);
4311
- }
4312
-
4313
- async updateImplementationTask(taskId, updates) {
4314
- return this.implementationTasks.updateImplementationTask(taskId, updates);
4315
- }
4316
-
4317
- async assignImplementationTask(taskId, { assignedTo, assignedBy } = {}) {
4318
- return this.implementationTasks.assignImplementationTask(taskId, { assignedTo, assignedBy });
4319
- }
4320
-
4321
- async completeImplementationTask(taskId, { completedBy } = {}) {
4322
- return this.implementationTasks.completeImplementationTask(taskId, { completedBy });
4323
- }
4324
-
4325
- // ─── Governed Implementation ───────────────────────────────────────────────
4326
-
4327
- async importImplementationPacket(body) {
4328
- return this.implementationPackets.importImplementationPacket(body);
4329
- }
4330
-
4331
- async listImplementationPackets({ status, packetType } = {}) {
4332
- return this.implementationPackets.listImplementationPackets({ status, packetType });
4333
- }
4334
-
4335
- async getImplementationPacket(packetId) {
4336
- return this.implementationPackets.getImplementationPacket(packetId);
4337
- }
4338
-
4339
- async getImplementationItemAcceptanceChecks(implementationItemId) {
4340
- return this.implementationChecks.getImplementationItemAcceptanceChecks(implementationItemId);
4341
- }
4342
-
4343
- async getArtifactManifest(implementationItemId) {
4344
- return this.implementationArtifacts.getArtifactManifest(implementationItemId);
4345
- }
4346
-
4347
- async getDecisionPacket(implementationItemId) {
4348
- return this.implementationArtifacts.getDecisionPacket(implementationItemId);
4349
- }
4350
-
4351
- async updateImplementationItemStatus(implementationItemId, body) {
4352
- return this.implementationItems.updateImplementationItemStatus(implementationItemId, body);
4353
- }
4354
-
4355
- async addImplementationItemEvidence(implementationItemId, body) {
4356
- return this.implementationEvidence.addImplementationItemEvidence(implementationItemId, body);
4357
- }
4358
-
4359
- async addImplementationItemActivity(implementationItemId, body) {
4360
- return this.implementationEvidence.addImplementationItemActivity(implementationItemId, body);
4361
- }
4362
-
4363
- async listImplementationItemActivity(implementationItemId) {
4364
- return this.implementationEvidence.listImplementationItemActivity(implementationItemId);
4365
- }
4366
-
4367
- async updateAcceptanceCheckStatus(implementationItemId, acceptanceCheckId, body) {
4368
- return this.implementationChecks.updateAcceptanceCheckStatus(implementationItemId, acceptanceCheckId, body);
4369
- }
4370
-
4371
- async createImplementationPacketGateDecision(packetId, body) {
4372
- return this.implementationGates.createImplementationPacketGateDecision(packetId, body);
4373
- }
4374
-
4375
- async bindImplementationPacketToWorkflow(workflowId, body) {
4376
- return this.implementationPackets.bindImplementationPacketToWorkflow(workflowId, body);
4377
- }
4378
-
4379
- async getWorkflowImplementationRoadmap(workflowId) {
4380
- return this.implementationPackets.getWorkflowImplementationRoadmap(workflowId);
4381
- }
4382
-
4383
- async getWorkflowResumeContext(workflowId) {
4384
- return this.implementationPackets.getWorkflowResumeContext(workflowId);
4385
- }
4386
-
4387
- async executeVerifiedMutation({
4388
- mutationName,
4389
- mutationFn,
4390
- verificationFn,
4391
- expectedState,
4392
- evidenceLabel,
4393
- } = {}) {
4394
- return executeVerifiedMutation({
4395
- mutationName,
4396
- mutationFn,
4397
- verificationFn,
4398
- expectedState,
4399
- evidenceLabel,
4400
- });
4401
- }
4402
-
4403
- async updateImplementationItemStatusVerified(implementationItemId, status, body = {}) {
4404
- return this.implementationItems.updateImplementationItemStatusVerified(implementationItemId, status, body);
4405
- }
4406
-
4407
- async updateAcceptanceCheckStatusVerified(implementationItemId, acceptanceCheckId, status, body = {}) {
4408
- return this.implementationChecks.updateAcceptanceCheckStatusVerified(implementationItemId, acceptanceCheckId, status, body);
4409
- }
4410
-
4411
- async verifyImplementationItemArtifacts(implementationItemId, { requiredArtifacts = [] } = {}) {
4412
- return this.implementationArtifacts.verifyImplementationItemArtifacts(implementationItemId, { requiredArtifacts });
4413
- }
4414
-
4415
- // ─── Skills ────────────────────────────────────────────────────────────────
4416
-
4417
- async currentSkillRegistryStatus() {
4418
- return this._request('/api/operator/current-skill-registry-status');
4419
- }
4420
-
4421
- async getSkillContract({ skillId, skillKey } = {}) {
4422
- return this._request('/api/skills/contract', { query: { skill_id: skillId, skill_key: skillKey } });
4423
- }
4424
-
4425
- async getSkillGovernance({ skillId, skillKey, skillVersionId } = {}) {
4426
- return this._request('/api/operator/skills/governance', {
4427
- query: { skill_id: skillId, skill_key: skillKey, skill_version_id: skillVersionId },
4428
- });
4429
- }
4430
-
4431
- async createSkillContractDraft(body) {
4432
- return this._request('/api/operator/skills/contracts/drafts', { method: 'POST', body });
4433
- }
4434
-
4435
- async recordSkillPatternReview(skillVersionId, body) {
4436
- return this._request(`/api/operator/skills/contracts/${skillVersionId}/pattern-reviews`, {
4437
- method: 'POST', body,
4438
- });
4439
- }
4440
-
4441
- async approveSkillContract(skillVersionId, body = {}) {
4442
- return this._request(`/api/operator/skills/contracts/${skillVersionId}/approve`, {
4443
- method: 'POST', body,
4444
- });
4445
- }
4446
-
4447
- async createWorkflowSkillContract(body) {
4448
- return this._request('/api/skills/workflow-contracts', { method: 'POST', body });
4449
- }
4450
-
4451
- async listWorkflowSkillBindings(workflowId, { workflowStepId } = {}) {
4452
- return this._request(`/api/workflows/${workflowId}/skill-bindings`, {
4453
- query: { workflow_step_id: workflowStepId },
4454
- });
4455
- }
4456
-
4457
- async seedFrequentOperationSkills({ createdBy } = {}) {
4458
- return this._request('/api/operator/skills/seed-frequent-operations', {
4459
- method: 'POST',
4460
- body: { created_by: createdBy },
4461
- });
4462
- }
4463
-
4464
- // ─── Skill Governance ──────────────────────────────────────────────────────
4465
-
4466
- async createSkillGovernanceChange(body) {
4467
- return this._request('/api/operator/skill-governance/changes', { method: 'POST', body });
4468
- }
4469
-
4470
- async listSkillGovernanceChanges({ limit, processStatus, changeStatus } = {}) {
4471
- return this._request('/api/operator/skill-governance/changes', {
4472
- query: { limit, process_status: processStatus, change_status: changeStatus },
4473
- });
4474
- }
4475
-
4476
- async getSkillGovernanceChange(governanceChangeId) {
4477
- return this._request(`/api/operator/skill-governance/changes/${governanceChangeId}`);
4478
- }
4479
-
4480
- // ─── Capabilities ──────────────────────────────────────────────────────────
4481
-
4482
- async listCapabilities() {
4483
- return this._request('/api/capabilities');
4484
- }
4485
-
4486
- async createCapability(body) {
4487
- return this._request('/api/capabilities', { method: 'POST', body });
4488
- }
4489
-
4490
- async testCapability(capabilityId, body = {}) {
4491
- return this._request(`/api/capabilities/${capabilityId}/test`, { method: 'POST', body });
4492
- }
4493
-
4494
- // ─── Tool Registry ─────────────────────────────────────────────────────────
4495
-
4496
- async currentToolRegistryStatus() {
4497
- return this._request('/api/operator/current-tool-registry-status');
4498
- }
4499
-
4500
- async getWorkflowToolRegistry({ workflowId, workflowSlug } = {}) {
4501
- return this._request('/api/operator/workflow-tool-registry', {
4502
- query: { workflow_id: workflowId, workflow_slug: workflowSlug },
4503
- });
4504
- }
4505
-
4506
- async currentAssistantToolContext() {
4507
- return this._request('/api/operator/current-assistant-tool-context');
4508
- }
4509
-
4510
- async getTool(toolKey) {
4511
- return this._request(`/api/tools/${toolKey}`);
4512
- }
4513
-
4514
- async getToolHistory(toolKey) {
4515
- return this._request(`/api/tools/${toolKey}/history`);
4516
- }
4517
-
4518
- async getToolInvocations(toolKey) {
4519
- return this._request(`/api/tools/${toolKey}/invocations`);
4520
- }
4521
-
4522
- async getToolGovernance(toolKey) {
4523
- return this._request(`/api/tools/${toolKey}/governance`);
4524
- }
4525
-
4526
- async getToolEventReplayBundle(toolEventSummaryId) {
4527
- return this._request(`/api/operator/tool-events/${toolEventSummaryId}/replay-bundle`);
4528
- }
4529
-
4530
- async createToolReviewDecision(toolKey, body) {
4531
- return this._request(`/api/governance/tools/${toolKey}/review-decisions`, {
4532
- method: 'POST', body,
4533
- });
4534
- }
4535
-
4536
- async createToolGateDecision(toolKey, body) {
4537
- return this._request(`/api/governance/tools/${toolKey}/gate-decisions`, {
4538
- method: 'POST', body,
4539
- });
4540
- }
4541
-
4542
- // ─── Context Assembly ──────────────────────────────────────────────────────
4543
-
4544
- async getContextAssemblyContract(workflowRunId, { stepRunId } = {}) {
4545
- return this._request(`/api/context-assembly/workflow-runs/${workflowRunId}/contract`, {
4546
- query: { step_run_id: stepRunId },
4547
- });
4548
- }
4549
-
4550
- async getContextAssemblyStatus(workflowRunId, { stepRunId } = {}) {
4551
- return this._request(`/api/context-assembly/workflow-runs/${workflowRunId}/status`, {
4552
- query: { step_run_id: stepRunId },
4553
- });
4554
- }
4555
-
4556
- async getOperatorContext(workflowRunId, { stepRunId } = {}) {
4557
- return this._request(`/api/operator/runs/${workflowRunId}/context`, {
4558
- query: { step_run_id: stepRunId },
4559
- });
4560
- }
4561
-
4562
- async getContextFragments(workflowRunId, { stepRunId } = {}) {
4563
- return this._request(`/api/operator/runs/${workflowRunId}/context/fragments`, {
4564
- query: { step_run_id: stepRunId },
4565
- });
4566
- }
4567
-
4568
- async getContextReuse(workflowRunId, { stepRunId } = {}) {
4569
- return this._request(`/api/operator/runs/${workflowRunId}/context/reuse`, {
4570
- query: { step_run_id: stepRunId },
4571
- });
4572
- }
4573
-
4574
- async listPromptAssemblies(workflowRunId) {
4575
- return this._request(`/api/operator/workflow-runs/${workflowRunId}/prompt-assemblies`);
4576
- }
4577
-
4578
- // ─── Performance ───────────────────────────────────────────────────────────
4579
-
4580
- async getSessionPerformanceMetrics({ clientType, workflowRunId, sessionId } = {}) {
4581
- return this._request('/api/operator/performance/sessions', {
4582
- query: { client_type: clientType, workflow_run_id: workflowRunId, session_id: sessionId },
4583
- });
4584
- }
4585
-
4586
- async captureBenchmarkSnapshot(body) {
4587
- return this._request('/api/operator/performance/benchmarks', { method: 'POST', body });
4588
- }
4589
-
4590
- async listBenchmarks({ benchmarkScope } = {}) {
4591
- return this._request('/api/operator/performance/benchmarks', {
4592
- query: { benchmark_scope: benchmarkScope },
4593
- });
4594
- }
4595
-
4596
- async getBenchmarkMetrics(benchmarkName) {
4597
- return this._request(`/api/operator/performance/benchmarks/${benchmarkName}/metrics`);
4598
- }
4599
-
4600
- async getBenchmarkDelta({ baseline, current } = {}) {
4601
- return this._request('/api/operator/performance/delta', { query: { baseline, current } });
4602
- }
4603
-
4604
- async getBenchmarkTrend({ metricKey, dimensionValue, limit } = {}) {
4605
- return this._request('/api/operator/performance/trend', {
4606
- query: { metric_key: metricKey, dimension_value: dimensionValue, limit },
4607
- });
4608
- }
4609
-
4610
- async getPerformanceDashboard({ clientType, workflowRunId } = {}) {
4611
- return this._request('/api/operator/performance/dashboard', {
4612
- query: { client_type: clientType, workflow_run_id: workflowRunId },
4613
- });
4614
- }
4615
-
4616
- // ─── Portfolio ─────────────────────────────────────────────────────────────
4617
-
4618
- async getPortfolioStatus({ projectId } = {}) {
4619
- return this._request('/api/operator/portfolio/status', { query: { project_id: projectId } });
4620
- }
4621
-
4622
- async getPortfolioSummary() {
4623
- return this._request('/api/operator/portfolio/summary');
4624
- }
4625
-
4626
- async getPortfolioExceptions() {
4627
- return this._request('/api/operator/portfolio/exceptions');
4628
- }
4629
-
4630
- async getPortfolioProject(projectId) {
4631
- return this._request(`/api/operator/portfolio/projects/${projectId}`);
4632
- }
4633
-
4634
- async getPortfolioReport() {
4635
- return this._request('/api/operator/portfolio/report');
4636
- }
4637
-
4638
- async getPortfolioBundle() {
4639
- return this._request('/api/operator/portfolio/bundle');
4640
- }
4641
-
4642
- async getPortfolioClosureReadiness({
4643
- projectLimit = 25,
4644
- includeInactive = false,
4645
- includeLogaPortfolioProjection = false,
4646
- includeLogaRoadmapProjections = false,
4647
- } = {}) {
4648
- return this.portfolio.getPortfolioClosureReadiness({
4649
- projectLimit,
4650
- includeInactive,
4651
- includeLogaPortfolioProjection,
4652
- includeLogaRoadmapProjections,
4653
- });
4654
- }
4655
-
4656
- async registerModernizationAsset(request = {}) {
4657
- return this.workflowComposition.registerModernizationAsset(request);
4658
- }
4659
-
4660
- async classifyModernizationAsset(request = {}) {
4661
- return this.workflowComposition.classifyModernizationAsset(request);
4662
- }
4663
-
4664
- async discoverSalvageCandidates(request = {}) {
4665
- return this.workflowComposition.discoverSalvageCandidates(request);
4666
- }
4667
-
4668
- async createModernizationWorkPacket(request = {}) {
4669
- return this.workflowComposition.createModernizationWorkPacket(request);
4670
- }
4671
-
4672
- async requestModernizationWrapperExecution(request = {}) {
4673
- return this.workflowComposition.requestModernizationWrapperExecution(request);
4674
- }
4675
-
4676
- async getModernizationWrapperEvidence(request = {}) {
4677
- return this.workflowComposition.getModernizationWrapperEvidence(request);
4678
- }
4679
-
4680
- async decideModernizationGate(request = {}) {
4681
- return this.workflowComposition.decideModernizationGate(request);
4682
- }
4683
- // ─── Self-Learning ─────────────────────────────────────────────────────────
4684
-
4685
- async getSelfLearningPosture({ workflowRunId, limit } = {}) {
4686
- return this._request('/api/operator/self-learning/posture', {
4687
- query: { workflow_run_id: workflowRunId, limit },
4688
- });
4689
- }
4690
-
4691
- async listLearningRecords({ workflowRunId, learningCategory, promotionReadiness, limit } = {}) {
4692
- return this._request('/api/operator/self-learning/records', {
4693
- query: {
4694
- workflow_run_id: workflowRunId,
4695
- learning_category: learningCategory,
4696
- promotion_readiness: promotionReadiness,
4697
- limit,
4698
- },
4699
- });
4700
- }
4701
-
4702
- async getLearningRecord(learningRecordId) {
4703
- return this._request(`/api/operator/self-learning/records/${learningRecordId}`);
4704
- }
4705
-
4706
- async listPromotionCandidates({ workflowRunId, learningCategory, promotionReadiness, limit } = {}) {
4707
- return this._request('/api/operator/self-learning/promotion-candidates', {
4708
- query: {
4709
- workflow_run_id: workflowRunId,
4710
- learning_category: learningCategory,
4711
- promotion_readiness: promotionReadiness,
4712
- limit,
4713
- },
4714
- });
4715
- }
4716
-
4717
- async getPromotionCandidate(candidateKey) {
4718
- return this._request(`/api/operator/self-learning/promotion-candidates/${candidateKey}`);
4719
- }
4720
-
4721
- async listPromotionFlows({ flowStatus, targetType, candidateKey, limit } = {}) {
4722
- return this._request('/api/operator/self-learning/promotion-flows', {
4723
- query: {
4724
- flow_status: flowStatus,
4725
- target_type: targetType,
4726
- candidate_key: candidateKey,
4727
- limit,
4728
- },
4729
- });
4730
- }
4731
-
4732
- // ─── Self-Optimization ─────────────────────────────────────────────────────
4733
-
4734
- async getSelfOptimizationDashboard() {
4735
- return this._request('/api/operator/self-optimization/dashboard');
4736
- }
4737
-
4738
- async getSelfOptimizationCandidateQueue({ objectiveCategory, impactPosture, blockedByDefault, limit } = {}) {
4739
- return this._request('/api/operator/self-optimization/candidate-queue', {
4740
- query: {
4741
- objective_category: objectiveCategory,
4742
- impact_posture: impactPosture,
4743
- blocked_by_default: blockedByDefault,
4744
- limit,
4745
- },
4746
- });
4747
- }
4748
-
4749
- async getSelfOptimizationBacklogPosture({ snapshotKey } = {}) {
4750
- return this._request('/api/operator/self-optimization/backlog-posture', {
4751
- query: { snapshot_key: snapshotKey },
4752
- });
4753
- }
4754
-
4755
- async getSelfOptimizationPendingHandoffs({ downstreamLane } = {}) {
4756
- return this._request('/api/operator/self-optimization/pending-handoffs', {
4757
- query: { downstream_lane: downstreamLane },
4758
- });
4759
- }
4760
-
4761
- // ─── Design Intelligence ───────────────────────────────────────────────────
4762
-
4763
- async getDesignIntelligenceDashboard() {
4764
- return this._request('/api/design-intelligence/dashboard');
4765
- }
4766
-
4767
- async listDesignDecisions() {
4768
- return this._request('/api/design-intelligence/decisions');
4769
- }
4770
-
4771
- async getDesignDecision(decisionId) {
4772
- return this._request(`/api/design-intelligence/decisions/${decisionId}`);
4773
- }
4774
-
4775
- async getDesignDecisionVariants(decisionId) {
4776
- return this._request(`/api/design-intelligence/decisions/${decisionId}/variants`);
4777
- }
4778
-
4779
- async getDesignDecisionCritique(decisionId) {
4780
- return this._request(`/api/design-intelligence/decisions/${decisionId}/critique`);
4781
- }
4782
-
4783
- async getDesignDecisionLineage(decisionId) {
4784
- return this._request(`/api/design-intelligence/decisions/${decisionId}/lineage`);
4785
- }
4786
-
4787
- async listDesignPatterns() {
4788
- return this._request('/api/design-intelligence/patterns');
4789
- }
4790
-
4791
- async getDecisionLabCanvas() {
4792
- return this._request('/api/design-intelligence/decision-lab/canvas');
4793
- }
4794
-
4795
- async getDesignRecommendations() {
4796
- return this._request('/api/design-intelligence/recommendations');
4797
- }
4798
-
4799
- async getDesignPromotions() {
4800
- return this._request('/api/design-intelligence/promotions');
4801
- }
4802
-
4803
- async previewDesignPromotion(body) {
4804
- return this._request('/api/design-intelligence/promotions/preview', { method: 'POST', body });
4805
- }
4806
-
4807
- async getDesignIntelligenceMetrics() {
4808
- return this._request('/api/design-intelligence/metrics');
4809
- }
4810
-
4811
- // ─── Script Discovery ──────────────────────────────────────────────────────
4812
-
4813
- async scanScripts(body = {}) {
4814
- return this._request('/api/script-discovery/scan', { method: 'POST', body });
4815
- }
4816
-
4817
- async listDiscoveredScriptAssets({ limit } = {}) {
4818
- return this._request('/api/script-discovery/script-assets', { query: { limit } });
4819
- }
4820
-
4821
- async listDiscoveredCapabilities({ limit } = {}) {
4822
- return this._request('/api/script-discovery/discovered-capabilities', { query: { limit } });
4823
- }
4824
-
4825
- async listWorkflowCandidates({ limit } = {}) {
4826
- return this._request('/api/script-discovery/workflow-candidates', { query: { limit } });
4827
- }
4828
-
4829
- async promoteWorkflowCandidate(workflowCandidateId, body = {}) {
4830
- return this._request(`/api/script-discovery/workflow-candidates/${workflowCandidateId}/promote`, {
4831
- method: 'POST', body,
4832
- });
4833
- }
4834
-
4835
- // ─── Notes Lab ─────────────────────────────────────────────────────────────
4836
-
4837
- async getNotesLabConfig() {
4838
- return this._request('/api/notes-lab/config');
4839
- }
4840
-
4841
- async submitNote(body) {
4842
- return this._request('/api/notes-lab/submit', { method: 'POST', body });
4843
- }
4844
-
4845
- async approveNoteReview(body) {
4846
- return this._request('/api/notes-lab/approve-review', { method: 'POST', body });
4847
- }
4848
-
4849
- // ─── Search & Contacts ─────────────────────────────────────────────────────
4850
-
4851
- async search(query) {
4852
- return this._request('/api/search', { query: { q: query } });
4853
- }
4854
-
4855
- async getOrganization(entityId) {
4856
- return this._request(`/api/organizations/${entityId}`);
4857
- }
4858
-
4859
- async getContact(contactId) {
4860
- return this._request(`/api/contacts/${contactId}`);
4861
- }
4862
-
4863
- // ─── Benchmarks ────────────────────────────────────────────────────────────
4864
-
4865
- async listRecentBenchmarkRuns({ limit } = {}) {
4866
- return this._request('/api/benchmarks/reasoners/runs/recent', { query: { limit } });
4867
- }
4868
-
4869
- async getBenchmarkRun(benchmarkRunId) {
4870
- return this._request(`/api/benchmarks/reasoners/runs/${benchmarkRunId}`);
4871
- }
4872
-
4873
- // ─── Commit Governance ────────────────────────────────────────────────────
4874
-
4875
- async evaluateCommitGovernance({
4876
- claimId,
4877
- contextSessionId,
4878
- agentId,
4879
- intentId,
4880
- changedFiles,
4881
- declaredScopeFiles,
4882
- diffSummary,
4883
- branch,
4884
- headSha,
4885
- } = {}) {
4886
- return this._request('/api/commit-governance/evaluate', {
4887
- method: 'POST',
4888
- body: {
4889
- claim_id: claimId,
4890
- context_session_id: contextSessionId,
4891
- agent_id: agentId,
4892
- intent_id: intentId,
4893
- changed_files: changedFiles,
4894
- declared_scope_files: declaredScopeFiles,
4895
- diff_summary: diffSummary,
4896
- branch,
4897
- head_sha: headSha,
4898
- },
4899
- });
4900
- }
4901
-
4902
- async checkGitShipReadiness({
4903
- claimId,
4904
- actorId,
4905
- targetBranch,
4906
- shipCommand,
4907
- packageName,
4908
- declaredScopeFiles,
4909
- stagedFiles,
4910
- dirtyFiles,
4911
- branch,
4912
- headSha,
4913
- packageJsonVersion,
4914
- facadeMinClientVersion,
4915
- packageRelease,
4916
- packageJsonHash,
4917
- sdkVersionHash,
4918
- } = {}) {
4919
- return this._request('/api/commit-governance/ship-readiness', {
4920
- method: 'POST',
4921
- body: {
4922
- claim_id: claimId,
4923
- actor_id: actorId,
4924
- target_branch: targetBranch,
4925
- ship_command: shipCommand,
4926
- package_name: packageName,
4927
- declared_scope_files: declaredScopeFiles,
4928
- staged_files: stagedFiles,
4929
- dirty_files: dirtyFiles,
4930
- branch,
4931
- head_sha: headSha,
4932
- package_json_version: packageJsonVersion,
4933
- facade_min_client_version: facadeMinClientVersion,
4934
- package_release: packageRelease,
4935
- package_json_hash: packageJsonHash,
4936
- sdk_version_hash: sdkVersionHash,
4937
- },
4938
- });
4939
- }
4940
-
4941
- async getCommitGovernanceEvaluation(evaluationId) {
4942
- return this._request(`/api/commit-governance/evaluations/${encodeURIComponent(evaluationId)}`);
4943
- }
4944
-
4945
- async listCommitGovernanceEvaluationsByClaim(claimId, { limit } = {}) {
4946
- return this._request(`/api/commit-governance/claims/${encodeURIComponent(claimId)}/evaluations`, {
4947
- query: { limit },
4948
- });
4949
- }
4950
-
4951
- // ─── Context Session Orientation ──────────────────────────────────────────
2912
+ export function createAIEngineClient(options) {
2913
+ return new AIEngineClient(options);
2914
+ }
4952
2915
 
4953
- async openContextSession({ agentId, runtimeSessionId, intentId, executionPurpose, notes } = {}) {
4954
- return this._request('/api/context-session/open', {
4955
- method: 'POST',
4956
- body: {
4957
- agent_id: agentId,
4958
- runtime_session_id: runtimeSessionId,
4959
- intent_id: intentId,
4960
- execution_purpose: executionPurpose,
4961
- notes,
2916
+ function defineCompatibilityMethods(proto, targetName, methodNames) {
2917
+ for (const methodName of methodNames) {
2918
+ if (Object.prototype.hasOwnProperty.call(proto, methodName)) continue;
2919
+ Object.defineProperty(proto, methodName, {
2920
+ value: function delegatedClientMethod(...args) {
2921
+ return this[targetName][methodName](...args);
4962
2922
  },
2923
+ configurable: true,
2924
+ writable: true,
4963
2925
  });
4964
2926
  }
2927
+ }
4965
2928
 
4966
- async getOrientationWindow(contextSessionId) {
4967
- return this._request(`/api/context-session/${encodeURIComponent(contextSessionId)}/window`);
4968
- }
4969
-
4970
- async acknowledgeReminder(contextSessionId, { reminderId, agentSignature, understandingSummary } = {}) {
4971
- return this._request(`/api/context-session/${encodeURIComponent(contextSessionId)}/acknowledge`, {
4972
- method: 'POST',
4973
- body: {
4974
- reminder_id: reminderId,
4975
- agent_signature: agentSignature,
4976
- understanding_summary: understandingSummary,
2929
+ function defineCompatibilityAliases(proto, targetName, methodMap) {
2930
+ for (const [methodName, targetMethodName] of Object.entries(methodMap)) {
2931
+ if (Object.prototype.hasOwnProperty.call(proto, methodName)) continue;
2932
+ Object.defineProperty(proto, methodName, {
2933
+ value: function delegatedClientMethod(...args) {
2934
+ return this[targetName][targetMethodName](...args);
4977
2935
  },
2936
+ configurable: true,
2937
+ writable: true,
4978
2938
  });
4979
2939
  }
4980
-
4981
- async completeOrientation(contextSessionId) {
4982
- return this._request(`/api/context-session/${encodeURIComponent(contextSessionId)}/complete`, {
4983
- method: 'POST',
4984
- });
4985
- }
4986
-
4987
- async lockContextSessionClaim(input) {
4988
- const contextSessionId = contextSessionIdFromInput(input);
4989
- if (!contextSessionId) throw new Error('contextSessionId is required.');
4990
- return this._request(`/api/context-session/${encodeURIComponent(contextSessionId)}/lock-claim`, {
4991
- method: 'POST',
4992
- });
4993
- }
4994
-
4995
- async getContextSessionGateStatus(contextSessionId) {
4996
- return this._request(`/api/context-session/${encodeURIComponent(contextSessionId)}/gate-status`);
4997
- }
4998
-
4999
- async conductOrientation({
5000
- agentId,
5001
- runtimeSessionId,
5002
- intentId,
5003
- executionPurpose,
5004
- agentSignature,
5005
- understandingSummary,
5006
- lockClaim = true,
5007
- } = {}) {
5008
- const { context_session, reminders } = await this.openContextSession({
5009
- agentId,
5010
- runtimeSessionId,
5011
- intentId,
5012
- executionPurpose,
5013
- });
5014
- const sessionId = context_session.context_session_id;
5015
-
5016
- const required = (reminders || []).filter(r => r.severity === 'required');
5017
- let acknowledgedCount = 0;
5018
- for (const reminder of required) {
5019
- await this.acknowledgeReminder(sessionId, {
5020
- reminderId: reminder.reminder_id,
5021
- agentSignature,
5022
- understandingSummary,
5023
- });
5024
- acknowledgedCount++;
5025
- }
5026
-
5027
- const completion = await this.completeOrientation(sessionId);
5028
-
5029
- let claimLockResult = null;
5030
- if (lockClaim) {
5031
- claimLockResult = await this.lockContextSessionClaim(sessionId);
5032
- }
5033
-
5034
- return {
5035
- context_session_id: sessionId,
5036
- intent_id: intentId,
5037
- context_session: claimLockResult?.context_session || completion.context_session,
5038
- gate_result: claimLockResult?.gate_result || completion.gate_result,
5039
- acknowledged_count: acknowledgedCount,
5040
- claim_locked: lockClaim && !!claimLockResult,
5041
- };
5042
- }
5043
-
5044
- // ─── Core HTTP ─────────────────────────────────────────────────────────────
5045
-
5046
- async _resolveAccessToken() {
5047
- return resolveAccessToken(this);
5048
- }
5049
-
5050
- async _buildHeaders({ headers, body, accept }) {
5051
- return buildHeaders(this, { headers, body, accept });
5052
- }
5053
-
5054
- async _assertExecutionEligibility(body = {}) {
5055
- const eligibility = await this.getExecutionEligibility(body);
5056
- if (eligibility?.execution_eligible && eligibility?.mutation_allowed) {
5057
- return eligibility;
5058
- }
5059
- const remediation = cleanText(eligibility?.remediation_command);
5060
- const verification = cleanText(eligibility?.verification_command);
5061
- throw buildEligibilityError(
5062
- [
5063
- `Execution eligibility gate blocked mutation${cleanText(body?.requested_mutation_surface) ? ` on ${cleanText(body.requested_mutation_surface)}` : ''}.`,
5064
- remediation ? `Fix: ${remediation}` : null,
5065
- verification ? `Then verify: ${verification}` : null,
5066
- ].filter(Boolean).join(' '),
5067
- {
5068
- required_gate: eligibility?.required_gate || 'execution_eligibility.required_gate',
5069
- execution_eligibility: eligibility ?? null,
5070
- },
5071
- );
5072
- }
5073
-
5074
- async _request(path, { method = 'GET', query, headers, body } = {}) {
5075
- return requestJson(this, path, { method, query, headers, body });
5076
- }
5077
-
5078
- async _requestText(path, { method = 'GET', query, headers, body } = {}) {
5079
- return requestText(this, path, { method, query, headers, body });
5080
- }
5081
-
5082
- async _requestLogaProjection(path, options = {}) {
5083
- return requestLogaProjection(this, path, options);
5084
- }
5085
-
5086
- async _requestBinary(path, { method = 'GET', query, headers, body } = {}) {
5087
- return requestBinary(this, path, { method, query, headers, body });
5088
- }
5089
2940
  }
5090
2941
 
5091
- export function createAIEngineClient(options) {
5092
- return new AIEngineClient(options);
2942
+ function installClientCompatibilityDelegates(ClientClass) {
2943
+ const proto = ClientClass.prototype;
2944
+ defineCompatibilityMethods(proto, 'health', ['ping']);
2945
+ defineCompatibilityMethods(proto, 'operatorStatus', ['currentWorkflowStatus', 'getCurrentWorkflowStatus', 'currentArchitectureIntegrityStatus', 'getCurrentArchitectureIntegrityStatus', 'currentSecurityGovernanceStatus', 'getCurrentSecurityGovernanceStatus', 'getExecutionTelemetryCurrent', 'listExecutionProcessRuns', 'getExecutionProcessRun', 'getGeneratedExecutionUsability', 'getLogaGeneratedExecutionUsabilityProjection', 'getAntiPatternRules', 'currentCodebaseShapeStatus', 'getLatestMemoryProjection', 'currentProjectStatus', 'getDashboard', 'getCommunicationCapabilities', 'getCollaborationCapabilities', 'getDeploymentCapabilities']);
2946
+ defineCompatibilityMethods(proto, 'database', ['query', 'createDatabaseBackup', 'listDatabaseBackups', 'getDatabaseBackup', 'listDatabaseBackupOperations', 'runAzureSqlBacpacBackup', 'listAzureSqlBacpacBackups', 'listAzureSqlBacpacBackupOperations']);
2947
+ defineCompatibilityMethods(proto, 'reports', ['runReport', 'runReportDefinition']);
2948
+ defineCompatibilityMethods(proto, 'retrievalWrapper', ['getCommandCard', 'resolveOperatingProcedure', 'getSymbolDefinition', 'getRelatedCode']);
2949
+ defineCompatibilityMethods(proto, 'repo', ['listRepositories', 'getRepository', 'listCodeFiles', 'getCodeFile', 'getCodeFileContentWindow', 'listCodeSymbolsByFile', 'getCodeSymbol', 'searchSymbols', 'getSymbolRelationships', 'listCodeRelationships', 'listActionObservations', 'listCodebaseShapeFindings', 'listObjectFlowObservations', 'getChangeAnalysis', 'listRefactorCandidates', 'analyzeRefactorCandidate', 'getRepoRetrievalPacket', 'getRepoRetrievalPacketFragments', 'evaluateProposalScope']);
2950
+ defineCompatibilityMethods(proto, 'retrievalManagement', ['getRetrievalStatus', 'getRetrievalProfileMetrics', 'getRetrievalFeedbackMetrics', 'getRetrievalQuery', 'getRetrievalPacket', 'generateRetrievalCandidates', 'selectRetrievalPacket', 'recordRetrievalFeedback', 'deriveRetrievalOptimizationCandidates', 'validatePromptAssembly']);
2951
+ defineCompatibilityMethods(proto, 'workflows', ['listWorkflows', 'createWorkflow', 'getWorkflow', 'replaceWorkflowSteps', 'publishWorkflow', 'cloneWorkflow', 'evaluateWorkflowGovernance', 'listWorkflowGovernanceDecisions', 'getWorkflowGovernanceSimulation', 'listWorkflowGovernanceBundles', 'listWorkflowGovernanceApprovals', 'listWorkflowGovernanceEvents', 'getWorkflowGovernanceReview', 'createWorkflowGovernanceReviewDecision', 'createWorkflowRun', 'getWorkflowRun', 'listWorkflowArtifacts', 'getWorkflowRunSubstrate', 'getWorkflowPlayback', 'resumeWorkflowRun', 'listRecentInspectorRuns', 'inspectWorkflowRun']);
2952
+ defineCompatibilityMethods(proto, 'projects', ['listProjects', 'getProject', 'listProjectWorkflowRuns', 'closeProject', 'closeActiveProject', 'getProjectBundle', 'listProjectOpenTasks', 'closeRoadmapItemWorkflow']);
2953
+ defineCompatibilityMethods(proto, 'projectChartering', ['createProjectCharter', 'createProjectDelivery', 'approveProjectCharterIntent', 'approveImplementationRoadmap', 'runProjectCharter', 'beginImplementationRoadmap', 'routeImplementationItem']);
2954
+ defineCompatibilityMethods(proto, 'projectReports', ['getProjectCharterReport', 'createProjectMarkdownDownload', 'downloadProjectMarkdownReport', 'downloadProjectCharterReportMarkdown']);
2955
+ defineCompatibilityMethods(proto, 'projectResume', ['resumeProjectWork']);
2956
+ defineCompatibilityMethods(proto, 'roadmaps', ['listProjectRoadmaps', 'getProjectRoadmap', 'getProjectRoadmapSummary', 'getProjectRoadmapActiveItem', 'listProjectOpenTasks', 'getProjectPerformanceMetrics', 'ensureProjectRoadmapTaskSurface']);
2957
+ defineCompatibilityMethods(proto, 'roadmapReports', ['getProjectImplementationRoadmapReport', 'downloadProjectImplementationRoadmapReportMarkdown']);
2958
+ defineCompatibilityMethods(proto, 'implementationTasks', ['createImplementationTask', 'listImplementationTasks', 'listImplementationSubtasks', 'updateImplementationTask', 'assignImplementationTask', 'completeImplementationTask']);
2959
+ defineCompatibilityMethods(proto, 'implementationPackets', ['importImplementationPacket', 'listImplementationPackets', 'getImplementationPacket', 'bindImplementationPacketToWorkflow', 'getWorkflowImplementationRoadmap', 'getWorkflowResumeContext', 'importImplementationPacketAndMaterializeRoadmap']);
2960
+ defineCompatibilityMethods(proto, 'implementationChecks', ['getImplementationItemAcceptanceChecks', 'updateAcceptanceCheckStatus', 'updateAcceptanceCheckStatusVerified']);
2961
+ defineCompatibilityMethods(proto, 'implementationArtifacts', ['getArtifactManifest', 'getDecisionPacket', 'verifyImplementationItemArtifacts']);
2962
+ defineCompatibilityMethods(proto, 'implementationItems', ['updateImplementationItemStatus', 'updateImplementationItemStatusVerified']);
2963
+ defineCompatibilityMethods(proto, 'implementationEvidence', ['addImplementationItemEvidence', 'addImplementationItemActivity', 'listImplementationItemActivity']);
2964
+ defineCompatibilityMethods(proto, 'implementationGates', ['createImplementationPacketGateDecision']);
2965
+ defineCompatibilityMethods(proto, 'workflowTurns', ['completeTurn', 'persistAssistantTurn']);
2966
+ defineCompatibilityMethods(proto, 'claims', ['getClaim', 'claimIsValid', 'signoffClaim', 'promoteClaimSurface']);
2967
+ defineCompatibilityMethods(proto, 'sessionGovernance', ['startSessionGovernance', 'startReviewGovernance', 'evaluateTurnCompliance', 'blockIfNonCompliant']);
2968
+ defineCompatibilityMethods(proto, 'workStart', ['startWork', 'startClaimedWork', 'claimWorkItem', 'bindClaimedWorkItem']);
2969
+ defineCompatibilityMethods(proto, 'executionEligibility', ['getExecutionEligibility', '_assertExecutionEligibility']);
2970
+ defineCompatibilityMethods(proto, 'toolBindingApprovals', ['createWorkflowToolBindingApprovalLane', 'recordWorkflowToolBindingApprovalDecision', 'executeWorkflowToolBindingApprovalBinding', 'revalidateWorkflowToolBindingStartup']);
2971
+ defineCompatibilityMethods(proto, 'verifiedMutations', ['executeVerifiedMutation']);
2972
+ defineCompatibilityMethods(proto, 'charters', ['runCharter']);
2973
+ defineCompatibilityMethods(proto, 'pingPong', ['checkCoordinationPingPongPreflight', 'startCoordinationPingPong', 'sendCoordinationPing', 'sendCoordinationPong', 'getCoordinationPingPongStatus', 'stopCoordinationPingPong']);
2974
+ defineCompatibilityAliases(proto, 'pingPong', { pingAgentCommunicationPeer: 'sendCoordinationPing', pongAgentCommunicationPeer: 'sendCoordinationPong' });
2975
+ defineCompatibilityMethods(proto, 'transferChannels', ['listCommunicationChannels', 'listOpenCommunicationChannels', 'getCommunicationChannelStatus', 'getCommunicationChannelParticipants', 'openTransferChannel', 'joinTransferChannel', 'resumeTransferChannel', 'replyToTransferChannel', 'closeTransferChannel', 'requestTransferClosure', 'openAgentChannel', 'connectToTransferChannel', 'startAgentConnection', 'postAgentHeartbeat', 'closeAgentChannel']);
2976
+ defineCompatibilityMethods(proto, 'messageWatch', ['startMessageWatch', 'acknowledgeExpectedMessage', 'expireMessageWatch', 'respondToMessageWatch', 'acceptAgentChannel', 'resolveMessageWatchId']);
2977
+ defineCompatibilityMethods(proto, 'presence', ['getPresenceBoard', 'getChannelPresence', 'markParticipantOnline', 'markParticipantOffline', 'whoIsOnline', 'findOnlineParticipant', 'sendToParticipant', 'sendToRole', 'postPresenceHeartbeat']);
2978
+ defineCompatibilityMethods(proto, 'collaborationDomain', ['reviewCollaborationProposal', 'reviseCollaborationProposal', 'postCollaborationProposal', 'acceptCollaborationProposal', 'assignCollaborationOwnership', 'raiseCollaborationBlocker', 'resolveCollaborationBlocker', 'postCollaborationHeartbeat', 'beginCollaborationImplementation', 'requestCollaborationClosure']);
2979
+ defineCompatibilityMethods(proto, 'transferBundles', ['transferWorkPacket', 'getTransferBundle', 'listTransferBundles', 'createTransferReceipt', 'listTransferReceipts', 'createCommunicationBundle', 'getCommunicationBundle', 'listCommunicationBundles', 'addCommunicationBundleItem', 'uploadCommunicationBundle', 'attachCommunicationBundleToMessage', 'recordCommunicationBundleReceipt', 'recordCommunicationBundleCleanupEvent', 'claimCommunicationBundle', 'recordCommunicationTransferReceipt']);
2980
+ defineCompatibilityMethods(proto, 'workflowComposition', ['registerModernizationAsset', 'classifyModernizationAsset', 'discoverSalvageCandidates', 'createModernizationWorkPacket', 'requestModernizationWrapperExecution', 'getModernizationWrapperEvidence', 'decideModernizationGate']);
2981
+ defineCompatibilityMethods(proto, 'currentProject', ['currentProjectStatus']);
2982
+ defineCompatibilityMethods(proto, 'projections', ['renderProjection', 'getLogaOperatorHomeProjection', 'getLogaProjectCatalogProjection', 'getLogaProjectPortfolioProjection', 'getLogaProjectRoadmapProjection', 'getLogaRoadmapItemProjection', 'getLogaWorkflowRunProjection', 'getLogaEvidencePacketProjection', 'getLogaTransferHomeProjection', 'getLogaTransferInboxProjection', 'getLogaTransferPacketProjection', 'getLogaTransferNegotiationEventsProjection', 'getLogaTransferFrictionLaneProjection', 'getLogaTransferReceiptsProjection', 'getLogaTransferClosureReviewProjection', 'getTransferChannelProjection']);
2983
+ defineCompatibilityAliases(proto, 'projections', { getLogaTransferChannelThreadProjection: 'getTransferChannelProjection' });
2984
+ defineCompatibilityMethods(proto, 'loga', ['submitUxGateRemediation', 'listUxGateRemediations', 'getUxGateRemediation', 'appendUxRemediationTicketNote', 'listUxRemediationTicketNotes', 'promoteUxGateRemediationImplementationCandidate', 'getLogaUxGateRemediationProjection', 'getUxGateRemediationProjection']);
2985
+ defineCompatibilityMethods(proto, 'actions', ['submitActionIntent']);
2986
+ defineCompatibilityMethods(proto, 'executionTelemetry', ['getExecutionTelemetryCurrent', 'listExecutionProcessRuns', 'getExecutionProcessRun', 'getGeneratedExecutionUsability', 'getLogaGeneratedExecutionUsabilityProjection']);
2987
+ defineCompatibilityMethods(proto, 'scripts', ['generateScript', 'renderScript', 'submitScriptArtifact', 'getScriptRunEvidence']);
2988
+ defineCompatibilityMethods(proto, 'capabilities', ['listCapabilities', 'createCapability', 'testCapability']);
2989
+ defineCompatibilityMethods(proto, 'skills', ['currentSkillRegistryStatus', 'getSkillContract', 'getSkillGovernance', 'createSkillContractDraft', 'recordSkillPatternReview', 'approveSkillContract', 'createWorkflowSkillContract', 'listWorkflowSkillBindings', 'seedFrequentOperationSkills']);
2990
+ defineCompatibilityMethods(proto, 'skillGovernance', ['createSkillGovernanceChange', 'listSkillGovernanceChanges', 'getSkillGovernanceChange']);
2991
+ defineCompatibilityMethods(proto, 'toolRegistry', ['currentToolRegistryStatus', 'getWorkflowToolRegistry', 'currentAssistantToolContext', 'getTool', 'getToolHistory', 'getToolInvocations', 'getToolEventReplayBundle', 'getToolGovernance', 'createToolReviewDecision', 'createToolGateDecision']);
2992
+ defineCompatibilityMethods(proto, 'contextAssembly', ['getContextAssemblyContract', 'getContextAssemblyStatus', 'getOperatorContext', 'getContextFragments', 'getContextReuse', 'listPromptAssemblies']);
2993
+ defineCompatibilityMethods(proto, 'performance', ['getSessionPerformanceMetrics', 'captureBenchmarkSnapshot', 'listBenchmarks', 'getBenchmarkMetrics', 'getBenchmarkDelta', 'getBenchmarkTrend', 'getPerformanceDashboard']);
2994
+ defineCompatibilityMethods(proto, 'selfLearning', ['getSelfLearningPosture', 'listLearningRecords', 'getLearningRecord', 'listPromotionCandidates', 'getPromotionCandidate', 'listPromotionFlows']);
2995
+ defineCompatibilityMethods(proto, 'selfOptimization', ['getSelfOptimizationDashboard', 'getSelfOptimizationCandidateQueue', 'getSelfOptimizationBacklogPosture', 'getSelfOptimizationPendingHandoffs']);
2996
+ defineCompatibilityMethods(proto, 'designIntelligence', ['getDesignIntelligenceDashboard', 'listDesignDecisions', 'getDesignDecision', 'getDesignDecisionVariants', 'getDesignDecisionCritique', 'getDesignDecisionLineage', 'listDesignPatterns', 'getDecisionLabCanvas', 'getDesignRecommendations', 'getDesignPromotions', 'previewDesignPromotion', 'getDesignIntelligenceMetrics']);
2997
+ defineCompatibilityMethods(proto, 'scriptDiscovery', ['scanScripts', 'listDiscoveredScriptAssets', 'listDiscoveredCapabilities', 'listWorkflowCandidates', 'promoteWorkflowCandidate']);
2998
+ defineCompatibilityMethods(proto, 'notesLab', ['getNotesLabConfig', 'submitNote', 'approveNoteReview']);
2999
+ defineCompatibilityMethods(proto, 'searchContacts', ['search', 'getOrganization', 'getContact']);
3000
+ defineCompatibilityMethods(proto, 'benchmarks', ['listRecentBenchmarkRuns', 'getBenchmarkRun']);
3001
+ defineCompatibilityMethods(proto, 'commitGovernance', ['evaluateCommitGovernance', 'checkGitShipReadiness', 'getCommitGovernanceEvaluation', 'listCommitGovernanceEvaluationsByClaim']);
3002
+ defineCompatibilityMethods(proto, 'contextSessions', ['openContextSession', 'getOrientationWindow', 'acknowledgeReminder', 'completeOrientation', 'lockContextSessionClaim', 'getContextSessionGateStatus']);
3003
+ defineCompatibilityMethods(proto, 'contextOrientation', ['conductOrientation']);
5093
3004
  }
3005
+
3006
+ installClientCompatibilityDelegates(AIEngineClient);