@sparkelf/dsh-dataops-managed 0.3.43 → 0.3.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -835,22 +835,22 @@ window.__ModuleLoader__.load({
835
835
  document.head.appendChild(tag);
836
836
  }
837
837
  var ManagedDataOpsSection_module_css_default = {
838
- "reviewActions": "_2dqzjG_reviewActions",
839
838
  "section": "_2dqzjG_section",
839
+ "card": "_2dqzjG_card",
840
840
  "actions": "_2dqzjG_actions",
841
- "heading": "_2dqzjG_heading",
842
- "refusal": "_2dqzjG_refusal",
843
- "reviewRow": "_2dqzjG_reviewRow",
844
- "title": "_2dqzjG_title",
845
841
  "meta": "_2dqzjG_meta",
846
- "row": "_2dqzjG_row",
847
- "reviewHint": "_2dqzjG_reviewHint",
848
842
  "label": "_2dqzjG_label",
849
- "copy": "_2dqzjG_copy",
850
- "status": "_2dqzjG_status",
851
- "card": "_2dqzjG_card",
843
+ "row": "_2dqzjG_row",
844
+ "refusal": "_2dqzjG_refusal",
852
845
  "reviewRows": "_2dqzjG_reviewRows",
853
- "fields": "_2dqzjG_fields"
846
+ "reviewActions": "_2dqzjG_reviewActions",
847
+ "status": "_2dqzjG_status",
848
+ "heading": "_2dqzjG_heading",
849
+ "reviewRow": "_2dqzjG_reviewRow",
850
+ "copy": "_2dqzjG_copy",
851
+ "reviewHint": "_2dqzjG_reviewHint",
852
+ "fields": "_2dqzjG_fields",
853
+ "title": "_2dqzjG_title"
854
854
  };
855
855
  //#endregion
856
856
  //#region src/client/ReviewSettingsCard.tsx
@@ -1600,62 +1600,62 @@ window.__ModuleLoader__.load({
1600
1600
  document.head.appendChild(tag);
1601
1601
  }
1602
1602
  var SkillPlazaSection_module_css_default = {
1603
- "risk": "_9FdZvq_risk",
1604
- "findings": "_9FdZvq_findings",
1605
- "cardIcon": "_9FdZvq_cardIcon",
1606
- "finding": "_9FdZvq_finding",
1607
- "cardTitle": "_9FdZvq_cardTitle",
1608
- "tab": "_9FdZvq_tab",
1609
- "reviewNote": "_9FdZvq_reviewNote",
1610
- "riskEmpty": "_9FdZvq_riskEmpty",
1611
- "findingText": "_9FdZvq_findingText",
1612
- "cards": "_9FdZvq_cards",
1613
- "detailRow": "_9FdZvq_detailRow",
1614
- "empty": "_9FdZvq_empty",
1603
+ "cardEnd": "_9FdZvq_cardEnd",
1604
+ "riskHead": "_9FdZvq_riskHead",
1615
1605
  "detailValue": "_9FdZvq_detailValue",
1616
- "detailButton": "_9FdZvq_detailButton",
1606
+ "riskSummary": "_9FdZvq_riskSummary",
1607
+ "findingHint": "_9FdZvq_findingHint",
1617
1608
  "cardTop": "_9FdZvq_cardTop",
1618
- "detailLabel": "_9FdZvq_detailLabel",
1609
+ "sharedTag": "_9FdZvq_sharedTag",
1610
+ "reviewError": "_9FdZvq_reviewError",
1611
+ "mine": "_9FdZvq_mine",
1612
+ "titleCount": "_9FdZvq_titleCount",
1613
+ "title": "_9FdZvq_title",
1614
+ "status": "_9FdZvq_status",
1619
1615
  "mark": "_9FdZvq_mark",
1620
- "detail": "_9FdZvq_detail",
1621
- "departmentSelect": "_9FdZvq_departmentSelect",
1616
+ "dialog": "_9FdZvq_dialog",
1617
+ "noteField": "_9FdZvq_noteField",
1618
+ "notice": "_9FdZvq_notice",
1622
1619
  "tagTop": "_9FdZvq_tagTop",
1620
+ "findingText": "_9FdZvq_findingText",
1623
1621
  "pendingTag": "_9FdZvq_pendingTag",
1624
- "auditDialog": "_9FdZvq_auditDialog",
1625
- "card": "_9FdZvq_card",
1626
- "demoTag": "_9FdZvq_demoTag",
1627
- "auditFooter": "_9FdZvq_auditFooter",
1628
- "title": "_9FdZvq_title",
1629
- "tabs": "_9FdZvq_tabs",
1630
- "titleCount": "_9FdZvq_titleCount",
1622
+ "cardIcon": "_9FdZvq_cardIcon",
1623
+ "head": "_9FdZvq_head",
1631
1624
  "tabCount": "_9FdZvq_tabCount",
1632
- "departmentBar": "_9FdZvq_departmentBar",
1633
- "findingHint": "_9FdZvq_findingHint",
1634
- "reviewError": "_9FdZvq_reviewError",
1635
- "emptyText": "_9FdZvq_emptyText",
1636
1625
  "section": "_9FdZvq_section",
1637
- "status": "_9FdZvq_status",
1626
+ "tab": "_9FdZvq_tab",
1627
+ "headRow": "_9FdZvq_headRow",
1638
1628
  "departmentLabel": "_9FdZvq_departmentLabel",
1639
- "cardEnd": "_9FdZvq_cardEnd",
1640
- "dialog": "_9FdZvq_dialog",
1641
- "sharedTag": "_9FdZvq_sharedTag",
1642
- "riskSummary": "_9FdZvq_riskSummary",
1643
1629
  "riskScore": "_9FdZvq_riskScore",
1644
- "notice": "_9FdZvq_notice",
1645
- "mine": "_9FdZvq_mine",
1646
- "head": "_9FdZvq_head",
1630
+ "departmentBar": "_9FdZvq_departmentBar",
1631
+ "audit": "_9FdZvq_audit",
1632
+ "detail": "_9FdZvq_detail",
1647
1633
  "rejectedTag": "_9FdZvq_rejectedTag",
1634
+ "auditDialog": "_9FdZvq_auditDialog",
1648
1635
  "cardDesc": "_9FdZvq_cardDesc",
1649
- "severity": "_9FdZvq_severity",
1650
- "headRow": "_9FdZvq_headRow",
1651
- "noteField": "_9FdZvq_noteField",
1652
- "riskFailed": "_9FdZvq_riskFailed",
1653
- "emptyIcon": "_9FdZvq_emptyIcon",
1636
+ "detailButton": "_9FdZvq_detailButton",
1637
+ "emptyText": "_9FdZvq_emptyText",
1638
+ "auditFooter": "_9FdZvq_auditFooter",
1639
+ "cardTitle": "_9FdZvq_cardTitle",
1640
+ "departmentSelect": "_9FdZvq_departmentSelect",
1641
+ "reviewButton": "_9FdZvq_reviewButton",
1642
+ "risk": "_9FdZvq_risk",
1654
1643
  "cardMarks": "_9FdZvq_cardMarks",
1655
- "riskHead": "_9FdZvq_riskHead",
1644
+ "riskEmpty": "_9FdZvq_riskEmpty",
1656
1645
  "tabActive": "_9FdZvq_tabActive",
1657
- "reviewButton": "_9FdZvq_reviewButton",
1658
- "audit": "_9FdZvq_audit"
1646
+ "detailLabel": "_9FdZvq_detailLabel",
1647
+ "demoTag": "_9FdZvq_demoTag",
1648
+ "cards": "_9FdZvq_cards",
1649
+ "riskFailed": "_9FdZvq_riskFailed",
1650
+ "reviewNote": "_9FdZvq_reviewNote",
1651
+ "severity": "_9FdZvq_severity",
1652
+ "card": "_9FdZvq_card",
1653
+ "emptyIcon": "_9FdZvq_emptyIcon",
1654
+ "tabs": "_9FdZvq_tabs",
1655
+ "findings": "_9FdZvq_findings",
1656
+ "detailRow": "_9FdZvq_detailRow",
1657
+ "empty": "_9FdZvq_empty",
1658
+ "finding": "_9FdZvq_finding"
1659
1659
  };
1660
1660
  //#endregion
1661
1661
  //#region src/client/SkillPlazaSection.tsx
@@ -2310,19 +2310,19 @@ window.__ModuleLoader__.load({
2310
2310
  document.head.appendChild(tag);
2311
2311
  }
2312
2312
  var WanxiangBrand_module_css_default = {
2313
- "unitTop": "s0HPxG_unitTop",
2314
- "unitLeft": "s0HPxG_unitLeft",
2315
- "harness": "s0HPxG_harness",
2316
- "wordmark": "s0HPxG_wordmark",
2317
2313
  "mark": "s0HPxG_mark",
2314
+ "unitLeft": "s0HPxG_unitLeft",
2318
2315
  "animatedMark": "s0HPxG_animatedMark",
2319
2316
  "unit-top": "s0HPxG_unit-top",
2317
+ "unit-left": "s0HPxG_unit-left",
2318
+ "unit-core": "s0HPxG_unit-core",
2319
+ "wordmark": "s0HPxG_wordmark",
2320
2320
  "unit-right": "s0HPxG_unit-right",
2321
- "sidebarName": "s0HPxG_sidebarName",
2321
+ "unitRight": "s0HPxG_unitRight",
2322
+ "harness": "s0HPxG_harness",
2323
+ "unitTop": "s0HPxG_unitTop",
2322
2324
  "unitCore": "s0HPxG_unitCore",
2323
- "unit-core": "s0HPxG_unit-core",
2324
- "unit-left": "s0HPxG_unit-left",
2325
- "unitRight": "s0HPxG_unitRight"
2325
+ "sidebarName": "s0HPxG_sidebarName"
2326
2326
  };
2327
2327
  //#endregion
2328
2328
  //#region src/client/WanxiangBrand.tsx
@@ -2739,92 +2739,92 @@ window.__ModuleLoader__.load({
2739
2739
  document.head.appendChild(tag);
2740
2740
  }
2741
2741
  var PermissionCenterSection_module_css_default = {
2742
- "matrixPermission": "PNbOqW_matrixPermission",
2743
- "treeChildren": "PNbOqW_treeChildren",
2742
+ "comboboxSearch": "PNbOqW_comboboxSearch",
2743
+ "onlyAdmin": "PNbOqW_onlyAdmin",
2744
+ "matrixRoleCell": "PNbOqW_matrixRoleCell",
2745
+ "pager": "PNbOqW_pager",
2746
+ "roleTag": "PNbOqW_roleTag",
2747
+ "field": "PNbOqW_field",
2744
2748
  "adminTag": "PNbOqW_adminTag",
2745
- "comboboxHint": "PNbOqW_comboboxHint",
2746
- "muted": "PNbOqW_muted",
2747
- "roleSearch": "PNbOqW_roleSearch",
2748
- "panelFoot": "PNbOqW_panelFoot",
2749
- "matrixTool": "PNbOqW_matrixTool",
2750
- "treeActions": "PNbOqW_treeActions",
2751
- "panel": "PNbOqW_panel",
2752
- "matrixScroll": "PNbOqW_matrixScroll",
2753
- "page": "PNbOqW_page",
2754
- "tabDivider": "PNbOqW_tabDivider",
2755
- "tabActive": "PNbOqW_tabActive",
2756
- "matrix": "PNbOqW_matrix",
2757
- "readOnly": "PNbOqW_readOnly",
2749
+ "treeName": "PNbOqW_treeName",
2750
+ "matrixModule": "PNbOqW_matrixModule",
2751
+ "comboboxEmpty": "PNbOqW_comboboxEmpty",
2752
+ "matrixHead": "PNbOqW_matrixHead",
2753
+ "waiting": "PNbOqW_waiting",
2754
+ "roleSearchWrap": "PNbOqW_roleSearchWrap",
2755
+ "dialogBody": "PNbOqW_dialogBody",
2756
+ "treeToggle": "PNbOqW_treeToggle",
2758
2757
  "comboboxPlaceholder": "PNbOqW_comboboxPlaceholder",
2759
2758
  "comboboxCheck": "PNbOqW_comboboxCheck",
2760
- "title": "PNbOqW_title",
2761
- "subtitle": "PNbOqW_subtitle",
2762
2759
  "matrixGroup": "PNbOqW_matrixGroup",
2763
- "comboboxOptionActive": "PNbOqW_comboboxOptionActive",
2764
- "roleTags": "PNbOqW_roleTags",
2765
- "demo": "PNbOqW_demo",
2766
- "tabGroup": "PNbOqW_tabGroup",
2767
- "headText": "PNbOqW_headText",
2768
- "error": "PNbOqW_error",
2760
+ "treeActions": "PNbOqW_treeActions",
2769
2761
  "protected": "PNbOqW_protected",
2770
- "treeToggle": "PNbOqW_treeToggle",
2771
- "field": "PNbOqW_field",
2772
- "matrixModule": "PNbOqW_matrixModule",
2773
- "permission": "PNbOqW_permission",
2774
- "departments": "PNbOqW_departments",
2775
- "empty": "PNbOqW_empty",
2776
- "detailGrid": "PNbOqW_detailGrid",
2762
+ "deptAdmins": "PNbOqW_deptAdmins",
2763
+ "matrixTool": "PNbOqW_matrixTool",
2764
+ "candidate": "PNbOqW_candidate",
2765
+ "error": "PNbOqW_error",
2766
+ "copied": "PNbOqW_copied",
2767
+ "roleCell": "PNbOqW_roleCell",
2768
+ "matrixNote": "PNbOqW_matrixNote",
2777
2769
  "tabs": "PNbOqW_tabs",
2778
- "dialogBody": "PNbOqW_dialogBody",
2779
- "dialogHint": "PNbOqW_dialogHint",
2770
+ "tab": "PNbOqW_tab",
2771
+ "tabActive": "PNbOqW_tabActive",
2772
+ "tabBadge": "PNbOqW_tabBadge",
2773
+ "matrix": "PNbOqW_matrix",
2780
2774
  "roleSearchIcon": "PNbOqW_roleSearchIcon",
2781
- "matrixHeadLeft": "PNbOqW_matrixHeadLeft",
2775
+ "headText": "PNbOqW_headText",
2776
+ "empty": "PNbOqW_empty",
2782
2777
  "tableScroll": "PNbOqW_tableScroll",
2783
- "scopeBadge": "PNbOqW_scopeBadge",
2784
- "matrixHead": "PNbOqW_matrixHead",
2785
- "panelHead": "PNbOqW_panelHead",
2786
- "head": "PNbOqW_head",
2778
+ "matrixHeadLeft": "PNbOqW_matrixHeadLeft",
2787
2779
  "table": "PNbOqW_table",
2788
- "notice": "PNbOqW_notice",
2789
- "copied": "PNbOqW_copied",
2790
- "search": "PNbOqW_search",
2791
- "permCopy": "PNbOqW_permCopy",
2792
- "roleTag": "PNbOqW_roleTag",
2780
+ "readOnly": "PNbOqW_readOnly",
2781
+ "tabDivider": "PNbOqW_tabDivider",
2782
+ "treeRoot": "PNbOqW_treeRoot",
2783
+ "muted": "PNbOqW_muted",
2784
+ "matrixPermission": "PNbOqW_matrixPermission",
2785
+ "matrixToolActive": "PNbOqW_matrixToolActive",
2786
+ "scopeBadge": "PNbOqW_scopeBadge",
2787
+ "detailGrid": "PNbOqW_detailGrid",
2788
+ "roleTags": "PNbOqW_roleTags",
2789
+ "title": "PNbOqW_title",
2793
2790
  "dialog": "PNbOqW_dialog",
2794
- "comboboxMenu": "PNbOqW_comboboxMenu",
2791
+ "panel": "PNbOqW_panel",
2792
+ "treeChildren": "PNbOqW_treeChildren",
2793
+ "matrixRoleHead": "PNbOqW_matrixRoleHead",
2795
2794
  "comboboxList": "PNbOqW_comboboxList",
2796
- "comboboxOption": "PNbOqW_comboboxOption",
2797
- "roleCell": "PNbOqW_roleCell",
2798
2795
  "roleGrant": "PNbOqW_roleGrant",
2799
- "dialogFooter": "PNbOqW_dialogFooter",
2800
- "matrixRoleHead": "PNbOqW_matrixRoleHead",
2801
- "roleSearchWrap": "PNbOqW_roleSearchWrap",
2802
- "treeSpacer": "PNbOqW_treeSpacer",
2803
- "rowActions": "PNbOqW_rowActions",
2804
- "sectionTitle": "PNbOqW_sectionTitle",
2805
- "headActions": "PNbOqW_headActions",
2806
- "treeRoot": "PNbOqW_treeRoot",
2807
- "treeRow": "PNbOqW_treeRow",
2796
+ "comboboxHint": "PNbOqW_comboboxHint",
2797
+ "combobox": "PNbOqW_combobox",
2798
+ "page": "PNbOqW_page",
2799
+ "department": "PNbOqW_department",
2808
2800
  "candidates": "PNbOqW_candidates",
2809
- "onlyAdmin": "PNbOqW_onlyAdmin",
2810
- "pager": "PNbOqW_pager",
2811
2801
  "permDescription": "PNbOqW_permDescription",
2812
2802
  "matrixPermHead": "PNbOqW_matrixPermHead",
2813
- "treeName": "PNbOqW_treeName",
2803
+ "comboboxMenu": "PNbOqW_comboboxMenu",
2804
+ "sectionTitle": "PNbOqW_sectionTitle",
2805
+ "roleSearch": "PNbOqW_roleSearch",
2806
+ "comboboxOption": "PNbOqW_comboboxOption",
2807
+ "headActions": "PNbOqW_headActions",
2808
+ "rowActions": "PNbOqW_rowActions",
2809
+ "matrixScroll": "PNbOqW_matrixScroll",
2810
+ "comboboxOptionActive": "PNbOqW_comboboxOptionActive",
2811
+ "tabGroup": "PNbOqW_tabGroup",
2812
+ "treeSpacer": "PNbOqW_treeSpacer",
2813
+ "treeRow": "PNbOqW_treeRow",
2814
+ "panelFoot": "PNbOqW_panelFoot",
2814
2815
  "comboboxTrigger": "PNbOqW_comboboxTrigger",
2815
- "comboboxSearch": "PNbOqW_comboboxSearch",
2816
- "tab": "PNbOqW_tab",
2817
- "matrixNote": "PNbOqW_matrixNote",
2818
- "combobox": "PNbOqW_combobox",
2819
- "matrixRoleCell": "PNbOqW_matrixRoleCell",
2820
- "candidate": "PNbOqW_candidate",
2816
+ "dialogHint": "PNbOqW_dialogHint",
2817
+ "demo": "PNbOqW_demo",
2818
+ "permCopy": "PNbOqW_permCopy",
2819
+ "subtitle": "PNbOqW_subtitle",
2820
+ "notice": "PNbOqW_notice",
2821
2821
  "roleRevoke": "PNbOqW_roleRevoke",
2822
- "comboboxEmpty": "PNbOqW_comboboxEmpty",
2823
- "tabBadge": "PNbOqW_tabBadge",
2824
- "waiting": "PNbOqW_waiting",
2825
- "matrixToolActive": "PNbOqW_matrixToolActive",
2826
- "department": "PNbOqW_department",
2827
- "deptAdmins": "PNbOqW_deptAdmins"
2822
+ "search": "PNbOqW_search",
2823
+ "head": "PNbOqW_head",
2824
+ "dialogFooter": "PNbOqW_dialogFooter",
2825
+ "permission": "PNbOqW_permission",
2826
+ "panelHead": "PNbOqW_panelHead",
2827
+ "departments": "PNbOqW_departments"
2828
2828
  };
2829
2829
  //#endregion
2830
2830
  //#region src/client/combobox.ts
@@ -4475,18 +4475,18 @@ window.__ModuleLoader__.load({
4475
4475
  document.head.appendChild(tag);
4476
4476
  }
4477
4477
  var WorkspaceUpgradePrompt_module_css_default = {
4478
- "banner": "razUfG_banner",
4479
4478
  "sessionList": "razUfG_sessionList",
4480
- "copy": "razUfG_copy",
4479
+ "banner": "razUfG_banner",
4480
+ "sessionPath": "razUfG_sessionPath",
4481
4481
  "error": "razUfG_error",
4482
- "title": "razUfG_title",
4482
+ "sessionRow": "razUfG_sessionRow",
4483
+ "body": "razUfG_body",
4484
+ "sessionTitle": "razUfG_sessionTitle",
4483
4485
  "dialogBody": "razUfG_dialogBody",
4484
4486
  "dialogText": "razUfG_dialogText",
4485
- "sessionPath": "razUfG_sessionPath",
4486
- "body": "razUfG_body",
4487
4487
  "actions": "razUfG_actions",
4488
- "sessionRow": "razUfG_sessionRow",
4489
- "sessionTitle": "razUfG_sessionTitle"
4488
+ "title": "razUfG_title",
4489
+ "copy": "razUfG_copy"
4490
4490
  };
4491
4491
  //#endregion
4492
4492
  //#region src/client/WorkspaceUpgradePrompt.tsx
@@ -4799,24 +4799,24 @@ window.__ModuleLoader__.load({
4799
4799
  document.head.appendChild(tag);
4800
4800
  }
4801
4801
  var NotificationBell_module_css_default = {
4802
- "rowBody": "tE0trG_rowBody",
4803
- "dialog": "tE0trG_dialog",
4804
- "rowIcon": "tE0trG_rowIcon",
4805
- "demo": "tE0trG_demo",
4802
+ "empty": "tE0trG_empty",
4803
+ "rowTime": "tE0trG_rowTime",
4806
4804
  "actions": "tE0trG_actions",
4807
4805
  "button": "tE0trG_button",
4808
- "empty": "tE0trG_empty",
4806
+ "rowMeta": "tE0trG_rowMeta",
4807
+ "demo": "tE0trG_demo",
4808
+ "badge": "tE0trG_badge",
4809
+ "linkButton": "tE0trG_linkButton",
4809
4810
  "dot": "tE0trG_dot",
4810
4811
  "list": "tE0trG_list",
4811
- "rowMeta": "tE0trG_rowMeta",
4812
+ "bell": "tE0trG_bell",
4813
+ "dialog": "tE0trG_dialog",
4814
+ "rowBody": "tE0trG_rowBody",
4812
4815
  "rowText": "tE0trG_rowText",
4813
- "linkButton": "tE0trG_linkButton",
4814
- "row": "tE0trG_row",
4815
4816
  "pager": "tE0trG_pager",
4816
- "badge": "tE0trG_badge",
4817
- "rowTime": "tE0trG_rowTime",
4818
- "rowTitle": "tE0trG_rowTitle",
4819
- "bell": "tE0trG_bell"
4817
+ "rowIcon": "tE0trG_rowIcon",
4818
+ "row": "tE0trG_row",
4819
+ "rowTitle": "tE0trG_rowTitle"
4820
4820
  };
4821
4821
  //#endregion
4822
4822
  //#region src/client/NotificationBell.tsx
package/lib/index.js CHANGED
@@ -3196,6 +3196,59 @@ var AiToolManager = class {
3196
3196
  }
3197
3197
  };
3198
3198
  //#endregion
3199
+ //#region src/scoped-credential.ts
3200
+ /**
3201
+ * Fold a Session id into the credential-ref alphabet.
3202
+ *
3203
+ * Credential references are uppercase underscore tokens, and the MCP bridge derives the same name
3204
+ * from the Session id it is serving. Both sides use this function so they cannot drift.
3205
+ * @param baseRef - the workspace credential reference, for example `DATAOPS_ACCESS_TOKEN`.
3206
+ * @param sessionId - the room Session id.
3207
+ * @returns the scoped reference for that Session.
3208
+ */
3209
+ function scopedCredentialRef(baseRef, sessionId) {
3210
+ return `${baseRef}_S_${sessionId.toUpperCase().replace(/[^A-Z0-9]+/g, "_").replace(/^_+|_+$/g, "")}`;
3211
+ }
3212
+ /**
3213
+ * Mint one room's scoped token and store it.
3214
+ *
3215
+ * Failure is reported and swallowed: the room keeps working on the workspace credential, which is
3216
+ * the pre-connector behaviour, so a backend outage degrades authority instead of breaking chat.
3217
+ * @param deps - endpoint, credential store, and logger.
3218
+ * @param baseRef - the workspace credential reference the scoped name derives from.
3219
+ * @param sessionId - the room Session the token is minted for.
3220
+ * @param actorUserId - the DataOps user the room acts for.
3221
+ * @returns the stored reference, or undefined when minting failed.
3222
+ */
3223
+ async function mintScopedCredential(deps, baseRef, sessionId, actorUserId) {
3224
+ const ref = scopedCredentialRef(baseRef, sessionId);
3225
+ try {
3226
+ const result = await deps.request("/api/ai/workspace/scoped-token", {
3227
+ method: "POST",
3228
+ body: JSON.stringify({
3229
+ sessionId,
3230
+ actorUserId
3231
+ })
3232
+ });
3233
+ const token = tokenOf(result.body);
3234
+ if (result.status !== 200 || token === void 0) {
3235
+ deps.warn(`scoped credential for ${sessionId} was not minted (status ${String(result.status)})`);
3236
+ return;
3237
+ }
3238
+ await deps.set(ref, token);
3239
+ return ref;
3240
+ } catch (error) {
3241
+ deps.warn(`scoped credential for ${sessionId} failed to mint`, error);
3242
+ return;
3243
+ }
3244
+ }
3245
+ /** Read the token out of an unknown mint response body. */
3246
+ function tokenOf(body) {
3247
+ if (typeof body !== "object" || body === null) return void 0;
3248
+ const value = body["token"];
3249
+ return typeof value === "string" && value !== "" ? value : void 0;
3250
+ }
3251
+ //#endregion
3199
3252
  //#region src/resource-tab.ts
3200
3253
  /** SSE route the client subscribes to. */
3201
3254
  const OPEN_RESOURCE_EVENTS_PATH = "/integrations/dataops/open-resource/events";
@@ -3739,6 +3792,8 @@ const inject = [
3739
3792
  "approval"
3740
3793
  ];
3741
3794
  const MANAGED_AUTH_PATH = "/integrations/dataops/managed-auth";
3795
+ /** Where the connector mints one room Session's scoped credential. */
3796
+ const SCOPED_TOKEN_PATH = "/integrations/dataops/scoped-token";
3742
3797
  /** This plugin's profile entry id, which owns its Config and sync state. */
3743
3798
  const MANAGED_PLUGIN_ID = "dataops-managed";
3744
3799
  /** Same-origin route the workspace settings pages use to read and change model sharing. */
@@ -4132,6 +4187,43 @@ async function apply(ctx, config) {
4132
4187
  reviewApiRef = reviewApi;
4133
4188
  const resourceTabHub = new OpenResourceHub(ctx.logger);
4134
4189
  ctx.effect(() => () => resourceTabHub.dispose(), "dataops-managed: resource tab SSE clients");
4190
+ /**
4191
+ * Mint the scoped credential one room Session uses.
4192
+ *
4193
+ * The connector calls this after it created (or adopted) the room Session with an actor, passing
4194
+ * the DataOps user the room acts for. The token is stored under the Session-specific ref the MCP
4195
+ * bridge derives from the same Session id; a failed mint answers 502 and leaves the room on the
4196
+ * workspace credential, which is what it would have used anyway.
4197
+ */
4198
+ ctx.effect(() => ctx.webServer.register({
4199
+ kind: "exact",
4200
+ path: SCOPED_TOKEN_PATH,
4201
+ handler: async (request, response) => {
4202
+ if ((request.method ?? "GET").toUpperCase() !== "POST") {
4203
+ response.writeHead(405).end();
4204
+ return;
4205
+ }
4206
+ const body = await readJson(request).catch(() => null);
4207
+ const sessionId = typeof body?.["sessionId"] === "string" ? body["sessionId"] : "";
4208
+ const actorUserId = typeof body?.["actorUserId"] === "string" ? body["actorUserId"] : "";
4209
+ if (sessionId === "" || actorUserId === "") {
4210
+ response.writeHead(400, { "content-type": "application/json; charset=utf-8" });
4211
+ response.end(JSON.stringify({ error: "sessionId and actorUserId are required" }));
4212
+ return;
4213
+ }
4214
+ const ref = await mintScopedCredential({
4215
+ request: (path, init) => reviewApi.request(path, init),
4216
+ set: async (name, value) => {
4217
+ await ctx.credentials.set(credentialRef(name), value);
4218
+ },
4219
+ warn: (message, error) => {
4220
+ ctx.logger.warn(`dataops-managed: ${message}`, error);
4221
+ }
4222
+ }, config.credentialRef ?? "DATAOPS_ACCESS_TOKEN", sessionId, actorUserId);
4223
+ response.writeHead(ref === void 0 ? 502 : 200, { "content-type": "application/json; charset=utf-8" });
4224
+ response.end(JSON.stringify(ref === void 0 ? { error: "scoped token was not minted" } : { ref }));
4225
+ }
4226
+ }), "dataops-managed: scoped credential route");
4135
4227
  ctx.effect(() => ctx.webServer.register({
4136
4228
  kind: "exact",
4137
4229
  path: OPEN_RESOURCE_EVENTS_PATH,
@@ -4280,7 +4372,17 @@ async function apply(ctx, config) {
4280
4372
  response.end();
4281
4373
  return;
4282
4374
  }
4283
- await ctx.credentials.set(accessRef, token);
4375
+ const body = await readJson(request).catch(() => null);
4376
+ const sessionId = typeof body?.["sessionId"] === "string" ? body["sessionId"] : "";
4377
+ if (sessionId === "") await ctx.credentials.set(accessRef, token);
4378
+ else {
4379
+ const scopedRef = credentialRef(scopedCredentialRef(config.credentialRef, sessionId));
4380
+ if ((await ctx.credentials.resolve(scopedRef).catch(() => void 0))?.value !== token) try {
4381
+ await ctx.credentials.set(scopedRef, token);
4382
+ } catch (error) {
4383
+ ctx.logger.warn(`dataops-managed: session credential for ${sessionId} was not stored`, error);
4384
+ }
4385
+ }
4284
4386
  resetAuthState();
4285
4387
  aiTools.refresh(true);
4286
4388
  await ensureMcp();
@@ -5083,4 +5185,4 @@ function writeJson(response, status, body) {
5083
5185
  response.end(payload);
5084
5186
  }
5085
5187
  //#endregion
5086
- export { AUTH_STATE_PATH, Config, DEFAULT_TOOL_CALL_TIMEOUT_MS, DEPARTMENTS_PATH, MANAGED_AUTH_PATH, MANAGED_PLUGIN_ID, MODEL_SYNC_PATH, RBAC_PATH, REVIEW_ACTION_PATH, REVIEW_CONTEXT_PATH, REVIEW_NOTIFICATIONS_PATH, REVIEW_SETTINGS_PATH, SKILL_PLAZA_PATH, TOOL_TIMEOUT_MAX_SECONDS, TOOL_TIMEOUT_MIN_SECONDS, TOOL_TIMEOUT_PATH, WORKSPACE_LIMITS_PATH, WORKSPACE_UPGRADE_PATH, adoptRequestJwt, apply, currentModelSync, currentSettingsSync, currentSkillPlaza, currentWorkspaceLimits, inject, name };
5188
+ export { AUTH_STATE_PATH, Config, DEFAULT_TOOL_CALL_TIMEOUT_MS, DEPARTMENTS_PATH, MANAGED_AUTH_PATH, MANAGED_PLUGIN_ID, MODEL_SYNC_PATH, RBAC_PATH, REVIEW_ACTION_PATH, REVIEW_CONTEXT_PATH, REVIEW_NOTIFICATIONS_PATH, REVIEW_SETTINGS_PATH, SCOPED_TOKEN_PATH, SKILL_PLAZA_PATH, TOOL_TIMEOUT_MAX_SECONDS, TOOL_TIMEOUT_MIN_SECONDS, TOOL_TIMEOUT_PATH, WORKSPACE_LIMITS_PATH, WORKSPACE_UPGRADE_PATH, adoptRequestJwt, apply, currentModelSync, currentSettingsSync, currentSkillPlaza, currentWorkspaceLimits, inject, name };
@@ -12,6 +12,8 @@ export declare const name = "dataops-managed";
12
12
  /** Host services required by managed JWT and MCP ownership. */
13
13
  export declare const inject: string[];
14
14
  export declare const MANAGED_AUTH_PATH = "/integrations/dataops/managed-auth";
15
+ /** Where the connector mints one room Session's scoped credential. */
16
+ export declare const SCOPED_TOKEN_PATH = "/integrations/dataops/scoped-token";
15
17
  /** This plugin's profile entry id, which owns its Config and sync state. */
16
18
  export declare const MANAGED_PLUGIN_ID = "dataops-managed";
17
19
  /** Same-origin route the workspace settings pages use to read and change model sharing. */
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Scoped credentials for group-chat rooms.
3
+ *
4
+ * A room acts for the member the connector names, so its MCP calls must not ride on the workspace
5
+ * JWT. The connector mints one token per room Session, stores it under a Session-specific
6
+ * credential ref, and the MCP bridge prefers that entry for the room's requests. Minting happens
7
+ * once per room, not per request: the token shares the workspace token's long lifetime, and a
8
+ * revoked token surfaces as a 401 the bridge retries once.
9
+ *
10
+ * @module scoped-credential
11
+ */
12
+ /** The credential reference a room Session's token is stored under. */
13
+ export interface ScopedCredentialDeps {
14
+ /** Calls one DataOps endpoint with the workspace JWT. */
15
+ readonly request: (path: string, init?: RequestInit) => Promise<{
16
+ readonly status: number;
17
+ readonly body: unknown;
18
+ }>;
19
+ /** Stores one credential value. */
20
+ readonly set: (ref: string, value: string) => Promise<void>;
21
+ /** Reports a failed mint without failing the caller. */
22
+ readonly warn: (message: string, error?: unknown) => void;
23
+ }
24
+ /**
25
+ * Fold a Session id into the credential-ref alphabet.
26
+ *
27
+ * Credential references are uppercase underscore tokens, and the MCP bridge derives the same name
28
+ * from the Session id it is serving. Both sides use this function so they cannot drift.
29
+ * @param baseRef - the workspace credential reference, for example `DATAOPS_ACCESS_TOKEN`.
30
+ * @param sessionId - the room Session id.
31
+ * @returns the scoped reference for that Session.
32
+ */
33
+ export declare function scopedCredentialRef(baseRef: string, sessionId: string): string;
34
+ /**
35
+ * Mint one room's scoped token and store it.
36
+ *
37
+ * Failure is reported and swallowed: the room keeps working on the workspace credential, which is
38
+ * the pre-connector behaviour, so a backend outage degrades authority instead of breaking chat.
39
+ * @param deps - endpoint, credential store, and logger.
40
+ * @param baseRef - the workspace credential reference the scoped name derives from.
41
+ * @param sessionId - the room Session the token is minted for.
42
+ * @param actorUserId - the DataOps user the room acts for.
43
+ * @returns the stored reference, or undefined when minting failed.
44
+ */
45
+ export declare function mintScopedCredential(deps: ScopedCredentialDeps, baseRef: string, sessionId: string, actorUserId: string): Promise<string | undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparkelf/dsh-dataops-managed",
3
- "version": "0.3.43",
3
+ "version": "0.3.44",
4
4
  "description": "DataOps JWT intake and credential-backed MCP tools for managed DeepSeek Harness workspaces.",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -46,12 +46,6 @@
46
46
  "README.md",
47
47
  "LICENSE"
48
48
  ],
49
- "scripts": {
50
- "build": "rm -rf lib && tsc -p tsconfig.build.json && tsdown",
51
- "bundle": "tsdown",
52
- "prepack": "pnpm run build",
53
- "prepublishOnly": "node ../../scripts/prepublish-guard.mjs"
54
- },
55
49
  "engines": {
56
50
  "node": "^22.19.0 || >=24.0.0"
57
51
  },
@@ -103,5 +97,9 @@
103
97
  "lightningcss": "^1.32.0",
104
98
  "react": "^18.2.0",
105
99
  "tsdown": "^0.22.2"
100
+ },
101
+ "scripts": {
102
+ "build": "rm -rf lib && tsc -p tsconfig.build.json && tsdown",
103
+ "bundle": "tsdown"
106
104
  }
107
- }
105
+ }