@sparkelf/dsh-dataops-managed 0.3.28 → 0.3.29

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
+ "section": "_2dqzjG_section",
751
+ "status": "_2dqzjG_status",
752
+ "actions": "_2dqzjG_actions",
753
+ "refusal": "_2dqzjG_refusal",
750
754
  "reviewActions": "_2dqzjG_reviewActions",
751
- "card": "_2dqzjG_card",
752
- "reviewHint": "_2dqzjG_reviewHint",
753
755
  "heading": "_2dqzjG_heading",
754
756
  "reviewRows": "_2dqzjG_reviewRows",
755
- "label": "_2dqzjG_label",
756
- "title": "_2dqzjG_title",
757
757
  "reviewRow": "_2dqzjG_reviewRow",
758
- "refusal": "_2dqzjG_refusal",
759
- "section": "_2dqzjG_section",
760
- "row": "_2dqzjG_row",
761
- "status": "_2dqzjG_status",
758
+ "copy": "_2dqzjG_copy",
762
759
  "meta": "_2dqzjG_meta",
763
- "actions": "_2dqzjG_actions",
760
+ "title": "_2dqzjG_title",
761
+ "reviewHint": "_2dqzjG_reviewHint",
762
+ "label": "_2dqzjG_label",
763
+ "card": "_2dqzjG_card",
764
764
  "fields": "_2dqzjG_fields",
765
- "copy": "_2dqzjG_copy"
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",
1620
+ "row": "tE0trG_row",
1621
+ "list": "tE0trG_list",
1622
+ "actions": "tE0trG_actions",
1623
+ "rowBody": "tE0trG_rowBody",
1624
+ "dot": "tE0trG_dot",
1625
+ "rowIcon": "tE0trG_rowIcon",
1621
1626
  "rowText": "tE0trG_rowText",
1622
1627
  "demo": "tE0trG_demo",
1623
- "bell": "tE0trG_bell",
1624
- "empty": "tE0trG_empty",
1625
- "dot": "tE0trG_dot",
1626
- "rowBody": "tE0trG_rowBody",
1627
1628
  "rowTitle": "tE0trG_rowTitle",
1628
- "row": "tE0trG_row",
1629
- "dialog": "tE0trG_dialog",
1630
- "actions": "tE0trG_actions",
1631
- "rowMeta": "tE0trG_rowMeta",
1632
- "button": "tE0trG_button",
1633
- "badge": "tE0trG_badge",
1634
1629
  "pager": "tE0trG_pager",
1630
+ "empty": "tE0trG_empty",
1631
+ "button": "tE0trG_button",
1632
+ "rowMeta": "tE0trG_rowMeta",
1635
1633
  "rowTime": "tE0trG_rowTime",
1636
- "list": "tE0trG_list",
1637
- "rowIcon": "tE0trG_rowIcon"
1634
+ "badge": "tE0trG_badge",
1635
+ "bell": "tE0trG_bell",
1636
+ "dialog": "tE0trG_dialog",
1637
+ "linkButton": "tE0trG_linkButton"
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
- "card": "_9FdZvq_card",
1930
- "riskEmpty": "_9FdZvq_riskEmpty",
1928
+ "titleCount": "_9FdZvq_titleCount",
1929
+ "head": "_9FdZvq_head",
1931
1930
  "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
1931
  "tabCount": "_9FdZvq_tabCount",
1939
- "findingText": "_9FdZvq_findingText",
1940
- "dialog": "_9FdZvq_dialog",
1941
- "pendingTag": "_9FdZvq_pendingTag",
1942
- "auditDialog": "_9FdZvq_auditDialog",
1943
- "status": "_9FdZvq_status",
1944
- "mark": "_9FdZvq_mark",
1932
+ "detailValue": "_9FdZvq_detailValue",
1933
+ "detail": "_9FdZvq_detail",
1934
+ "emptyText": "_9FdZvq_emptyText",
1935
+ "card": "_9FdZvq_card",
1936
+ "tabActive": "_9FdZvq_tabActive",
1937
+ "reviewNote": "_9FdZvq_reviewNote",
1938
+ "auditFooter": "_9FdZvq_auditFooter",
1939
+ "riskSummary": "_9FdZvq_riskSummary",
1940
+ "tabs": "_9FdZvq_tabs",
1941
+ "title": "_9FdZvq_title",
1942
+ "cards": "_9FdZvq_cards",
1943
+ "cardDesc": "_9FdZvq_cardDesc",
1945
1944
  "tagTop": "_9FdZvq_tagTop",
1946
- "headRow": "_9FdZvq_headRow",
1945
+ "pendingTag": "_9FdZvq_pendingTag",
1946
+ "section": "_9FdZvq_section",
1947
+ "cardMarks": "_9FdZvq_cardMarks",
1947
1948
  "departmentSelect": "_9FdZvq_departmentSelect",
1949
+ "cardTitle": "_9FdZvq_cardTitle",
1950
+ "detailRow": "_9FdZvq_detailRow",
1948
1951
  "departmentBar": "_9FdZvq_departmentBar",
1949
- "cardTop": "_9FdZvq_cardTop",
1950
- "detail": "_9FdZvq_detail",
1951
- "emptyText": "_9FdZvq_emptyText",
1952
- "riskFailed": "_9FdZvq_riskFailed",
1952
+ "notice": "_9FdZvq_notice",
1953
+ "reviewError": "_9FdZvq_reviewError",
1954
+ "dialog": "_9FdZvq_dialog",
1953
1955
  "finding": "_9FdZvq_finding",
1956
+ "findingText": "_9FdZvq_findingText",
1954
1957
  "findingHint": "_9FdZvq_findingHint",
1955
- "detailLabel": "_9FdZvq_detailLabel",
1956
- "section": "_9FdZvq_section",
1957
- "head": "_9FdZvq_head",
1958
- "cardTitle": "_9FdZvq_cardTitle",
1959
- "departmentLabel": "_9FdZvq_departmentLabel",
1960
- "detailValue": "_9FdZvq_detailValue",
1961
- "mine": "_9FdZvq_mine",
1962
- "cardIcon": "_9FdZvq_cardIcon",
1963
1958
  "emptyIcon": "_9FdZvq_emptyIcon",
1964
- "title": "_9FdZvq_title",
1965
- "cards": "_9FdZvq_cards",
1966
- "tabs": "_9FdZvq_tabs",
1967
- "rejectedTag": "_9FdZvq_rejectedTag",
1968
- "auditFooter": "_9FdZvq_auditFooter",
1969
- "risk": "_9FdZvq_risk",
1970
- "tab": "_9FdZvq_tab",
1971
1959
  "detailButton": "_9FdZvq_detailButton",
1960
+ "cardTop": "_9FdZvq_cardTop",
1961
+ "departmentLabel": "_9FdZvq_departmentLabel",
1972
1962
  "empty": "_9FdZvq_empty",
1963
+ "sharedTag": "_9FdZvq_sharedTag",
1964
+ "rejectedTag": "_9FdZvq_rejectedTag",
1973
1965
  "reviewButton": "_9FdZvq_reviewButton",
1974
- "notice": "_9FdZvq_notice",
1975
- "reviewNote": "_9FdZvq_reviewNote",
1966
+ "risk": "_9FdZvq_risk",
1967
+ "status": "_9FdZvq_status",
1968
+ "tab": "_9FdZvq_tab",
1976
1969
  "riskHead": "_9FdZvq_riskHead",
1977
- "titleCount": "_9FdZvq_titleCount",
1978
- "cardDesc": "_9FdZvq_cardDesc",
1979
- "riskSummary": "_9FdZvq_riskSummary",
1980
- "riskScore": "_9FdZvq_riskScore",
1970
+ "severity": "_9FdZvq_severity",
1971
+ "cardIcon": "_9FdZvq_cardIcon",
1972
+ "demoTag": "_9FdZvq_demoTag",
1973
+ "mark": "_9FdZvq_mark",
1974
+ "auditDialog": "_9FdZvq_auditDialog",
1975
+ "cardEnd": "_9FdZvq_cardEnd",
1976
+ "mine": "_9FdZvq_mine",
1977
+ "audit": "_9FdZvq_audit",
1978
+ "detailLabel": "_9FdZvq_detailLabel",
1979
+ "headRow": "_9FdZvq_headRow",
1980
+ "riskEmpty": "_9FdZvq_riskEmpty",
1981
+ "riskFailed": "_9FdZvq_riskFailed",
1981
1982
  "findings": "_9FdZvq_findings",
1982
- "reviewError": "_9FdZvq_reviewError",
1983
- "cardMarks": "_9FdZvq_cardMarks"
1983
+ "riskScore": "_9FdZvq_riskScore"
1984
1984
  };
1985
1985
  //#endregion
1986
1986
  //#region src/client/SkillPlazaSection.tsx
@@ -2646,18 +2646,18 @@ window.__ModuleLoader__.load({
2646
2646
  }
2647
2647
  var WanxiangBrand_module_css_default = {
2648
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
2649
  "mark": "s0HPxG_mark",
2650
+ "sidebarName": "s0HPxG_sidebarName",
2651
+ "unitRight": "s0HPxG_unitRight",
2652
+ "unitCore": "s0HPxG_unitCore",
2654
2653
  "wordmark": "s0HPxG_wordmark",
2655
- "unitTop": "s0HPxG_unitTop",
2656
2654
  "harness": "s0HPxG_harness",
2657
- "animatedMark": "s0HPxG_animatedMark",
2655
+ "unit-right": "s0HPxG_unit-right",
2658
2656
  "unit-left": "s0HPxG_unit-left",
2659
- "unitRight": "s0HPxG_unitRight",
2660
- "sidebarName": "s0HPxG_sidebarName"
2657
+ "unit-top": "s0HPxG_unit-top",
2658
+ "animatedMark": "s0HPxG_animatedMark",
2659
+ "unit-core": "s0HPxG_unit-core",
2660
+ "unitTop": "s0HPxG_unitTop"
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",
3083
- "rowActions": "PNbOqW_rowActions",
3077
+ "pager": "PNbOqW_pager",
3084
3078
  "dialogFooter": "PNbOqW_dialogFooter",
3085
3079
  "subtitle": "PNbOqW_subtitle",
3086
- "head": "PNbOqW_head",
3087
- "demo": "PNbOqW_demo",
3088
- "muted": "PNbOqW_muted",
3089
- "department": "PNbOqW_department",
3090
- "comboboxMenu": "PNbOqW_comboboxMenu",
3080
+ "comboboxHint": "PNbOqW_comboboxHint",
3081
+ "treeSpacer": "PNbOqW_treeSpacer",
3082
+ "field": "PNbOqW_field",
3091
3083
  "title": "PNbOqW_title",
3084
+ "departments": "PNbOqW_departments",
3085
+ "treeChildren": "PNbOqW_treeChildren",
3086
+ "treeActions": "PNbOqW_treeActions",
3087
+ "sectionTitle": "PNbOqW_sectionTitle",
3088
+ "treeRow": "PNbOqW_treeRow",
3092
3089
  "tabs": "PNbOqW_tabs",
3093
- "panelHead": "PNbOqW_panelHead",
3090
+ "matrixPermission": "PNbOqW_matrixPermission",
3091
+ "comboboxCheck": "PNbOqW_comboboxCheck",
3092
+ "dialogBody": "PNbOqW_dialogBody",
3093
+ "deptAdmins": "PNbOqW_deptAdmins",
3094
+ "head": "PNbOqW_head",
3095
+ "comboboxEmpty": "PNbOqW_comboboxEmpty",
3096
+ "permission": "PNbOqW_permission",
3097
+ "matrixNote": "PNbOqW_matrixNote",
3094
3098
  "treeName": "PNbOqW_treeName",
3095
- "treeToggle": "PNbOqW_treeToggle",
3096
- "comboboxTrigger": "PNbOqW_comboboxTrigger",
3097
- "pager": "PNbOqW_pager",
3098
- "sectionTitle": "PNbOqW_sectionTitle",
3099
- "combobox": "PNbOqW_combobox",
3099
+ "comboboxSearch": "PNbOqW_comboboxSearch",
3100
+ "copied": "PNbOqW_copied",
3101
+ "empty": "PNbOqW_empty",
3102
+ "treeRoot": "PNbOqW_treeRoot",
3103
+ "tab": "PNbOqW_tab",
3104
+ "comboboxPlaceholder": "PNbOqW_comboboxPlaceholder",
3105
+ "page": "PNbOqW_page",
3106
+ "department": "PNbOqW_department",
3107
+ "rowActions": "PNbOqW_rowActions",
3100
3108
  "permCopy": "PNbOqW_permCopy",
3101
- "candidate": "PNbOqW_candidate",
3102
- "treeRow": "PNbOqW_treeRow",
3103
- "protected": "PNbOqW_protected",
3109
+ "readOnly": "PNbOqW_readOnly",
3104
3110
  "table": "PNbOqW_table",
3105
- "departments": "PNbOqW_departments",
3106
- "comboboxPlaceholder": "PNbOqW_comboboxPlaceholder",
3107
- "empty": "PNbOqW_empty",
3111
+ "adminTag": "PNbOqW_adminTag",
3108
3112
  "candidates": "PNbOqW_candidates",
3109
- "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",
3113
+ "panelFoot": "PNbOqW_panelFoot",
3114
+ "dialog": "PNbOqW_dialog",
3115
+ "treeToggle": "PNbOqW_treeToggle",
3118
3116
  "comboboxOption": "PNbOqW_comboboxOption",
3119
- "tabActive": "PNbOqW_tabActive",
3120
- "comboboxOptionActive": "PNbOqW_comboboxOptionActive",
3121
- "comboboxHint": "PNbOqW_comboboxHint",
3117
+ "protected": "PNbOqW_protected",
3118
+ "muted": "PNbOqW_muted",
3119
+ "tableScroll": "PNbOqW_tableScroll",
3120
+ "demo": "PNbOqW_demo",
3121
+ "permDescription": "PNbOqW_permDescription",
3122
+ "combobox": "PNbOqW_combobox",
3122
3123
  "search": "PNbOqW_search",
3123
3124
  "matrix": "PNbOqW_matrix",
3124
- "comboboxSearch": "PNbOqW_comboboxSearch",
3125
- "dialog": "PNbOqW_dialog",
3126
- "field": "PNbOqW_field",
3127
- "deptAdmins": "PNbOqW_deptAdmins",
3128
- "panel": "PNbOqW_panel",
3125
+ "candidate": "PNbOqW_candidate",
3126
+ "tabActive": "PNbOqW_tabActive",
3127
+ "matrixScroll": "PNbOqW_matrixScroll",
3128
+ "panelHead": "PNbOqW_panelHead",
3129
+ "dialogHint": "PNbOqW_dialogHint",
3130
+ "onlyAdmin": "PNbOqW_onlyAdmin",
3131
+ "comboboxTrigger": "PNbOqW_comboboxTrigger",
3132
+ "detailGrid": "PNbOqW_detailGrid",
3133
+ "comboboxOptionActive": "PNbOqW_comboboxOptionActive",
3129
3134
  "scopeBadge": "PNbOqW_scopeBadge",
3130
3135
  "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",
3136
+ "error": "PNbOqW_error",
3140
3137
  "comboboxList": "PNbOqW_comboboxList",
3138
+ "notice": "PNbOqW_notice",
3141
3139
  "matrixGroup": "PNbOqW_matrixGroup",
3142
- "matrixScroll": "PNbOqW_matrixScroll"
3140
+ "panel": "PNbOqW_panel",
3141
+ "matrixModule": "PNbOqW_matrixModule",
3142
+ "comboboxMenu": "PNbOqW_comboboxMenu"
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
+ "dialogBody": "razUfG_dialogBody",
4571
4572
  "title": "razUfG_title",
4572
- "sessionTitle": "razUfG_sessionTitle",
4573
- "error": "razUfG_error",
4574
- "banner": "razUfG_banner",
4573
+ "copy": "razUfG_copy",
4574
+ "sessionList": "razUfG_sessionList",
4575
+ "body": "razUfG_body",
4575
4576
  "sessionRow": "razUfG_sessionRow",
4577
+ "banner": "razUfG_banner",
4576
4578
  "dialogText": "razUfG_dialogText",
4577
- "sessionPath": "razUfG_sessionPath",
4578
- "body": "razUfG_body",
4579
- "copy": "razUfG_copy",
4579
+ "sessionTitle": "razUfG_sessionTitle",
4580
4580
  "actions": "razUfG_actions",
4581
- "dialogBody": "razUfG_dialogBody",
4582
- "sessionList": "razUfG_sessionList"
4581
+ "sessionPath": "razUfG_sessionPath",
4582
+ "error": "razUfG_error"
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({