@sparkelf/dsh-dataops-managed 0.3.28 → 0.3.30

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
@@ -747,22 +747,22 @@ window.__ModuleLoader__.load({
747
747
  document.head.appendChild(tag);
748
748
  }
749
749
  var ManagedDataOpsSection_module_css_default = {
750
- "reviewActions": "_2dqzjG_reviewActions",
750
+ "section": "_2dqzjG_section",
751
+ "meta": "_2dqzjG_meta",
751
752
  "card": "_2dqzjG_card",
752
753
  "reviewHint": "_2dqzjG_reviewHint",
753
- "heading": "_2dqzjG_heading",
754
- "reviewRows": "_2dqzjG_reviewRows",
755
- "label": "_2dqzjG_label",
756
- "title": "_2dqzjG_title",
757
754
  "reviewRow": "_2dqzjG_reviewRow",
755
+ "label": "_2dqzjG_label",
758
756
  "refusal": "_2dqzjG_refusal",
759
- "section": "_2dqzjG_section",
760
- "row": "_2dqzjG_row",
761
- "status": "_2dqzjG_status",
762
- "meta": "_2dqzjG_meta",
757
+ "heading": "_2dqzjG_heading",
758
+ "copy": "_2dqzjG_copy",
759
+ "reviewRows": "_2dqzjG_reviewRows",
763
760
  "actions": "_2dqzjG_actions",
764
761
  "fields": "_2dqzjG_fields",
765
- "copy": "_2dqzjG_copy"
762
+ "status": "_2dqzjG_status",
763
+ "reviewActions": "_2dqzjG_reviewActions",
764
+ "title": "_2dqzjG_title",
765
+ "row": "_2dqzjG_row"
766
766
  };
767
767
  //#endregion
768
768
  //#region src/client/ReviewSettingsCard.tsx
@@ -1617,24 +1617,24 @@ window.__ModuleLoader__.load({
1617
1617
  document.head.appendChild(tag);
1618
1618
  }
1619
1619
  var NotificationBell_module_css_default = {
1620
- "linkButton": "tE0trG_linkButton",
1621
- "rowText": "tE0trG_rowText",
1620
+ "rowMeta": "tE0trG_rowMeta",
1621
+ "rowIcon": "tE0trG_rowIcon",
1622
+ "rowBody": "tE0trG_rowBody",
1622
1623
  "demo": "tE0trG_demo",
1624
+ "linkButton": "tE0trG_linkButton",
1625
+ "pager": "tE0trG_pager",
1626
+ "badge": "tE0trG_badge",
1627
+ "rowTitle": "tE0trG_rowTitle",
1623
1628
  "bell": "tE0trG_bell",
1629
+ "list": "tE0trG_list",
1630
+ "rowTime": "tE0trG_rowTime",
1631
+ "rowText": "tE0trG_rowText",
1632
+ "button": "tE0trG_button",
1624
1633
  "empty": "tE0trG_empty",
1625
- "dot": "tE0trG_dot",
1626
- "rowBody": "tE0trG_rowBody",
1627
- "rowTitle": "tE0trG_rowTitle",
1634
+ "actions": "tE0trG_actions",
1628
1635
  "row": "tE0trG_row",
1629
1636
  "dialog": "tE0trG_dialog",
1630
- "actions": "tE0trG_actions",
1631
- "rowMeta": "tE0trG_rowMeta",
1632
- "button": "tE0trG_button",
1633
- "badge": "tE0trG_badge",
1634
- "pager": "tE0trG_pager",
1635
- "rowTime": "tE0trG_rowTime",
1636
- "list": "tE0trG_list",
1637
- "rowIcon": "tE0trG_rowIcon"
1637
+ "dot": "tE0trG_dot"
1638
1638
  };
1639
1639
  //#endregion
1640
1640
  //#region src/client/NotificationBell.tsx
@@ -1925,62 +1925,62 @@ window.__ModuleLoader__.load({
1925
1925
  document.head.appendChild(tag);
1926
1926
  }
1927
1927
  var SkillPlazaSection_module_css_default = {
1928
- "demoTag": "_9FdZvq_demoTag",
1929
1928
  "card": "_9FdZvq_card",
1930
- "riskEmpty": "_9FdZvq_riskEmpty",
1931
- "noteField": "_9FdZvq_noteField",
1932
- "cardEnd": "_9FdZvq_cardEnd",
1933
- "detailRow": "_9FdZvq_detailRow",
1934
- "severity": "_9FdZvq_severity",
1935
- "audit": "_9FdZvq_audit",
1936
- "tabActive": "_9FdZvq_tabActive",
1937
- "sharedTag": "_9FdZvq_sharedTag",
1938
- "tabCount": "_9FdZvq_tabCount",
1939
- "findingText": "_9FdZvq_findingText",
1929
+ "empty": "_9FdZvq_empty",
1940
1930
  "dialog": "_9FdZvq_dialog",
1941
- "pendingTag": "_9FdZvq_pendingTag",
1931
+ "riskSummary": "_9FdZvq_riskSummary",
1932
+ "finding": "_9FdZvq_finding",
1933
+ "tab": "_9FdZvq_tab",
1934
+ "notice": "_9FdZvq_notice",
1942
1935
  "auditDialog": "_9FdZvq_auditDialog",
1936
+ "head": "_9FdZvq_head",
1943
1937
  "status": "_9FdZvq_status",
1944
- "mark": "_9FdZvq_mark",
1945
- "tagTop": "_9FdZvq_tagTop",
1946
- "headRow": "_9FdZvq_headRow",
1947
- "departmentSelect": "_9FdZvq_departmentSelect",
1938
+ "riskScore": "_9FdZvq_riskScore",
1939
+ "detailRow": "_9FdZvq_detailRow",
1940
+ "tabs": "_9FdZvq_tabs",
1948
1941
  "departmentBar": "_9FdZvq_departmentBar",
1949
- "cardTop": "_9FdZvq_cardTop",
1950
- "detail": "_9FdZvq_detail",
1951
- "emptyText": "_9FdZvq_emptyText",
1942
+ "detailValue": "_9FdZvq_detailValue",
1943
+ "tagTop": "_9FdZvq_tagTop",
1944
+ "pendingTag": "_9FdZvq_pendingTag",
1952
1945
  "riskFailed": "_9FdZvq_riskFailed",
1953
- "finding": "_9FdZvq_finding",
1954
1946
  "findingHint": "_9FdZvq_findingHint",
1955
- "detailLabel": "_9FdZvq_detailLabel",
1956
- "section": "_9FdZvq_section",
1957
- "head": "_9FdZvq_head",
1958
- "cardTitle": "_9FdZvq_cardTitle",
1947
+ "cards": "_9FdZvq_cards",
1948
+ "titleCount": "_9FdZvq_titleCount",
1949
+ "tabActive": "_9FdZvq_tabActive",
1959
1950
  "departmentLabel": "_9FdZvq_departmentLabel",
1960
- "detailValue": "_9FdZvq_detailValue",
1961
- "mine": "_9FdZvq_mine",
1951
+ "severity": "_9FdZvq_severity",
1952
+ "cardMarks": "_9FdZvq_cardMarks",
1953
+ "reviewError": "_9FdZvq_reviewError",
1954
+ "cardDesc": "_9FdZvq_cardDesc",
1955
+ "mark": "_9FdZvq_mark",
1956
+ "cardTitle": "_9FdZvq_cardTitle",
1957
+ "demoTag": "_9FdZvq_demoTag",
1958
+ "sharedTag": "_9FdZvq_sharedTag",
1959
+ "cardEnd": "_9FdZvq_cardEnd",
1960
+ "reviewNote": "_9FdZvq_reviewNote",
1961
+ "tabCount": "_9FdZvq_tabCount",
1962
+ "audit": "_9FdZvq_audit",
1962
1963
  "cardIcon": "_9FdZvq_cardIcon",
1964
+ "detail": "_9FdZvq_detail",
1965
+ "auditFooter": "_9FdZvq_auditFooter",
1966
+ "section": "_9FdZvq_section",
1967
+ "detailLabel": "_9FdZvq_detailLabel",
1968
+ "emptyText": "_9FdZvq_emptyText",
1969
+ "findingText": "_9FdZvq_findingText",
1970
+ "riskHead": "_9FdZvq_riskHead",
1971
+ "noteField": "_9FdZvq_noteField",
1972
+ "headRow": "_9FdZvq_headRow",
1973
+ "findings": "_9FdZvq_findings",
1974
+ "riskEmpty": "_9FdZvq_riskEmpty",
1963
1975
  "emptyIcon": "_9FdZvq_emptyIcon",
1964
1976
  "title": "_9FdZvq_title",
1965
- "cards": "_9FdZvq_cards",
1966
- "tabs": "_9FdZvq_tabs",
1967
1977
  "rejectedTag": "_9FdZvq_rejectedTag",
1968
- "auditFooter": "_9FdZvq_auditFooter",
1969
- "risk": "_9FdZvq_risk",
1970
- "tab": "_9FdZvq_tab",
1971
1978
  "detailButton": "_9FdZvq_detailButton",
1972
- "empty": "_9FdZvq_empty",
1973
1979
  "reviewButton": "_9FdZvq_reviewButton",
1974
- "notice": "_9FdZvq_notice",
1975
- "reviewNote": "_9FdZvq_reviewNote",
1976
- "riskHead": "_9FdZvq_riskHead",
1977
- "titleCount": "_9FdZvq_titleCount",
1978
- "cardDesc": "_9FdZvq_cardDesc",
1979
- "riskSummary": "_9FdZvq_riskSummary",
1980
- "riskScore": "_9FdZvq_riskScore",
1981
- "findings": "_9FdZvq_findings",
1982
- "reviewError": "_9FdZvq_reviewError",
1983
- "cardMarks": "_9FdZvq_cardMarks"
1980
+ "risk": "_9FdZvq_risk",
1981
+ "mine": "_9FdZvq_mine",
1982
+ "departmentSelect": "_9FdZvq_departmentSelect",
1983
+ "cardTop": "_9FdZvq_cardTop"
1984
1984
  };
1985
1985
  //#endregion
1986
1986
  //#region src/client/SkillPlazaSection.tsx
@@ -2645,19 +2645,19 @@ window.__ModuleLoader__.load({
2645
2645
  document.head.appendChild(tag);
2646
2646
  }
2647
2647
  var WanxiangBrand_module_css_default = {
2648
- "unitLeft": "s0HPxG_unitLeft",
2649
- "unit-core": "s0HPxG_unit-core",
2650
- "unit-top": "s0HPxG_unit-top",
2651
- "unitCore": "s0HPxG_unitCore",
2652
- "unit-right": "s0HPxG_unit-right",
2653
- "mark": "s0HPxG_mark",
2648
+ "animatedMark": "s0HPxG_animatedMark",
2649
+ "sidebarName": "s0HPxG_sidebarName",
2654
2650
  "wordmark": "s0HPxG_wordmark",
2651
+ "unit-right": "s0HPxG_unit-right",
2655
2652
  "unitTop": "s0HPxG_unitTop",
2656
2653
  "harness": "s0HPxG_harness",
2657
- "animatedMark": "s0HPxG_animatedMark",
2658
- "unit-left": "s0HPxG_unit-left",
2654
+ "unitCore": "s0HPxG_unitCore",
2659
2655
  "unitRight": "s0HPxG_unitRight",
2660
- "sidebarName": "s0HPxG_sidebarName"
2656
+ "unit-core": "s0HPxG_unit-core",
2657
+ "unitLeft": "s0HPxG_unitLeft",
2658
+ "unit-left": "s0HPxG_unit-left",
2659
+ "unit-top": "s0HPxG_unit-top",
2660
+ "mark": "s0HPxG_mark"
2661
2661
  };
2662
2662
  //#endregion
2663
2663
  //#region src/client/WanxiangBrand.tsx
@@ -3074,72 +3074,72 @@ window.__ModuleLoader__.load({
3074
3074
  document.head.appendChild(tag);
3075
3075
  }
3076
3076
  var PermissionCenterSection_module_css_default = {
3077
- "copied": "PNbOqW_copied",
3078
- "dialogHint": "PNbOqW_dialogHint",
3079
- "treeRoot": "PNbOqW_treeRoot",
3080
- "readOnly": "PNbOqW_readOnly",
3081
- "comboboxEmpty": "PNbOqW_comboboxEmpty",
3082
- "panelFoot": "PNbOqW_panelFoot",
3077
+ "empty": "PNbOqW_empty",
3078
+ "combobox": "PNbOqW_combobox",
3079
+ "deptAdmins": "PNbOqW_deptAdmins",
3080
+ "candidates": "PNbOqW_candidates",
3083
3081
  "rowActions": "PNbOqW_rowActions",
3084
- "dialogFooter": "PNbOqW_dialogFooter",
3082
+ "comboboxList": "PNbOqW_comboboxList",
3085
3083
  "subtitle": "PNbOqW_subtitle",
3086
- "head": "PNbOqW_head",
3084
+ "comboboxTrigger": "PNbOqW_comboboxTrigger",
3085
+ "error": "PNbOqW_error",
3087
3086
  "demo": "PNbOqW_demo",
3087
+ "comboboxOption": "PNbOqW_comboboxOption",
3088
3088
  "muted": "PNbOqW_muted",
3089
+ "dialogFooter": "PNbOqW_dialogFooter",
3090
+ "matrix": "PNbOqW_matrix",
3091
+ "comboboxOptionActive": "PNbOqW_comboboxOptionActive",
3089
3092
  "department": "PNbOqW_department",
3090
- "comboboxMenu": "PNbOqW_comboboxMenu",
3091
- "title": "PNbOqW_title",
3092
- "tabs": "PNbOqW_tabs",
3093
- "panelHead": "PNbOqW_panelHead",
3094
- "treeName": "PNbOqW_treeName",
3095
- "treeToggle": "PNbOqW_treeToggle",
3096
- "comboboxTrigger": "PNbOqW_comboboxTrigger",
3093
+ "permission": "PNbOqW_permission",
3094
+ "comboboxSearch": "PNbOqW_comboboxSearch",
3097
3095
  "pager": "PNbOqW_pager",
3098
- "sectionTitle": "PNbOqW_sectionTitle",
3099
- "combobox": "PNbOqW_combobox",
3096
+ "comboboxCheck": "PNbOqW_comboboxCheck",
3097
+ "permDescription": "PNbOqW_permDescription",
3098
+ "matrixModule": "PNbOqW_matrixModule",
3099
+ "tableScroll": "PNbOqW_tableScroll",
3100
+ "comboboxPlaceholder": "PNbOqW_comboboxPlaceholder",
3100
3101
  "permCopy": "PNbOqW_permCopy",
3102
+ "treeChildren": "PNbOqW_treeChildren",
3103
+ "treeName": "PNbOqW_treeName",
3104
+ "head": "PNbOqW_head",
3105
+ "panelFoot": "PNbOqW_panelFoot",
3106
+ "panelHead": "PNbOqW_panelHead",
3107
+ "field": "PNbOqW_field",
3108
+ "matrixPermission": "PNbOqW_matrixPermission",
3109
+ "departments": "PNbOqW_departments",
3110
+ "readOnly": "PNbOqW_readOnly",
3101
3111
  "candidate": "PNbOqW_candidate",
3102
- "treeRow": "PNbOqW_treeRow",
3103
- "protected": "PNbOqW_protected",
3112
+ "treeToggle": "PNbOqW_treeToggle",
3113
+ "adminTag": "PNbOqW_adminTag",
3114
+ "onlyAdmin": "PNbOqW_onlyAdmin",
3115
+ "dialogBody": "PNbOqW_dialogBody",
3116
+ "comboboxMenu": "PNbOqW_comboboxMenu",
3117
+ "matrixScroll": "PNbOqW_matrixScroll",
3104
3118
  "table": "PNbOqW_table",
3105
- "departments": "PNbOqW_departments",
3106
- "comboboxPlaceholder": "PNbOqW_comboboxPlaceholder",
3107
- "empty": "PNbOqW_empty",
3108
- "candidates": "PNbOqW_candidates",
3119
+ "notice": "PNbOqW_notice",
3120
+ "page": "PNbOqW_page",
3121
+ "waiting": "PNbOqW_waiting",
3122
+ "sectionTitle": "PNbOqW_sectionTitle",
3123
+ "protected": "PNbOqW_protected",
3124
+ "scopeBadge": "PNbOqW_scopeBadge",
3125
+ "treeSpacer": "PNbOqW_treeSpacer",
3126
+ "treeRow": "PNbOqW_treeRow",
3109
3127
  "treeActions": "PNbOqW_treeActions",
3110
- "detailGrid": "PNbOqW_detailGrid",
3111
- "matrixNote": "PNbOqW_matrixNote",
3112
- "onlyAdmin": "PNbOqW_onlyAdmin",
3113
- "treeChildren": "PNbOqW_treeChildren",
3114
- "error": "PNbOqW_error",
3115
- "tab": "PNbOqW_tab",
3116
- "tableScroll": "PNbOqW_tableScroll",
3117
- "matrixPermission": "PNbOqW_matrixPermission",
3118
- "comboboxOption": "PNbOqW_comboboxOption",
3128
+ "matrixGroup": "PNbOqW_matrixGroup",
3119
3129
  "tabActive": "PNbOqW_tabActive",
3120
- "comboboxOptionActive": "PNbOqW_comboboxOptionActive",
3130
+ "panel": "PNbOqW_panel",
3131
+ "treeRoot": "PNbOqW_treeRoot",
3121
3132
  "comboboxHint": "PNbOqW_comboboxHint",
3133
+ "copied": "PNbOqW_copied",
3134
+ "tab": "PNbOqW_tab",
3122
3135
  "search": "PNbOqW_search",
3123
- "matrix": "PNbOqW_matrix",
3124
- "comboboxSearch": "PNbOqW_comboboxSearch",
3136
+ "dialogHint": "PNbOqW_dialogHint",
3137
+ "detailGrid": "PNbOqW_detailGrid",
3138
+ "title": "PNbOqW_title",
3125
3139
  "dialog": "PNbOqW_dialog",
3126
- "field": "PNbOqW_field",
3127
- "deptAdmins": "PNbOqW_deptAdmins",
3128
- "panel": "PNbOqW_panel",
3129
- "scopeBadge": "PNbOqW_scopeBadge",
3130
- "waiting": "PNbOqW_waiting",
3131
- "comboboxCheck": "PNbOqW_comboboxCheck",
3132
- "dialogBody": "PNbOqW_dialogBody",
3133
- "adminTag": "PNbOqW_adminTag",
3134
- "treeSpacer": "PNbOqW_treeSpacer",
3135
- "permDescription": "PNbOqW_permDescription",
3136
- "page": "PNbOqW_page",
3137
- "permission": "PNbOqW_permission",
3138
- "matrixModule": "PNbOqW_matrixModule",
3139
- "notice": "PNbOqW_notice",
3140
- "comboboxList": "PNbOqW_comboboxList",
3141
- "matrixGroup": "PNbOqW_matrixGroup",
3142
- "matrixScroll": "PNbOqW_matrixScroll"
3140
+ "comboboxEmpty": "PNbOqW_comboboxEmpty",
3141
+ "tabs": "PNbOqW_tabs",
3142
+ "matrixNote": "PNbOqW_matrixNote"
3143
3143
  };
3144
3144
  //#endregion
3145
3145
  //#region src/client/combobox.ts
@@ -4568,18 +4568,18 @@ window.__ModuleLoader__.load({
4568
4568
  document.head.appendChild(tag);
4569
4569
  }
4570
4570
  var WorkspaceUpgradePrompt_module_css_default = {
4571
- "title": "razUfG_title",
4572
- "sessionTitle": "razUfG_sessionTitle",
4573
4571
  "error": "razUfG_error",
4572
+ "sessionPath": "razUfG_sessionPath",
4573
+ "sessionTitle": "razUfG_sessionTitle",
4574
4574
  "banner": "razUfG_banner",
4575
4575
  "sessionRow": "razUfG_sessionRow",
4576
- "dialogText": "razUfG_dialogText",
4577
- "sessionPath": "razUfG_sessionPath",
4576
+ "dialogBody": "razUfG_dialogBody",
4578
4577
  "body": "razUfG_body",
4579
- "copy": "razUfG_copy",
4580
4578
  "actions": "razUfG_actions",
4581
- "dialogBody": "razUfG_dialogBody",
4582
- "sessionList": "razUfG_sessionList"
4579
+ "dialogText": "razUfG_dialogText",
4580
+ "sessionList": "razUfG_sessionList",
4581
+ "title": "razUfG_title",
4582
+ "copy": "razUfG_copy"
4583
4583
  };
4584
4584
  //#endregion
4585
4585
  //#region src/client/WorkspaceUpgradePrompt.tsx
@@ -4812,7 +4812,7 @@ window.__ModuleLoader__.load({
4812
4812
  fontSize: "11px"
4813
4813
  };
4814
4814
  /** Render the embedded DataOps resource page and translate its parent messages. */
4815
- function DataOpsResourcesTab({ tab, scope, sendReference }) {
4815
+ function DataOpsResourcesTab({ tab, scope, insertResourceReference }) {
4816
4816
  const [config, setConfig] = (0, react.useState)(null);
4817
4817
  const [error, setError] = (0, react.useState)("");
4818
4818
  const [loading, setLoading] = (0, react.useState)(true);
@@ -4871,19 +4871,43 @@ window.__ModuleLoader__.load({
4871
4871
  name: payload.resource?.name,
4872
4872
  table: payload.resource?.table
4873
4873
  };
4874
- if (sendReference === void 0) {
4875
- setNotice("当前会话不可用,无法把资源加入对话");
4874
+ if (insertResourceReference === void 0) {
4875
+ setNotice("当前会话不可用,无法插入资源引用");
4876
4876
  return;
4877
4877
  }
4878
- sendReference("引用数据资源:\n\n```resource-ref\n" + JSON.stringify(reference, null, 2) + "\n```\n", scope?.sessionId).then(() => setNotice("已把资源加入当前对话")).catch((sendError) => setNotice("加入对话失败:" + (sendError instanceof Error ? sendError.message : String(sendError))));
4878
+ try {
4879
+ insertResourceReference(payload.resource ?? {}, reference, scope?.sessionId);
4880
+ setNotice("");
4881
+ } catch (insertError) {
4882
+ setNotice("插入引用失败:" + (insertError instanceof Error ? insertError.message : String(insertError)));
4883
+ }
4879
4884
  };
4880
4885
  window.addEventListener("message", onMessage);
4881
4886
  return () => window.removeEventListener("message", onMessage);
4882
4887
  }, [
4883
4888
  config,
4884
- sendReference,
4889
+ insertResourceReference,
4885
4890
  scope?.sessionId
4886
4891
  ]);
4892
+ (0, react.useEffect)(() => {
4893
+ const style = document.createElement("style");
4894
+ style.dataset.dataopsResourceChipIcon = "true";
4895
+ style.textContent = `
4896
+ [data-composer-chip="dataops-resource"]:not(:has(svg)) > span:last-child::before {
4897
+ content: "";
4898
+ display: inline-block;
4899
+ width: 14px;
4900
+ height: 14px;
4901
+ margin-right: 5px;
4902
+ vertical-align: -2px;
4903
+ background: currentColor;
4904
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpath d='m3.3 7 8.7 5 8.7-5'/%3E%3Cpath d='M12 22V12'/%3E%3C/svg%3E") center / contain no-repeat;
4905
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpath d='m3.3 7 8.7 5 8.7-5'/%3E%3Cpath d='M12 22V12'/%3E%3C/svg%3E") center / contain no-repeat;
4906
+ }
4907
+ `;
4908
+ document.head.appendChild(style);
4909
+ return () => style.remove();
4910
+ }, []);
4887
4911
  (0, react.useEffect)(() => {
4888
4912
  if (!notice) return void 0;
4889
4913
  const timer = window.setTimeout(() => setNotice(""), 2400);
@@ -4906,19 +4930,6 @@ window.__ModuleLoader__.load({
4906
4930
  role: "status",
4907
4931
  children: "正在准备数据资源页…"
4908
4932
  });
4909
- let topOrigin = "";
4910
- try {
4911
- topOrigin = window.top?.location.origin ?? "";
4912
- } catch {
4913
- topOrigin = "";
4914
- }
4915
- let embedOrigin = "";
4916
- try {
4917
- embedOrigin = new URL(config.embedBaseUrl).origin;
4918
- } catch {
4919
- embedOrigin = "";
4920
- }
4921
- const frameIsSameOrigin = config.sameOrigin === true || topOrigin !== "" && topOrigin === embedOrigin;
4922
4933
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4923
4934
  style: {
4924
4935
  display: "flex",
@@ -4932,13 +4943,6 @@ window.__ModuleLoader__.load({
4932
4943
  role: "status",
4933
4944
  children: notice
4934
4945
  }) : null,
4935
- !frameIsSameOrigin ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4936
- style: {
4937
- ...stateStyle,
4938
- paddingBottom: 6
4939
- },
4940
- children: "当前部署不是同源代理,资源页可能无法复用门户登录态。"
4941
- }) : null,
4942
4946
  loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4943
4947
  style: stateStyle,
4944
4948
  role: "status",
@@ -5499,17 +5503,72 @@ window.__ModuleLoader__.load({
5499
5503
  inject?.([
5500
5504
  "betterSidebar",
5501
5505
  "conversation",
5502
- "sessions"
5506
+ "sessions",
5507
+ "inputTriggers"
5503
5508
  ], (injected) => {
5504
5509
  const service = injected.betterSidebar;
5505
5510
  if (service?.registerTab === void 0) return;
5506
5511
  const conversation = injected.conversation;
5507
5512
  const sessions = injected.sessions;
5508
- const sendReference = async (text, sessionId) => {
5513
+ const inputTriggers = injected.inputTriggers;
5514
+ if (inputTriggers?.registerSource !== void 0) {
5515
+ const source = {
5516
+ trigger: "@",
5517
+ name: "dataops-resource",
5518
+ showGroupTitle: false,
5519
+ candidates: async () => [],
5520
+ codec: {
5521
+ clipboardText: (ref) => {
5522
+ try {
5523
+ return "@" + String(JSON.parse(ref).name ?? "资源");
5524
+ } catch {
5525
+ return "@资源";
5526
+ }
5527
+ },
5528
+ serialize: async (ref) => {
5529
+ try {
5530
+ const parsed = JSON.parse(ref);
5531
+ return "引用数据资源:\n\n```resource-ref\n" + JSON.stringify({
5532
+ kind: "dataops-resource",
5533
+ resourceId: parsed.resourceId,
5534
+ name: parsed.name,
5535
+ table: parsed.table ?? null
5536
+ }, null, 2) + "\n```\n";
5537
+ } catch {
5538
+ return ref;
5539
+ }
5540
+ }
5541
+ }
5542
+ };
5543
+ try {
5544
+ inputTriggers.registerSource(source);
5545
+ } catch {}
5546
+ }
5547
+ const insertResourceReference = (resource, reference, sessionId) => {
5509
5548
  if (!sessionId) throw new Error("no active session");
5510
- const target = (sessions?.scope?.(sessionId))?.get?.("conversation") ?? conversation;
5511
- if (target?.send === void 0) throw new Error("conversation service is unavailable");
5512
- await target.send(text);
5549
+ const scoped = sessions?.scope?.(sessionId);
5550
+ const input = conversation?.input?.for?.(scoped);
5551
+ if (!input?.insertReference || !input.state?.getSnapshot) throw new Error("composer is unavailable");
5552
+ const state = input.state.getSnapshot();
5553
+ const span = {
5554
+ start: state.draft.length,
5555
+ end: state.draft.length,
5556
+ draftRev: state.draftRev
5557
+ };
5558
+ const name = String(resource.name ?? reference.name ?? "资源");
5559
+ const payload = {
5560
+ kind: "dataops-resource",
5561
+ resourceId: resource.id ?? reference.resourceId,
5562
+ name,
5563
+ table: resource.table ?? reference.table ?? null
5564
+ };
5565
+ if (!input.insertReference({
5566
+ source: "dataops-resource",
5567
+ ref: JSON.stringify(payload),
5568
+ label: name,
5569
+ appearance: "resource",
5570
+ clipboardText: "@" + name
5571
+ }, span)) throw new Error("输入框正忙,请稍后再试");
5513
5572
  };
5514
5573
  disposeTab = service.registerTab({
5515
5574
  id: RESOURCE_TAB_TYPE,
@@ -5519,7 +5578,7 @@ window.__ModuleLoader__.load({
5519
5578
  single: true,
5520
5579
  component: ((props) => DataOpsResourcesTab({
5521
5580
  ...props,
5522
- sendReference
5581
+ insertResourceReference
5523
5582
  }))
5524
5583
  });
5525
5584
  disposeBridge = ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({