@lemoncat7/dsh-partner 1.12.0 → 1.13.0
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/README.md +12 -0
- package/docs/architecture.md +1 -0
- package/lib/api/features/workspace-api.d.ts.map +1 -1
- package/lib/api/features/workspace-api.js +7 -0
- package/lib/api/features/workspace-api.js.map +1 -1
- package/lib/api/http.d.ts +1 -1
- package/lib/api/http.d.ts.map +1 -1
- package/lib/api/http.js +2 -2
- package/lib/api/http.js.map +1 -1
- package/lib/client.js +1095 -987
- package/lib/client.js.map +4 -4
- package/lib/collaboration/composition.js +7 -3
- package/lib/collaboration/composition.js.map +1 -1
- package/lib/skills/import-request.d.ts +3 -0
- package/lib/skills/import-request.d.ts.map +1 -0
- package/lib/skills/import-request.js +26 -0
- package/lib/skills/import-request.js.map +1 -0
- package/lib/skills/package-zip.d.ts +5 -0
- package/lib/skills/package-zip.d.ts.map +1 -0
- package/lib/skills/package-zip.js +75 -0
- package/lib/skills/package-zip.js.map +1 -0
- package/lib/skills/package.d.ts +15 -0
- package/lib/skills/package.d.ts.map +1 -0
- package/lib/skills/package.js +48 -0
- package/lib/skills/package.js.map +1 -0
- package/lib/skills/repository.d.ts +2 -0
- package/lib/skills/repository.d.ts.map +1 -1
- package/lib/skills/repository.js +7 -0
- package/lib/skills/repository.js.map +1 -1
- package/lib/skills/service.d.ts +2 -0
- package/lib/skills/service.d.ts.map +1 -1
- package/lib/skills/service.js +10 -2
- package/lib/skills/service.js.map +1 -1
- package/lib/skills/task-planning.d.ts +2 -2
- package/lib/skills/task-planning.d.ts.map +1 -1
- package/lib/skills/task-planning.js +8 -1
- package/lib/skills/task-planning.js.map +1 -1
- package/lib/ui/skill-import-dialog.d.ts +5 -0
- package/lib/ui/skill-import-dialog.d.ts.map +1 -0
- package/lib/ui/skill-import-dialog.js +72 -0
- package/lib/ui/skill-import-dialog.js.map +1 -0
- package/lib/ui/skills-panel.d.ts.map +1 -1
- package/lib/ui/skills-panel.js +3 -1
- package/lib/ui/skills-panel.js.map +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -35,7 +35,7 @@ __export(client_exports, {
|
|
|
35
35
|
inject: () => inject
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(client_exports);
|
|
38
|
-
var
|
|
38
|
+
var import_react36 = require("react");
|
|
39
39
|
|
|
40
40
|
// src/workspace-ownership.ts
|
|
41
41
|
var WORKSPACE_ACTIVATE_EVENT = "@lemoncat7/dsh-plugin-ui/workspace-activate";
|
|
@@ -2629,7 +2629,7 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
|
|
|
2629
2629
|
`;
|
|
2630
2630
|
|
|
2631
2631
|
// src/ui/workspace-ui.css
|
|
2632
|
-
var workspace_ui_default = '.dsh-partner-feature-hero-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }\n.dsh-partner-feature-page { gap: 20px; }\n.dsh-partner-feature-hero { min-height: 92px; padding-bottom: 18px; }\n.dsh-partner-feature-hero p { max-width: 62ch; text-wrap: pretty; }\n.dsh-partner-feature-block { gap: 16px; padding: 20px; border-radius: 18px; box-shadow: inset 0 1px 0 var(--partner-card-highlight), 0 5px 16px color-mix(in srgb, var(--partner-text) 4%, transparent); }\n.dsh-partner-feature-block > header { min-height: 40px; }\n.dsh-partner-feature-block > header strong { font-size: var(--partner-font-label); letter-spacing: -.01em; }\n.dsh-partner-feature-block > header small { margin-top: 1px; }\n\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) :where(input, textarea, select) { outline: 0; }\n.dsh-partner-workspace select:not([multiple]) {\n appearance: none;\n padding-right: 32px;\n border-color: var(--partner-border);\n border-radius: 9px;\n color: var(--partner-text);\n background-color: var(--partner-control);\n background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);\n background-position: calc(100% - 15px) calc(50% - 1px), calc(100% - 11px) calc(50% - 1px);\n background-repeat: no-repeat;\n background-size: 4px 4px, 4px 4px;\n box-shadow: inset 0 1px 0 color-mix(in srgb, var(--partner-card-highlight) 54%, transparent), inset 0 -1px 0 var(--partner-glass-rim-shadow);\n font-family: var(--partner-font-family);\n font-size: var(--partner-font-body);\n font-weight: 520;\n cursor: pointer;\n transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;\n}\n.dsh-partner-workspace select:not([multiple]):hover:not(:disabled) { border-color: color-mix(in srgb, var(--partner-text) 24%, var(--partner-border)); background-color: var(--partner-hover); }\n.dsh-partner-workspace select:not([multiple]):focus-visible { border-color: var(--partner-focus-ring); background-color: var(--partner-raised); box-shadow: 0 0 0 3px color-mix(in srgb, var(--partner-focus-ring) 16%, transparent), inset 0 1px 0 color-mix(in srgb, var(--partner-card-highlight) 66%, transparent); }\n.dsh-partner-workspace select:not([multiple]):disabled { cursor: not-allowed; }\n.dsh-partner-workspace select option { color: var(--partner-text); background: var(--partner-solid-control); font: inherit; }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > footer { align-items: center; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--partner-separator); }\n.dsh-partner-form-footer-spacer { flex: 1; }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > footer .is-primary { color: var(--partner-on-accent); border-color: var(--partner-accent-strong); background: var(--partner-accent-strong); }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > footer .is-primary:hover { color: var(--partner-on-accent); border-color: var(--partner-accent-strong); background: color-mix(in srgb, var(--partner-accent-strong) 88%, #000); }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > .dsh-partner-workspace-notice { grid-column: 1 / -1; margin: 0; }\n.dsh-partner-feature-page button:disabled { cursor: not-allowed; opacity: .48; }\n.dsh-partner-identity-danger > div { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }\n.dsh-partner-identity-danger[data-confirming="true"] { margin-inline: -12px; padding: 16px 12px 0; border-top-color: color-mix(in srgb, var(--partner-danger) 30%, var(--partner-border)); background: color-mix(in srgb, var(--partner-danger) 4%, transparent); }\n.dsh-partner-identity-danger button.is-secondary { border-color: var(--partner-border); color: var(--partner-text-secondary); background: var(--partner-control); }\n.dsh-partner-identity-danger button.is-danger { color: var(--partner-on-accent); border-color: var(--partner-danger); background: var(--partner-danger); }\n.dsh-partner-profile-entries article > header button.is-danger { color: var(--partner-danger); background: color-mix(in srgb, var(--partner-danger) 8%, transparent); }\n\n.dsh-partner-skill-installed > article,\n.dsh-partner-market-grid > article,\n.dsh-partner-schedule-list > article { transition: border-color 150ms ease, background-color 150ms ease, transform 180ms var(--partner-ease-out); }\n.dsh-partner-skill-installed > article:hover,\n.dsh-partner-schedule-list > article:hover { border-color: color-mix(in srgb, var(--partner-text) 20%, var(--partner-border)); background: color-mix(in srgb, var(--partner-hover) 60%, var(--partner-raised)); transform: translate3d(0, -1px, 0); }\n.dsh-partner-schedule-meta { display: flex !important; align-items: center; flex-wrap: wrap; gap: 5px 10px !important; margin-top: 2px; }\n.dsh-partner-schedule-meta > em { position: relative; color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); font-style: normal; font-variant-numeric: tabular-nums; }\n.dsh-partner-schedule-meta > em + em::before { position: absolute; top: 50%; left: -6px; width: 2px; height: 2px; border-radius: 50%; background: var(--partner-text-tertiary); content: ""; }\n.dsh-partner-run-list > article { border-radius: 9px; transition: background-color 140ms ease; }\n.dsh-partner-run-list > article:hover { background: var(--partner-hover); }\n.dsh-partner-board > section { border-radius: 16px; box-shadow: none; }\n.dsh-partner-board .dsh-partner-task-card { box-shadow: none; }\n\n@media (hover: hover) {\n .dsh-partner-skill-installed .is-icon,\n .dsh-partner-schedule-list .is-icon { opacity: .34; transition: opacity 140ms ease, color 140ms ease, background-color 140ms ease; }\n .dsh-partner-skill-installed > article:hover .is-icon,\n .dsh-partner-schedule-list > article:hover .is-icon,\n .dsh-partner-skill-installed .is-icon:focus-visible,\n .dsh-partner-schedule-list .is-icon:focus-visible { opacity: 1; }\n}\n\n.dsh-partner-workspace-dialog-layer { position: absolute; z-index: 12; inset: 0; display: flex; align-items: center; justify-content: center; padding: clamp(16px, 3vw, 32px); background: var(--partner-dialog-veil); }\n.dsh-partner-workspace-dialog { position: relative; inset: auto; display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(560px, 100%); max-width: none; height: auto; max-height: min(680px, 100%); margin: 0; padding: 0; overflow: hidden; border: 1px solid color-mix(in srgb, var(--partner-text) 18%, var(--partner-border)); border-radius: 16px; color: var(--partner-text); background: var(--partner-solid-panel); box-shadow: 0 22px 58px color-mix(in srgb, #000 18%, transparent), 0 4px 14px color-mix(in srgb, #000 8%, transparent), inset 0 1px 0 var(--partner-card-highlight); animation: dsh-partner-dialog-enter 200ms var(--partner-ease-out) both; }\n.dsh-partner-workspace-dialog.is-wide { width: min(680px, 100%); max-height: min(720px, 100%); }\n.dsh-partner-workspace-dialog > header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 20px; padding: 22px 22px 18px; border-bottom: 1px solid var(--partner-separator); background: var(--partner-solid-raised); }\n.dsh-partner-workspace-dialog > header > span { display: grid; gap: 5px; min-width: 0; }\n.dsh-partner-workspace-dialog > header small { color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); font-weight: 680; letter-spacing: .09em; }\n.dsh-partner-workspace-dialog > header strong { font-size: var(--partner-font-title); line-height: 1.25; font-weight: 660; letter-spacing: -.025em; text-wrap: balance; }\n.dsh-partner-workspace-dialog > header p { max-width: 58ch; margin: 0; color: var(--partner-text-secondary); font-size: var(--partner-font-body); line-height: 1.55; text-wrap: pretty; }\n.dsh-partner-workspace-dialog > header button { display: grid; place-items: center; width: 32px; min-height: 32px; padding: 0; border: 1px solid transparent; border-radius: 9px; color: var(--partner-text-tertiary); background: transparent; box-shadow: none; cursor: pointer; transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease, transform 140ms var(--partner-ease-out); }\n.dsh-partner-workspace-dialog > header button:hover { border-color: var(--partner-border); color: var(--partner-text); background: var(--partner-hover); }\n.dsh-partner-workspace-dialog > header button:active { transform: scale(.94); }\n.dsh-partner-workspace-dialog-body { min-width: 0; min-height: 0; overflow: auto; padding: 20px 22px 24px; overscroll-behavior: contain; scrollbar-gutter: stable; }\n.dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }\n.dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-task-detail) > footer:last-child { position: sticky; z-index: 2; bottom: -24px; margin: 4px -22px -24px; padding: 14px 22px; border-top: 1px solid var(--partner-separator); background: var(--partner-solid-raised); box-shadow: 0 -10px 24px color-mix(in srgb, #000 5%, transparent); }\n\n.dsh-partner-workspace-notice { display: grid; grid-template-columns: 7px minmax(0, 1fr); align-items: start; gap: 10px; margin: 0 0 14px; padding: 11px 13px; border: 1px solid var(--partner-border); border-radius: 10px; color: var(--partner-text-secondary); background: var(--partner-control); font-size: var(--partner-font-body); line-height: 1.5; }\n.dsh-partner-workspace-notice > i { width: 7px; height: 7px; margin-top: .42em; border-radius: 50%; background: var(--partner-text-tertiary); }\n.dsh-partner-workspace-notice.is-error { border-color: color-mix(in srgb, var(--partner-danger) 30%, var(--partner-border)); color: var(--partner-danger); }\n.dsh-partner-workspace-notice.is-error > i { background: var(--partner-danger); }\n.dsh-partner-workspace-notice.is-warning > i { background: var(--partner-warning); }\n.dsh-partner-workspace-notice.is-success > i { background: var(--partner-success); }\n\n.dsh-partner-collection-empty { display: grid; justify-items: center; padding: 38px 24px 42px; color: var(--partner-text-secondary); text-align: center; }\n.dsh-partner-collection-empty > span { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 12px; border: 1px solid var(--partner-border); border-radius: 13px; color: var(--partner-text-tertiary); background: var(--partner-control); }\n.dsh-partner-collection-empty > strong { color: var(--partner-text); font-size: var(--partner-font-label); font-weight: 620; }\n.dsh-partner-collection-empty > p { max-width: 46ch; margin: 6px 0 14px; color: var(--partner-text-tertiary); font-size: var(--partner-font-body); line-height: 1.55; text-wrap: pretty; }\n.dsh-partner-collection-empty > button { margin-top: 14px; }\n\n.dsh-partner-collection-skeleton { display: grid; gap: 8px; padding: 6px 0; }\n.dsh-partner-collection-skeleton > i { display: block; height: 68px; overflow: hidden; border: 1px solid var(--partner-border); border-radius: 12px; background: linear-gradient(100deg, var(--partner-control) 20%, var(--partner-hover) 38%, var(--partner-control) 56%); background-size: 220% 100%; animation: dsh-partner-skeleton 1.4s ease-in-out infinite; }\n\n.dsh-partner-count-label { display: inline-flex; align-items: baseline; gap: 5px; color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); font-variant-numeric: tabular-nums; }\n.dsh-partner-count-label > b { color: var(--partner-text); font-size: var(--partner-font-label); font-weight: 650; }\n\n@keyframes dsh-partner-dialog-enter { from { opacity: 0; transform: translate3d(0, 10px, 0) scale(.985); } to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } }\n@keyframes dsh-partner-skeleton { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }\n\n@media (max-width: 760px) {\n .dsh-partner-workspace-dialog-layer { align-items: stretch; padding: 0; }\n .dsh-partner-workspace-dialog, .dsh-partner-workspace-dialog.is-wide { width: 100%; height: 100%; max-height: none; border-width: 0; border-radius: 0; }\n .dsh-partner-workspace-dialog > header { padding: 18px 18px 15px; }\n .dsh-partner-workspace-dialog-body { padding: 18px 18px 26px; }\n .dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-task-detail) > footer:last-child { bottom: -26px; margin: 4px -18px -26px; padding: 13px 18px max(13px, env(safe-area-inset-bottom)); }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-partner-workspace-dialog, .dsh-partner-collection-skeleton > i { animation: none; }\n}\n';
|
|
2632
|
+
var workspace_ui_default = '.dsh-partner-feature-hero-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }\n.dsh-partner-feature-page { gap: 20px; }\n.dsh-partner-feature-hero { min-height: 92px; padding-bottom: 18px; }\n.dsh-partner-feature-hero p { max-width: 62ch; text-wrap: pretty; }\n.dsh-partner-feature-block { gap: 16px; padding: 20px; border-radius: 18px; box-shadow: inset 0 1px 0 var(--partner-card-highlight), 0 5px 16px color-mix(in srgb, var(--partner-text) 4%, transparent); }\n.dsh-partner-feature-block > header { min-height: 40px; }\n.dsh-partner-feature-block > header strong { font-size: var(--partner-font-label); letter-spacing: -.01em; }\n.dsh-partner-feature-block > header small { margin-top: 1px; }\n\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) :where(input, textarea, select) { outline: 0; }\n.dsh-partner-workspace select:not([multiple]) {\n appearance: none;\n padding-right: 32px;\n border-color: var(--partner-border);\n border-radius: 9px;\n color: var(--partner-text);\n background-color: var(--partner-control);\n background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);\n background-position: calc(100% - 15px) calc(50% - 1px), calc(100% - 11px) calc(50% - 1px);\n background-repeat: no-repeat;\n background-size: 4px 4px, 4px 4px;\n box-shadow: inset 0 1px 0 color-mix(in srgb, var(--partner-card-highlight) 54%, transparent), inset 0 -1px 0 var(--partner-glass-rim-shadow);\n font-family: var(--partner-font-family);\n font-size: var(--partner-font-body);\n font-weight: 520;\n cursor: pointer;\n transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;\n}\n.dsh-partner-workspace select:not([multiple]):hover:not(:disabled) { border-color: color-mix(in srgb, var(--partner-text) 24%, var(--partner-border)); background-color: var(--partner-hover); }\n.dsh-partner-workspace select:not([multiple]):focus-visible { border-color: var(--partner-focus-ring); background-color: var(--partner-raised); box-shadow: 0 0 0 3px color-mix(in srgb, var(--partner-focus-ring) 16%, transparent), inset 0 1px 0 color-mix(in srgb, var(--partner-card-highlight) 66%, transparent); }\n.dsh-partner-workspace select:not([multiple]):disabled { cursor: not-allowed; }\n.dsh-partner-workspace select option { color: var(--partner-text); background: var(--partner-solid-control); font: inherit; }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > footer { align-items: center; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--partner-separator); }\n.dsh-partner-form-footer-spacer { flex: 1; }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > footer .is-primary { color: var(--partner-on-accent); border-color: var(--partner-accent-strong); background: var(--partner-accent-strong); }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > footer .is-primary:hover { color: var(--partner-on-accent); border-color: var(--partner-accent-strong); background: color-mix(in srgb, var(--partner-accent-strong) 88%, #000); }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > .dsh-partner-workspace-notice { grid-column: 1 / -1; margin: 0; }\n.dsh-partner-feature-page button:disabled { cursor: not-allowed; opacity: .48; }\n.dsh-partner-identity-danger > div { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }\n.dsh-partner-identity-danger[data-confirming="true"] { margin-inline: -12px; padding: 16px 12px 0; border-top-color: color-mix(in srgb, var(--partner-danger) 30%, var(--partner-border)); background: color-mix(in srgb, var(--partner-danger) 4%, transparent); }\n.dsh-partner-identity-danger button.is-secondary { border-color: var(--partner-border); color: var(--partner-text-secondary); background: var(--partner-control); }\n.dsh-partner-identity-danger button.is-danger { color: var(--partner-on-accent); border-color: var(--partner-danger); background: var(--partner-danger); }\n.dsh-partner-profile-entries article > header button.is-danger { color: var(--partner-danger); background: color-mix(in srgb, var(--partner-danger) 8%, transparent); }\n\n.dsh-partner-skill-installed > article,\n.dsh-partner-market-grid > article,\n.dsh-partner-schedule-list > article { transition: border-color 150ms ease, background-color 150ms ease, transform 180ms var(--partner-ease-out); }\n.dsh-partner-skill-installed > article:hover,\n.dsh-partner-schedule-list > article:hover { border-color: color-mix(in srgb, var(--partner-text) 20%, var(--partner-border)); background: color-mix(in srgb, var(--partner-hover) 60%, var(--partner-raised)); transform: translate3d(0, -1px, 0); }\n.dsh-partner-schedule-meta { display: flex !important; align-items: center; flex-wrap: wrap; gap: 5px 10px !important; margin-top: 2px; }\n.dsh-partner-schedule-meta > em { position: relative; color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); font-style: normal; font-variant-numeric: tabular-nums; }\n.dsh-partner-schedule-meta > em + em::before { position: absolute; top: 50%; left: -6px; width: 2px; height: 2px; border-radius: 50%; background: var(--partner-text-tertiary); content: ""; }\n.dsh-partner-run-list > article { border-radius: 9px; transition: background-color 140ms ease; }\n.dsh-partner-run-list > article:hover { background: var(--partner-hover); }\n.dsh-partner-board > section { border-radius: 16px; box-shadow: none; }\n.dsh-partner-board .dsh-partner-task-card { box-shadow: none; }\n\n@media (hover: hover) {\n .dsh-partner-skill-installed .is-icon,\n .dsh-partner-schedule-list .is-icon { opacity: .34; transition: opacity 140ms ease, color 140ms ease, background-color 140ms ease; }\n .dsh-partner-skill-installed > article:hover .is-icon,\n .dsh-partner-schedule-list > article:hover .is-icon,\n .dsh-partner-skill-installed .is-icon:focus-visible,\n .dsh-partner-schedule-list .is-icon:focus-visible { opacity: 1; }\n}\n\n.dsh-partner-workspace-dialog-layer { position: absolute; z-index: 12; inset: 0; display: flex; align-items: center; justify-content: center; padding: clamp(16px, 3vw, 32px); background: var(--partner-dialog-veil); }\n.dsh-partner-workspace-dialog { position: relative; inset: auto; display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(560px, 100%); max-width: none; height: auto; max-height: min(680px, 100%); margin: 0; padding: 0; overflow: hidden; border: 1px solid color-mix(in srgb, var(--partner-text) 18%, var(--partner-border)); border-radius: 16px; color: var(--partner-text); background: var(--partner-solid-panel); box-shadow: 0 22px 58px color-mix(in srgb, #000 18%, transparent), 0 4px 14px color-mix(in srgb, #000 8%, transparent), inset 0 1px 0 var(--partner-card-highlight); animation: dsh-partner-dialog-enter 200ms var(--partner-ease-out) both; }\n.dsh-partner-workspace-dialog.is-wide { width: min(680px, 100%); max-height: min(720px, 100%); }\n.dsh-partner-workspace-dialog > header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 20px; padding: 22px 22px 18px; border-bottom: 1px solid var(--partner-separator); background: var(--partner-solid-raised); }\n.dsh-partner-workspace-dialog > header > span { display: grid; gap: 5px; min-width: 0; }\n.dsh-partner-workspace-dialog > header small { color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); font-weight: 680; letter-spacing: .09em; }\n.dsh-partner-workspace-dialog > header strong { font-size: var(--partner-font-title); line-height: 1.25; font-weight: 660; letter-spacing: -.025em; text-wrap: balance; }\n.dsh-partner-workspace-dialog > header p { max-width: 58ch; margin: 0; color: var(--partner-text-secondary); font-size: var(--partner-font-body); line-height: 1.55; text-wrap: pretty; }\n.dsh-partner-workspace-dialog > header button { display: grid; place-items: center; width: 32px; min-height: 32px; padding: 0; border: 1px solid transparent; border-radius: 9px; color: var(--partner-text-tertiary); background: transparent; box-shadow: none; cursor: pointer; transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease, transform 140ms var(--partner-ease-out); }\n.dsh-partner-workspace-dialog > header button:hover { border-color: var(--partner-border); color: var(--partner-text); background: var(--partner-hover); }\n.dsh-partner-workspace-dialog > header button:active { transform: scale(.94); }\n.dsh-partner-workspace-dialog-body { min-width: 0; min-height: 0; overflow: auto; padding: 20px 22px 24px; overscroll-behavior: contain; scrollbar-gutter: stable; }\n.dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }\n.dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-task-detail) > footer:last-child { position: sticky; z-index: 2; bottom: -24px; margin: 4px -22px -24px; padding: 14px 22px; border-top: 1px solid var(--partner-separator); background: var(--partner-solid-raised); box-shadow: 0 -10px 24px color-mix(in srgb, #000 5%, transparent); }\n\n.dsh-partner-workspace-notice { display: grid; grid-template-columns: 7px minmax(0, 1fr); align-items: start; gap: 10px; margin: 0 0 14px; padding: 11px 13px; border: 1px solid var(--partner-border); border-radius: 10px; color: var(--partner-text-secondary); background: var(--partner-control); font-size: var(--partner-font-body); line-height: 1.5; }\n.dsh-partner-workspace-notice > i { width: 7px; height: 7px; margin-top: .42em; border-radius: 50%; background: var(--partner-text-tertiary); }\n.dsh-partner-workspace-notice.is-error { border-color: color-mix(in srgb, var(--partner-danger) 30%, var(--partner-border)); color: var(--partner-danger); }\n.dsh-partner-workspace-notice.is-error > i { background: var(--partner-danger); }\n.dsh-partner-workspace-notice.is-warning > i { background: var(--partner-warning); }\n.dsh-partner-workspace-notice.is-success > i { background: var(--partner-success); }\n\n.dsh-partner-collection-empty { display: grid; justify-items: center; padding: 38px 24px 42px; color: var(--partner-text-secondary); text-align: center; }\n.dsh-partner-collection-empty > span { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 12px; border: 1px solid var(--partner-border); border-radius: 13px; color: var(--partner-text-tertiary); background: var(--partner-control); }\n.dsh-partner-collection-empty > strong { color: var(--partner-text); font-size: var(--partner-font-label); font-weight: 620; }\n.dsh-partner-collection-empty > p { max-width: 46ch; margin: 6px 0 14px; color: var(--partner-text-tertiary); font-size: var(--partner-font-body); line-height: 1.55; text-wrap: pretty; }\n.dsh-partner-collection-empty > button { margin-top: 14px; }\n\n.dsh-partner-collection-skeleton { display: grid; gap: 8px; padding: 6px 0; }\n.dsh-partner-collection-skeleton > i { display: block; height: 68px; overflow: hidden; border: 1px solid var(--partner-border); border-radius: 12px; background: linear-gradient(100deg, var(--partner-control) 20%, var(--partner-hover) 38%, var(--partner-control) 56%); background-size: 220% 100%; animation: dsh-partner-skeleton 1.4s ease-in-out infinite; }\n\n.dsh-partner-count-label { display: inline-flex; align-items: baseline; gap: 5px; color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); font-variant-numeric: tabular-nums; }\n.dsh-partner-count-label > b { color: var(--partner-text); font-size: var(--partner-font-label); font-weight: 650; }\n\n@keyframes dsh-partner-dialog-enter { from { opacity: 0; transform: translate3d(0, 10px, 0) scale(.985); } to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } }\n@keyframes dsh-partner-skeleton { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }\n\n@media (max-width: 760px) {\n .dsh-partner-workspace-dialog-layer { align-items: stretch; padding: 0; }\n .dsh-partner-workspace-dialog, .dsh-partner-workspace-dialog.is-wide { width: 100%; height: 100%; max-height: none; border-width: 0; border-radius: 0; }\n .dsh-partner-workspace-dialog > header { padding: 18px 18px 15px; }\n .dsh-partner-workspace-dialog-body { padding: 18px 18px 26px; }\n .dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-task-detail) > footer:last-child { bottom: -26px; margin: 4px -18px -26px; padding: 13px 18px max(13px, env(safe-area-inset-bottom)); }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-partner-workspace-dialog, .dsh-partner-collection-skeleton > i { animation: none; }\n}\n.dsh-partner-feature-form > .dsh-partner-form-help { color: var(--partner-text-secondary); background: transparent; padding: 0; overflow-wrap: anywhere; line-height: 1.6; }\n';
|
|
2633
2633
|
|
|
2634
2634
|
// src/ui/requirement-board.css
|
|
2635
2635
|
var requirement_board_default = ".dsh-partner-requirement-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }\n.dsh-partner-requirement-toolbar .dsh-partner-board-statuses { margin: 0; flex: 1; }\n.dsh-partner-requirement-toolbar .dsh-partner-board-search { flex: 0 1 300px; }\n.dsh-partner-requirement-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }\n.dsh-partner-requirement-card { min-width: 0; border: 1px solid var(--partner-border); border-radius: 16px; overflow: hidden; background: var(--partner-raised); }\n.dsh-partner-feature-page .dsh-partner-requirement-open { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 100%; min-height: 186px; padding: 18px; border: 0; border-radius: 0; background: transparent; color: var(--partner-text); text-align: left; box-shadow: none; }\n.dsh-partner-requirement-open:hover, .dsh-partner-requirement-open:focus-visible { background: var(--partner-hover); }\n.dsh-partner-requirement-open > strong { font-size: var(--partner-font-label); line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }\n.dsh-partner-requirement-open > p { margin: 0; min-height: 3em; font-size: var(--partner-font-body); color: var(--partner-text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }\n.dsh-partner-requirement-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--partner-font-caption); color: var(--partner-text-secondary); }\n.dsh-partner-requirement-meta > span { border-radius: 6px; padding: 3px 7px; background: var(--partner-control); color: var(--partner-text); }\n.dsh-partner-requirement-meta small { font: inherit; overflow-wrap: anywhere; }\n.dsh-partner-requirement-progress { height: 4px; width: 100%; border-radius: 4px; background: var(--partner-border); overflow: hidden; margin-top: auto; }\n.dsh-partner-requirement-progress > i { display: block; height: 100%; border-radius: inherit; background: var(--partner-text-secondary); }\n.dsh-partner-requirement-card > footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 18px; border-top: 1px solid var(--partner-separator); }\n.dsh-partner-requirement-card > footer > small { color: var(--partner-text-secondary); font-size: var(--partner-font-caption); }\n.dsh-partner-requirement-card > footer > button { border: 0; background: transparent; box-shadow: none; }\n.dsh-partner-requirement-legacy { width: 100%; display: flex; gap: 12px; margin-top: 20px; padding: 14px !important; text-align: left; }\n.dsh-partner-requirement-legacy > span { flex: 1; color: var(--partner-text-secondary); }\n.dsh-partner-requirement-breadcrumb { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 12px; font-size: var(--partner-font-body); }\n.dsh-partner-requirement-breadcrumb > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }\n.dsh-partner-requirement-breadcrumb > button, .dsh-partner-requirement-breadcrumb > svg { flex-shrink: 0; }\n.dsh-partner-requirement-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-block: 12px; border-block: 1px solid var(--partner-separator); }\n.dsh-partner-requirement-facts > span { display: grid; gap: 6px; color: var(--partner-text-secondary); font-size: var(--partner-font-caption); }\n.dsh-partner-requirement-facts b { color: var(--partner-text); font-weight: 550; overflow-wrap: anywhere; }\n.dsh-partner-requirement-disclosure { border-top: 1px solid var(--partner-separator); padding-top: 8px; }\n.dsh-partner-requirement-disclosure > summary { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; color: var(--partner-text-secondary); font-size: var(--partner-font-body); list-style: none; }\n.dsh-partner-requirement-disclosure > summary::-webkit-details-marker { display: none; }\n.dsh-partner-requirement-disclosure > summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }\n.dsh-partner-requirement-disclosure[open] > summary::before { transform: rotate(45deg); }\n.dsh-partner-requirement-disclosure > p { color: var(--partner-text-secondary); font-size: var(--partner-font-body); line-height: 1.6; }\n.dsh-partner-requirement-disclosure > label { display: grid; gap: 8px; margin-bottom: 12px; }\n.dsh-partner-requirement-actions { display: flex; flex-wrap: wrap; gap: 8px; }\n.dsh-partner-requirement-owner { display: grid; gap: 8px; font-size: var(--partner-font-body); }\n.dsh-partner-requirement-detail :is(textarea, select) { box-sizing: border-box; width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--partner-border); border-radius: 9px; background: var(--partner-control); color: var(--partner-text); font: var(--partner-font-body)/1.5 var(--partner-font-family); }\n.dsh-partner-requirement-detail textarea { resize: vertical; }\n.dsh-partner-feature-page.is-board :is(button, summary, textarea):focus-visible { outline: 2px solid var(--partner-focus-ring); outline-offset: 2px; }\n.dsh-partner-feature-page.is-board button:not(:disabled):active { transform: none; }\n.dsh-partner-requirement-detail button.is-primary { background: var(--partner-accent-strong); color: var(--partner-on-accent); border-color: var(--partner-accent-strong); }\n.dsh-partner-requirement-detail button.is-danger { color: var(--partner-danger); }\n.dsh-partner-feature-page.is-board > .dsh-partner-feature-page.is-board { padding: 0; }\n.dsh-partner-requirement-detail > footer { display: flex; justify-content: flex-end; gap: 8px; }\n.dsh-partner-requirement-detail .dsh-partner-task-result { overflow-wrap: anywhere; }\n@media (max-width: 760px) {\n .dsh-partner-requirement-toolbar { align-items: stretch; }\n .dsh-partner-requirement-toolbar .dsh-partner-board-statuses { display: flex; }\n .dsh-partner-requirement-toolbar .dsh-partner-board-search { flex-basis: 100%; }\n .dsh-partner-requirement-facts { grid-template-columns: 1fr 1fr; }\n .dsh-partner-requirement-legacy { flex-wrap: wrap; }\n .dsh-partner-requirement-legacy > span { flex-basis: 100%; }\n .dsh-partner-requirement-detail button, .dsh-partner-requirement-card button, .dsh-partner-requirement-disclosure summary { min-height: 44px; }\n}\n";
|
|
@@ -5653,24 +5653,128 @@ function GlassSurface({
|
|
|
5653
5653
|
}
|
|
5654
5654
|
|
|
5655
5655
|
// src/ui/skills-panel.tsx
|
|
5656
|
-
var
|
|
5656
|
+
var import_react25 = require("react");
|
|
5657
5657
|
var import_dsh_client_ui_primitives10 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5658
|
+
|
|
5659
|
+
// src/ui/skill-import-dialog.tsx
|
|
5660
|
+
var import_react24 = require("react");
|
|
5658
5661
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
const
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5662
|
+
var LIMIT = 32 * 1024 * 1024;
|
|
5663
|
+
var encodeFile = (file) => new Promise((resolve, reject) => {
|
|
5664
|
+
const reader = new FileReader();
|
|
5665
|
+
reader.onerror = () => reject(new Error(`\u65E0\u6CD5\u8BFB\u53D6 ${file.name}`));
|
|
5666
|
+
reader.onload = () => resolve(String(reader.result).split(",")[1] ?? "");
|
|
5667
|
+
reader.readAsDataURL(file);
|
|
5668
|
+
});
|
|
5669
|
+
function SkillImportDialog({ close, changed: changed2 }) {
|
|
5670
|
+
const zipInput = (0, import_react24.useRef)(null), directoryInput = (0, import_react24.useRef)(null);
|
|
5671
|
+
const [files, setFiles] = (0, import_react24.useState)([]);
|
|
5672
|
+
const [kind, setKind] = (0, import_react24.useState)("zip");
|
|
5673
|
+
const [busy, setBusy] = (0, import_react24.useState)(false), [progress, setProgress] = (0, import_react24.useState)("");
|
|
5666
5674
|
const [error, setError] = (0, import_react24.useState)();
|
|
5667
|
-
const
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5675
|
+
const choose = (selected, nextKind) => {
|
|
5676
|
+
if (!selected?.length || busy) return;
|
|
5677
|
+
setError(void 0);
|
|
5678
|
+
setFiles([]);
|
|
5679
|
+
const next = Array.from(selected).filter((file) => !file.webkitRelativePath.split("/").some((part) => [".git", "node_modules", "__MACOSX", ".DS_Store"].includes(part)));
|
|
5680
|
+
if (nextKind === "zip" && !/\.zip$/iu.test(next[0]?.name ?? "")) {
|
|
5681
|
+
setError("\u8BF7\u9009\u62E9 ZIP \u538B\u7F29\u5305\uFF1B\u5176\u4ED6\u683C\u5F0F\u8BF7\u5148\u89E3\u538B\uFF0C\u518D\u9009\u62E9\u76EE\u5F55\u5BFC\u5165\u3002");
|
|
5682
|
+
return;
|
|
5683
|
+
}
|
|
5684
|
+
if (!next.length || next.length > 512 || next.reduce((total, file) => total + file.size, 0) > LIMIT || nextKind === "directory" && next.some((file) => file.size > 8 * 1024 * 1024)) {
|
|
5685
|
+
setError("\u6700\u591A 512 \u4E2A\u6587\u4EF6\u3001\u603B\u8BA1 32 MiB\uFF1B\u76EE\u5F55\u4E2D\u7684\u5355\u4E2A\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7 8 MiB\u3002");
|
|
5686
|
+
return;
|
|
5687
|
+
}
|
|
5688
|
+
setKind(nextKind);
|
|
5689
|
+
setFiles(next);
|
|
5690
|
+
};
|
|
5691
|
+
const submit = async (event) => {
|
|
5692
|
+
event.preventDefault();
|
|
5693
|
+
if (busy || !files.length) return;
|
|
5694
|
+
setBusy(true);
|
|
5695
|
+
setError(void 0);
|
|
5696
|
+
try {
|
|
5697
|
+
let body;
|
|
5698
|
+
if (kind === "zip") {
|
|
5699
|
+
setProgress("\u6B63\u5728\u8BFB\u53D6\u538B\u7F29\u5305\u2026");
|
|
5700
|
+
body = { kind, data: await encodeFile(files[0]) };
|
|
5701
|
+
} else {
|
|
5702
|
+
const entries = [];
|
|
5703
|
+
for (const [index, file] of files.entries()) {
|
|
5704
|
+
setProgress(`\u6B63\u5728\u8BFB\u53D6\u6587\u4EF6 ${index + 1}/${files.length}`);
|
|
5705
|
+
entries.push({ path: file.webkitRelativePath || file.name, data: await encodeFile(file) });
|
|
5706
|
+
}
|
|
5707
|
+
body = { kind, files: entries };
|
|
5708
|
+
}
|
|
5709
|
+
setProgress("\u6B63\u5728\u6821\u9A8C\u5E76\u5BFC\u5165\u2026");
|
|
5710
|
+
await api("/skills/import", { method: "POST", body: JSON.stringify(body), signal: AbortSignal.timeout(12e4) });
|
|
5711
|
+
setProgress("\u5BFC\u5165\u6210\u529F\uFF0C\u6B63\u5728\u66F4\u65B0\u5217\u8868\u2026");
|
|
5712
|
+
await changed2();
|
|
5713
|
+
close();
|
|
5714
|
+
} catch (reason) {
|
|
5715
|
+
setError(errorMessage(reason));
|
|
5716
|
+
} finally {
|
|
5717
|
+
setBusy(false);
|
|
5718
|
+
setProgress("");
|
|
5719
|
+
}
|
|
5720
|
+
};
|
|
5721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(WorkspaceDialog, { title: "\u5BFC\u5165 Skill", detail: "\u5BFC\u5165\u5B8C\u6574\u6280\u80FD\u5305\uFF0C\u4FDD\u7559 scripts\u3001references\u3001assets \u7B49\u914D\u5957\u6587\u4EF6\u3002", close: () => {
|
|
5722
|
+
if (!busy) close();
|
|
5723
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-skill-form", "aria-busy": busy, onSubmit: (event) => {
|
|
5724
|
+
void submit(event);
|
|
5725
|
+
}, children: [
|
|
5726
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { hidden: true, type: "file", accept: ".zip,application/zip", ref: zipInput, onChange: (event) => {
|
|
5727
|
+
choose(event.target.files, "zip");
|
|
5728
|
+
event.target.value = "";
|
|
5729
|
+
} }),
|
|
5730
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { hidden: true, type: "file", multiple: true, ref: (node) => {
|
|
5731
|
+
directoryInput.current = node;
|
|
5732
|
+
node?.setAttribute("webkitdirectory", "");
|
|
5733
|
+
}, onChange: (event) => {
|
|
5734
|
+
choose(event.target.files, "directory");
|
|
5735
|
+
event.target.value = "";
|
|
5736
|
+
} }),
|
|
5737
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "is-wide dsh-partner-capability-actions", children: [
|
|
5738
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", autoFocus: true, disabled: busy, onClick: () => zipInput.current?.click(), children: "\u9009\u62E9 ZIP \u538B\u7F29\u5305" }),
|
|
5739
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", disabled: busy || !("webkitdirectory" in document.createElement("input")), onClick: () => directoryInput.current?.click(), children: "\u9009\u62E9\u76EE\u5F55" })
|
|
5740
|
+
] }),
|
|
5741
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "is-wide dsh-partner-form-help", children: "\u6BCF\u6B21\u5BFC\u5165\u4E00\u4E2A Skill\uFF0C\u76EE\u5F55\u4E2D\u5E94\u6709 SKILL.md\u3002\u5B89\u88C5\u4E0D\u4F1A\u6267\u884C\u811A\u672C\uFF0C\u4E5F\u4E0D\u4F1A\u81EA\u52A8\u4E3A\u4F19\u4F34\u542F\u7528\u3002\u4EC5\u5BFC\u5165\u53EF\u4FE1\u6765\u6E90\uFF1B\u5176\u4ED6\u538B\u7F29\u683C\u5F0F\u53EF\u5148\u89E3\u538B\u540E\u5BFC\u5165\u76EE\u5F55\u3002" }),
|
|
5742
|
+
files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { className: "is-wide dsh-partner-form-help", role: "status", children: [
|
|
5743
|
+
"\u5DF2\u9009\u62E9\uFF1A",
|
|
5744
|
+
kind === "zip" ? files[0].name : files[0].webkitRelativePath.split("/")[0],
|
|
5745
|
+
" \xB7 ",
|
|
5746
|
+
files.length,
|
|
5747
|
+
" \u4E2A\u6587\u4EF6 \xB7 ",
|
|
5748
|
+
(files.reduce((total, file) => total + file.size, 0) / 1024 / 1024).toFixed(2),
|
|
5749
|
+
" MiB"
|
|
5750
|
+
] }),
|
|
5751
|
+
progress && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "is-wide dsh-partner-form-help", role: "status", children: progress }),
|
|
5752
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(WorkspaceNotice, { children: error }),
|
|
5753
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("footer", { children: [
|
|
5754
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
5755
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !files.length, children: busy ? "\u5BFC\u5165\u4E2D\u2026" : "\u5BFC\u5165 Skill" })
|
|
5756
|
+
] })
|
|
5757
|
+
] }) });
|
|
5758
|
+
}
|
|
5759
|
+
|
|
5760
|
+
// src/ui/skills-panel.tsx
|
|
5761
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
5762
|
+
function SkillsPanel() {
|
|
5763
|
+
const [catalog, setCatalog] = (0, import_react25.useState)({ installed: [], bindings: [], sources: [] });
|
|
5764
|
+
const [market, setMarket] = (0, import_react25.useState)({ sources: [], entries: [], errors: [] });
|
|
5765
|
+
const [query, setQuery] = (0, import_react25.useState)("");
|
|
5766
|
+
const [activeSource, setActiveSource] = (0, import_react25.useState)("market-clawhub");
|
|
5767
|
+
const [busy, setBusy] = (0, import_react25.useState)();
|
|
5768
|
+
const [loading, setLoading] = (0, import_react25.useState)(true);
|
|
5769
|
+
const [error, setError] = (0, import_react25.useState)();
|
|
5770
|
+
const [actionError, setActionError] = (0, import_react25.useState)();
|
|
5771
|
+
const [addingSource, setAddingSource] = (0, import_react25.useState)(false);
|
|
5772
|
+
const [creatingSkill, setCreatingSkill] = (0, import_react25.useState)(false);
|
|
5773
|
+
const [importingSkill, setImportingSkill] = (0, import_react25.useState)(false);
|
|
5774
|
+
const [editingNetwork, setEditingNetwork] = (0, import_react25.useState)(false);
|
|
5775
|
+
const [showAllInstalled, setShowAllInstalled] = (0, import_react25.useState)(false);
|
|
5776
|
+
const [network, setNetwork] = (0, import_react25.useState)({});
|
|
5777
|
+
const load2 = (0, import_react25.useCallback)(async (refresh = false) => {
|
|
5674
5778
|
try {
|
|
5675
5779
|
const [nextCatalog, nextMarket, nextNetwork] = await Promise.all([
|
|
5676
5780
|
api("/skills"),
|
|
@@ -5687,17 +5791,17 @@ function SkillsPanel() {
|
|
|
5687
5791
|
setLoading(false);
|
|
5688
5792
|
}
|
|
5689
5793
|
}, []);
|
|
5690
|
-
(0,
|
|
5794
|
+
(0, import_react25.useEffect)(() => {
|
|
5691
5795
|
void load2();
|
|
5692
5796
|
}, [load2]);
|
|
5693
5797
|
const installed = new Map(catalog.installed.map((item) => [item.id, item]));
|
|
5694
5798
|
const visibleInstalled = showAllInstalled ? catalog.installed : catalog.installed.slice(0, 4);
|
|
5695
|
-
const visible = (0,
|
|
5799
|
+
const visible = (0, import_react25.useMemo)(() => {
|
|
5696
5800
|
const normalized = query.trim().toLocaleLowerCase();
|
|
5697
5801
|
return market.entries.filter((item) => item.sourceId === activeSource && (!normalized || `${item.name} ${item.description} ${item.tags.join(" ")}`.toLocaleLowerCase().includes(normalized)));
|
|
5698
5802
|
}, [activeSource, market.entries, query]);
|
|
5699
5803
|
const sources = [{ id: "builtin", name: "\u5185\u7F6E\u7CBE\u9009" }, ...market.sources.map((source) => ({ id: source.id, name: source.name }))];
|
|
5700
|
-
const sourceCounts = (0,
|
|
5804
|
+
const sourceCounts = (0, import_react25.useMemo)(() => market.entries.reduce((counts, entry) => {
|
|
5701
5805
|
counts.set(entry.sourceId, (counts.get(entry.sourceId) ?? 0) + 1);
|
|
5702
5806
|
return counts;
|
|
5703
5807
|
}, /* @__PURE__ */ new Map()), [market.entries]);
|
|
@@ -5725,33 +5829,37 @@ function SkillsPanel() {
|
|
|
5725
5829
|
setBusy(void 0);
|
|
5726
5830
|
}
|
|
5727
5831
|
};
|
|
5728
|
-
return /* @__PURE__ */ (0,
|
|
5729
|
-
/* @__PURE__ */ (0,
|
|
5832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-feature-page", children: [
|
|
5833
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WorkspaceHero, { eyebrow: "Capability catalog", title: "Skill \u5E02\u573A", detail: "\u96C6\u4E2D\u5B89\u88C5\u548C\u7EF4\u62A4\u5DE5\u4F5C\u80FD\u529B\uFF1B\u5B89\u88C5\u540E\uFF0C\u518D\u4E3A\u9700\u8981\u5B83\u7684\u4F19\u4F34\u5355\u72EC\u542F\u7528\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", disabled: loading, onClick: () => {
|
|
5730
5834
|
void load2(true);
|
|
5731
5835
|
}, children: [
|
|
5732
|
-
/* @__PURE__ */ (0,
|
|
5836
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives10.IconRefreshOutline16, { size: 15 }),
|
|
5733
5837
|
loading ? "\u540C\u6B65\u4E2D\u2026" : "\u5237\u65B0\u5E02\u573A"
|
|
5734
5838
|
] }) }),
|
|
5735
|
-
error && /* @__PURE__ */ (0,
|
|
5736
|
-
|
|
5737
|
-
|
|
5839
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WorkspaceNotice, { children: error }),
|
|
5840
|
+
importingSkill && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SkillImportDialog, { close: () => setImportingSkill(false), changed: load2 }),
|
|
5841
|
+
creatingSkill && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA Skill", detail: "\u521B\u5EFA\u4E00\u4E2A\u53EF\u590D\u7528\u7684\u5DE5\u4F5C\u6D41\u7A0B\uFF0C\u5E76\u660E\u786E\u6267\u884C\u4E0A\u4E0B\u6587\u3001\u5DE5\u5177\u8FB9\u754C\u548C\u9A8C\u6536\u6307\u4EE4\u3002", close: () => setCreatingSkill(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(NewSkillForm, { existingIds: catalog.installed.map((skill) => skill.id), close: () => setCreatingSkill(false), changed: load2 }) }),
|
|
5842
|
+
editingNetwork && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WorkspaceDialog, { title: "\u5E02\u573A\u7F51\u7EDC\u8BBE\u7F6E", detail: "\u914D\u7F6E Skill \u7D22\u5F15\u548C\u5B89\u88C5\u5305\u4E0B\u8F7D\u5171\u7528\u7684 HTTP \u4EE3\u7406\uFF0C\u5E76\u5728\u4FDD\u5B58\u524D\u6D4B\u8BD5\u8FDE\u901A\u6027\u3002", close: () => setEditingNetwork(false), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(NetworkSettingsForm, { value: network, close: () => setEditingNetwork(false), changed: async (next) => {
|
|
5738
5843
|
setNetwork(next);
|
|
5739
5844
|
await load2(true);
|
|
5740
5845
|
} }) }),
|
|
5741
|
-
addingSource && /* @__PURE__ */ (0,
|
|
5742
|
-
/* @__PURE__ */ (0,
|
|
5743
|
-
/* @__PURE__ */ (0,
|
|
5744
|
-
"
|
|
5745
|
-
|
|
5746
|
-
|
|
5846
|
+
addingSource && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WorkspaceDialog, { title: "\u6DFB\u52A0\u5E02\u573A\u6765\u6E90", detail: "\u63A5\u5165\u56E2\u961F\u6216\u4E2A\u4EBA\u7EF4\u62A4\u7684 Skill \u7D22\u5F15\u3002\u81EA\u5B9A\u4E49\u6765\u6E90\u9ED8\u8BA4\u6309\u4E0D\u53EF\u4FE1\u6765\u6E90\u9694\u79BB\u6267\u884C\u3002", close: () => setAddingSource(false), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MarketSourceForm, { close: () => setAddingSource(false), changed: () => load2(true) }) }),
|
|
5847
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WorkspaceBlock, { title: "\u5DF2\u5B89\u88C5", detail: `${catalog.installed.length} \u4E2A\u53EF\u4F9B\u4F19\u4F34\u4F7F\u7528`, actions: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
5848
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: () => setImportingSkill(true), children: "\u5BFC\u5165 Skill" }),
|
|
5849
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", onClick: () => setCreatingSkill(true), children: [
|
|
5850
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives10.IconPlusOutline16, { size: 14 }),
|
|
5851
|
+
"\u65B0\u5EFA Skill"
|
|
5852
|
+
] })
|
|
5853
|
+
] }), children: loading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CollectionSkeleton, { rows: 2 }) : catalog.installed.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u5B89\u88C5 Skill", detail: "\u53EF\u4EE5\u521B\u5EFA\u81EA\u5DF1\u7684 Skill\uFF0C\u6216\u4ECE\u4E0B\u65B9\u5E02\u573A\u9009\u62E9\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", onClick: () => setCreatingSkill(true), children: [
|
|
5854
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives10.IconPlusOutline16, { size: 14 }),
|
|
5747
5855
|
"\u65B0\u5EFA\u7B2C\u4E00\u4E2A Skill"
|
|
5748
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
5749
|
-
/* @__PURE__ */ (0,
|
|
5750
|
-
/* @__PURE__ */ (0,
|
|
5751
|
-
/* @__PURE__ */ (0,
|
|
5752
|
-
/* @__PURE__ */ (0,
|
|
5753
|
-
/* @__PURE__ */ (0,
|
|
5754
|
-
/* @__PURE__ */ (0,
|
|
5856
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
5857
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-skill-installed is-market", children: visibleInstalled.map((skill) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("article", { children: [
|
|
5858
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "dsh-partner-skill-mark", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives10.IconCheckOutline16, { size: 16 }) }),
|
|
5859
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
5860
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: skill.displayName }),
|
|
5861
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: skill.description }),
|
|
5862
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { children: [
|
|
5755
5863
|
skill.version,
|
|
5756
5864
|
" \xB7 ",
|
|
5757
5865
|
skill.executionContext === "fork" ? "\u4E34\u65F6\u4F1A\u8BDD" : "\u5F53\u524D\u4F1A\u8BDD",
|
|
@@ -5759,74 +5867,74 @@ function SkillsPanel() {
|
|
|
5759
5867
|
skill.source
|
|
5760
5868
|
] })
|
|
5761
5869
|
] }),
|
|
5762
|
-
/* @__PURE__ */ (0,
|
|
5870
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "is-icon", disabled: busy === skill.id, "aria-label": `\u5378\u8F7D ${skill.displayName}`, onClick: () => {
|
|
5763
5871
|
void uninstall(skill.id);
|
|
5764
|
-
}, children: /* @__PURE__ */ (0,
|
|
5765
|
-
actionError?.kind === "uninstall" && actionError.id === skill.id && /* @__PURE__ */ (0,
|
|
5872
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives10.IconTrashOutline16, { size: 15 }) }),
|
|
5873
|
+
actionError?.kind === "uninstall" && actionError.id === skill.id && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { className: "dsh-partner-skill-action-error", role: "alert", children: [
|
|
5766
5874
|
"\u5378\u8F7D\u5931\u8D25\uFF1A",
|
|
5767
5875
|
actionError.message
|
|
5768
5876
|
] })
|
|
5769
5877
|
] }, skill.id)) }),
|
|
5770
|
-
catalog.installed.length > 4 && /* @__PURE__ */ (0,
|
|
5878
|
+
catalog.installed.length > 4 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "dsh-partner-skill-disclosure", "aria-expanded": showAllInstalled, onClick: () => setShowAllInstalled((value) => !value), children: showAllInstalled ? "\u6536\u8D77\u5DF2\u5B89\u88C5 Skill" : `\u67E5\u770B\u5168\u90E8 ${catalog.installed.length} \u4E2A\u5DF2\u5B89\u88C5 Skill` })
|
|
5771
5879
|
] }) }),
|
|
5772
|
-
/* @__PURE__ */ (0,
|
|
5773
|
-
/* @__PURE__ */ (0,
|
|
5880
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(WorkspaceBlock, { title: "\u5E02\u573A\u76EE\u5F55", detail: "\u5185\u7F6E ClawHub\u3001LoopHub\u3001SkillHub\uFF0C\u4E0E nomifun \u5F53\u524D Skill \u699C\u5355\u4E00\u81F4", actions: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
5881
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", onClick: () => setEditingNetwork(true), children: [
|
|
5774
5882
|
"\u4EE3\u7406\u8BBE\u7F6E",
|
|
5775
5883
|
network.proxyUrl ? " \xB7 \u5DF2\u542F\u7528" : ""
|
|
5776
5884
|
] }),
|
|
5777
|
-
/* @__PURE__ */ (0,
|
|
5778
|
-
/* @__PURE__ */ (0,
|
|
5885
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", onClick: () => setAddingSource(true), children: [
|
|
5886
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives10.IconPlusOutline16, { size: 14 }),
|
|
5779
5887
|
"\u81EA\u5B9A\u4E49\u6E90"
|
|
5780
5888
|
] })
|
|
5781
5889
|
] }), children: [
|
|
5782
|
-
/* @__PURE__ */ (0,
|
|
5783
|
-
/* @__PURE__ */ (0,
|
|
5784
|
-
/* @__PURE__ */ (0,
|
|
5785
|
-
/* @__PURE__ */ (0,
|
|
5786
|
-
/* @__PURE__ */ (0,
|
|
5890
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-market-toolbar", children: [
|
|
5891
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SkillSearch, { value: query, change: setQuery, count: visible.length, label: "\u641C\u7D22 Skill \u5E02\u573A", placeholder: "\u641C\u7D22\u540D\u79F0\u3001\u8BF4\u660E\u6216\u6807\u7B7E", loading }),
|
|
5892
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("nav", { className: "dsh-partner-market-sources", "aria-label": "Skill \u5E02\u573A\u6765\u6E90", children: sources.map((source) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: activeSource === source.id ? "is-active" : "", "aria-pressed": activeSource === source.id, onClick: () => setActiveSource(source.id), children: [
|
|
5893
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: source.name }),
|
|
5894
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: sourceCounts.get(source.id) ?? 0 })
|
|
5787
5895
|
] }, source.id)) })
|
|
5788
5896
|
] }),
|
|
5789
|
-
market.errors.some((item) => item.sourceId === activeSource) && /* @__PURE__ */ (0,
|
|
5790
|
-
loading ? /* @__PURE__ */ (0,
|
|
5897
|
+
market.errors.some((item) => item.sourceId === activeSource) && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "dsh-partner-inline-warning", children: market.errors.filter((item) => item.sourceId === activeSource).map((item) => item.error).join("\uFF1B") }),
|
|
5898
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CollectionSkeleton, { rows: 4 }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-market-grid", children: visible.map((entry) => {
|
|
5791
5899
|
const current2 = installed.get(entry.id);
|
|
5792
5900
|
const cardError = actionError?.kind === "install" && actionError.id === entry.id ? actionError.message : void 0;
|
|
5793
5901
|
const errorId = cardError ? `dsh-partner-skill-error-${entry.id}` : void 0;
|
|
5794
|
-
return /* @__PURE__ */ (0,
|
|
5795
|
-
/* @__PURE__ */ (0,
|
|
5796
|
-
/* @__PURE__ */ (0,
|
|
5797
|
-
/* @__PURE__ */ (0,
|
|
5798
|
-
/* @__PURE__ */ (0,
|
|
5902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("article", { children: [
|
|
5903
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
5904
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: entry.tags.slice(0, 3).join(" \xB7 ") || "SKILL" }),
|
|
5905
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: entry.name }),
|
|
5906
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: entry.description })
|
|
5799
5907
|
] }),
|
|
5800
|
-
cardError && /* @__PURE__ */ (0,
|
|
5908
|
+
cardError && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { id: errorId, className: "dsh-partner-market-card-error", role: "alert", children: [
|
|
5801
5909
|
"\u5B89\u88C5\u5931\u8D25\uFF1A",
|
|
5802
5910
|
cardError
|
|
5803
5911
|
] }),
|
|
5804
|
-
/* @__PURE__ */ (0,
|
|
5805
|
-
/* @__PURE__ */ (0,
|
|
5912
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("footer", { children: [
|
|
5913
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { children: [
|
|
5806
5914
|
"v",
|
|
5807
5915
|
entry.version
|
|
5808
5916
|
] }),
|
|
5809
|
-
current2 ? /* @__PURE__ */ (0,
|
|
5810
|
-
/* @__PURE__ */ (0,
|
|
5917
|
+
current2 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", disabled: true, children: [
|
|
5918
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives10.IconCheckOutline16, { size: 14 }),
|
|
5811
5919
|
"\u5DF2\u5B89\u88C5"
|
|
5812
|
-
] }) : /* @__PURE__ */ (0,
|
|
5920
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", disabled: busy === entry.id, "aria-describedby": errorId, onClick: () => {
|
|
5813
5921
|
void install(entry);
|
|
5814
5922
|
}, children: busy === entry.id ? "\u5B89\u88C5\u4E2D\u2026" : cardError ? "\u91CD\u8BD5\u5B89\u88C5" : "\u5B89\u88C5" })
|
|
5815
5923
|
] })
|
|
5816
5924
|
] }, `${entry.sourceId}:${entry.id}`);
|
|
5817
5925
|
}) }),
|
|
5818
|
-
!loading && visible.length === 0 && /* @__PURE__ */ (0,
|
|
5926
|
+
!loading && visible.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CollectionEmpty, { title: query ? "\u6CA1\u6709\u5339\u914D\u7684 Skill" : "\u5F53\u524D\u6765\u6E90\u6682\u65F6\u4E0D\u53EF\u7528", detail: query ? "\u6362\u4E00\u4E2A\u5173\u952E\u8BCD\uFF0C\u6216\u5207\u6362\u5E02\u573A\u6765\u6E90\u3002" : "\u5237\u65B0\u5E02\u573A\uFF0C\u6216\u68C0\u67E5\u4EE3\u7406\u4E0E\u6765\u6E90\u914D\u7F6E\u3002" })
|
|
5819
5927
|
] })
|
|
5820
5928
|
] });
|
|
5821
5929
|
}
|
|
5822
5930
|
function CompanionSkillSettings({ companionId }) {
|
|
5823
|
-
const [catalog, setCatalog] = (0,
|
|
5824
|
-
const [busy, setBusy] = (0,
|
|
5825
|
-
const [error, setError] = (0,
|
|
5826
|
-
const [selecting, setSelecting] = (0,
|
|
5827
|
-
const [showAll, setShowAll] = (0,
|
|
5828
|
-
const [query, setQuery] = (0,
|
|
5829
|
-
const load2 = (0,
|
|
5931
|
+
const [catalog, setCatalog] = (0, import_react25.useState)({ installed: [], bindings: [], sources: [] });
|
|
5932
|
+
const [busy, setBusy] = (0, import_react25.useState)();
|
|
5933
|
+
const [error, setError] = (0, import_react25.useState)();
|
|
5934
|
+
const [selecting, setSelecting] = (0, import_react25.useState)(false);
|
|
5935
|
+
const [showAll, setShowAll] = (0, import_react25.useState)(false);
|
|
5936
|
+
const [query, setQuery] = (0, import_react25.useState)("");
|
|
5937
|
+
const load2 = (0, import_react25.useCallback)(async () => {
|
|
5830
5938
|
try {
|
|
5831
5939
|
setCatalog(await api("/skills"));
|
|
5832
5940
|
setError(void 0);
|
|
@@ -5834,18 +5942,18 @@ function CompanionSkillSettings({ companionId }) {
|
|
|
5834
5942
|
setError(errorMessage(reason));
|
|
5835
5943
|
}
|
|
5836
5944
|
}, []);
|
|
5837
|
-
(0,
|
|
5945
|
+
(0, import_react25.useEffect)(() => {
|
|
5838
5946
|
void load2();
|
|
5839
5947
|
}, [load2, companionId]);
|
|
5840
|
-
(0,
|
|
5948
|
+
(0, import_react25.useEffect)(() => {
|
|
5841
5949
|
setSelecting(false);
|
|
5842
5950
|
setShowAll(false);
|
|
5843
5951
|
setQuery("");
|
|
5844
5952
|
setError(void 0);
|
|
5845
5953
|
}, [companionId]);
|
|
5846
|
-
const enabled = (0,
|
|
5847
|
-
const enabledSkills = (0,
|
|
5848
|
-
const availableSkills = (0,
|
|
5954
|
+
const enabled = (0, import_react25.useMemo)(() => new Set(catalog.bindings.filter((item) => item.companionId === companionId && item.enabled).map((item) => item.skillId)), [catalog.bindings, companionId]);
|
|
5955
|
+
const enabledSkills = (0, import_react25.useMemo)(() => catalog.installed.filter((skill) => enabled.has(skill.id)), [catalog.installed, enabled]);
|
|
5956
|
+
const availableSkills = (0, import_react25.useMemo)(() => {
|
|
5849
5957
|
const normalized = query.trim().toLocaleLowerCase();
|
|
5850
5958
|
return catalog.installed.filter((skill) => !enabled.has(skill.id) && (!normalized || `${skill.displayName} ${skill.description} ${skill.id}`.toLocaleLowerCase().includes(normalized)));
|
|
5851
5959
|
}, [catalog.installed, enabled, query]);
|
|
@@ -5863,65 +5971,65 @@ function CompanionSkillSettings({ companionId }) {
|
|
|
5863
5971
|
setBusy(void 0);
|
|
5864
5972
|
}
|
|
5865
5973
|
};
|
|
5866
|
-
return /* @__PURE__ */ (0,
|
|
5867
|
-
/* @__PURE__ */ (0,
|
|
5868
|
-
/* @__PURE__ */ (0,
|
|
5869
|
-
/* @__PURE__ */ (0,
|
|
5870
|
-
/* @__PURE__ */ (0,
|
|
5974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { className: "dsh-partner-capability-detail", "aria-labelledby": "dsh-partner-skill-capability-title", children: [
|
|
5975
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { children: [
|
|
5976
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
5977
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "PARTNER SKILLS" }),
|
|
5978
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { id: "dsh-partner-skill-capability-title", children: "\u5F53\u524D\u4F19\u4F34\u7684 Skill" })
|
|
5871
5979
|
] }),
|
|
5872
|
-
/* @__PURE__ */ (0,
|
|
5873
|
-
/* @__PURE__ */ (0,
|
|
5980
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-capability-actions", children: [
|
|
5981
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("em", { children: [
|
|
5874
5982
|
enabledSkills.length,
|
|
5875
5983
|
" \u4E2A\u542F\u7528"
|
|
5876
5984
|
] }),
|
|
5877
|
-
catalog.installed.length > 0 && /* @__PURE__ */ (0,
|
|
5878
|
-
/* @__PURE__ */ (0,
|
|
5985
|
+
catalog.installed.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", "aria-expanded": selecting, onClick: () => setSelecting((value) => !value), children: [
|
|
5986
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives10.IconPlusOutline16, { size: 14 }),
|
|
5879
5987
|
"\u6DFB\u52A0 Skill"
|
|
5880
5988
|
] })
|
|
5881
5989
|
] })
|
|
5882
5990
|
] }),
|
|
5883
|
-
selecting && /* @__PURE__ */ (0,
|
|
5884
|
-
/* @__PURE__ */ (0,
|
|
5885
|
-
/* @__PURE__ */ (0,
|
|
5886
|
-
visibleAvailableSkills.map((skill) => /* @__PURE__ */ (0,
|
|
5887
|
-
/* @__PURE__ */ (0,
|
|
5888
|
-
/* @__PURE__ */ (0,
|
|
5889
|
-
/* @__PURE__ */ (0,
|
|
5890
|
-
/* @__PURE__ */ (0,
|
|
5991
|
+
selecting && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-skill-picker", "aria-label": "\u6DFB\u52A0 Skill", children: [
|
|
5992
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SkillSearch, { value: query, change: setQuery, count: availableSkills.length, label: "\u641C\u7D22\u53EF\u6DFB\u52A0\u7684 Skill", placeholder: "\u641C\u7D22\u540D\u79F0\u3001\u8BF4\u660E\u6216\u6807\u8BC6", autoFocus: true, compact: true }),
|
|
5993
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-skill-picker-list", children: [
|
|
5994
|
+
visibleAvailableSkills.map((skill) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("article", { children: [
|
|
5995
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
5996
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: skill.displayName }),
|
|
5997
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: skill.description }),
|
|
5998
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: skill.executionContext === "fork" ? "\u9694\u79BB\u4E34\u65F6\u4F1A\u8BDD\u6267\u884C" : "\u53EF\u4FE1\u5F53\u524D\u4F1A\u8BDD\u6267\u884C" })
|
|
5891
5999
|
] }),
|
|
5892
|
-
/* @__PURE__ */ (0,
|
|
6000
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", disabled: busy === skill.id, onClick: () => {
|
|
5893
6001
|
void setBinding(skill.id, true);
|
|
5894
6002
|
}, children: busy === skill.id ? "\u6DFB\u52A0\u4E2D\u2026" : "\u6DFB\u52A0" })
|
|
5895
6003
|
] }, skill.id)),
|
|
5896
|
-
availableSkills.length === 0 && /* @__PURE__ */ (0,
|
|
6004
|
+
availableSkills.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "dsh-partner-skill-picker-empty", children: query ? "\u6CA1\u6709\u5339\u914D\u7684\u672A\u542F\u7528 Skill\u3002" : "\u6240\u6709\u5DF2\u5B89\u88C5 Skill \u90FD\u5DF2\u542F\u7528\u3002" })
|
|
5897
6005
|
] }),
|
|
5898
|
-
availableSkills.length > visibleAvailableSkills.length && /* @__PURE__ */ (0,
|
|
6006
|
+
availableSkills.length > visibleAvailableSkills.length && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { className: "dsh-partner-skill-picker-limit", children: [
|
|
5899
6007
|
"\u8FD8\u6709 ",
|
|
5900
6008
|
availableSkills.length - visibleAvailableSkills.length,
|
|
5901
6009
|
" \u4E2A\u7ED3\u679C\uFF0C\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u7EE7\u7EED\u7B5B\u9009\u3002"
|
|
5902
6010
|
] })
|
|
5903
6011
|
] }),
|
|
5904
|
-
catalog.installed.length === 0 ? /* @__PURE__ */ (0,
|
|
5905
|
-
/* @__PURE__ */ (0,
|
|
5906
|
-
/* @__PURE__ */ (0,
|
|
5907
|
-
/* @__PURE__ */ (0,
|
|
5908
|
-
/* @__PURE__ */ (0,
|
|
5909
|
-
/* @__PURE__ */ (0,
|
|
5910
|
-
/* @__PURE__ */ (0,
|
|
6012
|
+
catalog.installed.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "dsh-partner-feature-empty", children: "\u5C1A\u672A\u5B89\u88C5 Skill\uFF0C\u8BF7\u5148\u4ECE\u5DE6\u4FA7\u7684 Skill \u5E02\u573A\u5B89\u88C5\u3002" }) : enabledSkills.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "dsh-partner-feature-empty", children: "\u5F53\u524D\u4F19\u4F34\u8FD8\u6CA1\u6709\u542F\u7528 Skill\u3002\u70B9\u51FB\u201C\u6DFB\u52A0 Skill\u201D\u9009\u62E9\u9700\u8981\u7684\u80FD\u529B\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
6013
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-skill-installed is-binding", children: visibleEnabledSkills.map((skill) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("article", { children: [
|
|
6014
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "dsh-partner-skill-mark", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives10.IconCheckOutline16, { size: 16 }) }),
|
|
6015
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
6016
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: skill.displayName }),
|
|
6017
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: skill.description }),
|
|
6018
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: skill.executionContext === "fork" ? "\u9694\u79BB\u4E34\u65F6\u4F1A\u8BDD\u6267\u884C" : "\u53EF\u4FE1\u5F53\u524D\u4F1A\u8BDD\u6267\u884C" })
|
|
5911
6019
|
] }),
|
|
5912
|
-
/* @__PURE__ */ (0,
|
|
6020
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "dsh-partner-skill-binding-action", disabled: busy === skill.id, "aria-label": `\u4ECE\u5F53\u524D\u4F19\u4F34\u505C\u7528 ${skill.displayName}`, onClick: () => {
|
|
5913
6021
|
void setBinding(skill.id, false);
|
|
5914
6022
|
}, children: busy === skill.id ? "\u5904\u7406\u4E2D\u2026" : "\u505C\u7528" })
|
|
5915
6023
|
] }, skill.id)) }),
|
|
5916
|
-
enabledSkills.length > 4 && /* @__PURE__ */ (0,
|
|
6024
|
+
enabledSkills.length > 4 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "dsh-partner-skill-disclosure", "aria-expanded": showAll, onClick: () => setShowAll((value) => !value), children: showAll ? "\u6536\u8D77 Skill" : `\u67E5\u770B\u5168\u90E8 ${enabledSkills.length} \u4E2A Skill` })
|
|
5917
6025
|
] }),
|
|
5918
|
-
error && /* @__PURE__ */ (0,
|
|
6026
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error })
|
|
5919
6027
|
] });
|
|
5920
6028
|
}
|
|
5921
6029
|
function SkillSearch({ value, change, count, label, placeholder, loading = false, autoFocus = false, compact = false }) {
|
|
5922
|
-
return /* @__PURE__ */ (0,
|
|
5923
|
-
/* @__PURE__ */ (0,
|
|
5924
|
-
/* @__PURE__ */ (0,
|
|
6030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: `dsh-partner-skill-search${compact ? " is-compact" : ""}`, role: "search", "aria-label": label, children: [
|
|
6031
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "dsh-partner-skill-search-icon", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives10.IconSearchOutline16, { size: 16 }) }),
|
|
6032
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
5925
6033
|
"input",
|
|
5926
6034
|
{
|
|
5927
6035
|
type: "search",
|
|
@@ -5938,13 +6046,13 @@ function SkillSearch({ value, change, count, label, placeholder, loading = false
|
|
|
5938
6046
|
}
|
|
5939
6047
|
}
|
|
5940
6048
|
),
|
|
5941
|
-
value && /* @__PURE__ */ (0,
|
|
5942
|
-
/* @__PURE__ */ (0,
|
|
6049
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "dsh-partner-skill-search-clear", "aria-label": "\u6E05\u7A7A\u641C\u7D22", title: "\u6E05\u7A7A\u641C\u7D22", onClick: () => change(""), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives10.IconCloseOutline16, { size: 14 }) }),
|
|
6050
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "dsh-partner-skill-search-count", "aria-live": "polite", children: loading ? "\u540C\u6B65\u4E2D" : `${count} \u9879` })
|
|
5943
6051
|
] });
|
|
5944
6052
|
}
|
|
5945
6053
|
function NewSkillForm({ existingIds, close, changed: changed2 }) {
|
|
5946
|
-
const [error, setError] = (0,
|
|
5947
|
-
const [busy, setBusy] = (0,
|
|
6054
|
+
const [error, setError] = (0, import_react25.useState)();
|
|
6055
|
+
const [busy, setBusy] = (0, import_react25.useState)(false);
|
|
5948
6056
|
const submit = async (event) => {
|
|
5949
6057
|
event.preventDefault();
|
|
5950
6058
|
const data = new FormData(event.currentTarget);
|
|
@@ -5973,51 +6081,51 @@ function NewSkillForm({ existingIds, close, changed: changed2 }) {
|
|
|
5973
6081
|
setBusy(false);
|
|
5974
6082
|
}
|
|
5975
6083
|
};
|
|
5976
|
-
return /* @__PURE__ */ (0,
|
|
6084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-skill-form", "aria-busy": busy, onSubmit: (event) => {
|
|
5977
6085
|
void submit(event);
|
|
5978
6086
|
}, children: [
|
|
5979
|
-
/* @__PURE__ */ (0,
|
|
5980
|
-
/* @__PURE__ */ (0,
|
|
5981
|
-
/* @__PURE__ */ (0,
|
|
6087
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { children: [
|
|
6088
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "Skill \u540D\u79F0" }),
|
|
6089
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { name: "displayName", required: true, maxLength: 120, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u53D1\u5E03\u8BF4\u660E\u6574\u7406" })
|
|
5982
6090
|
] }),
|
|
5983
|
-
/* @__PURE__ */ (0,
|
|
5984
|
-
/* @__PURE__ */ (0,
|
|
5985
|
-
/* @__PURE__ */ (0,
|
|
6091
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { children: [
|
|
6092
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "Skill \u6807\u8BC6" }),
|
|
6093
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { name: "id", required: true, maxLength: 80, pattern: "[A-Za-z0-9][A-Za-z0-9._-]{0,79}", placeholder: "release-notes" })
|
|
5986
6094
|
] }),
|
|
5987
|
-
/* @__PURE__ */ (0,
|
|
5988
|
-
/* @__PURE__ */ (0,
|
|
5989
|
-
/* @__PURE__ */ (0,
|
|
6095
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { className: "is-wide", children: [
|
|
6096
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u8BF4\u660E" }),
|
|
6097
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { name: "description", required: true, maxLength: 600, placeholder: "\u8BF4\u660E\u4EC0\u4E48\u65F6\u5019\u4F7F\u7528\uFF0C\u4EE5\u53CA\u8981\u89E3\u51B3\u4EC0\u4E48\u95EE\u9898" })
|
|
5990
6098
|
] }),
|
|
5991
|
-
/* @__PURE__ */ (0,
|
|
5992
|
-
/* @__PURE__ */ (0,
|
|
5993
|
-
/* @__PURE__ */ (0,
|
|
5994
|
-
/* @__PURE__ */ (0,
|
|
5995
|
-
/* @__PURE__ */ (0,
|
|
6099
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { children: [
|
|
6100
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "\u6267\u884C\u65B9\u5F0F" }),
|
|
6101
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("select", { name: "context", defaultValue: "fork", children: [
|
|
6102
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: "fork", children: "\u9694\u79BB\u4E34\u65F6\u4F1A\u8BDD" }),
|
|
6103
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: "inline", children: "\u53EF\u4FE1\u5F53\u524D\u4F1A\u8BDD" })
|
|
5996
6104
|
] })
|
|
5997
6105
|
] }),
|
|
5998
|
-
/* @__PURE__ */ (0,
|
|
5999
|
-
/* @__PURE__ */ (0,
|
|
6000
|
-
/* @__PURE__ */ (0,
|
|
6106
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { children: [
|
|
6107
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "\u5141\u8BB8\u7684\u5DE5\u5177" }),
|
|
6108
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { name: "allowedTools", maxLength: 1e3, placeholder: "\u591A\u4E2A\u5DE5\u5177\u7528\u9017\u53F7\u5206\u9694\uFF0C\u53EF\u7559\u7A7A" })
|
|
6001
6109
|
] }),
|
|
6002
|
-
/* @__PURE__ */ (0,
|
|
6003
|
-
/* @__PURE__ */ (0,
|
|
6004
|
-
/* @__PURE__ */ (0,
|
|
6110
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { className: "is-wide", children: [
|
|
6111
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "Skill \u6307\u4EE4" }),
|
|
6112
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("textarea", { name: "instructions", required: true, maxLength: 5e5, rows: 8, placeholder: "\u5199\u6E05\u5DE5\u4F5C\u6B65\u9AA4\u3001\u8FB9\u754C\u3001\u8F93\u51FA\u683C\u5F0F\u548C\u9A8C\u6536\u6761\u4EF6" })
|
|
6005
6113
|
] }),
|
|
6006
|
-
error && /* @__PURE__ */ (0,
|
|
6007
|
-
/* @__PURE__ */ (0,
|
|
6008
|
-
/* @__PURE__ */ (0,
|
|
6009
|
-
/* @__PURE__ */ (0,
|
|
6010
|
-
/* @__PURE__ */ (0,
|
|
6114
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WorkspaceNotice, { children: error }),
|
|
6115
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("footer", { children: [
|
|
6116
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
6117
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
6118
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives10.IconPlusOutline16, { size: 14 }),
|
|
6011
6119
|
busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA Skill"
|
|
6012
6120
|
] })
|
|
6013
6121
|
] })
|
|
6014
6122
|
] });
|
|
6015
6123
|
}
|
|
6016
6124
|
function NetworkSettingsForm({ value, close, changed: changed2 }) {
|
|
6017
|
-
const [proxyUrl, setProxyUrl] = (0,
|
|
6018
|
-
const [busy, setBusy] = (0,
|
|
6019
|
-
const [status, setStatus] = (0,
|
|
6020
|
-
const [error, setError] = (0,
|
|
6125
|
+
const [proxyUrl, setProxyUrl] = (0, import_react25.useState)(value.proxyUrl ?? "");
|
|
6126
|
+
const [busy, setBusy] = (0, import_react25.useState)();
|
|
6127
|
+
const [status, setStatus] = (0, import_react25.useState)();
|
|
6128
|
+
const [error, setError] = (0, import_react25.useState)();
|
|
6021
6129
|
const test = async () => {
|
|
6022
6130
|
setBusy("test");
|
|
6023
6131
|
setError(void 0);
|
|
@@ -6045,29 +6153,29 @@ function NetworkSettingsForm({ value, close, changed: changed2 }) {
|
|
|
6045
6153
|
setBusy(void 0);
|
|
6046
6154
|
}
|
|
6047
6155
|
};
|
|
6048
|
-
return /* @__PURE__ */ (0,
|
|
6156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-network-form", "aria-busy": busy !== void 0, onSubmit: (event) => {
|
|
6049
6157
|
void save(event);
|
|
6050
6158
|
}, children: [
|
|
6051
|
-
/* @__PURE__ */ (0,
|
|
6052
|
-
/* @__PURE__ */ (0,
|
|
6053
|
-
/* @__PURE__ */ (0,
|
|
6054
|
-
/* @__PURE__ */ (0,
|
|
6159
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { className: "is-wide", children: [
|
|
6160
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "HTTP \u4EE3\u7406" }),
|
|
6161
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { type: "url", autoFocus: true, value: proxyUrl, onChange: (event) => setProxyUrl(event.target.value), placeholder: "http://host.docker.internal:7893" }),
|
|
6162
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u7559\u7A7A\u4E3A\u76F4\u8FDE\uFF1B\u5E02\u573A\u5217\u8868\u548C\u5B89\u88C5\u5305\u4E0B\u8F7D\u5171\u7528\u8FD9\u4E2A\u4EE3\u7406\u3002" })
|
|
6055
6163
|
] }),
|
|
6056
|
-
status && /* @__PURE__ */ (0,
|
|
6057
|
-
error && /* @__PURE__ */ (0,
|
|
6058
|
-
/* @__PURE__ */ (0,
|
|
6059
|
-
/* @__PURE__ */ (0,
|
|
6164
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WorkspaceNotice, { kind: "success", children: status }),
|
|
6165
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WorkspaceNotice, { children: error }),
|
|
6166
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("footer", { children: [
|
|
6167
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", disabled: busy !== void 0, onClick: () => {
|
|
6060
6168
|
void test();
|
|
6061
6169
|
}, children: busy === "test" ? "\u6D4B\u8BD5\u4E2D\u2026" : "\u6D4B\u8BD5\u8FDE\u63A5" }),
|
|
6062
|
-
/* @__PURE__ */ (0,
|
|
6063
|
-
/* @__PURE__ */ (0,
|
|
6064
|
-
/* @__PURE__ */ (0,
|
|
6170
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "dsh-partner-form-footer-spacer" }),
|
|
6171
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", disabled: busy !== void 0, onClick: close, children: "\u53D6\u6D88" }),
|
|
6172
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "submit", className: "is-primary", disabled: busy !== void 0, children: busy === "save" ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58\u8BBE\u7F6E" })
|
|
6065
6173
|
] })
|
|
6066
6174
|
] });
|
|
6067
6175
|
}
|
|
6068
6176
|
function MarketSourceForm({ close, changed: changed2 }) {
|
|
6069
|
-
const [error, setError] = (0,
|
|
6070
|
-
const [busy, setBusy] = (0,
|
|
6177
|
+
const [error, setError] = (0, import_react25.useState)();
|
|
6178
|
+
const [busy, setBusy] = (0, import_react25.useState)(false);
|
|
6071
6179
|
const submit = async (event) => {
|
|
6072
6180
|
event.preventDefault();
|
|
6073
6181
|
const data = new FormData(event.currentTarget);
|
|
@@ -6083,21 +6191,21 @@ function MarketSourceForm({ close, changed: changed2 }) {
|
|
|
6083
6191
|
setBusy(false);
|
|
6084
6192
|
}
|
|
6085
6193
|
};
|
|
6086
|
-
return /* @__PURE__ */ (0,
|
|
6194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-market-source-form", "aria-busy": busy, onSubmit: (event) => {
|
|
6087
6195
|
void submit(event);
|
|
6088
6196
|
}, children: [
|
|
6089
|
-
/* @__PURE__ */ (0,
|
|
6090
|
-
/* @__PURE__ */ (0,
|
|
6091
|
-
/* @__PURE__ */ (0,
|
|
6197
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { children: [
|
|
6198
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "\u6765\u6E90\u540D\u79F0" }),
|
|
6199
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { name: "name", required: true, maxLength: 100, autoFocus: true, placeholder: "\u56E2\u961F Skill \u5E02\u573A" })
|
|
6092
6200
|
] }),
|
|
6093
|
-
/* @__PURE__ */ (0,
|
|
6094
|
-
/* @__PURE__ */ (0,
|
|
6095
|
-
/* @__PURE__ */ (0,
|
|
6201
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { children: [
|
|
6202
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "\u7D22\u5F15 URL" }),
|
|
6203
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { name: "indexUrl", required: true, type: "url", placeholder: "https://example.com/skills.json" })
|
|
6096
6204
|
] }),
|
|
6097
|
-
error && /* @__PURE__ */ (0,
|
|
6098
|
-
/* @__PURE__ */ (0,
|
|
6099
|
-
/* @__PURE__ */ (0,
|
|
6100
|
-
/* @__PURE__ */ (0,
|
|
6205
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WorkspaceNotice, { children: error }),
|
|
6206
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("footer", { children: [
|
|
6207
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
6208
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u6DFB\u52A0\u4E2D\u2026" : "\u6DFB\u52A0\u6765\u6E90" })
|
|
6101
6209
|
] })
|
|
6102
6210
|
] });
|
|
6103
6211
|
}
|
|
@@ -6124,17 +6232,17 @@ function skillScalar(value) {
|
|
|
6124
6232
|
}
|
|
6125
6233
|
|
|
6126
6234
|
// src/ui/requirement-board.tsx
|
|
6127
|
-
var
|
|
6235
|
+
var import_react30 = require("react");
|
|
6128
6236
|
var import_dsh_client_ui_primitives14 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6129
6237
|
|
|
6130
6238
|
// src/ui/board-refresh.ts
|
|
6131
|
-
var
|
|
6239
|
+
var import_react26 = require("react");
|
|
6132
6240
|
function useBoardRefresh(read, failed, enabled = true) {
|
|
6133
|
-
const readRef = (0,
|
|
6241
|
+
const readRef = (0, import_react26.useRef)(read), failedRef = (0, import_react26.useRef)(failed);
|
|
6134
6242
|
readRef.current = read;
|
|
6135
6243
|
failedRef.current = failed;
|
|
6136
|
-
const epoch = (0,
|
|
6137
|
-
const refresh = (0,
|
|
6244
|
+
const epoch = (0, import_react26.useRef)(0), pending = (0, import_react26.useRef)(), mounted = (0, import_react26.useRef)(false);
|
|
6245
|
+
const refresh = (0, import_react26.useCallback)(async () => {
|
|
6138
6246
|
const version = ++epoch.current;
|
|
6139
6247
|
await pending.current;
|
|
6140
6248
|
if (!mounted.current || version !== epoch.current) return;
|
|
@@ -6150,7 +6258,7 @@ function useBoardRefresh(read, failed, enabled = true) {
|
|
|
6150
6258
|
await request;
|
|
6151
6259
|
if (pending.current === request) pending.current = void 0;
|
|
6152
6260
|
}, []);
|
|
6153
|
-
(0,
|
|
6261
|
+
(0, import_react26.useEffect)(() => {
|
|
6154
6262
|
if (!enabled) return;
|
|
6155
6263
|
mounted.current = true;
|
|
6156
6264
|
void refresh();
|
|
@@ -6170,15 +6278,15 @@ function useBoardRefresh(read, failed, enabled = true) {
|
|
|
6170
6278
|
}
|
|
6171
6279
|
|
|
6172
6280
|
// src/ui/requirement-dialog.tsx
|
|
6173
|
-
var
|
|
6281
|
+
var import_react27 = require("react");
|
|
6174
6282
|
var import_dsh_client_ui_primitives11 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6175
|
-
var
|
|
6283
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
6176
6284
|
function requirementStatus(item) {
|
|
6177
6285
|
if (item.lastError) return item.status === "done" ? "\u5DF2\u5F52\u6863 \xB7 \u901A\u77E5\u5F85\u91CD\u8BD5" : "\u6536\u5C3E\u5F85\u91CD\u8BD5";
|
|
6178
6286
|
return { planning: "\u89C4\u5212\u4E2D", active: "\u63A8\u8FDB\u4E2D", review: "\u6C47\u603B\u4E2D", done: "\u5DF2\u5F52\u6863" }[item.status];
|
|
6179
6287
|
}
|
|
6180
6288
|
function RequirementForm({ directory, close, created }) {
|
|
6181
|
-
const [busy, setBusy] = (0,
|
|
6289
|
+
const [busy, setBusy] = (0, import_react27.useState)(false), [error, setError] = (0, import_react27.useState)();
|
|
6182
6290
|
const submit = async (event) => {
|
|
6183
6291
|
event.preventDefault();
|
|
6184
6292
|
const data = new FormData(event.currentTarget);
|
|
@@ -6193,37 +6301,37 @@ function RequirementForm({ directory, close, created }) {
|
|
|
6193
6301
|
setBusy(false);
|
|
6194
6302
|
}
|
|
6195
6303
|
};
|
|
6196
|
-
return /* @__PURE__ */ (0,
|
|
6304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("form", { className: "dsh-partner-task-form", "aria-busy": busy, onSubmit: (event) => {
|
|
6197
6305
|
void submit(event);
|
|
6198
6306
|
}, children: [
|
|
6199
|
-
error && /* @__PURE__ */ (0,
|
|
6200
|
-
/* @__PURE__ */ (0,
|
|
6201
|
-
/* @__PURE__ */ (0,
|
|
6202
|
-
/* @__PURE__ */ (0,
|
|
6307
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(WorkspaceNotice, { children: error }),
|
|
6308
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "is-wide", children: [
|
|
6309
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "\u9700\u6C42\u540D\u79F0" }),
|
|
6310
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { name: "title", autoFocus: true, required: true, maxLength: 200, placeholder: "\u8FD9\u6B21\u5E0C\u671B\u5B8C\u6210\u4EC0\u4E48" })
|
|
6203
6311
|
] }),
|
|
6204
|
-
/* @__PURE__ */ (0,
|
|
6205
|
-
/* @__PURE__ */ (0,
|
|
6206
|
-
/* @__PURE__ */ (0,
|
|
6312
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "is-wide", children: [
|
|
6313
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "\u4EA4\u4ED8\u76EE\u6807" }),
|
|
6314
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("textarea", { name: "description", rows: 5, maxLength: 8e3, placeholder: "\u80CC\u666F\u3001\u9884\u671F\u6210\u679C\u4E0E\u6574\u4F53\u5B8C\u6210\u6807\u51C6" })
|
|
6207
6315
|
] }),
|
|
6208
|
-
/* @__PURE__ */ (0,
|
|
6209
|
-
/* @__PURE__ */ (0,
|
|
6210
|
-
/* @__PURE__ */ (0,
|
|
6211
|
-
/* @__PURE__ */ (0,
|
|
6212
|
-
directory.map((c) => /* @__PURE__ */ (0,
|
|
6316
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "is-wide", children: [
|
|
6317
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "\u6536\u5C3E\u8D1F\u8D23\u4EBA" }),
|
|
6318
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("select", { name: "owner", defaultValue: "", children: [
|
|
6319
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "", children: "\u4EBA\u5DE5\u6C47\u603B" }),
|
|
6320
|
+
directory.map((c) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("option", { value: c.id, children: [
|
|
6213
6321
|
"@",
|
|
6214
6322
|
c.name
|
|
6215
6323
|
] }, c.id))
|
|
6216
6324
|
] }),
|
|
6217
|
-
/* @__PURE__ */ (0,
|
|
6325
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { children: "\u5B50\u4EFB\u52A1\u5168\u90E8\u901A\u8FC7\u9A8C\u6536\u540E\uFF0C\u7531\u8BE5\u4F19\u4F34\u603B\u7ED3\u5E76\u901A\u8FC7\u9700\u6C42\u6765\u6E90\u6E20\u9053\u901A\u77E5\u3002" })
|
|
6218
6326
|
] }),
|
|
6219
|
-
/* @__PURE__ */ (0,
|
|
6220
|
-
/* @__PURE__ */ (0,
|
|
6221
|
-
/* @__PURE__ */ (0,
|
|
6327
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("footer", { children: [
|
|
6328
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", onClick: close, disabled: busy, children: "\u53D6\u6D88" }),
|
|
6329
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u5E76\u5B89\u6392\u4EFB\u52A1" })
|
|
6222
6330
|
] })
|
|
6223
6331
|
] });
|
|
6224
6332
|
}
|
|
6225
6333
|
function RequirementDetail({ item, tasks, directory, changed: changed2, close }) {
|
|
6226
|
-
const [busy, setBusy] = (0,
|
|
6334
|
+
const [busy, setBusy] = (0, import_react27.useState)(false), [error, setError] = (0, import_react27.useState)(), [confirming, setConfirming] = (0, import_react27.useState)(false), [summary, setSummary] = (0, import_react27.useState)("");
|
|
6227
6335
|
const done = tasks.filter((t) => t.status === "done").length, ready = tasks.length > 0 && done === tasks.length && item.status !== "planning";
|
|
6228
6336
|
const act = async (action, body = {}) => {
|
|
6229
6337
|
setBusy(true);
|
|
@@ -6239,94 +6347,94 @@ function RequirementDetail({ item, tasks, directory, changed: changed2, close })
|
|
|
6239
6347
|
setBusy(false);
|
|
6240
6348
|
}
|
|
6241
6349
|
};
|
|
6242
|
-
return /* @__PURE__ */ (0,
|
|
6243
|
-
error && /* @__PURE__ */ (0,
|
|
6244
|
-
/* @__PURE__ */ (0,
|
|
6245
|
-
/* @__PURE__ */ (0,
|
|
6246
|
-
/* @__PURE__ */ (0,
|
|
6350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "dsh-partner-task-detail dsh-partner-requirement-detail", "aria-busy": busy, children: [
|
|
6351
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(WorkspaceNotice, { children: error }),
|
|
6352
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("section", { className: "dsh-partner-task-description", children: [
|
|
6353
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("strong", { children: "\u4EA4\u4ED8\u76EE\u6807" }),
|
|
6354
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { children: item.description || "\u672A\u8865\u5145\u4EA4\u4ED8\u76EE\u6807" })
|
|
6247
6355
|
] }),
|
|
6248
|
-
/* @__PURE__ */ (0,
|
|
6249
|
-
/* @__PURE__ */ (0,
|
|
6356
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "dsh-partner-requirement-facts", children: [
|
|
6357
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { children: [
|
|
6250
6358
|
"\u6536\u5C3E\u8D1F\u8D23\u4EBA",
|
|
6251
|
-
/* @__PURE__ */ (0,
|
|
6359
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("b", { children: directory.find((c) => c.id === item.ownerCompanionId)?.name ?? "\u4EBA\u5DE5\u6C47\u603B" })
|
|
6252
6360
|
] }),
|
|
6253
|
-
/* @__PURE__ */ (0,
|
|
6361
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { children: [
|
|
6254
6362
|
"\u5B50\u4EFB\u52A1\u9A8C\u6536",
|
|
6255
|
-
/* @__PURE__ */ (0,
|
|
6363
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("b", { children: item.status === "done" ? `${item.results?.length ?? done} \u9879\u5DF2\u5F52\u6863` : `${done} / ${tasks.length}` })
|
|
6256
6364
|
] }),
|
|
6257
|
-
/* @__PURE__ */ (0,
|
|
6365
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { children: [
|
|
6258
6366
|
"\u901A\u77E5\u65B9\u5F0F",
|
|
6259
|
-
/* @__PURE__ */ (0,
|
|
6367
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("b", { children: item.creatorSessionId ? "\u9700\u6C42\u6765\u6E90\u4F1A\u8BDD / \u6E20\u9053" : "\u770B\u677F\u5185\u67E5\u770B\u7ED3\u679C" })
|
|
6260
6368
|
] })
|
|
6261
6369
|
] }),
|
|
6262
|
-
item.lastError && /* @__PURE__ */ (0,
|
|
6370
|
+
item.lastError && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(WorkspaceNotice, { children: [
|
|
6263
6371
|
item.lastError,
|
|
6264
6372
|
" \xB7 \u7CFB\u7EDF\u4F1A\u81EA\u52A8\u91CD\u8BD5\uFF0C\u4E5F\u53EF\u7ACB\u5373\u91CD\u8BD5\u3002",
|
|
6265
|
-
/* @__PURE__ */ (0,
|
|
6373
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", disabled: busy, onClick: () => {
|
|
6266
6374
|
void act("retry");
|
|
6267
6375
|
}, children: "\u7ACB\u5373\u91CD\u8BD5" })
|
|
6268
6376
|
] }),
|
|
6269
|
-
item.summary && /* @__PURE__ */ (0,
|
|
6270
|
-
/* @__PURE__ */ (0,
|
|
6271
|
-
/* @__PURE__ */ (0,
|
|
6377
|
+
item.summary && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("section", { className: "dsh-partner-task-result", children: [
|
|
6378
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("strong", { children: "\u6700\u7EC8\u7ED3\u8BBA" }),
|
|
6379
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { children: item.summary })
|
|
6272
6380
|
] }),
|
|
6273
|
-
!!item.results?.length && /* @__PURE__ */ (0,
|
|
6274
|
-
/* @__PURE__ */ (0,
|
|
6381
|
+
!!item.results?.length && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
|
|
6382
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("summary", { children: [
|
|
6275
6383
|
"\u4EA4\u4ED8\u8BB0\u5F55 \xB7 ",
|
|
6276
6384
|
item.results.length,
|
|
6277
6385
|
" \u9879"
|
|
6278
6386
|
] }),
|
|
6279
|
-
item.results.map((result) => /* @__PURE__ */ (0,
|
|
6280
|
-
/* @__PURE__ */ (0,
|
|
6281
|
-
/* @__PURE__ */ (0,
|
|
6387
|
+
item.results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("section", { className: "dsh-partner-task-result", children: [
|
|
6388
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("strong", { children: result.title }),
|
|
6389
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { children: result.resultSummary || result.resultAbstract || "\u672A\u63D0\u4F9B\u7ED3\u679C\u6B63\u6587" })
|
|
6282
6390
|
] }, result.id))
|
|
6283
6391
|
] }),
|
|
6284
|
-
item.status !== "done" && /* @__PURE__ */ (0,
|
|
6285
|
-
/* @__PURE__ */ (0,
|
|
6286
|
-
/* @__PURE__ */ (0,
|
|
6287
|
-
/* @__PURE__ */ (0,
|
|
6392
|
+
item.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
6393
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "dsh-partner-requirement-owner", children: [
|
|
6394
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "\u8C03\u6574\u6536\u5C3E\u8D1F\u8D23\u4EBA" }),
|
|
6395
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("select", { "aria-label": "\u6536\u5C3E\u8D1F\u8D23\u4EBA", value: item.ownerCompanionId ?? "", disabled: busy, onChange: (event) => {
|
|
6288
6396
|
void act("owner", { ownerCompanionId: event.target.value });
|
|
6289
6397
|
}, children: [
|
|
6290
|
-
/* @__PURE__ */ (0,
|
|
6291
|
-
item.ownerCompanionId && !directory.some((c) => c.id === item.ownerCompanionId) && /* @__PURE__ */ (0,
|
|
6292
|
-
directory.map((c) => /* @__PURE__ */ (0,
|
|
6398
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "", children: "\u4EBA\u5DE5\u6C47\u603B" }),
|
|
6399
|
+
item.ownerCompanionId && !directory.some((c) => c.id === item.ownerCompanionId) && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: item.ownerCompanionId, children: "\u539F\u8D1F\u8D23\u4EBA\u5DF2\u5220\u9664" }),
|
|
6400
|
+
directory.map((c) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("option", { value: c.id, children: [
|
|
6293
6401
|
"@",
|
|
6294
6402
|
c.name
|
|
6295
6403
|
] }, c.id))
|
|
6296
6404
|
] })
|
|
6297
6405
|
] }),
|
|
6298
|
-
/* @__PURE__ */ (0,
|
|
6299
|
-
ready && /* @__PURE__ */ (0,
|
|
6300
|
-
/* @__PURE__ */ (0,
|
|
6301
|
-
/* @__PURE__ */ (0,
|
|
6302
|
-
/* @__PURE__ */ (0,
|
|
6303
|
-
/* @__PURE__ */ (0,
|
|
6406
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(WorkspaceNotice, { kind: "warning", children: item.status === "planning" ? "\u5168\u90E8\u5B50\u4EFB\u52A1\u5B89\u6392\u597D\u540E\uFF0C\u63D0\u4EA4\u672C\u6B21\u89C4\u5212\uFF1B\u5220\u9664\u5B50\u4EFB\u52A1\u4F1A\u91CD\u65B0\u6253\u5F00\u89C4\u5212\uFF0C\u9700\u786E\u8BA4\u65B0\u7684\u4EA4\u4ED8\u8303\u56F4\u3002" : "\u5B50\u4EFB\u52A1\u7684\u6267\u884C\u548C\u9A8C\u6536\u53EA\u5728\u5185\u90E8\u6D41\u8F6C\uFF0C\u5168\u90E8\u5B8C\u6210\u540E\u624D\u6C47\u603B\u9700\u6C42\u7ED3\u679C\u3002" }),
|
|
6407
|
+
ready && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
|
|
6408
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("summary", { children: "\u4EBA\u5DE5\u5B8C\u6210\u6536\u5C3E" }),
|
|
6409
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { children: [
|
|
6410
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "\u6700\u7EC8\u7ED3\u8BBA" }),
|
|
6411
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("textarea", { rows: 5, maxLength: 12e3, value: summary, onChange: (event) => setSummary(event.target.value), placeholder: "\u786E\u8BA4\u5B9E\u9645\u4EA4\u4ED8\u5185\u5BB9\u3001\u7ED3\u8BBA\u53CA\u9650\u5236" })
|
|
6304
6412
|
] }),
|
|
6305
|
-
/* @__PURE__ */ (0,
|
|
6413
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", disabled: busy || !summary.trim(), onClick: () => {
|
|
6306
6414
|
void act("finish", { summary });
|
|
6307
6415
|
}, children: "\u4FDD\u5B58\u603B\u7ED3\u5E76\u5F52\u6863" })
|
|
6308
6416
|
] })
|
|
6309
6417
|
] }),
|
|
6310
|
-
/* @__PURE__ */ (0,
|
|
6311
|
-
/* @__PURE__ */ (0,
|
|
6312
|
-
/* @__PURE__ */ (0,
|
|
6313
|
-
confirming ? /* @__PURE__ */ (0,
|
|
6314
|
-
/* @__PURE__ */ (0,
|
|
6315
|
-
/* @__PURE__ */ (0,
|
|
6418
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
|
|
6419
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("summary", { children: "\u7BA1\u7406\u9700\u6C42" }),
|
|
6420
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { children: "\u5220\u9664\u9700\u6C42\u4F1A\u540C\u65F6\u79FB\u9664\u5B50\u4EFB\u52A1\uFF0C\u5E76\u53D6\u6D88\u5173\u8054\u6267\u884C\u3002\u4E0D\u80FD\u64A4\u9500\uFF0C\u4E0D\u4F1A\u5220\u9664\u5DF2\u751F\u6210\u7684\u4EA4\u4ED8\u6587\u4EF6\u3002" }),
|
|
6421
|
+
confirming ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "dsh-partner-requirement-actions", children: [
|
|
6422
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirming(false), children: "\u4FDD\u7559\u9700\u6C42" }),
|
|
6423
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => {
|
|
6316
6424
|
void act("remove");
|
|
6317
6425
|
}, children: [
|
|
6318
6426
|
"\u786E\u8BA4\u5220\u9664\u9700\u6C42\u548C ",
|
|
6319
6427
|
tasks.length,
|
|
6320
6428
|
" \u4E2A\u4EFB\u52A1"
|
|
6321
6429
|
] })
|
|
6322
|
-
] }) : /* @__PURE__ */ (0,
|
|
6323
|
-
/* @__PURE__ */ (0,
|
|
6430
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("button", { type: "button", className: "is-danger", onClick: () => setConfirming(true), children: [
|
|
6431
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_dsh_client_ui_primitives11.IconTrashOutline16, { size: 14 }),
|
|
6324
6432
|
"\u5220\u9664\u9700\u6C42"
|
|
6325
6433
|
] })
|
|
6326
6434
|
] }),
|
|
6327
|
-
/* @__PURE__ */ (0,
|
|
6328
|
-
/* @__PURE__ */ (0,
|
|
6329
|
-
item.status !== "done" && /* @__PURE__ */ (0,
|
|
6435
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("footer", { children: [
|
|
6436
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", onClick: close, disabled: busy, children: "\u5173\u95ED" }),
|
|
6437
|
+
item.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", className: "is-primary", disabled: busy || item.status === "planning" && !tasks.length, onClick: () => {
|
|
6330
6438
|
void act(item.status === "planning" ? "submit" : "reopen");
|
|
6331
6439
|
}, children: busy ? "\u5904\u7406\u4E2D\u2026" : item.status === "planning" ? "\u63D0\u4EA4\u89C4\u5212" : "\u8C03\u6574\u4EFB\u52A1\u8303\u56F4" })
|
|
6332
6440
|
] })
|
|
@@ -6334,109 +6442,109 @@ function RequirementDetail({ item, tasks, directory, changed: changed2, close })
|
|
|
6334
6442
|
}
|
|
6335
6443
|
|
|
6336
6444
|
// src/ui/requirement-tasks-panel.tsx
|
|
6337
|
-
var
|
|
6445
|
+
var import_react29 = require("react");
|
|
6338
6446
|
var import_dsh_client_ui_primitives13 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6339
6447
|
|
|
6340
6448
|
// src/ui/task-board-stage.tsx
|
|
6341
|
-
var
|
|
6449
|
+
var import_react28 = require("react");
|
|
6342
6450
|
var import_dsh_client_ui_primitives12 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6343
|
-
var
|
|
6451
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
6344
6452
|
function TaskBoardStage({ id, label, tasks, focused, filtered, renderTask }) {
|
|
6345
|
-
const [collapsed, setCollapsed] = (0,
|
|
6346
|
-
const [limit, setLimit] = (0,
|
|
6453
|
+
const [collapsed, setCollapsed] = (0, import_react28.useState)(false);
|
|
6454
|
+
const [limit, setLimit] = (0, import_react28.useState)(6);
|
|
6347
6455
|
const count = Math.max(limit, focused ? 12 : 6);
|
|
6348
6456
|
const titleId = `dsh-partner-board-${id}`, listId = `${titleId}-list`;
|
|
6349
6457
|
const expanded = !collapsed;
|
|
6350
|
-
return /* @__PURE__ */ (0,
|
|
6351
|
-
/* @__PURE__ */ (0,
|
|
6352
|
-
/* @__PURE__ */ (0,
|
|
6353
|
-
/* @__PURE__ */ (0,
|
|
6354
|
-
/* @__PURE__ */ (0,
|
|
6458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("section", { "data-status": id, "data-empty": tasks.length === 0, "aria-labelledby": titleId, children: [
|
|
6459
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("header", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("button", { type: "button", className: "dsh-partner-board-stage-toggle", "aria-expanded": expanded, "aria-controls": listId, onClick: () => setCollapsed((value) => !value), children: [
|
|
6460
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_dsh_client_ui_primitives12.IconChevronRightOutline14, { size: 14 }),
|
|
6461
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("strong", { id: titleId, children: label }),
|
|
6462
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("b", { children: tasks.length })
|
|
6355
6463
|
] }) }),
|
|
6356
|
-
/* @__PURE__ */ (0,
|
|
6357
|
-
/* @__PURE__ */ (0,
|
|
6358
|
-
tasks.length > count && /* @__PURE__ */ (0,
|
|
6464
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { id: listId, hidden: !expanded, children: tasks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
6465
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "dsh-partner-board-column-list", children: tasks.slice(0, count).map(renderTask) }),
|
|
6466
|
+
tasks.length > count && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("button", { type: "button", className: "dsh-partner-board-more", onClick: () => setLimit(count + 12), children: [
|
|
6359
6467
|
"\u5C55\u5F00\u66F4\u591A \xB7 \u8FD8\u6709 ",
|
|
6360
6468
|
tasks.length - count,
|
|
6361
6469
|
" \u9879"
|
|
6362
6470
|
] })
|
|
6363
|
-
] }) : /* @__PURE__ */ (0,
|
|
6471
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "dsh-partner-board-empty", children: filtered ? "\u6CA1\u6709\u5339\u914D\u4EFB\u52A1" : "\u6682\u65E0\u4EFB\u52A1" }) })
|
|
6364
6472
|
] });
|
|
6365
6473
|
}
|
|
6366
6474
|
|
|
6367
6475
|
// src/ui/task-contract-panel.tsx
|
|
6368
|
-
var
|
|
6476
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
6369
6477
|
function TaskContractPanel({ task, checks, setChecks, busy }) {
|
|
6370
6478
|
if (!task.acceptanceCriteria?.length && !task.resourceKeys?.length) return null;
|
|
6371
6479
|
const editing = task.status === "review";
|
|
6372
6480
|
const change = (criterion, patch) => setChecks((task.acceptanceCriteria ?? []).map((_, i) => ({ criterion: i + 1, verdict: "unverified", ...checks.find((c) => c.criterion === i + 1), ...criterion === i + 1 ? patch : {} })));
|
|
6373
|
-
return /* @__PURE__ */ (0,
|
|
6374
|
-
Boolean(task.acceptanceCriteria?.length) && /* @__PURE__ */ (0,
|
|
6375
|
-
/* @__PURE__ */ (0,
|
|
6481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("section", { className: "dsh-partner-task-contract", children: [
|
|
6482
|
+
Boolean(task.acceptanceCriteria?.length) && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("header", { children: [
|
|
6483
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("strong", { children: [
|
|
6376
6484
|
"\u9A8C\u6536\u6E05\u5355 \xB7 ",
|
|
6377
6485
|
task.acceptanceCriteria?.length
|
|
6378
6486
|
] }),
|
|
6379
|
-
/* @__PURE__ */ (0,
|
|
6487
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("small", { children: "\u4F19\u4F34 / \u4EBA\u5DE5\u6838\u9A8C\uFF0C\u4E0D\u7B49\u4E8E\u7A0B\u5E8F\u9A8C\u8BC1" })
|
|
6380
6488
|
] }),
|
|
6381
|
-
/* @__PURE__ */ (0,
|
|
6489
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("ol", { children: task.acceptanceCriteria?.map((text, i) => {
|
|
6382
6490
|
const criterion = i + 1, check = checks.find((c) => c.criterion === criterion);
|
|
6383
6491
|
const saved = task.reviewChecks?.find((c) => c.criterion === criterion);
|
|
6384
6492
|
const previous = task.previousAttempt?.reviewChecks?.find((c) => c.criterion === criterion);
|
|
6385
6493
|
const evidence = (task.evidence ?? []).filter((e) => e.criterion === criterion);
|
|
6386
|
-
return /* @__PURE__ */ (0,
|
|
6387
|
-
/* @__PURE__ */ (0,
|
|
6388
|
-
evidence.length > 0 && /* @__PURE__ */ (0,
|
|
6389
|
-
/* @__PURE__ */ (0,
|
|
6494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("li", { children: [
|
|
6495
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { children: text }),
|
|
6496
|
+
evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
|
|
6497
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("summary", { children: [
|
|
6390
6498
|
"\u6267\u884C\u8BC1\u636E \xB7 ",
|
|
6391
6499
|
evidence.length,
|
|
6392
6500
|
" \xB7 \u5C1A\u9700\u6838\u9A8C"
|
|
6393
6501
|
] }),
|
|
6394
|
-
evidence.map((e, j) => /* @__PURE__ */ (0,
|
|
6395
|
-
/* @__PURE__ */ (0,
|
|
6396
|
-
e.note && /* @__PURE__ */ (0,
|
|
6502
|
+
evidence.map((e, j) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
|
|
6503
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("code", { children: e.reference }),
|
|
6504
|
+
e.note && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("small", { children: e.note })
|
|
6397
6505
|
] }, j))
|
|
6398
6506
|
] }),
|
|
6399
|
-
previous?.reason && /* @__PURE__ */ (0,
|
|
6507
|
+
previous?.reason && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("small", { children: [
|
|
6400
6508
|
"\u4E0A\u6B21\u6838\u9A8C\uFF1A",
|
|
6401
6509
|
previous.reason
|
|
6402
6510
|
] }),
|
|
6403
|
-
editing ? /* @__PURE__ */ (0,
|
|
6404
|
-
/* @__PURE__ */ (0,
|
|
6405
|
-
/* @__PURE__ */ (0,
|
|
6511
|
+
editing ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "dsh-partner-task-fields", children: [
|
|
6512
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("label", { children: [
|
|
6513
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { children: [
|
|
6406
6514
|
"\u7B2C ",
|
|
6407
6515
|
criterion,
|
|
6408
6516
|
" \u9879\u7ED3\u8BBA"
|
|
6409
6517
|
] }),
|
|
6410
|
-
/* @__PURE__ */ (0,
|
|
6411
|
-
/* @__PURE__ */ (0,
|
|
6412
|
-
/* @__PURE__ */ (0,
|
|
6413
|
-
/* @__PURE__ */ (0,
|
|
6518
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("select", { disabled: busy, value: check?.verdict ?? "unverified", onChange: (e) => change(criterion, { verdict: e.target.value }), children: [
|
|
6519
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("option", { value: "unverified", children: "\u672A\u9A8C\u8BC1" }),
|
|
6520
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("option", { value: "passed", children: "\u5DF2\u6838\u9A8C\u901A\u8FC7" }),
|
|
6521
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("option", { value: "failed", children: "\u672A\u901A\u8FC7" })
|
|
6414
6522
|
] })
|
|
6415
6523
|
] }),
|
|
6416
|
-
/* @__PURE__ */ (0,
|
|
6417
|
-
/* @__PURE__ */ (0,
|
|
6418
|
-
/* @__PURE__ */ (0,
|
|
6524
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("label", { children: [
|
|
6525
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: check?.verdict === "passed" ? "\u5B9E\u9645\u6838\u9A8C\u8BC1\u636E" : "\u7F3A\u9879 / \u65E0\u6CD5\u6838\u9A8C\u7684\u539F\u56E0" }),
|
|
6526
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("textarea", { rows: 2, maxLength: 1e3, disabled: busy, value: (check?.verdict === "passed" ? check.evidence : check?.reason) ?? "", onChange: (e) => change(criterion, check?.verdict === "passed" ? { evidence: e.target.value } : { reason: e.target.value }) })
|
|
6419
6527
|
] })
|
|
6420
|
-
] }) : saved && /* @__PURE__ */ (0,
|
|
6528
|
+
] }) : saved && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("small", { children: [
|
|
6421
6529
|
saved.verdict === "passed" ? "\u6838\u9A8C\u901A\u8FC7" : saved.verdict === "failed" ? "\u672A\u901A\u8FC7" : "\u672A\u9A8C\u8BC1",
|
|
6422
6530
|
" \xB7 ",
|
|
6423
6531
|
saved.evidence ?? saved.reason
|
|
6424
6532
|
] })
|
|
6425
6533
|
] }, criterion);
|
|
6426
6534
|
}) }),
|
|
6427
|
-
task.resourceKeys?.length ? /* @__PURE__ */ (0,
|
|
6428
|
-
/* @__PURE__ */ (0,
|
|
6535
|
+
task.resourceKeys?.length ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
|
|
6536
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("summary", { children: [
|
|
6429
6537
|
"\u72EC\u5360\u8D44\u6E90\u58F0\u660E \xB7 ",
|
|
6430
6538
|
task.resourceKeys.length
|
|
6431
6539
|
] }),
|
|
6432
|
-
task.resourceKeys.map((key) => /* @__PURE__ */ (0,
|
|
6433
|
-
/* @__PURE__ */ (0,
|
|
6540
|
+
task.resourceKeys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("code", { children: key }, key)),
|
|
6541
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("small", { children: "\u4EC5\u7EA6\u675F\u770B\u677F\u5185\u76F8\u540C\u58F0\u660E\uFF0C\u4E0D\u662F\u64CD\u4F5C\u7CFB\u7EDF\u9501\u3002" })
|
|
6434
6542
|
] }) : null
|
|
6435
6543
|
] });
|
|
6436
6544
|
}
|
|
6437
6545
|
|
|
6438
6546
|
// src/ui/requirement-tasks-panel.tsx
|
|
6439
|
-
var
|
|
6547
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
6440
6548
|
var COLUMNS = [
|
|
6441
6549
|
{ id: "backlog", label: "\u6536\u96C6\u7BB1" },
|
|
6442
6550
|
{ id: "ready", label: "\u5F85\u5F00\u59CB" },
|
|
@@ -6446,26 +6554,26 @@ var COLUMNS = [
|
|
|
6446
6554
|
{ id: "done", label: "\u5DF2\u5B8C\u6210" }
|
|
6447
6555
|
];
|
|
6448
6556
|
function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back, detailOnly = false } = {}) {
|
|
6449
|
-
const [board, setBoard] = (0,
|
|
6450
|
-
const [directory, setDirectory] = (0,
|
|
6451
|
-
const [delegations, setDelegations] = (0,
|
|
6452
|
-
const [creating, setCreating] = (0,
|
|
6453
|
-
const [requirementDetail, setRequirementDetail] = (0,
|
|
6454
|
-
const [selectedTaskId, setSelectedTaskId] = (0,
|
|
6455
|
-
(0,
|
|
6557
|
+
const [board, setBoard] = (0, import_react29.useState)({ tasks: [], activities: [] });
|
|
6558
|
+
const [directory, setDirectory] = (0, import_react29.useState)([]);
|
|
6559
|
+
const [delegations, setDelegations] = (0, import_react29.useState)([]);
|
|
6560
|
+
const [creating, setCreating] = (0, import_react29.useState)(false);
|
|
6561
|
+
const [requirementDetail, setRequirementDetail] = (0, import_react29.useState)(false);
|
|
6562
|
+
const [selectedTaskId, setSelectedTaskId] = (0, import_react29.useState)(initialTaskId);
|
|
6563
|
+
(0, import_react29.useEffect)(() => {
|
|
6456
6564
|
if (initialTaskId) setSelectedTaskId(initialTaskId);
|
|
6457
6565
|
}, [initialTaskId, openRequest]);
|
|
6458
|
-
const [busy, setBusy] = (0,
|
|
6459
|
-
const [loading, setLoading] = (0,
|
|
6460
|
-
const [error, setError] = (0,
|
|
6461
|
-
const [syncedAt, setSyncedAt] = (0,
|
|
6462
|
-
const [query, setQuery] = (0,
|
|
6463
|
-
const [statusFilter, setStatusFilter] = (0,
|
|
6464
|
-
const [assigneeFilter, setAssigneeFilter] = (0,
|
|
6465
|
-
const deferredQuery = (0,
|
|
6466
|
-
const tasksById = (0,
|
|
6467
|
-
const directoryById = (0,
|
|
6468
|
-
const activeDelegationByTaskId = (0,
|
|
6566
|
+
const [busy, setBusy] = (0, import_react29.useState)();
|
|
6567
|
+
const [loading, setLoading] = (0, import_react29.useState)(true);
|
|
6568
|
+
const [error, setError] = (0, import_react29.useState)();
|
|
6569
|
+
const [syncedAt, setSyncedAt] = (0, import_react29.useState)();
|
|
6570
|
+
const [query, setQuery] = (0, import_react29.useState)("");
|
|
6571
|
+
const [statusFilter, setStatusFilter] = (0, import_react29.useState)("all");
|
|
6572
|
+
const [assigneeFilter, setAssigneeFilter] = (0, import_react29.useState)("all");
|
|
6573
|
+
const deferredQuery = (0, import_react29.useDeferredValue)(query.trim().toLocaleLowerCase());
|
|
6574
|
+
const tasksById = (0, import_react29.useMemo)(() => new Map(board.tasks.map((item) => [item.id, item])), [board.tasks]);
|
|
6575
|
+
const directoryById = (0, import_react29.useMemo)(() => new Map(directory.map((item) => [item.id, item])), [directory]);
|
|
6576
|
+
const activeDelegationByTaskId = (0, import_react29.useMemo)(() => {
|
|
6469
6577
|
const result = /* @__PURE__ */ new Map();
|
|
6470
6578
|
for (const delegation of delegations) {
|
|
6471
6579
|
if ((delegation.status === "queued" || delegation.status === "running") && !result.has(delegation.taskId)) result.set(delegation.taskId, delegation);
|
|
@@ -6474,25 +6582,25 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
|
|
|
6474
6582
|
}, [delegations]);
|
|
6475
6583
|
const selectedTask = selectedTaskId ? tasksById.get(selectedTaskId) : void 0;
|
|
6476
6584
|
const requirement = board.requirements?.find((item) => item.id === requirementId);
|
|
6477
|
-
const requirementTasks = (0,
|
|
6478
|
-
const dependentsById = (0,
|
|
6585
|
+
const requirementTasks = (0, import_react29.useMemo)(() => board.tasks.filter((task) => !requirementId || (requirementId === "legacy" ? !task.requirementId : task.requirementId === requirementId)), [board.tasks, requirementId]);
|
|
6586
|
+
const dependentsById = (0, import_react29.useMemo)(() => {
|
|
6479
6587
|
const result = /* @__PURE__ */ new Map();
|
|
6480
6588
|
for (const task of board.tasks) for (const dependencyId of task.dependencyTaskIds) result.set(dependencyId, (result.get(dependencyId) ?? 0) + 1);
|
|
6481
6589
|
return result;
|
|
6482
6590
|
}, [board.tasks]);
|
|
6483
|
-
const scopedTasks = (0,
|
|
6591
|
+
const scopedTasks = (0, import_react29.useMemo)(() => requirementTasks.filter((task) => {
|
|
6484
6592
|
if (assigneeFilter !== "all" && (task.assigneeCompanionId ?? "unassigned") !== assigneeFilter) return false;
|
|
6485
6593
|
if (!deferredQuery) return true;
|
|
6486
6594
|
const dependencies = task.dependencyTaskIds.map((id) => tasksById.get(id)?.title ?? "");
|
|
6487
6595
|
return [task.title, task.description, task.resultAbstract, task.resultSummary, directoryById.get(task.assigneeCompanionId ?? "")?.name, ...dependencies].some((value) => value?.toLocaleLowerCase().includes(deferredQuery));
|
|
6488
6596
|
}), [assigneeFilter, requirementTasks, deferredQuery, directoryById, tasksById]);
|
|
6489
|
-
const statusCounts = (0,
|
|
6597
|
+
const statusCounts = (0, import_react29.useMemo)(() => {
|
|
6490
6598
|
const result = new Map(COLUMNS.map((column) => [column.id, 0]));
|
|
6491
6599
|
for (const task of scopedTasks) result.set(task.status, (result.get(task.status) ?? 0) + 1);
|
|
6492
6600
|
return result;
|
|
6493
6601
|
}, [scopedTasks]);
|
|
6494
6602
|
const visibleColumns = statusFilter === "all" ? COLUMNS.filter((column) => (statusCounts.get(column.id) ?? 0) > 0) : COLUMNS.filter((column) => column.id === statusFilter);
|
|
6495
|
-
const tasksByStatus = (0,
|
|
6603
|
+
const tasksByStatus = (0, import_react29.useMemo)(() => {
|
|
6496
6604
|
const priorityRank = { urgent: 3, high: 2, normal: 1, low: 0 };
|
|
6497
6605
|
const result = new Map(COLUMNS.map((column) => [column.id, []]));
|
|
6498
6606
|
for (const task of scopedTasks) {
|
|
@@ -6594,30 +6702,30 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
|
|
|
6594
6702
|
setBusy(void 0);
|
|
6595
6703
|
}
|
|
6596
6704
|
};
|
|
6597
|
-
return /* @__PURE__ */ (0,
|
|
6598
|
-
!detailOnly && /* @__PURE__ */ (0,
|
|
6599
|
-
back && /* @__PURE__ */ (0,
|
|
6600
|
-
/* @__PURE__ */ (0,
|
|
6601
|
-
/* @__PURE__ */ (0,
|
|
6602
|
-
/* @__PURE__ */ (0,
|
|
6705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
|
|
6706
|
+
!detailOnly && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
6707
|
+
back && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("nav", { className: "dsh-partner-requirement-breadcrumb", children: [
|
|
6708
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", onClick: back, children: "\u9700\u6C42\u770B\u677F" }),
|
|
6709
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_dsh_client_ui_primitives13.IconChevronRightOutline14, { size: 14 }),
|
|
6710
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: requirement?.title ?? "\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1" })
|
|
6603
6711
|
] }),
|
|
6604
|
-
/* @__PURE__ */ (0,
|
|
6605
|
-
/* @__PURE__ */ (0,
|
|
6606
|
-
/* @__PURE__ */ (0,
|
|
6712
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(WorkspaceHero, { eyebrow: requirement ? requirementStatus(requirement) : "\u65E7\u4EFB\u52A1", title: requirement?.title ?? "\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1", detail: requirement?.description || "\u4EFB\u52A1\u6309\u9636\u6BB5\u5C55\u793A\uFF0C\u70B9\u51FB\u67E5\u770B\u4EA4\u4ED8\u3001\u4F9D\u8D56\u548C\u6267\u884C\u72B6\u6001\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
6713
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "dsh-partner-board-live", title: syncedAt ? `\u6700\u8FD1\u540C\u6B65 ${new Date(syncedAt).toLocaleTimeString()}` : "\u6B63\u5728\u8FDE\u63A5", children: [
|
|
6714
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("i", {}),
|
|
6607
6715
|
"\u5B9E\u65F6\u540C\u6B65"
|
|
6608
6716
|
] }),
|
|
6609
|
-
requirement && /* @__PURE__ */ (0,
|
|
6610
|
-
requirement?.status === "planning" && /* @__PURE__ */ (0,
|
|
6611
|
-
/* @__PURE__ */ (0,
|
|
6717
|
+
requirement && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", onClick: () => setRequirementDetail(true), children: "\u9700\u6C42\u8BE6\u60C5" }),
|
|
6718
|
+
requirement?.status === "planning" && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
|
|
6719
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_dsh_client_ui_primitives13.IconPlusOutline16, { size: 15 }),
|
|
6612
6720
|
"\u65B0\u4EFB\u52A1"
|
|
6613
6721
|
] })
|
|
6614
6722
|
] }) })
|
|
6615
6723
|
] }),
|
|
6616
|
-
error && /* @__PURE__ */ (0,
|
|
6617
|
-
requirementDetail && requirement && /* @__PURE__ */ (0,
|
|
6618
|
-
creating && requirement && /* @__PURE__ */ (0,
|
|
6619
|
-
selectedTask && /* @__PURE__ */ (0,
|
|
6620
|
-
/* @__PURE__ */ (0,
|
|
6724
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(WorkspaceNotice, { children: error }),
|
|
6725
|
+
requirementDetail && requirement && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(WorkspaceDialog, { eyebrow: "\u9700\u6C42\u8BE6\u60C5", title: requirement.title, detail: requirementStatus(requirement), close: () => setRequirementDetail(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(RequirementDetail, { item: requirement, tasks: requirementTasks, directory, changed: load2, close: () => setRequirementDetail(false) }, requirement.id) }),
|
|
6726
|
+
creating && requirement && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u5B50\u4EFB\u52A1", detail: `\u6240\u5C5E\u9700\u6C42\uFF1A${requirement.title}`, close: () => setCreating(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TaskForm, { requirementId: requirement.id, companions: directory, tasks: requirementTasks, close: () => setCreating(false), changed: load2 }) }),
|
|
6727
|
+
selectedTask && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(WorkspaceDialog, { eyebrow: "TASK DETAIL", title: selectedTask.title, detail: taskDialogSummary(selectedTask, directory), close: () => setSelectedTaskId(void 0), width: "wide", children: [
|
|
6728
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
6621
6729
|
TaskDetail,
|
|
6622
6730
|
{
|
|
6623
6731
|
task: selectedTask,
|
|
@@ -6647,61 +6755,61 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
|
|
|
6647
6755
|
},
|
|
6648
6756
|
selectedTask.id
|
|
6649
6757
|
),
|
|
6650
|
-
error && /* @__PURE__ */ (0,
|
|
6758
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(WorkspaceNotice, { children: error })
|
|
6651
6759
|
] }),
|
|
6652
|
-
!detailOnly && (loading ? /* @__PURE__ */ (0,
|
|
6653
|
-
/* @__PURE__ */ (0,
|
|
6654
|
-
/* @__PURE__ */ (0,
|
|
6655
|
-
/* @__PURE__ */ (0,
|
|
6656
|
-
/* @__PURE__ */ (0,
|
|
6657
|
-
/* @__PURE__ */ (0,
|
|
6658
|
-
query && /* @__PURE__ */ (0,
|
|
6760
|
+
!detailOnly && (loading ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CollectionSkeleton, { rows: 6 }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
6761
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "dsh-partner-board-tools", children: [
|
|
6762
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "dsh-partner-board-search", children: [
|
|
6763
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u4EFB\u52A1" }),
|
|
6764
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_dsh_client_ui_primitives13.IconSearchOutline16, { size: 16 }) }),
|
|
6765
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: "\u641C\u7D22\u4EFB\u52A1\u3001\u8D1F\u8D23\u4EBA\u6216\u524D\u7F6E\u4EFB\u52A1" }),
|
|
6766
|
+
query && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", onClick: () => setQuery(""), "aria-label": "\u6E05\u9664\u4EFB\u52A1\u641C\u7D22", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_dsh_client_ui_primitives13.IconCloseOutline16, { size: 14 }) })
|
|
6659
6767
|
] }),
|
|
6660
|
-
/* @__PURE__ */ (0,
|
|
6661
|
-
/* @__PURE__ */ (0,
|
|
6662
|
-
/* @__PURE__ */ (0,
|
|
6663
|
-
/* @__PURE__ */ (0,
|
|
6664
|
-
/* @__PURE__ */ (0,
|
|
6665
|
-
directory.map((item) => /* @__PURE__ */ (0,
|
|
6768
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "dsh-partner-board-assignee", children: [
|
|
6769
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "sr-only", children: "\u6309\u8D1F\u8D23\u4EBA\u7B5B\u9009" }),
|
|
6770
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("select", { value: assigneeFilter, onChange: (event) => setAssigneeFilter(event.target.value), children: [
|
|
6771
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "all", children: "\u5168\u90E8\u4F19\u4F34" }),
|
|
6772
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "unassigned", children: "\u672A\u6307\u6D3E" }),
|
|
6773
|
+
directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: item.id, children: [
|
|
6666
6774
|
"@",
|
|
6667
6775
|
item.name
|
|
6668
6776
|
] }, item.id))
|
|
6669
6777
|
] })
|
|
6670
6778
|
] }),
|
|
6671
|
-
/* @__PURE__ */ (0,
|
|
6672
|
-
/* @__PURE__ */ (0,
|
|
6673
|
-
/* @__PURE__ */ (0,
|
|
6674
|
-
/* @__PURE__ */ (0,
|
|
6779
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "dsh-partner-board-assignee is-mobile-stage", children: [
|
|
6780
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "sr-only", children: "\u6309\u4EFB\u52A1\u9636\u6BB5\u7B5B\u9009" }),
|
|
6781
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("select", { value: statusFilter, onChange: (event) => setStatusFilter(event.target.value), children: [
|
|
6782
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: "all", children: [
|
|
6675
6783
|
"\u5168\u90E8\u9636\u6BB5 \xB7 ",
|
|
6676
6784
|
scopedTasks.length
|
|
6677
6785
|
] }),
|
|
6678
|
-
COLUMNS.map((column) => /* @__PURE__ */ (0,
|
|
6786
|
+
COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: column.id, children: [
|
|
6679
6787
|
column.label,
|
|
6680
6788
|
" \xB7 ",
|
|
6681
6789
|
statusCounts.get(column.id) ?? 0
|
|
6682
6790
|
] }, column.id))
|
|
6683
6791
|
] })
|
|
6684
6792
|
] }),
|
|
6685
|
-
/* @__PURE__ */ (0,
|
|
6793
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("small", { "aria-live": "polite", children: [
|
|
6686
6794
|
"\u663E\u793A ",
|
|
6687
6795
|
visibleTaskCount,
|
|
6688
6796
|
" / ",
|
|
6689
6797
|
board.tasks.length
|
|
6690
6798
|
] })
|
|
6691
6799
|
] }),
|
|
6692
|
-
/* @__PURE__ */ (0,
|
|
6693
|
-
/* @__PURE__ */ (0,
|
|
6694
|
-
/* @__PURE__ */ (0,
|
|
6695
|
-
/* @__PURE__ */ (0,
|
|
6800
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u6309\u4EFB\u52A1\u72B6\u6001\u7B5B\u9009", children: [
|
|
6801
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("button", { type: "button", className: statusFilter === "all" ? "is-active" : "", "aria-pressed": statusFilter === "all", onClick: () => setStatusFilter("all"), children: [
|
|
6802
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "\u5168\u90E8" }),
|
|
6803
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("b", { children: scopedTasks.length })
|
|
6696
6804
|
] }),
|
|
6697
|
-
COLUMNS.map((column) => /* @__PURE__ */ (0,
|
|
6698
|
-
/* @__PURE__ */ (0,
|
|
6699
|
-
/* @__PURE__ */ (0,
|
|
6805
|
+
COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("button", { type: "button", className: statusFilter === column.id ? "is-active" : "", "aria-pressed": statusFilter === column.id, onClick: () => setStatusFilter(column.id), children: [
|
|
6806
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: column.label }),
|
|
6807
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("b", { children: statusCounts.get(column.id) ?? 0 })
|
|
6700
6808
|
] }, column.id))
|
|
6701
6809
|
] }),
|
|
6702
|
-
/* @__PURE__ */ (0,
|
|
6810
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "dsh-partner-board", "data-focused": statusFilter !== "all", "aria-label": "\u4EFB\u52A1\u770B\u677F", children: visibleColumns.map((column) => {
|
|
6703
6811
|
const tasks = tasksByStatus.get(column.id) ?? [];
|
|
6704
|
-
return /* @__PURE__ */ (0,
|
|
6812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TaskBoardStage, { id: column.id, label: column.label, tasks, focused: statusFilter !== "all", filtered: Boolean(query || assigneeFilter !== "all"), renderTask: (task) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
6705
6813
|
TaskCard,
|
|
6706
6814
|
{
|
|
6707
6815
|
task,
|
|
@@ -6714,9 +6822,9 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
|
|
|
6714
6822
|
task.id
|
|
6715
6823
|
) }, column.id);
|
|
6716
6824
|
}) }),
|
|
6717
|
-
!scopedTasks.length && /* @__PURE__ */ (0,
|
|
6718
|
-
/* @__PURE__ */ (0,
|
|
6719
|
-
/* @__PURE__ */ (0,
|
|
6825
|
+
!scopedTasks.length && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "dsh-partner-collection-empty", children: [
|
|
6826
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("strong", { children: query || assigneeFilter !== "all" ? "\u6CA1\u6709\u5339\u914D\u7684\u4EFB\u52A1" : "\u8FD8\u6CA1\u6709\u5B50\u4EFB\u52A1" }),
|
|
6827
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: requirement?.status === "planning" ? "\u6DFB\u52A0\u5B50\u4EFB\u52A1\u5E76\u5B89\u6392\u8D1F\u8D23\u4EBA\uFF0C\u5B8C\u6210\u5206\u5DE5\u540E\u5728\u9700\u6C42\u8BE6\u60C5\u4E2D\u63D0\u4EA4\u89C4\u5212\u3002" : "\u53EF\u8FD4\u56DE\u9700\u6C42\u770B\u677F\u67E5\u770B\u5176\u4ED6\u9700\u6C42\u3002" })
|
|
6720
6828
|
] })
|
|
6721
6829
|
] }))
|
|
6722
6830
|
] });
|
|
@@ -6727,48 +6835,48 @@ function TaskCard({ task, tasksById, directoryById, dependentCount, execution, o
|
|
|
6727
6835
|
const completedDependencies = dependencies.length - blockers.length;
|
|
6728
6836
|
const assignee = directoryById.get(task.assigneeCompanionId ?? "");
|
|
6729
6837
|
const executionState = task.scheduling ? { label: task.scheduling.message } : execution ? delegationState(execution, blockers.length) : task.autoRun && task.status === "ready" ? { label: blockers.length ? "\u7B49\u5F85\u524D\u7F6E\u5B8C\u6210" : "\u7B49\u5F85\u8C03\u5EA6" } : void 0;
|
|
6730
|
-
return /* @__PURE__ */ (0,
|
|
6731
|
-
/* @__PURE__ */ (0,
|
|
6732
|
-
/* @__PURE__ */ (0,
|
|
6733
|
-
/* @__PURE__ */ (0,
|
|
6734
|
-
/* @__PURE__ */ (0,
|
|
6838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("article", { className: "dsh-partner-task-card", "data-blocked": blockers.length > 0, "data-priority": task.priority, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("button", { type: "button", className: "dsh-partner-task-summary", "aria-haspopup": "dialog", onClick: open, children: [
|
|
6839
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { children: [
|
|
6840
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "dsh-partner-task-card-title", children: [
|
|
6841
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("strong", { title: task.title, children: task.title }),
|
|
6842
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("em", { children: priorityLabel(task.priority) })
|
|
6735
6843
|
] }),
|
|
6736
|
-
/* @__PURE__ */ (0,
|
|
6844
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("small", { className: "dsh-partner-task-card-owner", children: [
|
|
6737
6845
|
assignee ? `@${assignee.name}` : "\u672A\u6307\u6D3E",
|
|
6738
6846
|
task.resultSummary ? " \xB7 \u5DF2\u6709\u7ED3\u679C" : "",
|
|
6739
6847
|
executionState ? ` \xB7 ${executionState.label}` : ""
|
|
6740
6848
|
] }),
|
|
6741
|
-
(dependencies.length > 0 || dependentCount > 0) && /* @__PURE__ */ (0,
|
|
6742
|
-
dependencies.length > 0 && /* @__PURE__ */ (0,
|
|
6849
|
+
(dependencies.length > 0 || dependentCount > 0) && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "dsh-partner-task-relations", children: [
|
|
6850
|
+
dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("small", { "data-blocked": blockers.length > 0, children: [
|
|
6743
6851
|
"\u524D\u7F6E ",
|
|
6744
6852
|
completedDependencies,
|
|
6745
6853
|
"/",
|
|
6746
6854
|
dependencies.length
|
|
6747
6855
|
] }),
|
|
6748
|
-
dependentCount > 0 && /* @__PURE__ */ (0,
|
|
6856
|
+
dependentCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("small", { children: [
|
|
6749
6857
|
"\u5B8C\u6210\u540E\u89E3\u9501 ",
|
|
6750
6858
|
dependentCount
|
|
6751
6859
|
] })
|
|
6752
6860
|
] })
|
|
6753
6861
|
] }),
|
|
6754
|
-
/* @__PURE__ */ (0,
|
|
6862
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_dsh_client_ui_primitives13.IconChevronRightOutline14, { size: 14 })
|
|
6755
6863
|
] }) });
|
|
6756
6864
|
}
|
|
6757
6865
|
function TaskDetail({ task, tasks, activities, directory, execution, busy, update, delegate, review, accept, reject, remove }) {
|
|
6758
|
-
const [rejecting, setRejecting] = (0,
|
|
6759
|
-
const [checks, setChecks] = (0,
|
|
6760
|
-
(0,
|
|
6866
|
+
const [rejecting, setRejecting] = (0, import_react29.useState)(false);
|
|
6867
|
+
const [checks, setChecks] = (0, import_react29.useState)([]);
|
|
6868
|
+
(0, import_react29.useEffect)(() => {
|
|
6761
6869
|
setChecks([]);
|
|
6762
6870
|
}, [task.id, task.revision]);
|
|
6763
|
-
const [rejectReason, setRejectReason] = (0,
|
|
6764
|
-
(0,
|
|
6871
|
+
const [rejectReason, setRejectReason] = (0, import_react29.useState)("");
|
|
6872
|
+
(0, import_react29.useEffect)(() => {
|
|
6765
6873
|
if (task.status !== "review") {
|
|
6766
6874
|
setRejecting(false);
|
|
6767
6875
|
setRejectReason("");
|
|
6768
6876
|
}
|
|
6769
6877
|
}, [task.status]);
|
|
6770
|
-
const [confirmingDelete, setConfirmingDelete] = (0,
|
|
6771
|
-
const byId = (0,
|
|
6878
|
+
const [confirmingDelete, setConfirmingDelete] = (0, import_react29.useState)(false);
|
|
6879
|
+
const byId = (0, import_react29.useMemo)(() => new Map(tasks.map((item) => [item.id, item])), [tasks]);
|
|
6772
6880
|
const dependencies = task.dependencyTaskIds.map((id) => byId.get(id)).filter((item) => item !== void 0);
|
|
6773
6881
|
const blockers = dependencies.filter((item) => item.status !== "done");
|
|
6774
6882
|
const assignee = directory.find((item) => item.id === task.assigneeCompanionId);
|
|
@@ -6777,30 +6885,30 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
|
|
|
6777
6885
|
const canExecute = Boolean(task.assigneeCompanionId) && !execution && !["doing", "review", "done"].includes(task.status);
|
|
6778
6886
|
const recentActivities = [...activities].sort((left, right) => right.at - left.at).slice(0, 6);
|
|
6779
6887
|
const executionState = execution ? delegationState(execution, blockers.length) : void 0;
|
|
6780
|
-
return /* @__PURE__ */ (0,
|
|
6781
|
-
/* @__PURE__ */ (0,
|
|
6782
|
-
/* @__PURE__ */ (0,
|
|
6783
|
-
/* @__PURE__ */ (0,
|
|
6888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "dsh-partner-task-detail", children: [
|
|
6889
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("section", { className: "dsh-partner-task-description", children: [
|
|
6890
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("strong", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
|
|
6891
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: task.description || "\u6CA1\u6709\u8865\u5145\u8BF4\u660E" })
|
|
6784
6892
|
] }),
|
|
6785
|
-
task.scheduling && task.status !== "done" && /* @__PURE__ */ (0,
|
|
6786
|
-
/* @__PURE__ */ (0,
|
|
6787
|
-
task.scheduling.taskIds?.length ? /* @__PURE__ */ (0,
|
|
6788
|
-
task.scheduling.retryAt ? /* @__PURE__ */ (0,
|
|
6893
|
+
task.scheduling && task.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("section", { className: "dsh-partner-task-description", children: [
|
|
6894
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("strong", { children: task.scheduling.message }),
|
|
6895
|
+
task.scheduling.taskIds?.length ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: task.scheduling.taskIds.map((id) => byId.get(id)?.title ?? "\u5DF2\u5220\u9664\u4EFB\u52A1").join("\u3001") }) : null,
|
|
6896
|
+
task.scheduling.retryAt ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("small", { children: [
|
|
6789
6897
|
"\u4E0B\u6B21\u91CD\u8BD5\uFF1A",
|
|
6790
6898
|
new Date(task.scheduling.retryAt).toLocaleString()
|
|
6791
6899
|
] }) : null
|
|
6792
6900
|
] }),
|
|
6793
|
-
/* @__PURE__ */ (0,
|
|
6794
|
-
/* @__PURE__ */ (0,
|
|
6795
|
-
/* @__PURE__ */ (0,
|
|
6796
|
-
/* @__PURE__ */ (0,
|
|
6797
|
-
/* @__PURE__ */ (0,
|
|
6901
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TaskContractPanel, { task, checks, setChecks, busy }),
|
|
6902
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "dsh-partner-task-fields", children: [
|
|
6903
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { children: [
|
|
6904
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "\u72B6\u6001" }),
|
|
6905
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("select", { value: task.status, disabled: busy, onChange: (event) => update({ status: event.target.value, ...event.target.value === "done" ? { checks } : {} }), children: COLUMNS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: item.id, disabled: (item.id === "doing" || item.id === "review" || item.id === "done") && blockers.length > 0 || item.id === "done" && task.status !== "review" && task.status !== "done", children: item.label }, item.id)) })
|
|
6798
6906
|
] }),
|
|
6799
|
-
/* @__PURE__ */ (0,
|
|
6800
|
-
/* @__PURE__ */ (0,
|
|
6801
|
-
/* @__PURE__ */ (0,
|
|
6802
|
-
/* @__PURE__ */ (0,
|
|
6803
|
-
directory.map((item) => /* @__PURE__ */ (0,
|
|
6907
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { children: [
|
|
6908
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
|
|
6909
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("select", { value: task.assigneeCompanionId ?? "", disabled: busy || task.status === "doing", onChange: (event) => update({ assigneeCompanionId: event.target.value }), children: [
|
|
6910
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
|
|
6911
|
+
directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: item.id, children: [
|
|
6804
6912
|
"@",
|
|
6805
6913
|
item.name,
|
|
6806
6914
|
" \xB7 ",
|
|
@@ -6808,43 +6916,43 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
|
|
|
6808
6916
|
] }, item.id))
|
|
6809
6917
|
] })
|
|
6810
6918
|
] }),
|
|
6811
|
-
/* @__PURE__ */ (0,
|
|
6812
|
-
/* @__PURE__ */ (0,
|
|
6813
|
-
/* @__PURE__ */ (0,
|
|
6814
|
-
/* @__PURE__ */ (0,
|
|
6815
|
-
directory.map((item) => /* @__PURE__ */ (0,
|
|
6919
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { children: [
|
|
6920
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
|
|
6921
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("select", { value: task.reviewerCompanionId ?? "", disabled: busy, onChange: (event) => update({ reviewerCompanionId: event.target.value }), children: [
|
|
6922
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
|
|
6923
|
+
directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: item.id, children: [
|
|
6816
6924
|
"@",
|
|
6817
6925
|
item.name
|
|
6818
6926
|
] }, item.id))
|
|
6819
6927
|
] })
|
|
6820
6928
|
] })
|
|
6821
6929
|
] }),
|
|
6822
|
-
executionState && /* @__PURE__ */ (0,
|
|
6823
|
-
/* @__PURE__ */ (0,
|
|
6824
|
-
/* @__PURE__ */ (0,
|
|
6825
|
-
/* @__PURE__ */ (0,
|
|
6826
|
-
/* @__PURE__ */ (0,
|
|
6930
|
+
executionState && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("section", { className: "dsh-partner-task-execution", "data-state": execution?.status, children: [
|
|
6931
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("i", {}),
|
|
6932
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { children: [
|
|
6933
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("strong", { children: executionState.title }),
|
|
6934
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("small", { children: executionState.detail })
|
|
6827
6935
|
] })
|
|
6828
6936
|
] }),
|
|
6829
|
-
/* @__PURE__ */ (0,
|
|
6830
|
-
/* @__PURE__ */ (0,
|
|
6831
|
-
/* @__PURE__ */ (0,
|
|
6832
|
-
/* @__PURE__ */ (0,
|
|
6937
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("section", { className: "dsh-partner-task-dependency", children: [
|
|
6938
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("header", { children: [
|
|
6939
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("strong", { children: "\u524D\u7F6E\u4EFB\u52A1" }),
|
|
6940
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("small", { children: blockers.length ? `${blockers.length} \u9879\u672A\u5B8C\u6210\uFF0C\u5F53\u524D\u4EFB\u52A1\u4E0D\u80FD\u542F\u52A8` : dependencies.length ? "\u5DF2\u5168\u90E8\u5B8C\u6210\uFF0C\u53EF\u4EE5\u542F\u52A8" : "\u6CA1\u6709\u524D\u7F6E\u4F9D\u8D56" })
|
|
6833
6941
|
] }),
|
|
6834
|
-
dependencies.length > 0 && /* @__PURE__ */ (0,
|
|
6835
|
-
/* @__PURE__ */ (0,
|
|
6836
|
-
/* @__PURE__ */ (0,
|
|
6837
|
-
/* @__PURE__ */ (0,
|
|
6942
|
+
dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: dependencies.map((item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { "data-done": item.status === "done", children: [
|
|
6943
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("i", { children: item.status === "done" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_dsh_client_ui_primitives13.IconCheckOutline16, { size: 12 }) : "" }),
|
|
6944
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("b", { children: item.title }),
|
|
6945
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", disabled: busy || ["doing", "review", "done"].includes(task.status), "aria-label": `\u79FB\u9664\u524D\u7F6E\u4EFB\u52A1 ${item.title}`, onClick: () => update({ dependencyTaskIds: task.dependencyTaskIds.filter((id) => id !== item.id) }), children: "\u79FB\u9664" })
|
|
6838
6946
|
] }, item.id)) }),
|
|
6839
|
-
dependencyCandidates.length > 0 && /* @__PURE__ */ (0,
|
|
6840
|
-
/* @__PURE__ */ (0,
|
|
6841
|
-
/* @__PURE__ */ (0,
|
|
6947
|
+
dependencyCandidates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { children: [
|
|
6948
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "sr-only", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1" }),
|
|
6949
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("select", { defaultValue: "", disabled: busy || ["doing", "review", "done"].includes(task.status), onChange: (event) => {
|
|
6842
6950
|
const id = event.currentTarget.value;
|
|
6843
6951
|
if (id) update({ dependencyTaskIds: [...task.dependencyTaskIds, id] });
|
|
6844
6952
|
event.currentTarget.value = "";
|
|
6845
6953
|
}, children: [
|
|
6846
|
-
/* @__PURE__ */ (0,
|
|
6847
|
-
dependencyCandidates.map((item) => /* @__PURE__ */ (0,
|
|
6954
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1\u2026" }),
|
|
6955
|
+
dependencyCandidates.map((item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: item.id, children: [
|
|
6848
6956
|
item.title,
|
|
6849
6957
|
" \xB7 ",
|
|
6850
6958
|
statusLabel(item.status)
|
|
@@ -6852,70 +6960,70 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
|
|
|
6852
6960
|
] })
|
|
6853
6961
|
] })
|
|
6854
6962
|
] }),
|
|
6855
|
-
task.resultSummary && /* @__PURE__ */ (0,
|
|
6856
|
-
task.reviewSummary && /* @__PURE__ */ (0,
|
|
6857
|
-
recentActivities.length > 0 && /* @__PURE__ */ (0,
|
|
6858
|
-
/* @__PURE__ */ (0,
|
|
6963
|
+
task.resultSummary && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ResultBlock, { label: "\u6267\u884C\u7ED3\u679C", value: task.resultSummary }),
|
|
6964
|
+
task.reviewSummary && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ResultBlock, { label: `\u6838\u9A8C\u610F\u89C1${reviewer ? ` \xB7 @${reviewer.name}` : ""}`, value: task.reviewSummary }),
|
|
6965
|
+
recentActivities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("details", { className: "dsh-partner-task-activity dsh-partner-requirement-disclosure", children: [
|
|
6966
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("summary", { children: [
|
|
6859
6967
|
"\u6700\u8FD1\u6D3B\u52A8 \xB7 ",
|
|
6860
6968
|
recentActivities.length
|
|
6861
6969
|
] }),
|
|
6862
|
-
/* @__PURE__ */ (0,
|
|
6863
|
-
/* @__PURE__ */ (0,
|
|
6864
|
-
/* @__PURE__ */ (0,
|
|
6970
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("ol", { children: recentActivities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("li", { children: [
|
|
6971
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: item.message }),
|
|
6972
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("time", { children: new Date(item.at).toLocaleString() })
|
|
6865
6973
|
] }, item.id)) })
|
|
6866
6974
|
] }),
|
|
6867
|
-
rejecting && /* @__PURE__ */ (0,
|
|
6975
|
+
rejecting && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("form", { className: "dsh-partner-task-reject", onSubmit: (event) => {
|
|
6868
6976
|
event.preventDefault();
|
|
6869
6977
|
const reason = rejectReason.trim();
|
|
6870
6978
|
if (!reason) return;
|
|
6871
6979
|
reject(reason, checks);
|
|
6872
6980
|
}, children: [
|
|
6873
|
-
/* @__PURE__ */ (0,
|
|
6874
|
-
/* @__PURE__ */ (0,
|
|
6875
|
-
/* @__PURE__ */ (0,
|
|
6981
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { children: [
|
|
6982
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "\u6253\u56DE\u539F\u56E0" }),
|
|
6983
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("textarea", { autoFocus: true, value: rejectReason, onChange: (event) => setRejectReason(event.target.value), rows: 3, maxLength: 1200, placeholder: "\u8BF4\u660E\u9700\u8981\u91CD\u505A\u6216\u8865\u5145\u7684\u5185\u5BB9" })
|
|
6876
6984
|
] }),
|
|
6877
|
-
/* @__PURE__ */ (0,
|
|
6878
|
-
/* @__PURE__ */ (0,
|
|
6985
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
|
|
6986
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", onClick: () => {
|
|
6879
6987
|
setRejecting(false);
|
|
6880
6988
|
setRejectReason("");
|
|
6881
6989
|
}, children: "\u53D6\u6D88" }),
|
|
6882
|
-
/* @__PURE__ */ (0,
|
|
6990
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !rejectReason.trim(), children: "\u786E\u8BA4\u6253\u56DE" })
|
|
6883
6991
|
] })
|
|
6884
6992
|
] }),
|
|
6885
|
-
confirmingDelete && /* @__PURE__ */ (0,
|
|
6886
|
-
/* @__PURE__ */ (0,
|
|
6887
|
-
/* @__PURE__ */ (0,
|
|
6888
|
-
/* @__PURE__ */ (0,
|
|
6889
|
-
/* @__PURE__ */ (0,
|
|
6993
|
+
confirmingDelete && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "dsh-partner-task-delete-confirm", role: "alert", children: [
|
|
6994
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "\u5220\u9664\u4F1A\u53D6\u6D88\u5173\u8054\u6267\u884C\uFF0C\u4F9D\u8D56\u5B83\u7684\u672A\u5B8C\u6210\u4EFB\u52A1\u5C06\u6682\u505C\u3002\u9700\u6C42\u9700\u91CD\u65B0\u786E\u8BA4\u8303\u56F4\uFF1B\u4E0D\u80FD\u64A4\u9500\u3002" }),
|
|
6995
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
|
|
6996
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", onClick: () => setConfirmingDelete(false), children: "\u4FDD\u7559\u4EFB\u52A1" }),
|
|
6997
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
|
|
6890
6998
|
] })
|
|
6891
6999
|
] }),
|
|
6892
|
-
/* @__PURE__ */ (0,
|
|
6893
|
-
/* @__PURE__ */ (0,
|
|
7000
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("footer", { className: "dsh-partner-task-actions", children: [
|
|
7001
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("small", { children: [
|
|
6894
7002
|
"r",
|
|
6895
7003
|
task.revision,
|
|
6896
7004
|
" \xB7 ",
|
|
6897
7005
|
new Date(task.updatedAt).toLocaleString()
|
|
6898
7006
|
] }),
|
|
6899
|
-
/* @__PURE__ */ (0,
|
|
6900
|
-
task.status === "review" ? /* @__PURE__ */ (0,
|
|
6901
|
-
task.reviewerCompanionId && /* @__PURE__ */ (0,
|
|
6902
|
-
/* @__PURE__ */ (0,
|
|
6903
|
-
/* @__PURE__ */ (0,
|
|
6904
|
-
] }) : /* @__PURE__ */ (0,
|
|
6905
|
-
/* @__PURE__ */ (0,
|
|
7007
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { children: [
|
|
7008
|
+
task.status === "review" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
7009
|
+
task.reviewerCompanionId && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", disabled: busy, onClick: review, children: busy ? "\u6838\u9A8C\u4E2D\u2026" : `\u4EA4\u7ED9 @${reviewer?.name ?? "\u4F19\u4F34"} \u6838\u9A8C` }),
|
|
7010
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", disabled: busy, onClick: () => setRejecting(true), children: "\u6253\u56DE\u91CD\u505A" }),
|
|
7011
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", className: "is-primary", disabled: busy || Boolean(task.acceptanceCriteria?.length && (checks.length !== task.acceptanceCriteria.length || checks.some((c) => c.verdict !== "passed" || !c.evidence?.trim()))), onClick: () => accept(checks), children: "\u9A8C\u6536\u901A\u8FC7" })
|
|
7012
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", disabled: busy || !canExecute, title: blockers.length ? "\u53EF\u63D0\u524D\u6392\u961F\uFF0C\u4F9D\u8D56\u901A\u8FC7\u9A8C\u6536\u540E\u81EA\u52A8\u6267\u884C" : !task.assigneeCompanionId ? "\u8BF7\u5148\u9009\u62E9\u8D1F\u8D23\u4EBA" : void 0, onClick: delegate, children: busy ? "\u6267\u884C\u4E2D\u2026" : execution?.status === "queued" ? "\u5DF2\u63D0\u4EA4\uFF0C\u7B49\u5F85\u6267\u884C" : task.status === "doing" ? "\u6B63\u5728\u6267\u884C" : task.status === "done" ? "\u5DF2\u7ECF\u5B8C\u6210" : `\u4EA4\u7ED9 @${assignee?.name ?? "\u4F19\u4F34"}` }),
|
|
7013
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", className: "is-icon", "aria-label": `\u5220\u9664 ${task.title}`, "aria-expanded": confirmingDelete, disabled: busy, onClick: () => setConfirmingDelete(true), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_dsh_client_ui_primitives13.IconTrashOutline16, { size: 14 }) })
|
|
6906
7014
|
] })
|
|
6907
7015
|
] })
|
|
6908
7016
|
] });
|
|
6909
7017
|
}
|
|
6910
7018
|
function ResultBlock({ label, value }) {
|
|
6911
|
-
return /* @__PURE__ */ (0,
|
|
6912
|
-
/* @__PURE__ */ (0,
|
|
6913
|
-
/* @__PURE__ */ (0,
|
|
7019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("section", { className: "dsh-partner-task-result", children: [
|
|
7020
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("strong", { children: label }),
|
|
7021
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: value })
|
|
6914
7022
|
] });
|
|
6915
7023
|
}
|
|
6916
7024
|
function TaskForm({ requirementId, companions, tasks, close, changed: changed2 }) {
|
|
6917
|
-
const [error, setError] = (0,
|
|
6918
|
-
const [busy, setBusy] = (0,
|
|
7025
|
+
const [error, setError] = (0, import_react29.useState)();
|
|
7026
|
+
const [busy, setBusy] = (0, import_react29.useState)(false);
|
|
6919
7027
|
const dependencyOptions = tasks.filter((item) => item.status !== "done");
|
|
6920
7028
|
const submit = async (event) => {
|
|
6921
7029
|
event.preventDefault();
|
|
@@ -6943,79 +7051,79 @@ function TaskForm({ requirementId, companions, tasks, close, changed: changed2 }
|
|
|
6943
7051
|
setBusy(false);
|
|
6944
7052
|
}
|
|
6945
7053
|
};
|
|
6946
|
-
return /* @__PURE__ */ (0,
|
|
7054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("form", { className: "dsh-partner-task-form", "aria-busy": busy, onSubmit: (event) => {
|
|
6947
7055
|
void submit(event);
|
|
6948
7056
|
}, children: [
|
|
6949
|
-
/* @__PURE__ */ (0,
|
|
6950
|
-
/* @__PURE__ */ (0,
|
|
6951
|
-
/* @__PURE__ */ (0,
|
|
7057
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { children: [
|
|
7058
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "\u4EFB\u52A1\u540D\u79F0" }),
|
|
7059
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("input", { name: "title", maxLength: 200, required: true, autoFocus: true, placeholder: "\u4E00\u53E5\u8BDD\u8BF4\u660E\u4EA4\u4ED8\u76EE\u6807" })
|
|
6952
7060
|
] }),
|
|
6953
|
-
/* @__PURE__ */ (0,
|
|
6954
|
-
/* @__PURE__ */ (0,
|
|
6955
|
-
/* @__PURE__ */ (0,
|
|
6956
|
-
/* @__PURE__ */ (0,
|
|
6957
|
-
companions.map((item) => /* @__PURE__ */ (0,
|
|
7061
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { children: [
|
|
7062
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
|
|
7063
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("select", { name: "assignee", defaultValue: "", children: [
|
|
7064
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
|
|
7065
|
+
companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: item.id, children: [
|
|
6958
7066
|
"@",
|
|
6959
7067
|
item.name
|
|
6960
7068
|
] }, item.id))
|
|
6961
7069
|
] })
|
|
6962
7070
|
] }),
|
|
6963
|
-
/* @__PURE__ */ (0,
|
|
6964
|
-
/* @__PURE__ */ (0,
|
|
6965
|
-
/* @__PURE__ */ (0,
|
|
7071
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "is-wide", children: [
|
|
7072
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
|
|
7073
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("textarea", { name: "description", maxLength: 8e3, rows: 5, placeholder: "\u8865\u5145\u80CC\u666F\u3001\u4EA4\u4ED8\u7269\u548C\u5B8C\u6210\u6761\u4EF6" })
|
|
6966
7074
|
] }),
|
|
6967
|
-
/* @__PURE__ */ (0,
|
|
6968
|
-
/* @__PURE__ */ (0,
|
|
6969
|
-
/* @__PURE__ */ (0,
|
|
7075
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "is-wide", children: [
|
|
7076
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "\u9A8C\u6536\u6E05\u5355 \xB7 \u53EF\u9009" }),
|
|
7077
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("textarea", { name: "acceptanceCriteria", rows: 3, maxLength: 1e4, placeholder: "\u6BCF\u884C\u4E00\u9879\u53EF\u6838\u9A8C\u4EA4\u4ED8\uFF0C\u6700\u591A 20 \u9879" })
|
|
6970
7078
|
] }),
|
|
6971
|
-
/* @__PURE__ */ (0,
|
|
6972
|
-
/* @__PURE__ */ (0,
|
|
6973
|
-
/* @__PURE__ */ (0,
|
|
7079
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "is-wide", children: [
|
|
7080
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "\u72EC\u5360\u8D44\u6E90 \xB7 \u53EF\u9009" }),
|
|
7081
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("textarea", { name: "resourceKeys", rows: 2, maxLength: 2400, placeholder: "\u6BCF\u884C\u4E00\u4E2A\u4E00\u81F4\u7684\u8D44\u6E90\u6807\u8BC6\uFF0C\u4F8B\u5982 repo:team/api\uFF1B\u76F8\u540C\u8D44\u6E90\u4E0D\u4F1A\u540C\u65F6\u6267\u884C" })
|
|
6974
7082
|
] }),
|
|
6975
|
-
/* @__PURE__ */ (0,
|
|
6976
|
-
/* @__PURE__ */ (0,
|
|
6977
|
-
/* @__PURE__ */ (0,
|
|
6978
|
-
/* @__PURE__ */ (0,
|
|
6979
|
-
/* @__PURE__ */ (0,
|
|
6980
|
-
/* @__PURE__ */ (0,
|
|
6981
|
-
/* @__PURE__ */ (0,
|
|
7083
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { children: [
|
|
7084
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "\u4F18\u5148\u7EA7" }),
|
|
7085
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("select", { name: "priority", defaultValue: "normal", children: [
|
|
7086
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "low", children: "\u4F4E" }),
|
|
7087
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "normal", children: "\u666E\u901A" }),
|
|
7088
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "high", children: "\u9AD8" }),
|
|
7089
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "urgent", children: "\u7D27\u6025" })
|
|
6982
7090
|
] })
|
|
6983
7091
|
] }),
|
|
6984
|
-
/* @__PURE__ */ (0,
|
|
6985
|
-
/* @__PURE__ */ (0,
|
|
6986
|
-
/* @__PURE__ */ (0,
|
|
6987
|
-
/* @__PURE__ */ (0,
|
|
6988
|
-
companions.map((item) => /* @__PURE__ */ (0,
|
|
7092
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { children: [
|
|
7093
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
|
|
7094
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("select", { name: "reviewer", defaultValue: "", children: [
|
|
7095
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
|
|
7096
|
+
companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: item.id, children: [
|
|
6989
7097
|
"@",
|
|
6990
7098
|
item.name
|
|
6991
7099
|
] }, item.id))
|
|
6992
7100
|
] })
|
|
6993
7101
|
] }),
|
|
6994
|
-
/* @__PURE__ */ (0,
|
|
6995
|
-
/* @__PURE__ */ (0,
|
|
7102
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "dsh-partner-task-form-dependencies is-wide", children: [
|
|
7103
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { children: [
|
|
6996
7104
|
"\u4F9D\u8D56\u4EFB\u52A1 ",
|
|
6997
|
-
/* @__PURE__ */ (0,
|
|
7105
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("small", { children: "\u53EF\u9009" })
|
|
6998
7106
|
] }),
|
|
6999
|
-
dependencyOptions.length > 0 ? /* @__PURE__ */ (0,
|
|
7000
|
-
/* @__PURE__ */ (0,
|
|
7001
|
-
/* @__PURE__ */ (0,
|
|
7002
|
-
/* @__PURE__ */ (0,
|
|
7003
|
-
/* @__PURE__ */ (0,
|
|
7004
|
-
] }, item.id)) }) : /* @__PURE__ */ (0,
|
|
7005
|
-
/* @__PURE__ */ (0,
|
|
7107
|
+
dependencyOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: dependencyOptions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { children: [
|
|
7108
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("input", { type: "checkbox", name: "dependencyTaskId", value: item.id }),
|
|
7109
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("i", {}),
|
|
7110
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: item.title }),
|
|
7111
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("small", { children: statusLabel(item.status) })
|
|
7112
|
+
] }, item.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: "\u5F53\u524D\u6CA1\u6709\u53EF\u9009\u7684\u672A\u5B8C\u6210\u4EFB\u52A1" }),
|
|
7113
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("small", { children: "\u53EF\u4EE5\u9009\u62E9\u591A\u4E2A\uFF1B\u7559\u7A7A\u8868\u793A\u8BE5\u4EFB\u52A1\u4E0D\u4F9D\u8D56\u5176\u4ED6\u4EFB\u52A1\u3002" })
|
|
7006
7114
|
] }),
|
|
7007
|
-
/* @__PURE__ */ (0,
|
|
7008
|
-
/* @__PURE__ */ (0,
|
|
7009
|
-
/* @__PURE__ */ (0,
|
|
7010
|
-
/* @__PURE__ */ (0,
|
|
7011
|
-
/* @__PURE__ */ (0,
|
|
7115
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "is-wide", children: [
|
|
7116
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "\u521B\u5EFA\u540E\u6267\u884C" }),
|
|
7117
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("select", { name: "submission", defaultValue: "run", children: [
|
|
7118
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "run", children: "\u5DF2\u6307\u5B9A\u8D1F\u8D23\u4EBA\u5219\u81EA\u52A8\u6392\u961F\uFF0C\u7B49\u5F85\u4F9D\u8D56\u5B8C\u6210\u540E\u6267\u884C" }),
|
|
7119
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "plan", children: "\u4EC5\u89C4\u5212\uFF0C\u7A0D\u540E\u624B\u52A8\u63D0\u4EA4" })
|
|
7012
7120
|
] })
|
|
7013
7121
|
] }),
|
|
7014
|
-
error && /* @__PURE__ */ (0,
|
|
7015
|
-
/* @__PURE__ */ (0,
|
|
7016
|
-
/* @__PURE__ */ (0,
|
|
7017
|
-
/* @__PURE__ */ (0,
|
|
7018
|
-
/* @__PURE__ */ (0,
|
|
7122
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(WorkspaceNotice, { children: error }),
|
|
7123
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("footer", { children: [
|
|
7124
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
7125
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
7126
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_dsh_client_ui_primitives13.IconPlusOutline16, { size: 14 }),
|
|
7019
7127
|
busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u4EFB\u52A1"
|
|
7020
7128
|
] })
|
|
7021
7129
|
] })
|
|
@@ -7053,15 +7161,15 @@ function delegationState(value, blockers = 0) {
|
|
|
7053
7161
|
}
|
|
7054
7162
|
|
|
7055
7163
|
// src/ui/requirement-board.tsx
|
|
7056
|
-
var
|
|
7164
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
7057
7165
|
function RequirementBoard({ initialTaskId, openRequest } = {}) {
|
|
7058
|
-
const [board, setBoard] = (0,
|
|
7059
|
-
const [directory, setDirectory] = (0,
|
|
7060
|
-
const [loading, setLoading] = (0,
|
|
7061
|
-
const [selected, setSelected] = (0,
|
|
7062
|
-
const [creating, setCreating] = (0,
|
|
7063
|
-
const [query, setQuery] = (0,
|
|
7064
|
-
(0,
|
|
7166
|
+
const [board, setBoard] = (0, import_react30.useState)({ tasks: [], activities: [], requirements: [] });
|
|
7167
|
+
const [directory, setDirectory] = (0, import_react30.useState)([]);
|
|
7168
|
+
const [loading, setLoading] = (0, import_react30.useState)(true), [error, setError] = (0, import_react30.useState)();
|
|
7169
|
+
const [selected, setSelected] = (0, import_react30.useState)(), [detailId, setDetailId] = (0, import_react30.useState)();
|
|
7170
|
+
const [creating, setCreating] = (0, import_react30.useState)(false), [archived, setArchived] = (0, import_react30.useState)(false);
|
|
7171
|
+
const [query, setQuery] = (0, import_react30.useState)(""), [limit, setLimit] = (0, import_react30.useState)(24);
|
|
7172
|
+
(0, import_react30.useEffect)(() => {
|
|
7065
7173
|
if (initialTaskId) {
|
|
7066
7174
|
setSelected(void 0);
|
|
7067
7175
|
setDetailId(void 0);
|
|
@@ -7082,7 +7190,7 @@ function RequirementBoard({ initialTaskId, openRequest } = {}) {
|
|
|
7082
7190
|
setLoading(false);
|
|
7083
7191
|
}, !selected);
|
|
7084
7192
|
const requirements = board.requirements ?? [];
|
|
7085
|
-
const groups = (0,
|
|
7193
|
+
const groups = (0, import_react30.useMemo)(() => {
|
|
7086
7194
|
const result = /* @__PURE__ */ new Map();
|
|
7087
7195
|
for (const task of board.tasks) {
|
|
7088
7196
|
const id = task.requirementId ?? "legacy";
|
|
@@ -7094,110 +7202,110 @@ function RequirementBoard({ initialTaskId, openRequest } = {}) {
|
|
|
7094
7202
|
}, [board.tasks]);
|
|
7095
7203
|
const visible = requirements.filter((r) => r.status === "done" === archived && [r.title, r.description, directory.find((c) => c.id === r.ownerCompanionId)?.name].some((v) => v?.toLocaleLowerCase().includes(query.trim().toLocaleLowerCase()))).sort((a, b) => b.updatedAt - a.updatedAt);
|
|
7096
7204
|
const detail = requirements.find((r) => r.id === detailId);
|
|
7097
|
-
if (selected) return /* @__PURE__ */ (0,
|
|
7205
|
+
if (selected) return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(RequirementTasksPanel, { requirementId: selected, back: () => {
|
|
7098
7206
|
setSelected(void 0);
|
|
7099
7207
|
void load2();
|
|
7100
7208
|
} }, selected);
|
|
7101
|
-
return /* @__PURE__ */ (0,
|
|
7102
|
-
/* @__PURE__ */ (0,
|
|
7103
|
-
/* @__PURE__ */ (0,
|
|
7209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
|
|
7210
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(WorkspaceHero, { eyebrow: "Shared workspace", title: "\u9700\u6C42\u770B\u677F", detail: "\u6309\u9700\u6C42\u7EC4\u7EC7\u5DE5\u4F5C\uFF0C\u5B50\u4EFB\u52A1\u72EC\u7ACB\u63A8\u8FDB\uFF0C\u6574\u4F53\u5B8C\u6210\u540E\u7EDF\u4E00\u6C47\u603B\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
|
|
7211
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_dsh_client_ui_primitives14.IconPlusOutline16, { size: 15 }),
|
|
7104
7212
|
"\u65B0\u9700\u6C42"
|
|
7105
7213
|
] }) }),
|
|
7106
|
-
error && /* @__PURE__ */ (0,
|
|
7214
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(WorkspaceNotice, { children: [
|
|
7107
7215
|
error,
|
|
7108
|
-
/* @__PURE__ */ (0,
|
|
7216
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { type: "button", onClick: () => {
|
|
7109
7217
|
void load2();
|
|
7110
7218
|
}, children: "\u91CD\u8BD5" })
|
|
7111
7219
|
] }),
|
|
7112
|
-
/* @__PURE__ */ (0,
|
|
7113
|
-
/* @__PURE__ */ (0,
|
|
7220
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "dsh-partner-requirement-toolbar", children: [
|
|
7221
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u9700\u6C42\u8303\u56F4", children: [false, true].map((value) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("button", { type: "button", "aria-pressed": archived === value, className: archived === value ? "is-active" : "", onClick: () => {
|
|
7114
7222
|
setArchived(value);
|
|
7115
7223
|
setLimit(24);
|
|
7116
7224
|
}, children: [
|
|
7117
7225
|
value ? "\u5DF2\u5F52\u6863" : "\u8FDB\u884C\u4E2D",
|
|
7118
|
-
/* @__PURE__ */ (0,
|
|
7226
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("b", { children: requirements.filter((r) => r.status === "done" === value).length })
|
|
7119
7227
|
] }, String(value))) }),
|
|
7120
|
-
/* @__PURE__ */ (0,
|
|
7121
|
-
/* @__PURE__ */ (0,
|
|
7122
|
-
/* @__PURE__ */ (0,
|
|
7123
|
-
/* @__PURE__ */ (0,
|
|
7228
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "dsh-partner-board-search", children: [
|
|
7229
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u9700\u6C42" }),
|
|
7230
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_dsh_client_ui_primitives14.IconSearchOutline16, { size: 16 }) }),
|
|
7231
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("input", { placeholder: "\u641C\u7D22\u9700\u6C42\u6216\u8D1F\u8D23\u4EBA", value: query, onChange: (event) => {
|
|
7124
7232
|
setQuery(event.target.value);
|
|
7125
7233
|
setLimit(24);
|
|
7126
7234
|
} })
|
|
7127
7235
|
] })
|
|
7128
7236
|
] }),
|
|
7129
|
-
loading ? /* @__PURE__ */ (0,
|
|
7130
|
-
/* @__PURE__ */ (0,
|
|
7237
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CollectionSkeleton, { rows: 4 }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
7238
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "dsh-partner-requirement-grid", children: visible.slice(0, limit).map((item) => {
|
|
7131
7239
|
const tasks = groups.get(item.id) ?? [], total = item.status === "done" ? item.results?.length ?? tasks.length : tasks.length;
|
|
7132
7240
|
const done = item.status === "done" ? total : tasks.filter((t) => t.status === "done").length;
|
|
7133
7241
|
const blocked = tasks.filter((t) => t.status === "blocked").length;
|
|
7134
|
-
return /* @__PURE__ */ (0,
|
|
7135
|
-
/* @__PURE__ */ (0,
|
|
7136
|
-
/* @__PURE__ */ (0,
|
|
7137
|
-
/* @__PURE__ */ (0,
|
|
7138
|
-
/* @__PURE__ */ (0,
|
|
7242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("article", { className: "dsh-partner-requirement-card", children: [
|
|
7243
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("button", { type: "button", className: "dsh-partner-requirement-open", onClick: () => item.status === "done" ? setDetailId(item.id) : setSelected(item.id), children: [
|
|
7244
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "dsh-partner-requirement-meta", children: [
|
|
7245
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: requirementStatus(item) }),
|
|
7246
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("small", { children: directory.find((c) => c.id === item.ownerCompanionId)?.name ?? "\u4EBA\u5DE5\u6536\u5C3E" })
|
|
7139
7247
|
] }),
|
|
7140
|
-
/* @__PURE__ */ (0,
|
|
7141
|
-
/* @__PURE__ */ (0,
|
|
7142
|
-
/* @__PURE__ */ (0,
|
|
7143
|
-
/* @__PURE__ */ (0,
|
|
7144
|
-
/* @__PURE__ */ (0,
|
|
7248
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("strong", { title: item.title, children: item.title }),
|
|
7249
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { children: item.summary || item.description || "\u5C1A\u672A\u8865\u5145\u9700\u6C42\u8BF4\u660E" }),
|
|
7250
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "dsh-partner-requirement-progress", role: "progressbar", "aria-label": "\u5B50\u4EFB\u52A1\u9A8C\u6536\u8FDB\u5EA6", "aria-valuemin": 0, "aria-valuemax": Math.max(total, 1), "aria-valuenow": done, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("i", { style: { width: `${total ? done / total * 100 : 0}%` } }) }),
|
|
7251
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "dsh-partner-requirement-meta", children: [
|
|
7252
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("small", { children: [
|
|
7145
7253
|
done,
|
|
7146
7254
|
" / ",
|
|
7147
7255
|
total,
|
|
7148
7256
|
" \u5DF2\u9A8C\u6536",
|
|
7149
7257
|
blocked ? ` \xB7 ${blocked} \u53D7\u963B` : ""
|
|
7150
7258
|
] }),
|
|
7151
|
-
/* @__PURE__ */ (0,
|
|
7259
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_dsh_client_ui_primitives14.IconChevronRightOutline14, { size: 14 })
|
|
7152
7260
|
] })
|
|
7153
7261
|
] }),
|
|
7154
|
-
/* @__PURE__ */ (0,
|
|
7155
|
-
/* @__PURE__ */ (0,
|
|
7262
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("footer", { children: [
|
|
7263
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("small", { children: [
|
|
7156
7264
|
new Date(item.updatedAt).toLocaleDateString(),
|
|
7157
7265
|
" \u66F4\u65B0"
|
|
7158
7266
|
] }),
|
|
7159
|
-
/* @__PURE__ */ (0,
|
|
7267
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { type: "button", onClick: () => setDetailId(item.id), "aria-haspopup": "dialog", children: item.lastError ? "\u67E5\u770B\u5F02\u5E38" : "\u9700\u6C42\u8BE6\u60C5" })
|
|
7160
7268
|
] })
|
|
7161
7269
|
] }, item.id);
|
|
7162
7270
|
}) }),
|
|
7163
|
-
!visible.length && /* @__PURE__ */ (0,
|
|
7164
|
-
/* @__PURE__ */ (0,
|
|
7165
|
-
/* @__PURE__ */ (0,
|
|
7271
|
+
!visible.length && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "dsh-partner-collection-empty", children: [
|
|
7272
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("strong", { children: query ? "\u6CA1\u6709\u5339\u914D\u7684\u9700\u6C42" : archived ? "\u8FD8\u6CA1\u6709\u5F52\u6863\u9700\u6C42" : "\u4ECE\u4E00\u4E2A\u9700\u6C42\u5F00\u59CB" }),
|
|
7273
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { children: archived ? "\u5B50\u4EFB\u52A1\u5168\u90E8\u9A8C\u6536\u901A\u8FC7\u3001\u5B8C\u6210\u603B\u7ED3\u540E\uFF0C\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002" : "\u5148\u5199\u6E05\u4EA4\u4ED8\u76EE\u6807\uFF0C\u518D\u5B89\u6392\u8D1F\u8D23\u4EBA\u548C\u5B50\u4EFB\u52A1\u3002" })
|
|
7166
7274
|
] }),
|
|
7167
|
-
visible.length > limit && /* @__PURE__ */ (0,
|
|
7275
|
+
visible.length > limit && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("button", { type: "button", onClick: () => setLimit((n) => n + 24), children: [
|
|
7168
7276
|
"\u663E\u793A\u66F4\u591A\u9700\u6C42 \xB7 \u8FD8\u6709 ",
|
|
7169
7277
|
visible.length - limit,
|
|
7170
7278
|
" \u9879"
|
|
7171
7279
|
] }),
|
|
7172
|
-
!archived && Boolean(groups.get("legacy")?.length) && /* @__PURE__ */ (0,
|
|
7280
|
+
!archived && Boolean(groups.get("legacy")?.length) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("button", { type: "button", className: "dsh-partner-requirement-legacy", onClick: () => setSelected("legacy"), children: [
|
|
7173
7281
|
"\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1 ",
|
|
7174
|
-
/* @__PURE__ */ (0,
|
|
7175
|
-
/* @__PURE__ */ (0,
|
|
7176
|
-
/* @__PURE__ */ (0,
|
|
7282
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("b", { children: groups.get("legacy").length }),
|
|
7283
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: "\u4FDD\u7559\u539F\u8BB0\u5F55\uFF0C\u4E0D\u81EA\u52A8\u5408\u5E76" }),
|
|
7284
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_dsh_client_ui_primitives14.IconChevronRightOutline14, { size: 14 })
|
|
7177
7285
|
] })
|
|
7178
7286
|
] }),
|
|
7179
|
-
creating && /* @__PURE__ */ (0,
|
|
7287
|
+
creating && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u9700\u6C42", detail: "\u4E00\u4E2A\u9700\u6C42\u5BF9\u5E94\u4E00\u4EFD\u6700\u7EC8\u4EA4\u4ED8\uFF0C\u7531\u8D1F\u8D23\u4EBA\u7EDF\u4E00\u6536\u5C3E\u3002", close: () => setCreating(false), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(RequirementForm, { directory, close: () => setCreating(false), created: async (item) => {
|
|
7180
7288
|
setCreating(false);
|
|
7181
7289
|
await load2();
|
|
7182
7290
|
setSelected(item.id);
|
|
7183
7291
|
} }) }),
|
|
7184
|
-
detail && /* @__PURE__ */ (0,
|
|
7185
|
-
initialTaskId && /* @__PURE__ */ (0,
|
|
7292
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(WorkspaceDialog, { title: detail.title, eyebrow: "\u9700\u6C42\u8BE6\u60C5", detail: requirementStatus(detail), close: () => setDetailId(void 0), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(RequirementDetail, { item: detail, tasks: groups.get(detail.id) ?? [], directory, changed: load2, close: () => setDetailId(void 0) }, detail.id) }),
|
|
7293
|
+
initialTaskId && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(RequirementTasksPanel, { initialTaskId, openRequest, detailOnly: true })
|
|
7186
7294
|
] });
|
|
7187
7295
|
}
|
|
7188
7296
|
|
|
7189
7297
|
// src/ui/schedule-panel.tsx
|
|
7190
|
-
var
|
|
7298
|
+
var import_react31 = require("react");
|
|
7191
7299
|
var import_dsh_client_ui_primitives15 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
7192
|
-
var
|
|
7300
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
7193
7301
|
function SchedulePanel({ companions }) {
|
|
7194
|
-
const [schedules, setSchedules] = (0,
|
|
7195
|
-
const [runs, setRuns] = (0,
|
|
7196
|
-
const [creating, setCreating] = (0,
|
|
7197
|
-
const [busy, setBusy] = (0,
|
|
7198
|
-
const [loading, setLoading] = (0,
|
|
7199
|
-
const [error, setError] = (0,
|
|
7200
|
-
const load2 = (0,
|
|
7302
|
+
const [schedules, setSchedules] = (0, import_react31.useState)([]);
|
|
7303
|
+
const [runs, setRuns] = (0, import_react31.useState)([]);
|
|
7304
|
+
const [creating, setCreating] = (0, import_react31.useState)(false);
|
|
7305
|
+
const [busy, setBusy] = (0, import_react31.useState)();
|
|
7306
|
+
const [loading, setLoading] = (0, import_react31.useState)(true);
|
|
7307
|
+
const [error, setError] = (0, import_react31.useState)();
|
|
7308
|
+
const load2 = (0, import_react31.useCallback)(async () => {
|
|
7201
7309
|
try {
|
|
7202
7310
|
const value = await api("/schedules");
|
|
7203
7311
|
setSchedules(value.schedules);
|
|
@@ -7209,7 +7317,7 @@ function SchedulePanel({ companions }) {
|
|
|
7209
7317
|
setLoading(false);
|
|
7210
7318
|
}
|
|
7211
7319
|
}, []);
|
|
7212
|
-
(0,
|
|
7320
|
+
(0, import_react31.useEffect)(() => {
|
|
7213
7321
|
void load2();
|
|
7214
7322
|
}, [load2]);
|
|
7215
7323
|
const update = async (entry, value) => {
|
|
@@ -7245,65 +7353,65 @@ function SchedulePanel({ companions }) {
|
|
|
7245
7353
|
setBusy(void 0);
|
|
7246
7354
|
}
|
|
7247
7355
|
};
|
|
7248
|
-
return /* @__PURE__ */ (0,
|
|
7249
|
-
/* @__PURE__ */ (0,
|
|
7250
|
-
/* @__PURE__ */ (0,
|
|
7356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "dsh-partner-feature-page", children: [
|
|
7357
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(WorkspaceHero, { eyebrow: "Ephemeral automation", title: "\u4F19\u4F34\u5B9A\u65F6\u4EFB\u52A1", detail: "\u7531\u6307\u5B9A\u4F19\u4F34\u5728\u9694\u79BB\u4E34\u65F6\u4F1A\u8BDD\u4E2D\u6267\u884C\uFF1B\u9ED8\u8BA4\u5B8C\u6210\u5373\u9500\u6BC1\uFF0C\u907F\u514D\u957F\u671F\u4F1A\u8BDD\u88AB\u540E\u53F0\u4EFB\u52A1\u6C61\u67D3\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
7358
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("button", { type: "button", disabled: loading, onClick: () => {
|
|
7251
7359
|
void load2();
|
|
7252
7360
|
}, children: [
|
|
7253
|
-
/* @__PURE__ */ (0,
|
|
7361
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_dsh_client_ui_primitives15.IconRefreshOutline16, { size: 15 }),
|
|
7254
7362
|
"\u5237\u65B0"
|
|
7255
7363
|
] }),
|
|
7256
|
-
/* @__PURE__ */ (0,
|
|
7257
|
-
/* @__PURE__ */ (0,
|
|
7364
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
|
|
7365
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_dsh_client_ui_primitives15.IconPlusOutline16, { size: 15 }),
|
|
7258
7366
|
"\u65B0\u8BA1\u5212"
|
|
7259
7367
|
] })
|
|
7260
7368
|
] }) }),
|
|
7261
|
-
error && /* @__PURE__ */ (0,
|
|
7262
|
-
creating && /* @__PURE__ */ (0,
|
|
7263
|
-
/* @__PURE__ */ (0,
|
|
7264
|
-
/* @__PURE__ */ (0,
|
|
7369
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(WorkspaceNotice, { children: error }),
|
|
7370
|
+
creating && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u5B9A\u65F6\u4EFB\u52A1", detail: "\u9009\u62E9\u6267\u884C\u4F19\u4F34\u3001\u8FD0\u884C\u9891\u7387\u548C\u4F1A\u8BDD\u4FDD\u7559\u7B56\u7565\u3002\u8BA1\u5212\u521B\u5EFA\u540E\u53EF\u4EE5\u968F\u65F6\u505C\u7528\u6216\u7ACB\u5373\u6267\u884C\u3002", close: () => setCreating(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ScheduleForm, { companions, close: () => setCreating(false), changed: load2 }) }),
|
|
7371
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(WorkspaceBlock, { title: "\u6267\u884C\u8BA1\u5212", detail: `${schedules.filter((item) => item.enabled).length} \u4E2A\u542F\u7528`, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CollectionSkeleton, { rows: 3 }) : schedules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u5B9A\u65F6\u4EFB\u52A1", detail: "\u521B\u5EFA\u8BA1\u5212\u540E\uFF0C\u4F19\u4F34\u4F1A\u6309\u8BBE\u5B9A\u5728\u72EC\u7ACB\u4F1A\u8BDD\u4E2D\u6267\u884C\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
|
|
7372
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_dsh_client_ui_primitives15.IconPlusOutline16, { size: 14 }),
|
|
7265
7373
|
"\u521B\u5EFA\u7B2C\u4E00\u4E2A\u8BA1\u5212"
|
|
7266
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
7267
|
-
/* @__PURE__ */ (0,
|
|
7268
|
-
/* @__PURE__ */ (0,
|
|
7269
|
-
/* @__PURE__ */ (0,
|
|
7270
|
-
/* @__PURE__ */ (0,
|
|
7271
|
-
/* @__PURE__ */ (0,
|
|
7374
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "dsh-partner-schedule-list", children: schedules.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("article", { children: [
|
|
7375
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { children: [
|
|
7376
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("strong", { children: entry.title }),
|
|
7377
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: entry.prompt }),
|
|
7378
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "dsh-partner-schedule-meta", children: [
|
|
7379
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("em", { children: [
|
|
7272
7380
|
"@",
|
|
7273
7381
|
companionName(companions, entry.companionId)
|
|
7274
7382
|
] }),
|
|
7275
|
-
/* @__PURE__ */ (0,
|
|
7276
|
-
/* @__PURE__ */ (0,
|
|
7383
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("em", { children: scheduleLabel(entry) }),
|
|
7384
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("em", { children: [
|
|
7277
7385
|
"\u4E0B\u6B21 ",
|
|
7278
7386
|
new Date(entry.nextRunAt).toLocaleString()
|
|
7279
7387
|
] }),
|
|
7280
|
-
/* @__PURE__ */ (0,
|
|
7388
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("em", { children: entry.destroySessionAfterRun ? "\u6267\u884C\u540E\u9500\u6BC1" : "\u4FDD\u7559\u4F1A\u8BDD" })
|
|
7281
7389
|
] })
|
|
7282
7390
|
] }),
|
|
7283
|
-
/* @__PURE__ */ (0,
|
|
7391
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("button", { type: "button", className: "dsh-partner-feature-switch", "data-on": entry.enabled, "aria-pressed": entry.enabled, disabled: busy === entry.id, onClick: () => {
|
|
7284
7392
|
void update(entry, { enabled: !entry.enabled });
|
|
7285
|
-
}, children: /* @__PURE__ */ (0,
|
|
7286
|
-
/* @__PURE__ */ (0,
|
|
7393
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("i", {}) }),
|
|
7394
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("button", { type: "button", disabled: busy === entry.id, onClick: () => {
|
|
7287
7395
|
void run(entry);
|
|
7288
7396
|
}, children: [
|
|
7289
|
-
/* @__PURE__ */ (0,
|
|
7397
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_dsh_client_ui_primitives15.IconPlayOutline16, { size: 14 }),
|
|
7290
7398
|
busy === entry.id ? "\u6267\u884C\u4E2D\u2026" : "\u7ACB\u5373\u6267\u884C"
|
|
7291
7399
|
] }),
|
|
7292
|
-
/* @__PURE__ */ (0,
|
|
7400
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("button", { type: "button", className: "is-icon", disabled: busy === entry.id, onClick: () => {
|
|
7293
7401
|
void remove(entry);
|
|
7294
|
-
}, "aria-label": `\u5220\u9664 ${entry.title}`, children: /* @__PURE__ */ (0,
|
|
7402
|
+
}, "aria-label": `\u5220\u9664 ${entry.title}`, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_dsh_client_ui_primitives15.IconTrashOutline16, { size: 14 }) })
|
|
7295
7403
|
] }, entry.id)) }) }),
|
|
7296
|
-
/* @__PURE__ */ (0,
|
|
7297
|
-
/* @__PURE__ */ (0,
|
|
7298
|
-
/* @__PURE__ */ (0,
|
|
7299
|
-
/* @__PURE__ */ (0,
|
|
7300
|
-
/* @__PURE__ */ (0,
|
|
7404
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(WorkspaceBlock, { title: "\u6700\u8FD1\u8FD0\u884C", detail: "\u4FDD\u7559\u6700\u8FD1\u7684\u72B6\u6001\u4E0E\u7ED3\u679C\u6458\u8981", children: [
|
|
7405
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "dsh-partner-run-list", children: runs.map((run2) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("article", { "data-status": run2.status, children: [
|
|
7406
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("i", {}),
|
|
7407
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { children: [
|
|
7408
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("strong", { children: [
|
|
7301
7409
|
schedules.find((item) => item.id === run2.sourceId)?.title ?? "\u5DF2\u5220\u9664\u8BA1\u5212",
|
|
7302
7410
|
" \xB7 @",
|
|
7303
7411
|
companionName(companions, run2.ownerCompanionId)
|
|
7304
7412
|
] }),
|
|
7305
|
-
/* @__PURE__ */ (0,
|
|
7306
|
-
/* @__PURE__ */ (0,
|
|
7413
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: run2.error || run2.outputSummary || "\u7B49\u5F85\u7ED3\u679C" }),
|
|
7414
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("small", { children: [
|
|
7307
7415
|
new Date(run2.startedAt).toLocaleString(),
|
|
7308
7416
|
" \xB7 ",
|
|
7309
7417
|
run2.status,
|
|
@@ -7312,14 +7420,14 @@ function SchedulePanel({ companions }) {
|
|
|
7312
7420
|
] })
|
|
7313
7421
|
] })
|
|
7314
7422
|
] }, run2.id)) }),
|
|
7315
|
-
!loading && runs.length === 0 && /* @__PURE__ */ (0,
|
|
7423
|
+
!loading && runs.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u6267\u884C\u8BB0\u5F55", detail: "\u8BA1\u5212\u7B2C\u4E00\u6B21\u6267\u884C\u540E\uFF0C\u7ED3\u679C\u548C\u8017\u65F6\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002" })
|
|
7316
7424
|
] })
|
|
7317
7425
|
] });
|
|
7318
7426
|
}
|
|
7319
7427
|
function ScheduleForm({ companions, close, changed: changed2 }) {
|
|
7320
|
-
const [kind, setKind] = (0,
|
|
7321
|
-
const [error, setError] = (0,
|
|
7322
|
-
const [busy, setBusy] = (0,
|
|
7428
|
+
const [kind, setKind] = (0, import_react31.useState)("interval");
|
|
7429
|
+
const [error, setError] = (0, import_react31.useState)();
|
|
7430
|
+
const [busy, setBusy] = (0, import_react31.useState)(false);
|
|
7323
7431
|
const submit = async (event) => {
|
|
7324
7432
|
event.preventDefault();
|
|
7325
7433
|
const data = new FormData(event.currentTarget);
|
|
@@ -7336,18 +7444,18 @@ function ScheduleForm({ companions, close, changed: changed2 }) {
|
|
|
7336
7444
|
setBusy(false);
|
|
7337
7445
|
}
|
|
7338
7446
|
};
|
|
7339
|
-
return /* @__PURE__ */ (0,
|
|
7447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("form", { className: "dsh-partner-schedule-form", "aria-busy": busy, onSubmit: (event) => {
|
|
7340
7448
|
void submit(event);
|
|
7341
7449
|
}, children: [
|
|
7342
|
-
/* @__PURE__ */ (0,
|
|
7343
|
-
/* @__PURE__ */ (0,
|
|
7344
|
-
/* @__PURE__ */ (0,
|
|
7450
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { children: [
|
|
7451
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "\u8BA1\u5212\u540D\u79F0" }),
|
|
7452
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("input", { name: "title", required: true, maxLength: 160, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u6BCF\u65E5\u6574\u7406\u9879\u76EE\u53D8\u5316" })
|
|
7345
7453
|
] }),
|
|
7346
|
-
/* @__PURE__ */ (0,
|
|
7347
|
-
/* @__PURE__ */ (0,
|
|
7348
|
-
/* @__PURE__ */ (0,
|
|
7349
|
-
/* @__PURE__ */ (0,
|
|
7350
|
-
companions.map((companion) => /* @__PURE__ */ (0,
|
|
7454
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { children: [
|
|
7455
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "\u6267\u884C\u4F19\u4F34" }),
|
|
7456
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("select", { name: "companionId", required: true, defaultValue: companions[0]?.id ?? "", children: [
|
|
7457
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: "", disabled: true, children: "\u9009\u62E9\u4F19\u4F34" }),
|
|
7458
|
+
companions.map((companion) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("option", { value: companion.id, children: [
|
|
7351
7459
|
"@",
|
|
7352
7460
|
companion.name,
|
|
7353
7461
|
" \xB7 ",
|
|
@@ -7355,51 +7463,51 @@ function ScheduleForm({ companions, close, changed: changed2 }) {
|
|
|
7355
7463
|
] }, companion.id))
|
|
7356
7464
|
] })
|
|
7357
7465
|
] }),
|
|
7358
|
-
/* @__PURE__ */ (0,
|
|
7359
|
-
/* @__PURE__ */ (0,
|
|
7360
|
-
/* @__PURE__ */ (0,
|
|
7466
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { className: "is-wide", children: [
|
|
7467
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "\u6267\u884C\u5185\u5BB9" }),
|
|
7468
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("textarea", { name: "prompt", required: true, maxLength: 12e3, rows: 5, placeholder: "\u660E\u786E\u8BF4\u660E\u8981\u68C0\u67E5\u3001\u6574\u7406\u6216\u5B8C\u6210\u4EC0\u4E48\uFF0C\u4EE5\u53CA\u5E0C\u671B\u8FD4\u56DE\u4EC0\u4E48\u7ED3\u679C" })
|
|
7361
7469
|
] }),
|
|
7362
|
-
/* @__PURE__ */ (0,
|
|
7363
|
-
/* @__PURE__ */ (0,
|
|
7364
|
-
/* @__PURE__ */ (0,
|
|
7365
|
-
/* @__PURE__ */ (0,
|
|
7366
|
-
/* @__PURE__ */ (0,
|
|
7470
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { children: [
|
|
7471
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "\u9891\u7387" }),
|
|
7472
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("select", { value: kind, onChange: (event) => setKind(event.target.value), children: [
|
|
7473
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: "interval", children: "\u6BCF\u9694\u4E00\u6BB5\u65F6\u95F4" }),
|
|
7474
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: "daily", children: "\u6BCF\u5929\u56FA\u5B9A\u65F6\u95F4" })
|
|
7367
7475
|
] })
|
|
7368
7476
|
] }),
|
|
7369
|
-
kind === "interval" ? /* @__PURE__ */ (0,
|
|
7370
|
-
/* @__PURE__ */ (0,
|
|
7371
|
-
/* @__PURE__ */ (0,
|
|
7372
|
-
] }) : /* @__PURE__ */ (0,
|
|
7373
|
-
/* @__PURE__ */ (0,
|
|
7374
|
-
/* @__PURE__ */ (0,
|
|
7375
|
-
/* @__PURE__ */ (0,
|
|
7477
|
+
kind === "interval" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { children: [
|
|
7478
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "\u95F4\u9694\u5206\u949F" }),
|
|
7479
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("input", { name: "minutes", type: "number", min: 5, max: 43200, defaultValue: 60 })
|
|
7480
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "dsh-partner-schedule-time", children: [
|
|
7481
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { children: [
|
|
7482
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "\u5C0F\u65F6" }),
|
|
7483
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("input", { name: "hour", type: "number", min: 0, max: 23, defaultValue: 9 })
|
|
7376
7484
|
] }),
|
|
7377
|
-
/* @__PURE__ */ (0,
|
|
7378
|
-
/* @__PURE__ */ (0,
|
|
7379
|
-
/* @__PURE__ */ (0,
|
|
7485
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { children: [
|
|
7486
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "\u5206\u949F" }),
|
|
7487
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("input", { name: "minute", type: "number", min: 0, max: 59, defaultValue: 0 })
|
|
7380
7488
|
] })
|
|
7381
7489
|
] }),
|
|
7382
|
-
/* @__PURE__ */ (0,
|
|
7383
|
-
/* @__PURE__ */ (0,
|
|
7384
|
-
/* @__PURE__ */ (0,
|
|
7385
|
-
/* @__PURE__ */ (0,
|
|
7386
|
-
/* @__PURE__ */ (0,
|
|
7490
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { children: [
|
|
7491
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "\u91CD\u53E0\u7B56\u7565" }),
|
|
7492
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("select", { name: "overlapPolicy", defaultValue: "skip", children: [
|
|
7493
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: "skip", children: "\u8DF3\u8FC7\u91CD\u53E0" }),
|
|
7494
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: "queue", children: "\u6392\u961F\u6267\u884C" })
|
|
7387
7495
|
] })
|
|
7388
7496
|
] }),
|
|
7389
|
-
/* @__PURE__ */ (0,
|
|
7390
|
-
/* @__PURE__ */ (0,
|
|
7391
|
-
/* @__PURE__ */ (0,
|
|
7497
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { children: [
|
|
7498
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "\u8D85\u65F6\u5206\u949F" }),
|
|
7499
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("input", { name: "timeoutMinutes", type: "number", min: 1, max: 120, defaultValue: 10 })
|
|
7392
7500
|
] }),
|
|
7393
|
-
/* @__PURE__ */ (0,
|
|
7394
|
-
/* @__PURE__ */ (0,
|
|
7395
|
-
/* @__PURE__ */ (0,
|
|
7396
|
-
/* @__PURE__ */ (0,
|
|
7501
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { className: "dsh-partner-check is-wide", children: [
|
|
7502
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("input", { name: "retain", type: "checkbox" }),
|
|
7503
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("i", {}),
|
|
7504
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "\u6267\u884C\u540E\u4FDD\u7559\u4E34\u65F6\u4F1A\u8BDD" })
|
|
7397
7505
|
] }),
|
|
7398
|
-
error && /* @__PURE__ */ (0,
|
|
7399
|
-
/* @__PURE__ */ (0,
|
|
7400
|
-
/* @__PURE__ */ (0,
|
|
7401
|
-
/* @__PURE__ */ (0,
|
|
7402
|
-
/* @__PURE__ */ (0,
|
|
7506
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(WorkspaceNotice, { children: error }),
|
|
7507
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("footer", { children: [
|
|
7508
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
7509
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
7510
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_dsh_client_ui_primitives15.IconPlusOutline16, { size: 14 }),
|
|
7403
7511
|
busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u8BA1\u5212"
|
|
7404
7512
|
] })
|
|
7405
7513
|
] })
|
|
@@ -7413,7 +7521,7 @@ function companionName(companions, id) {
|
|
|
7413
7521
|
}
|
|
7414
7522
|
|
|
7415
7523
|
// src/ui/capability-editor.tsx
|
|
7416
|
-
var
|
|
7524
|
+
var import_react33 = require("react");
|
|
7417
7525
|
var import_dsh_client_ui_primitives17 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
7418
7526
|
|
|
7419
7527
|
// src/capabilities.ts
|
|
@@ -7433,14 +7541,14 @@ function isCompanionCapability(value) {
|
|
|
7433
7541
|
}
|
|
7434
7542
|
|
|
7435
7543
|
// src/ui/companion-access-panel.tsx
|
|
7436
|
-
var
|
|
7544
|
+
var import_react32 = require("react");
|
|
7437
7545
|
var import_dsh_client_ui_primitives16 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
7438
|
-
var
|
|
7546
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
7439
7547
|
function CompanionAccessPanel({ companionId }) {
|
|
7440
|
-
const [access, setAccess] = (0,
|
|
7441
|
-
const [busy, setBusy] = (0,
|
|
7442
|
-
const [error, setError] = (0,
|
|
7443
|
-
const load2 = (0,
|
|
7548
|
+
const [access, setAccess] = (0, import_react32.useState)({ targetIds: [], companions: [] });
|
|
7549
|
+
const [busy, setBusy] = (0, import_react32.useState)();
|
|
7550
|
+
const [error, setError] = (0, import_react32.useState)();
|
|
7551
|
+
const load2 = (0, import_react32.useCallback)(async () => {
|
|
7444
7552
|
try {
|
|
7445
7553
|
setAccess(await api(`/companions/${encodeURIComponent(companionId)}/access`));
|
|
7446
7554
|
setError(void 0);
|
|
@@ -7448,7 +7556,7 @@ function CompanionAccessPanel({ companionId }) {
|
|
|
7448
7556
|
setError(errorMessage(reason));
|
|
7449
7557
|
}
|
|
7450
7558
|
}, [companionId]);
|
|
7451
|
-
(0,
|
|
7559
|
+
(0, import_react32.useEffect)(() => {
|
|
7452
7560
|
void load2();
|
|
7453
7561
|
}, [load2]);
|
|
7454
7562
|
const toggle = async (targetId) => {
|
|
@@ -7467,38 +7575,38 @@ function CompanionAccessPanel({ companionId }) {
|
|
|
7467
7575
|
setBusy(void 0);
|
|
7468
7576
|
}
|
|
7469
7577
|
};
|
|
7470
|
-
return /* @__PURE__ */ (0,
|
|
7471
|
-
/* @__PURE__ */ (0,
|
|
7472
|
-
/* @__PURE__ */ (0,
|
|
7473
|
-
/* @__PURE__ */ (0,
|
|
7474
|
-
/* @__PURE__ */ (0,
|
|
7578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("section", { className: "dsh-partner-capability-detail dsh-partner-access", "aria-labelledby": "dsh-partner-access-title", children: [
|
|
7579
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("header", { children: [
|
|
7580
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { children: [
|
|
7581
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("small", { children: "DIRECTED ACCESS" }),
|
|
7582
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("strong", { id: "dsh-partner-access-title", children: "\u53EF\u8BBF\u95EE\u7684\u4F19\u4F34" })
|
|
7475
7583
|
] }),
|
|
7476
|
-
/* @__PURE__ */ (0,
|
|
7584
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("em", { children: [
|
|
7477
7585
|
access.targetIds.length,
|
|
7478
7586
|
" \u4F4D\u5DF2\u6388\u6743"
|
|
7479
7587
|
] })
|
|
7480
7588
|
] }),
|
|
7481
|
-
/* @__PURE__ */ (0,
|
|
7482
|
-
access.companions.length === 0 ? /* @__PURE__ */ (0,
|
|
7589
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "dsh-partner-access-note", children: "\u52FE\u9009\u540E\uFF0C\u5F53\u524D\u4F19\u4F34\u80FD\u4E86\u89E3\u5BF9\u65B9\u7684\u516C\u5F00\u80FD\u529B\uFF0C\u5E76\u5728\u4EFB\u52A1\u770B\u677F\u4E2D `@` \u5BF9\u65B9\u6267\u884C\u4EFB\u52A1\u3002\u6388\u6743\u53EA\u6CBF\u5F53\u524D\u65B9\u5411\u751F\u6548\uFF0C\u4E0D\u4F1A\u53CD\u5411\u6388\u6743\uFF0C\u4E5F\u4E0D\u4F1A\u5171\u4EAB\u4F1A\u8BDD\u3001\u8BB0\u5FC6\u3001\u6E20\u9053\u6216\u51ED\u636E\u3002" }),
|
|
7590
|
+
access.companions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u53EF\u6388\u6743\u7684\u4F19\u4F34", detail: "\u521B\u5EFA\u7B2C\u4E8C\u4F4D\u4F19\u4F34\u540E\uFF0C\u53EF\u4EE5\u5728\u8FD9\u91CC\u5EFA\u7ACB\u5355\u5411\u534F\u4F5C\u6388\u6743\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "dsh-partner-access-list", children: access.companions.map((companion) => {
|
|
7483
7591
|
const selected = access.targetIds.includes(companion.id);
|
|
7484
7592
|
const abilities = companion.capabilities.map((capability) => isCompanionCapability(capability) ? CAPABILITY_LABELS[capability] : capability);
|
|
7485
|
-
return /* @__PURE__ */ (0,
|
|
7593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("button", { type: "button", className: selected ? "is-active" : "", "aria-pressed": selected, disabled: busy === companion.id, onClick: () => {
|
|
7486
7594
|
void toggle(companion.id);
|
|
7487
7595
|
}, children: [
|
|
7488
|
-
/* @__PURE__ */ (0,
|
|
7489
|
-
/* @__PURE__ */ (0,
|
|
7490
|
-
/* @__PURE__ */ (0,
|
|
7596
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "dsh-partner-access-avatar", "aria-hidden": "true", children: initials(companion.name) }),
|
|
7597
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "dsh-partner-access-copy", children: [
|
|
7598
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("strong", { children: [
|
|
7491
7599
|
"@",
|
|
7492
7600
|
companion.name
|
|
7493
7601
|
] }),
|
|
7494
|
-
/* @__PURE__ */ (0,
|
|
7495
|
-
/* @__PURE__ */ (0,
|
|
7496
|
-
/* @__PURE__ */ (0,
|
|
7602
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("small", { children: companion.role }),
|
|
7603
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { children: companion.description || "\u672A\u586B\u5199\u4F19\u4F34\u8BF4\u660E" }),
|
|
7604
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: [...abilities, ...companion.enabledSkills.map((skill) => skill.name)].map((item) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("em", { children: item }, item)) })
|
|
7497
7605
|
] }),
|
|
7498
|
-
/* @__PURE__ */ (0,
|
|
7606
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "dsh-partner-access-check", "aria-hidden": "true", children: selected && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives16.IconCheckOutline16, { size: 15 }) })
|
|
7499
7607
|
] }, companion.id);
|
|
7500
7608
|
}) }),
|
|
7501
|
-
error && /* @__PURE__ */ (0,
|
|
7609
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(WorkspaceNotice, { children: error })
|
|
7502
7610
|
] });
|
|
7503
7611
|
}
|
|
7504
7612
|
function initials(name) {
|
|
@@ -7511,25 +7619,25 @@ function companionDraft(companion) {
|
|
|
7511
7619
|
}
|
|
7512
7620
|
|
|
7513
7621
|
// src/ui/capability-editor.tsx
|
|
7514
|
-
var
|
|
7622
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
7515
7623
|
function CapabilityEditor({ companion, presets, onChanged }) {
|
|
7516
|
-
const [form, setForm] = (0,
|
|
7517
|
-
const [modelCatalog, setModelCatalog] = (0,
|
|
7518
|
-
const [saving, setSaving] = (0,
|
|
7519
|
-
const [saved, setSaved] = (0,
|
|
7520
|
-
const [error, setError] = (0,
|
|
7521
|
-
const savingRef = (0,
|
|
7522
|
-
const mounted = (0,
|
|
7523
|
-
(0,
|
|
7624
|
+
const [form, setForm] = (0, import_react33.useState)(() => companionDraft(companion));
|
|
7625
|
+
const [modelCatalog, setModelCatalog] = (0, import_react33.useState)();
|
|
7626
|
+
const [saving, setSaving] = (0, import_react33.useState)(false);
|
|
7627
|
+
const [saved, setSaved] = (0, import_react33.useState)(false);
|
|
7628
|
+
const [error, setError] = (0, import_react33.useState)();
|
|
7629
|
+
const savingRef = (0, import_react33.useRef)(false);
|
|
7630
|
+
const mounted = (0, import_react33.useRef)(true);
|
|
7631
|
+
(0, import_react33.useEffect)(() => {
|
|
7524
7632
|
mounted.current = true;
|
|
7525
7633
|
return () => {
|
|
7526
7634
|
mounted.current = false;
|
|
7527
7635
|
};
|
|
7528
7636
|
}, []);
|
|
7529
|
-
(0,
|
|
7637
|
+
(0, import_react33.useEffect)(() => {
|
|
7530
7638
|
if (!savingRef.current) setForm(companionDraft(companion));
|
|
7531
7639
|
}, [companion.id, companion.updatedAt]);
|
|
7532
|
-
(0,
|
|
7640
|
+
(0, import_react33.useEffect)(() => {
|
|
7533
7641
|
void api("/models").then((value) => {
|
|
7534
7642
|
if (mounted.current) setModelCatalog(value);
|
|
7535
7643
|
}).catch((reason) => {
|
|
@@ -7584,69 +7692,69 @@ function CapabilityEditor({ companion, presets, onChanged }) {
|
|
|
7584
7692
|
const selectedProvider = form.provider || modelCatalog?.defaultSelection.provider || "";
|
|
7585
7693
|
const modelOptions = modelCatalog?.providers.find((item) => item.id === selectedProvider)?.models ?? [];
|
|
7586
7694
|
const currentModelMissing = Boolean(form.model) && !modelOptions.some((item) => item.id === form.model);
|
|
7587
|
-
return /* @__PURE__ */ (0,
|
|
7588
|
-
/* @__PURE__ */ (0,
|
|
7589
|
-
/* @__PURE__ */ (0,
|
|
7590
|
-
/* @__PURE__ */ (0,
|
|
7591
|
-
/* @__PURE__ */ (0,
|
|
7592
|
-
presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0,
|
|
7695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
|
|
7696
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SectionHeading, { eyebrow: "COMPOSITION", title: "\u80FD\u529B\u7EC4\u5408", detail: "\u4F19\u4F34\u58F0\u660E\u610F\u56FE\u8303\u56F4\uFF1B\u771F\u6B63\u53EF\u8C03\u7528\u7684\u5DE5\u5177\u4ECD\u6765\u81EA\u6240\u9009 Agent Preset\uFF0C\u5E76\u7EE7\u7EED\u6267\u884C\u5404\u63D2\u4EF6\u6743\u9650\u3002" }),
|
|
7697
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "dsh-partner-runtime-fields", children: [
|
|
7698
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FormField, { label: "Agent Preset", hint: "\u5DE5\u5177\u3001Skill \u4E0E\u7CFB\u7EDF\u63D0\u793A", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("select", { disabled: saving, value: form.presetId, onChange: (event) => edit({ ...form, presetId: event.target.value }), children: [
|
|
7699
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4 Preset" }),
|
|
7700
|
+
presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: item.id, children: item.name }, item.id))
|
|
7593
7701
|
] }) }),
|
|
7594
|
-
/* @__PURE__ */ (0,
|
|
7595
|
-
/* @__PURE__ */ (0,
|
|
7702
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FormField, { label: "\u6A21\u578B\u63D0\u4F9B\u65B9", hint: "\u6765\u81EA\u5F53\u524D\u5BA2\u6237\u7AEF", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("select", { disabled: saving, value: form.provider, onChange: (event) => edit({ ...form, provider: event.target.value, model: "" }), children: [
|
|
7703
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("option", { value: "", children: [
|
|
7596
7704
|
"\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
|
|
7597
7705
|
modelCatalog?.defaultSelection.provider || "\u6B63\u5728\u8BFB\u53D6"
|
|
7598
7706
|
] }),
|
|
7599
|
-
modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0,
|
|
7707
|
+
modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
|
|
7600
7708
|
] }) }),
|
|
7601
|
-
/* @__PURE__ */ (0,
|
|
7602
|
-
/* @__PURE__ */ (0,
|
|
7709
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FormField, { label: "\u6A21\u578B", hint: "\u968F\u63D0\u4F9B\u65B9\u8054\u52A8", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("select", { disabled: saving, value: form.model, onChange: (event) => edit({ ...form, model: event.target.value }), children: [
|
|
7710
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("option", { value: "", children: [
|
|
7603
7711
|
"\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
|
|
7604
7712
|
modelCatalog?.defaultSelection.model || "\u6B63\u5728\u8BFB\u53D6"
|
|
7605
7713
|
] }),
|
|
7606
|
-
currentModelMissing && /* @__PURE__ */ (0,
|
|
7714
|
+
currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("option", { value: form.model, children: [
|
|
7607
7715
|
"\u5F53\u524D\u914D\u7F6E \xB7 ",
|
|
7608
7716
|
form.model
|
|
7609
7717
|
] }),
|
|
7610
|
-
modelOptions.map((model) => /* @__PURE__ */ (0,
|
|
7718
|
+
modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
|
|
7611
7719
|
] }) })
|
|
7612
7720
|
] }),
|
|
7613
|
-
/* @__PURE__ */ (0,
|
|
7614
|
-
/* @__PURE__ */ (0,
|
|
7721
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "dsh-partner-inline-note", children: "\u8EAB\u4EFD\u4E0E\u80FD\u529B\u5728\u4E0B\u4E00\u8F6E\u6267\u884C\u524D\u66F4\u65B0\uFF1BPreset \u4E0E\u6A21\u578B\u4F5C\u4E3A\u4F1A\u8BDD\u9ED8\u8BA4\u914D\u7F6E\uFF0C\u4E0D\u8986\u76D6\u5DF2\u6709\u4F1A\u8BDD\u7684\u9009\u62E9\u3002" }),
|
|
7722
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "dsh-partner-capability-groups", children: groups.map((group) => {
|
|
7615
7723
|
const enabled = group.choices.filter((choice) => form.capabilities.includes(choice.id)).length;
|
|
7616
|
-
return /* @__PURE__ */ (0,
|
|
7617
|
-
/* @__PURE__ */ (0,
|
|
7618
|
-
/* @__PURE__ */ (0,
|
|
7619
|
-
/* @__PURE__ */ (0,
|
|
7620
|
-
/* @__PURE__ */ (0,
|
|
7621
|
-
/* @__PURE__ */ (0,
|
|
7724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("section", { className: "dsh-partner-capability-group", "aria-labelledby": `partner-capability-${group.id}`, children: [
|
|
7725
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("header", { children: [
|
|
7726
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { children: [
|
|
7727
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("small", { children: group.eyebrow }),
|
|
7728
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("strong", { id: `partner-capability-${group.id}`, children: group.title }),
|
|
7729
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: group.detail })
|
|
7622
7730
|
] }),
|
|
7623
|
-
/* @__PURE__ */ (0,
|
|
7731
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("em", { children: [
|
|
7624
7732
|
enabled,
|
|
7625
7733
|
" / ",
|
|
7626
7734
|
group.choices.length,
|
|
7627
7735
|
" \u5DF2\u542F\u7528"
|
|
7628
7736
|
] })
|
|
7629
7737
|
] }),
|
|
7630
|
-
/* @__PURE__ */ (0,
|
|
7738
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "dsh-partner-capabilities", children: group.choices.map((choice) => {
|
|
7631
7739
|
const active = form.capabilities.includes(choice.id);
|
|
7632
|
-
return /* @__PURE__ */ (0,
|
|
7633
|
-
/* @__PURE__ */ (0,
|
|
7634
|
-
/* @__PURE__ */ (0,
|
|
7635
|
-
/* @__PURE__ */ (0,
|
|
7740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("button", { type: "button", disabled: saving, className: active ? "is-active" : "", "aria-pressed": active, onClick: () => toggle(choice.id), children: [
|
|
7741
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: active && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_dsh_client_ui_primitives17.IconCheckOutline14, { size: 14 }) }),
|
|
7742
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("strong", { children: choice.title }),
|
|
7743
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("small", { children: choice.detail })
|
|
7636
7744
|
] }, choice.id);
|
|
7637
7745
|
}) })
|
|
7638
7746
|
] }, group.id);
|
|
7639
7747
|
}) }),
|
|
7640
|
-
form.capabilities.includes("skills") && companion.capabilities.includes("skills") && /* @__PURE__ */ (0,
|
|
7641
|
-
form.capabilities.includes("skills") && !companion.capabilities.includes("skills") && /* @__PURE__ */ (0,
|
|
7642
|
-
/* @__PURE__ */ (0,
|
|
7643
|
-
error && /* @__PURE__ */ (0,
|
|
7644
|
-
/* @__PURE__ */ (0,
|
|
7645
|
-
/* @__PURE__ */ (0,
|
|
7646
|
-
/* @__PURE__ */ (0,
|
|
7647
|
-
/* @__PURE__ */ (0,
|
|
7748
|
+
form.capabilities.includes("skills") && companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CompanionSkillSettings, { companionId: companion.id }),
|
|
7749
|
+
form.capabilities.includes("skills") && !companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "dsh-partner-inline-note", children: "\u5148\u5E94\u7528\u80FD\u529B\u7EC4\u5408\uFF0C\u518D\u4E3A\u5F53\u524D\u4F19\u4F34\u9009\u62E9\u5177\u4F53 Skill\u3002" }),
|
|
7750
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CompanionAccessPanel, { companionId: companion.id }),
|
|
7751
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
|
|
7752
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "dsh-partner-form-actions is-capability-save", children: [
|
|
7753
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { role: "status", "aria-live": "polite", "aria-atomic": "true", children: saved && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
7754
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_dsh_client_ui_primitives17.IconCheckOutline14, { size: 14 }),
|
|
7755
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u751F\u6548" })
|
|
7648
7756
|
] }) }),
|
|
7649
|
-
/* @__PURE__ */ (0,
|
|
7757
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "button", disabled: saving, "aria-busy": saving, onClick: () => {
|
|
7650
7758
|
void save();
|
|
7651
7759
|
}, children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u5E94\u7528\u80FD\u529B\u7EC4\u5408" })
|
|
7652
7760
|
] })
|
|
@@ -7654,28 +7762,28 @@ function CapabilityEditor({ companion, presets, onChanged }) {
|
|
|
7654
7762
|
}
|
|
7655
7763
|
|
|
7656
7764
|
// src/ui/identity-editor.tsx
|
|
7657
|
-
var
|
|
7765
|
+
var import_react34 = require("react");
|
|
7658
7766
|
var import_dsh_client_ui_primitives18 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
7659
|
-
var
|
|
7767
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
7660
7768
|
function IdentityEditor(props) {
|
|
7661
|
-
return /* @__PURE__ */ (0,
|
|
7769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(IdentityEditorForm, { ...props }, props.companion.id);
|
|
7662
7770
|
}
|
|
7663
7771
|
function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
|
|
7664
|
-
const [form, setForm] = (0,
|
|
7665
|
-
const [operation, setOperation] = (0,
|
|
7666
|
-
const [saved, setSaved] = (0,
|
|
7667
|
-
const [removed, setRemoved] = (0,
|
|
7668
|
-
const [error, setError] = (0,
|
|
7669
|
-
const [confirmationId, setConfirmationId] = (0,
|
|
7670
|
-
const locked = (0,
|
|
7671
|
-
const alive = (0,
|
|
7672
|
-
(0,
|
|
7772
|
+
const [form, setForm] = (0, import_react34.useState)(() => companionDraft(companion));
|
|
7773
|
+
const [operation, setOperation] = (0, import_react34.useState)();
|
|
7774
|
+
const [saved, setSaved] = (0, import_react34.useState)(false);
|
|
7775
|
+
const [removed, setRemoved] = (0, import_react34.useState)(false);
|
|
7776
|
+
const [error, setError] = (0, import_react34.useState)();
|
|
7777
|
+
const [confirmationId, setConfirmationId] = (0, import_react34.useState)();
|
|
7778
|
+
const locked = (0, import_react34.useRef)(false);
|
|
7779
|
+
const alive = (0, import_react34.useRef)(true);
|
|
7780
|
+
(0, import_react34.useEffect)(() => {
|
|
7673
7781
|
alive.current = true;
|
|
7674
7782
|
return () => {
|
|
7675
7783
|
alive.current = false;
|
|
7676
7784
|
};
|
|
7677
7785
|
}, []);
|
|
7678
|
-
(0,
|
|
7786
|
+
(0, import_react34.useEffect)(() => {
|
|
7679
7787
|
setForm(companionDraft(companion));
|
|
7680
7788
|
setSaved(false);
|
|
7681
7789
|
setConfirmationId(void 0);
|
|
@@ -7722,33 +7830,33 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
|
|
|
7722
7830
|
if (alive.current) setOperation(void 0);
|
|
7723
7831
|
}
|
|
7724
7832
|
};
|
|
7725
|
-
return /* @__PURE__ */ (0,
|
|
7833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("form", { className: "dsh-partner-form is-identity", "aria-busy": operation !== void 0, onSubmit: (event) => {
|
|
7726
7834
|
void submit(event);
|
|
7727
7835
|
}, children: [
|
|
7728
|
-
/* @__PURE__ */ (0,
|
|
7729
|
-
/* @__PURE__ */ (0,
|
|
7730
|
-
/* @__PURE__ */ (0,
|
|
7731
|
-
/* @__PURE__ */ (0,
|
|
7836
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SectionHeading, { eyebrow: "IDENTITY", title: "\u5DE5\u4F5C\u8EAB\u4EFD", detail: "\u5B83\u4E0D\u662F\u4E00\u6B21\u5BF9\u8BDD\u7684\u63D0\u793A\u8BCD\uFF0C\u800C\u662F\u8FD9\u4E2A\u4F19\u4F34\u5728\u684C\u9762\u548C\u5FAE\u4FE1\u4E2D\u7684\u957F\u671F\u884C\u4E3A\u57FA\u7EBF\u3002" }),
|
|
7837
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "dsh-partner-fields two", children: [
|
|
7838
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormField, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("input", { disabled: busy, required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
|
|
7839
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormField, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("input", { disabled: busy, required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
|
|
7732
7840
|
] }),
|
|
7733
|
-
/* @__PURE__ */ (0,
|
|
7734
|
-
/* @__PURE__ */ (0,
|
|
7735
|
-
error && /* @__PURE__ */ (0,
|
|
7736
|
-
/* @__PURE__ */ (0,
|
|
7737
|
-
/* @__PURE__ */ (0,
|
|
7738
|
-
/* @__PURE__ */ (0,
|
|
7841
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormField, { label: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D", hint: "\u7528\u4E8E\u540D\u518C\u8BC6\u522B\uFF0C\u4E0D\u4F1A\u66FF\u4EE3\u5B8C\u6574\u884C\u4E3A\u51C6\u5219\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("textarea", { disabled: busy, rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
|
|
7842
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormField, { label: "\u957F\u671F\u884C\u4E3A\u51C6\u5219", hint: "\u5EFA\u8BAE\u5199\u804C\u8D23\u3001\u8868\u8FBE\u65B9\u5F0F\u4E0E\u8FB9\u754C\uFF1B\u6E20\u9053\u3001\u5DE5\u5177\u548C\u6388\u6743\u7531\u7CFB\u7EDF\u5355\u72EC\u63A7\u5236\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("textarea", { disabled: busy, rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
|
|
7843
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
|
|
7844
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "dsh-partner-form-actions", children: [
|
|
7845
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { role: "status", children: saved && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
7846
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives18.IconCheckOutline14, { size: 14 }),
|
|
7739
7847
|
"\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u5C06\u4F7F\u7528\u65B0\u8EAB\u4EFD"
|
|
7740
7848
|
] }) }),
|
|
7741
|
-
/* @__PURE__ */ (0,
|
|
7849
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { disabled: busy, children: operation === "save" ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
|
|
7742
7850
|
] }),
|
|
7743
|
-
/* @__PURE__ */ (0,
|
|
7744
|
-
/* @__PURE__ */ (0,
|
|
7745
|
-
/* @__PURE__ */ (0,
|
|
7746
|
-
/* @__PURE__ */ (0,
|
|
7851
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "dsh-partner-identity-danger", "data-confirming": confirming, children: [
|
|
7852
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { children: [
|
|
7853
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("strong", { children: removed ? "\u4F19\u4F34\u5DF2\u5220\u9664" : confirming ? `\u786E\u8BA4\u5220\u9664\u300C${companion.name}\u300D\uFF1F` : "\u5220\u9664\u4F19\u4F34" }),
|
|
7854
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("small", { children: confirming ? "\u5C06\u5220\u9664\u8BE5\u4F19\u4F34\u7684\u914D\u7F6E\u3001\u8BB0\u5FC6\u3001\u6302\u5FF5\u3001\u4E13\u5C5E\u76EE\u5F55\u53CA\u5176\u4E2D\u5168\u90E8\u6587\u4EF6\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002\u5171\u4EAB\u6216\u5F02\u5E38\u76EE\u5F55\u4F1A\u62E6\u622A\uFF1BDSH \u539F\u4F1A\u8BDD\u65E5\u5FD7\u4ECD\u7531\u5BBF\u4E3B\u7BA1\u7406\uFF0C\u4E0D\u5728\u6B64\u6B21\u6E05\u7406\u8303\u56F4\u5185\u3002" : "\u5FC5\u987B\u5148\u89E3\u7ED1\u5FAE\u4FE1\u5E76\u7ED3\u675F\u8FD0\u884C\u4E2D\u7684\u4EFB\u52A1\u3002\u5220\u9664\u53EA\u9488\u5BF9\u672C\u6B21\u786E\u8BA4\u7684\u4F19\u4F34\uFF0C\u4E0D\u4F1A\u8F6C\u4EA4\u8054\u7CFB\u4EBA\u3002" })
|
|
7747
7855
|
] }),
|
|
7748
|
-
/* @__PURE__ */ (0,
|
|
7749
|
-
confirming && /* @__PURE__ */ (0,
|
|
7750
|
-
/* @__PURE__ */ (0,
|
|
7751
|
-
/* @__PURE__ */ (0,
|
|
7856
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
|
|
7857
|
+
confirming && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", disabled: busy, className: "is-secondary", onClick: () => setConfirmationId(void 0), children: "\u53D6\u6D88" }),
|
|
7858
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("button", { type: "button", className: confirming ? "is-danger" : "", disabled: busy || count <= 1, onClick: () => confirming ? void remove() : setConfirmationId(companion.id), children: [
|
|
7859
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives18.IconTrashOutline16, { size: 16 }),
|
|
7752
7860
|
operation === "remove" ? "\u6B63\u5728\u5220\u9664\u2026" : removed ? "\u5DF2\u5220\u9664" : confirming ? "\u786E\u8BA4\u5220\u9664" : "\u5220\u9664"
|
|
7753
7861
|
] })
|
|
7754
7862
|
] })
|
|
@@ -7757,12 +7865,12 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
|
|
|
7757
7865
|
}
|
|
7758
7866
|
|
|
7759
7867
|
// src/ui/companion-create.tsx
|
|
7760
|
-
var
|
|
7868
|
+
var import_react35 = require("react");
|
|
7761
7869
|
var import_dsh_client_ui_primitives19 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
7762
|
-
var
|
|
7870
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
7763
7871
|
function CompanionCreateDialog({ close, create }) {
|
|
7764
|
-
const [busy, setBusy] = (0,
|
|
7765
|
-
const [error, setError] = (0,
|
|
7872
|
+
const [busy, setBusy] = (0, import_react35.useState)(false);
|
|
7873
|
+
const [error, setError] = (0, import_react35.useState)();
|
|
7766
7874
|
const submit = async (event) => {
|
|
7767
7875
|
event.preventDefault();
|
|
7768
7876
|
const data = new FormData(event.currentTarget);
|
|
@@ -7781,30 +7889,30 @@ function CompanionCreateDialog({ close, create }) {
|
|
|
7781
7889
|
setBusy(false);
|
|
7782
7890
|
}
|
|
7783
7891
|
};
|
|
7784
|
-
return /* @__PURE__ */ (0,
|
|
7892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u4F19\u4F34", detail: "\u5148\u5EFA\u7ACB\u6E05\u6670\u7684\u8EAB\u4EFD\u548C\u804C\u8D23\u3002\u6A21\u578B\u3001\u5DE5\u5177\u3001Skill \u4E0E\u534F\u4F5C\u6743\u9650\u4F1A\u5728\u521B\u5EFA\u540E\u5355\u72EC\u914D\u7F6E\u3002", close, width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-companion-create-form", "aria-busy": busy, onSubmit: (event) => {
|
|
7785
7893
|
void submit(event);
|
|
7786
7894
|
}, children: [
|
|
7787
|
-
/* @__PURE__ */ (0,
|
|
7788
|
-
/* @__PURE__ */ (0,
|
|
7789
|
-
/* @__PURE__ */ (0,
|
|
7895
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { children: [
|
|
7896
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
|
|
7897
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("input", { name: "name", required: true, maxLength: 60, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u5C0F\u9ED1" })
|
|
7790
7898
|
] }),
|
|
7791
|
-
/* @__PURE__ */ (0,
|
|
7792
|
-
/* @__PURE__ */ (0,
|
|
7793
|
-
/* @__PURE__ */ (0,
|
|
7899
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { children: [
|
|
7900
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
|
|
7901
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("input", { name: "role", required: true, maxLength: 120, placeholder: "\u4F8B\u5982\uFF1A\u4EA7\u54C1\u4E0E\u5DE5\u7A0B\u534F\u4F5C\u4F19\u4F34" })
|
|
7794
7902
|
] }),
|
|
7795
|
-
/* @__PURE__ */ (0,
|
|
7796
|
-
/* @__PURE__ */ (0,
|
|
7797
|
-
/* @__PURE__ */ (0,
|
|
7903
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "is-wide", children: [
|
|
7904
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
|
|
7905
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("input", { name: "description", maxLength: 500, placeholder: "\u5B83\u4E3B\u8981\u8D1F\u8D23\u4EC0\u4E48\uFF0C\u4EC0\u4E48\u65F6\u5019\u5E94\u8BE5\u627E\u5B83" })
|
|
7798
7906
|
] }),
|
|
7799
|
-
/* @__PURE__ */ (0,
|
|
7800
|
-
/* @__PURE__ */ (0,
|
|
7801
|
-
/* @__PURE__ */ (0,
|
|
7907
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "is-wide", children: [
|
|
7908
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
|
|
7909
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("textarea", { name: "instructions", maxLength: 12e3, rows: 7, placeholder: "\u5199\u6E05\u804C\u8D23\u3001\u8868\u8FBE\u65B9\u5F0F\u3001\u5DE5\u4F5C\u8FB9\u754C\u548C\u4EA4\u4ED8\u6807\u51C6\uFF1B\u4E5F\u53EF\u4EE5\u521B\u5EFA\u540E\u518D\u5B8C\u5584" })
|
|
7802
7910
|
] }),
|
|
7803
|
-
error && /* @__PURE__ */ (0,
|
|
7804
|
-
/* @__PURE__ */ (0,
|
|
7805
|
-
/* @__PURE__ */ (0,
|
|
7806
|
-
/* @__PURE__ */ (0,
|
|
7807
|
-
/* @__PURE__ */ (0,
|
|
7911
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(WorkspaceNotice, { children: error }),
|
|
7912
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("footer", { children: [
|
|
7913
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
7914
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
7915
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_dsh_client_ui_primitives19.IconPlusOutline16, { size: 14 }),
|
|
7808
7916
|
busy ? "\u6B63\u5728\u521B\u5EFA\u2026" : "\u521B\u5EFA\u4F19\u4F34"
|
|
7809
7917
|
] })
|
|
7810
7918
|
] })
|
|
@@ -7894,7 +8002,7 @@ function sessions(ctx) {
|
|
|
7894
8002
|
}
|
|
7895
8003
|
|
|
7896
8004
|
// src/client.tsx
|
|
7897
|
-
var
|
|
8005
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
7898
8006
|
var PLUGIN_ID = "@lemoncat7/dsh-partner";
|
|
7899
8007
|
var STYLE_ID = `${PLUGIN_ID}/client`;
|
|
7900
8008
|
var cssText = `${client_default}
|
|
@@ -7909,24 +8017,24 @@ var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "board", "schedules", "
|
|
|
7909
8017
|
var inject = ["slots", "layout", "sessions"];
|
|
7910
8018
|
function apply(ctx) {
|
|
7911
8019
|
ctx.effect(installStyles, "dsh-partner: styles");
|
|
7912
|
-
const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0,
|
|
7913
|
-
ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0,
|
|
8020
|
+
const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
|
|
8021
|
+
ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PartnerPendant, { controller })));
|
|
7914
8022
|
ctx.effect(() => observePluginWorkspace(PLUGIN_ID, controller.close), "dsh-partner: exclusive workspace");
|
|
7915
8023
|
ctx.effect(() => () => controller.close(), "dsh-partner: workspace lifecycle");
|
|
7916
8024
|
ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({
|
|
7917
8025
|
name: "sidebar.footer.action",
|
|
7918
8026
|
id: "partner",
|
|
7919
8027
|
order: -120
|
|
7920
|
-
}, (props) => /* @__PURE__ */ (0,
|
|
8028
|
+
}, (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
|
|
7921
8029
|
}
|
|
7922
8030
|
function PartnerSidebar(props) {
|
|
7923
|
-
const ref = (0,
|
|
8031
|
+
const ref = (0, import_react36.useRef)(null);
|
|
7924
8032
|
useWorkspaceTopAnchor(ref);
|
|
7925
|
-
const [open, setOpen] = (0,
|
|
7926
|
-
const [snapshot, setSnapshot] = (0,
|
|
7927
|
-
const [, update] = (0,
|
|
7928
|
-
(0,
|
|
7929
|
-
(0,
|
|
8033
|
+
const [open, setOpen] = (0, import_react36.useState)(true);
|
|
8034
|
+
const [snapshot, setSnapshot] = (0, import_react36.useState)();
|
|
8035
|
+
const [, update] = (0, import_react36.useState)(0);
|
|
8036
|
+
(0, import_react36.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
|
|
8037
|
+
(0, import_react36.useEffect)(() => {
|
|
7930
8038
|
void loadPartner().then(setSnapshot).catch(() => {
|
|
7931
8039
|
});
|
|
7932
8040
|
}, [props.controller.isOpen()]);
|
|
@@ -7934,34 +8042,34 @@ function PartnerSidebar(props) {
|
|
|
7934
8042
|
props.controller.open(id);
|
|
7935
8043
|
if (props.wide && window.matchMedia("(max-width: 820px)").matches) props.collapse();
|
|
7936
8044
|
};
|
|
7937
|
-
if (!props.wide) return /* @__PURE__ */ (0,
|
|
7938
|
-
return /* @__PURE__ */ (0,
|
|
7939
|
-
/* @__PURE__ */ (0,
|
|
7940
|
-
/* @__PURE__ */ (0,
|
|
8045
|
+
if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: `dsh-partner-rail${props.controller.isOpen() ? " is-active" : ""}`, title: "\u4F19\u4F34", onClick: () => props.controller.toggle(), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconAgentPresetOutline16, { size: 18 }) }) });
|
|
8046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
|
|
8047
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
|
|
8048
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconChevronDownOutline14, { size: 14 }) }),
|
|
7941
8049
|
"\u4F19\u4F34"
|
|
7942
8050
|
] }) }),
|
|
7943
|
-
/* @__PURE__ */ (0,
|
|
7944
|
-
/* @__PURE__ */ (0,
|
|
7945
|
-
/* @__PURE__ */ (0,
|
|
7946
|
-
/* @__PURE__ */ (0,
|
|
7947
|
-
/* @__PURE__ */ (0,
|
|
8051
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
|
|
8052
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconAgentPresetOutline16, { size: 16 }) }),
|
|
8053
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
8054
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
|
|
8055
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u5FAE\u4FE1\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
|
|
7948
8056
|
] }),
|
|
7949
|
-
/* @__PURE__ */ (0,
|
|
8057
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
|
|
7950
8058
|
] }) }) })
|
|
7951
8059
|
] });
|
|
7952
8060
|
}
|
|
7953
8061
|
function PartnerWorkspace({ controller }) {
|
|
7954
|
-
const [snapshot, setSnapshot] = (0,
|
|
7955
|
-
const [selectedId, setSelectedId] = (0,
|
|
7956
|
-
const [view, setView] = (0,
|
|
7957
|
-
const [requestedDestination, setRequestedDestination] = (0,
|
|
7958
|
-
const [error, setError] = (0,
|
|
7959
|
-
const [loading, setLoading] = (0,
|
|
7960
|
-
const [creatingCompanion, setCreatingCompanion] = (0,
|
|
7961
|
-
const [notice, setNotice] = (0,
|
|
7962
|
-
const selectionRef = (0,
|
|
8062
|
+
const [snapshot, setSnapshot] = (0, import_react36.useState)();
|
|
8063
|
+
const [selectedId, setSelectedId] = (0, import_react36.useState)(controller.selected());
|
|
8064
|
+
const [view, setView] = (0, import_react36.useState)(controller.destination()?.page ?? "home");
|
|
8065
|
+
const [requestedDestination, setRequestedDestination] = (0, import_react36.useState)(controller.destination());
|
|
8066
|
+
const [error, setError] = (0, import_react36.useState)();
|
|
8067
|
+
const [loading, setLoading] = (0, import_react36.useState)(true);
|
|
8068
|
+
const [creatingCompanion, setCreatingCompanion] = (0, import_react36.useState)(false);
|
|
8069
|
+
const [notice, setNotice] = (0, import_react36.useState)();
|
|
8070
|
+
const selectionRef = (0, import_react36.useRef)({ selectedId, companions: snapshot?.companions });
|
|
7963
8071
|
selectionRef.current = { selectedId, companions: snapshot?.companions };
|
|
7964
|
-
const refresh = (0,
|
|
8072
|
+
const refresh = (0, import_react36.useCallback)(async (throwOnError = false) => {
|
|
7965
8073
|
try {
|
|
7966
8074
|
const next = await loadPartner();
|
|
7967
8075
|
setSnapshot(next);
|
|
@@ -7974,10 +8082,10 @@ function PartnerWorkspace({ controller }) {
|
|
|
7974
8082
|
setLoading(false);
|
|
7975
8083
|
}
|
|
7976
8084
|
}, []);
|
|
7977
|
-
(0,
|
|
8085
|
+
(0, import_react36.useEffect)(() => {
|
|
7978
8086
|
void refresh();
|
|
7979
8087
|
}, [refresh]);
|
|
7980
|
-
(0,
|
|
8088
|
+
(0, import_react36.useEffect)(() => controller.subscribe(() => {
|
|
7981
8089
|
const next = controller.selected();
|
|
7982
8090
|
if (next) setSelectedId(next);
|
|
7983
8091
|
const destination = controller.destination();
|
|
@@ -8046,18 +8154,18 @@ function PartnerWorkspace({ controller }) {
|
|
|
8046
8154
|
setSelectedId(id);
|
|
8047
8155
|
setView("home");
|
|
8048
8156
|
};
|
|
8049
|
-
return /* @__PURE__ */ (0,
|
|
8050
|
-
creatingCompanion && /* @__PURE__ */ (0,
|
|
8051
|
-
/* @__PURE__ */ (0,
|
|
8052
|
-
/* @__PURE__ */ (0,
|
|
8053
|
-
/* @__PURE__ */ (0,
|
|
8054
|
-
/* @__PURE__ */ (0,
|
|
8055
|
-
/* @__PURE__ */ (0,
|
|
8056
|
-
/* @__PURE__ */ (0,
|
|
8057
|
-
/* @__PURE__ */ (0,
|
|
8157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("main", { className: "dsh-partner-workspace", children: [
|
|
8158
|
+
creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
|
|
8159
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("header", { className: "dsh-partner-topbar", children: [
|
|
8160
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
|
|
8161
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", "data-xiaohei-workspace-close": true, onClick: controller.close, "aria-label": "\u8FD4\u56DE\u4F1A\u8BDD", title: "\u8FD4\u56DE\u4F1A\u8BDD", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconChevronLeftOutline14, { size: 15 }) }),
|
|
8162
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconAgentPresetOutline16, { size: 18 }),
|
|
8163
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
8164
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: "\u4F19\u4F34" }),
|
|
8165
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u5FAE\u4FE1\u6E20\u9053" })
|
|
8058
8166
|
] })
|
|
8059
8167
|
] }),
|
|
8060
|
-
/* @__PURE__ */ (0,
|
|
8168
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
8061
8169
|
MobileWorkspaceControls,
|
|
8062
8170
|
{
|
|
8063
8171
|
companions: snapshot?.companions ?? [],
|
|
@@ -8069,117 +8177,117 @@ function PartnerWorkspace({ controller }) {
|
|
|
8069
8177
|
}
|
|
8070
8178
|
)
|
|
8071
8179
|
] }),
|
|
8072
|
-
/* @__PURE__ */ (0,
|
|
8073
|
-
/* @__PURE__ */ (0,
|
|
8074
|
-
/* @__PURE__ */ (0,
|
|
8075
|
-
/* @__PURE__ */ (0,
|
|
8076
|
-
/* @__PURE__ */ (0,
|
|
8077
|
-
/* @__PURE__ */ (0,
|
|
8180
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-grid", children: [
|
|
8181
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("aside", { className: "dsh-partner-roster", children: [
|
|
8182
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-roster-title", children: [
|
|
8183
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
8184
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "COMPANIONS" }),
|
|
8185
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
|
|
8078
8186
|
] }),
|
|
8079
|
-
/* @__PURE__ */ (0,
|
|
8187
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconPlusOutline16, { size: 16 }) })
|
|
8080
8188
|
] }),
|
|
8081
|
-
/* @__PURE__ */ (0,
|
|
8189
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
|
|
8082
8190
|
const channel = snapshot.channels.find((item) => item.companionId === companion.id);
|
|
8083
|
-
return /* @__PURE__ */ (0,
|
|
8084
|
-
/* @__PURE__ */ (0,
|
|
8085
|
-
/* @__PURE__ */ (0,
|
|
8086
|
-
/* @__PURE__ */ (0,
|
|
8087
|
-
/* @__PURE__ */ (0,
|
|
8191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
|
|
8192
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Avatar, { name: companion.name }),
|
|
8193
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
8194
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: companion.name }),
|
|
8195
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: companion.role })
|
|
8088
8196
|
] }),
|
|
8089
|
-
/* @__PURE__ */ (0,
|
|
8197
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
|
|
8090
8198
|
] }, companion.id);
|
|
8091
8199
|
}) }),
|
|
8092
|
-
/* @__PURE__ */ (0,
|
|
8093
|
-
/* @__PURE__ */ (0,
|
|
8094
|
-
/* @__PURE__ */ (0,
|
|
8095
|
-
/* @__PURE__ */ (0,
|
|
8096
|
-
/* @__PURE__ */ (0,
|
|
8200
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: [
|
|
8201
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-current": view === "skills" ? "page" : void 0, onClick: () => setView("skills"), children: [
|
|
8202
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconBrowseOutline16, { size: 16 }) }),
|
|
8203
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: "Skill \u5E02\u573A" }),
|
|
8204
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "\u5B89\u88C5\u4E0E\u7BA1\u7406\u80FD\u529B" })
|
|
8097
8205
|
] }),
|
|
8098
|
-
/* @__PURE__ */ (0,
|
|
8099
|
-
/* @__PURE__ */ (0,
|
|
8100
|
-
/* @__PURE__ */ (0,
|
|
8101
|
-
/* @__PURE__ */ (0,
|
|
8206
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-current": view === "board" ? "page" : void 0, onClick: () => setView("board"), children: [
|
|
8207
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconListPenOutline16, { size: 16 }) }),
|
|
8208
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: "\u4EFB\u52A1\u770B\u677F" }),
|
|
8209
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "\u534F\u4F5C\u3001\u59D4\u6D3E\u4E0E\u9A8C\u6536" })
|
|
8102
8210
|
] }),
|
|
8103
|
-
/* @__PURE__ */ (0,
|
|
8104
|
-
/* @__PURE__ */ (0,
|
|
8105
|
-
/* @__PURE__ */ (0,
|
|
8106
|
-
/* @__PURE__ */ (0,
|
|
8211
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-current": view === "schedules" ? "page" : void 0, onClick: () => setView("schedules"), children: [
|
|
8212
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconPlayOutline16, { size: 16 }) }),
|
|
8213
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: "\u5B9A\u65F6\u4EFB\u52A1" }),
|
|
8214
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "\u9009\u62E9\u4F19\u4F34\u5468\u671F\u6267\u884C" })
|
|
8107
8215
|
] }),
|
|
8108
|
-
/* @__PURE__ */ (0,
|
|
8109
|
-
/* @__PURE__ */ (0,
|
|
8110
|
-
/* @__PURE__ */ (0,
|
|
8111
|
-
/* @__PURE__ */ (0,
|
|
8216
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-current": view === "pendant" ? "page" : void 0, onClick: () => setView("pendant"), children: [
|
|
8217
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconEditOutline16, { size: 16 }) }),
|
|
8218
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: "\u5361\u7247\u8BBE\u7F6E" }),
|
|
8219
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "\u6302\u9970\u3001\u7EF3\u5B50\u4E0E\u56FE\u6848" })
|
|
8112
8220
|
] })
|
|
8113
8221
|
] }),
|
|
8114
|
-
/* @__PURE__ */ (0,
|
|
8115
|
-
/* @__PURE__ */ (0,
|
|
8116
|
-
/* @__PURE__ */ (0,
|
|
8117
|
-
/* @__PURE__ */ (0,
|
|
8118
|
-
/* @__PURE__ */ (0,
|
|
8222
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-roster-note", children: [
|
|
8223
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconLinkOutline16, { size: 16 }),
|
|
8224
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
8225
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
|
|
8226
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "\u5FAE\u4FE1\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
|
|
8119
8227
|
] })
|
|
8120
8228
|
] })
|
|
8121
8229
|
] }),
|
|
8122
|
-
/* @__PURE__ */ (0,
|
|
8123
|
-
loading ? /* @__PURE__ */ (0,
|
|
8124
|
-
view === "skills" && /* @__PURE__ */ (0,
|
|
8125
|
-
view === "board" && /* @__PURE__ */ (0,
|
|
8126
|
-
view === "schedules" && /* @__PURE__ */ (0,
|
|
8127
|
-
view === "pendant" && /* @__PURE__ */ (0,
|
|
8128
|
-
] }) : selected === void 0 ? /* @__PURE__ */ (0,
|
|
8129
|
-
/* @__PURE__ */ (0,
|
|
8130
|
-
/* @__PURE__ */ (0,
|
|
8131
|
-
/* @__PURE__ */ (0,
|
|
8132
|
-
/* @__PURE__ */ (0,
|
|
8133
|
-
/* @__PURE__ */ (0,
|
|
8134
|
-
/* @__PURE__ */ (0,
|
|
8230
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
|
|
8231
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
|
|
8232
|
+
view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SkillsPanel, {}),
|
|
8233
|
+
view === "board" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(RequirementBoard, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
|
|
8234
|
+
view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
|
|
8235
|
+
view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PendantSettingsPanel, {})
|
|
8236
|
+
] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ContentState, { title: "\u521B\u5EFA\u7B2C\u4E00\u4E2A\u4F19\u4F34", detail: "\u4F19\u4F34\u4F1A\u4FDD\u5B58\u72EC\u7ACB\u8EAB\u4EFD\u3001\u80FD\u529B\u548C\u5FAE\u4FE1\u4F1A\u8BDD\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
8237
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-identity", children: [
|
|
8238
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Avatar, { name: selected.name }),
|
|
8239
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
8240
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "ACTIVE COMPANION" }),
|
|
8241
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h1", { children: selected.name }),
|
|
8242
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { children: selected.description || selected.role })
|
|
8135
8243
|
] }),
|
|
8136
|
-
/* @__PURE__ */ (0,
|
|
8244
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
|
|
8137
8245
|
] }),
|
|
8138
|
-
/* @__PURE__ */ (0,
|
|
8139
|
-
/* @__PURE__ */ (0,
|
|
8140
|
-
/* @__PURE__ */ (0,
|
|
8141
|
-
/* @__PURE__ */ (0,
|
|
8142
|
-
/* @__PURE__ */ (0,
|
|
8143
|
-
/* @__PURE__ */ (0,
|
|
8144
|
-
/* @__PURE__ */ (0,
|
|
8246
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
|
|
8247
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
|
|
8248
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
|
|
8249
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
|
|
8250
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(WeixinGlyph, {}), children: "\u5FAE\u4FE1" }),
|
|
8251
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconDataOutline16, { size: 16 }), children: "\u8BB0\u5FC6" }),
|
|
8252
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TabButton, { active: view === "concerns", onClick: () => setView("concerns"), icon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconBrowseOutline16, { size: 16 }), children: "\u6301\u7EED\u5173\u6CE8" })
|
|
8145
8253
|
] }),
|
|
8146
|
-
/* @__PURE__ */ (0,
|
|
8147
|
-
notice && /* @__PURE__ */ (0,
|
|
8148
|
-
view === "home" && /* @__PURE__ */ (0,
|
|
8149
|
-
view === "identity" && /* @__PURE__ */ (0,
|
|
8150
|
-
view === "capabilities" && /* @__PURE__ */ (0,
|
|
8151
|
-
view === "weixin" && /* @__PURE__ */ (0,
|
|
8152
|
-
view === "memory" && /* @__PURE__ */ (0,
|
|
8153
|
-
view === "concerns" && /* @__PURE__ */ (0,
|
|
8254
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
|
|
8255
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "dsh-partner-inline-notice", role: "status", children: notice }),
|
|
8256
|
+
view === "home" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession }),
|
|
8257
|
+
view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: () => refresh(true), onRemoved: companionRemoved }),
|
|
8258
|
+
view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: () => refresh(true) }, selected.id),
|
|
8259
|
+
view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }),
|
|
8260
|
+
view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh }, selected.id),
|
|
8261
|
+
view === "concerns" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ConcernPanel, { companion: selected, snapshot, onChanged: refresh }, selected.id)
|
|
8154
8262
|
] })
|
|
8155
8263
|
] }),
|
|
8156
|
-
error && /* @__PURE__ */ (0,
|
|
8264
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
|
|
8157
8265
|
] })
|
|
8158
8266
|
] })
|
|
8159
8267
|
] });
|
|
8160
8268
|
}
|
|
8161
8269
|
function MobileWorkspaceControls({ companions, selectedId, view, openCompanion, openPage, createCompanion }) {
|
|
8162
|
-
return /* @__PURE__ */ (0,
|
|
8163
|
-
/* @__PURE__ */ (0,
|
|
8164
|
-
/* @__PURE__ */ (0,
|
|
8165
|
-
/* @__PURE__ */ (0,
|
|
8270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
|
|
8271
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
|
|
8272
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
|
|
8273
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconPlusOutline16, { size: 17 }) })
|
|
8166
8274
|
] }),
|
|
8167
|
-
/* @__PURE__ */ (0,
|
|
8168
|
-
/* @__PURE__ */ (0,
|
|
8169
|
-
/* @__PURE__ */ (0,
|
|
8170
|
-
/* @__PURE__ */ (0,
|
|
8275
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: [
|
|
8276
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-pressed": view === "skills", onClick: () => openPage("skills"), children: [
|
|
8277
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconBrowseOutline16, { size: 16 }),
|
|
8278
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "Skill" })
|
|
8171
8279
|
] }),
|
|
8172
|
-
/* @__PURE__ */ (0,
|
|
8173
|
-
/* @__PURE__ */ (0,
|
|
8174
|
-
/* @__PURE__ */ (0,
|
|
8280
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-pressed": view === "board", onClick: () => openPage("board"), children: [
|
|
8281
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconListPenOutline16, { size: 16 }),
|
|
8282
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u770B\u677F" })
|
|
8175
8283
|
] }),
|
|
8176
|
-
/* @__PURE__ */ (0,
|
|
8177
|
-
/* @__PURE__ */ (0,
|
|
8178
|
-
/* @__PURE__ */ (0,
|
|
8284
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-pressed": view === "schedules", onClick: () => openPage("schedules"), children: [
|
|
8285
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconPlayOutline16, { size: 16 }),
|
|
8286
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u5B9A\u65F6" })
|
|
8179
8287
|
] }),
|
|
8180
|
-
/* @__PURE__ */ (0,
|
|
8181
|
-
/* @__PURE__ */ (0,
|
|
8182
|
-
/* @__PURE__ */ (0,
|
|
8288
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-pressed": view === "pendant", onClick: () => openPage("pendant"), children: [
|
|
8289
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconEditOutline16, { size: 16 }),
|
|
8290
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u5361\u7247" })
|
|
8183
8291
|
] })
|
|
8184
8292
|
] })
|
|
8185
8293
|
] });
|
|
@@ -8192,76 +8300,76 @@ function HomePanel({ companion, snapshot, navigate, openSession, startSession, r
|
|
|
8192
8300
|
const approved = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id && item.status === "approved").length : 0;
|
|
8193
8301
|
const capabilities = companion.capabilities.map((item) => CAPABILITY_LABELS[item]);
|
|
8194
8302
|
const online = channel?.runtimeStatus === "running";
|
|
8195
|
-
return /* @__PURE__ */ (0,
|
|
8196
|
-
/* @__PURE__ */ (0,
|
|
8197
|
-
/* @__PURE__ */ (0,
|
|
8198
|
-
/* @__PURE__ */ (0,
|
|
8199
|
-
/* @__PURE__ */ (0,
|
|
8303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-home", children: [
|
|
8304
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("header", { className: "dsh-partner-home-heading", children: [
|
|
8305
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
8306
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
|
|
8307
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u5FAE\u4FE1\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
|
|
8200
8308
|
] }),
|
|
8201
|
-
/* @__PURE__ */ (0,
|
|
8309
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { children: online ? "\u6D88\u606F\u3001\u6388\u6743\u4E0E\u4E0A\u4E0B\u6587\u8FB9\u754C\u90FD\u5728\u8FD9\u91CC\u6C47\u603B\u3002" : "\u4F19\u4F34\u8EAB\u4EFD\u3001\u4F1A\u8BDD\u4E0E\u80FD\u529B\u5DF2\u7ECF\u51C6\u5907\u5B8C\u6210\u3002" })
|
|
8202
8310
|
] }),
|
|
8203
|
-
/* @__PURE__ */ (0,
|
|
8204
|
-
/* @__PURE__ */ (0,
|
|
8205
|
-
/* @__PURE__ */ (0,
|
|
8206
|
-
/* @__PURE__ */ (0,
|
|
8207
|
-
/* @__PURE__ */ (0,
|
|
8311
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
|
|
8312
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
|
|
8313
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Avatar, { name: companion.name }),
|
|
8314
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("i", {}) }),
|
|
8315
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(WeixinGlyph, { large: true }) })
|
|
8208
8316
|
] }),
|
|
8209
|
-
/* @__PURE__ */ (0,
|
|
8210
|
-
/* @__PURE__ */ (0,
|
|
8211
|
-
/* @__PURE__ */ (0,
|
|
8317
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
|
|
8318
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
|
|
8319
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("i", {}),
|
|
8212
8320
|
"\u4E3B\u8981\u6E20\u9053 \xB7 \u5FAE\u4FE1"
|
|
8213
8321
|
] }),
|
|
8214
|
-
/* @__PURE__ */ (0,
|
|
8215
|
-
/* @__PURE__ */ (0,
|
|
8216
|
-
/* @__PURE__ */ (0,
|
|
8217
|
-
/* @__PURE__ */ (0,
|
|
8218
|
-
/* @__PURE__ */ (0,
|
|
8322
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h3", { children: !channel ? "\u7B49\u5F85\u626B\u7801\u8FDE\u63A5" : online ? "\u8FDE\u63A5\u6B63\u5E38\uFF0C\u6B63\u5728\u63A5\u6536\u6D88\u606F" : channel.runtimeStatus === "error" ? "\u6E20\u9053\u8FDE\u63A5\u9700\u8981\u5904\u7406" : "\u6E20\u9053\u5F53\u524D\u5DF2\u505C\u7528" }),
|
|
8323
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { children: !channel ? "\u901A\u8FC7\u5FAE\u4FE1 iLink Bot \u63A5\u5165\u3002\u51ED\u636E\u53EA\u8FDB\u5165 DSH \u51ED\u636E\u5E93\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u4ECD\u9700\u4F60\u7684\u6279\u51C6\u3002" : online ? "\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u62E5\u6709\u72EC\u7ACB DSH \u4F1A\u8BDD\uFF0C\u4F19\u4F34\u8EAB\u4EFD\u4E00\u81F4\uFF0C\u4F46\u4E0A\u4E0B\u6587\u4E0D\u4F1A\u4E92\u76F8\u6DF7\u5408\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
|
|
8324
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
|
|
8325
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: "is-primary", onClick: () => navigate("weixin"), children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1" : pending > 0 ? `\u5904\u7406 ${pending} \u4E2A\u8BF7\u6C42` : "\u7BA1\u7406\u6E20\u9053" }),
|
|
8326
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: !channel ? "\u626B\u7801\u5B8C\u6210\uFF0C\u65E0\u9700\u7C98\u8D34 Token" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 ${sessions2.length} \u4E2A\u72EC\u7ACB\u4F1A\u8BDD` })
|
|
8219
8327
|
] })
|
|
8220
8328
|
] })
|
|
8221
8329
|
] }),
|
|
8222
|
-
/* @__PURE__ */ (0,
|
|
8223
|
-
/* @__PURE__ */ (0,
|
|
8224
|
-
/* @__PURE__ */ (0,
|
|
8225
|
-
/* @__PURE__ */ (0,
|
|
8226
|
-
/* @__PURE__ */ (0,
|
|
8227
|
-
/* @__PURE__ */ (0,
|
|
8228
|
-
/* @__PURE__ */ (0,
|
|
8330
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-home-details", children: [
|
|
8331
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { className: "dsh-partner-home-profile", children: [
|
|
8332
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("header", { children: [
|
|
8333
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconUserOutline16, { size: 16 }) }),
|
|
8334
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
|
|
8335
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
|
|
8336
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: companion.role })
|
|
8229
8337
|
] }),
|
|
8230
|
-
/* @__PURE__ */ (0,
|
|
8338
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
|
|
8231
8339
|
] }),
|
|
8232
|
-
/* @__PURE__ */ (0,
|
|
8340
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
|
|
8233
8341
|
] }),
|
|
8234
|
-
/* @__PURE__ */ (0,
|
|
8235
|
-
/* @__PURE__ */ (0,
|
|
8236
|
-
/* @__PURE__ */ (0,
|
|
8237
|
-
/* @__PURE__ */ (0,
|
|
8238
|
-
/* @__PURE__ */ (0,
|
|
8239
|
-
/* @__PURE__ */ (0,
|
|
8342
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
|
|
8343
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("header", { children: [
|
|
8344
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconAgentPresetOutline16, { size: 16 }) }),
|
|
8345
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
|
|
8346
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
|
|
8347
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
|
|
8240
8348
|
] }),
|
|
8241
|
-
/* @__PURE__ */ (0,
|
|
8349
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
|
|
8242
8350
|
] }),
|
|
8243
|
-
/* @__PURE__ */ (0,
|
|
8351
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
|
|
8244
8352
|
] }),
|
|
8245
|
-
/* @__PURE__ */ (0,
|
|
8246
|
-
/* @__PURE__ */ (0,
|
|
8247
|
-
/* @__PURE__ */ (0,
|
|
8248
|
-
/* @__PURE__ */ (0,
|
|
8249
|
-
/* @__PURE__ */ (0,
|
|
8250
|
-
/* @__PURE__ */ (0,
|
|
8353
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
|
|
8354
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("header", { children: [
|
|
8355
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconDataOutline16, { size: 16 }) }),
|
|
8356
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
|
|
8357
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
|
|
8358
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
|
|
8251
8359
|
] }),
|
|
8252
|
-
/* @__PURE__ */ (0,
|
|
8360
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", onClick: () => localSession === void 0 ? void startSession(companion.id) : localSession.archived ? void renewSession(localSession.id) : void openSession(localSession.id, localSession.sessionId), children: localSession === void 0 ? "\u5F00\u59CB\u5BF9\u8BDD" : localSession.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
|
|
8253
8361
|
] }),
|
|
8254
|
-
/* @__PURE__ */ (0,
|
|
8362
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { children: localSession ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(localSession.lastMessageAt)}\uFF1B\u53E6\u6709 ${sessions2.filter((item) => item.kind === "channel").length} \u4E2A\u6E20\u9053\u4F1A\u8BDD\u3002` : "\u4F19\u4F34\u4F1A\u8BDD\u6B63\u5728\u521D\u59CB\u5316\uFF0C\u7A0D\u540E\u5373\u53EF\u6253\u5F00\u3002" })
|
|
8255
8363
|
] })
|
|
8256
8364
|
] })
|
|
8257
8365
|
] });
|
|
8258
8366
|
}
|
|
8259
8367
|
function WeixinPanel({ companion, snapshot, onChanged }) {
|
|
8260
8368
|
const channel = snapshot.channels.find((item) => item.companionId === companion.id);
|
|
8261
|
-
const [login, setLogin] = (0,
|
|
8262
|
-
const [busy, setBusy] = (0,
|
|
8263
|
-
const [error, setError] = (0,
|
|
8264
|
-
(0,
|
|
8369
|
+
const [login, setLogin] = (0, import_react36.useState)();
|
|
8370
|
+
const [busy, setBusy] = (0, import_react36.useState)(false);
|
|
8371
|
+
const [error, setError] = (0, import_react36.useState)();
|
|
8372
|
+
(0, import_react36.useEffect)(() => {
|
|
8265
8373
|
if (!login || login.phase === "confirmed" || login.phase === "expired" || login.phase === "error") return;
|
|
8266
8374
|
const timer = window.setInterval(() => {
|
|
8267
8375
|
void api(`/weixin/login/${login.id}`).then(async (result) => {
|
|
@@ -8307,93 +8415,93 @@ function WeixinPanel({ companion, snapshot, onChanged }) {
|
|
|
8307
8415
|
setError(errorMessage(reason));
|
|
8308
8416
|
}
|
|
8309
8417
|
};
|
|
8310
|
-
return /* @__PURE__ */ (0,
|
|
8311
|
-
/* @__PURE__ */ (0,
|
|
8312
|
-
!channel && !login && /* @__PURE__ */ (0,
|
|
8313
|
-
/* @__PURE__ */ (0,
|
|
8314
|
-
/* @__PURE__ */ (0,
|
|
8315
|
-
/* @__PURE__ */ (0,
|
|
8418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
|
|
8419
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SectionHeading, { eyebrow: "PRIMARY CHANNEL", title: "\u5FAE\u4FE1\u6E20\u9053", detail: "\u4F7F\u7528\u5FAE\u4FE1 iLink Bot \u626B\u7801\u63A5\u5165\u3002\u6BCF\u4E2A\u673A\u5668\u4EBA\u53EA\u7ED1\u5B9A\u4E00\u4E2A\u4F19\u4F34\uFF0C\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u4FDD\u6301\u72EC\u7ACB DSH \u4F1A\u8BDD\u3002" }),
|
|
8420
|
+
!channel && !login && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
|
|
8421
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(WeixinGlyph, { large: true }) }),
|
|
8422
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
8423
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("strong", { children: [
|
|
8316
8424
|
"\u628A ",
|
|
8317
8425
|
companion.name,
|
|
8318
8426
|
" \u5E26\u5230\u5FAE\u4FE1"
|
|
8319
8427
|
] }),
|
|
8320
|
-
/* @__PURE__ */ (0,
|
|
8321
|
-
/* @__PURE__ */ (0,
|
|
8322
|
-
/* @__PURE__ */ (0,
|
|
8323
|
-
/* @__PURE__ */ (0,
|
|
8324
|
-
/* @__PURE__ */ (0,
|
|
8428
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { children: "\u626B\u7801\u540E\uFF0C\u673A\u5668\u4EBA\u51ED\u636E\u76F4\u63A5\u4FDD\u5B58\u8FDB DSH \u51ED\u636E\u5E93\uFF0C\u4E0D\u4F1A\u663E\u793A\u5728\u6D4F\u89C8\u5668\u6216\u666E\u901A\u914D\u7F6E\u6587\u4EF6\u4E2D\u3002" }),
|
|
8429
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("ul", { children: [
|
|
8430
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
|
|
8431
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
|
|
8432
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
|
|
8325
8433
|
] })
|
|
8326
8434
|
] }),
|
|
8327
|
-
/* @__PURE__ */ (0,
|
|
8435
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", disabled: busy, onClick: () => {
|
|
8328
8436
|
void begin();
|
|
8329
8437
|
}, children: busy ? "\u6B63\u5728\u7533\u8BF7\u4E8C\u7EF4\u7801\u2026" : "\u626B\u7801\u8FDE\u63A5\u5FAE\u4FE1" })
|
|
8330
8438
|
] }),
|
|
8331
|
-
login && /* @__PURE__ */ (0,
|
|
8332
|
-
/* @__PURE__ */ (0,
|
|
8333
|
-
/* @__PURE__ */ (0,
|
|
8334
|
-
/* @__PURE__ */ (0,
|
|
8335
|
-
/* @__PURE__ */ (0,
|
|
8336
|
-
/* @__PURE__ */ (0,
|
|
8337
|
-
(login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0,
|
|
8439
|
+
login && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
|
|
8440
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
|
|
8441
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
8442
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "WECHAT ILINK BOT" }),
|
|
8443
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: login.phase === "scanned" ? "\u5DF2\u626B\u7801\uFF0C\u8BF7\u5728\u5FAE\u4FE1\u786E\u8BA4" : login.phase === "expired" ? "\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F" : login.phase === "error" ? "\u8FDE\u63A5\u5931\u8D25" : "\u4F7F\u7528\u5FAE\u4FE1\u626B\u7801" }),
|
|
8444
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { children: login.error || (login.phase === "scanned" ? "\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u542F\u52A8\u6E20\u9053\uFF0C\u4E0D\u9700\u8981\u590D\u5236 Token\u3002" : "\u4E8C\u7EF4\u7801\u7EA6 5 \u5206\u949F\u6709\u6548\u3002\u6B64\u9875\u9762\u53EF\u4EE5\u5B89\u5168\u5730\u4FDD\u6301\u6253\u5F00\u3002") }),
|
|
8445
|
+
(login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", onClick: () => {
|
|
8338
8446
|
setLogin(void 0);
|
|
8339
8447
|
void begin();
|
|
8340
8448
|
}, children: [
|
|
8341
|
-
/* @__PURE__ */ (0,
|
|
8449
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconRefreshOutline16, { size: 16 }),
|
|
8342
8450
|
"\u91CD\u65B0\u751F\u6210"
|
|
8343
8451
|
] })
|
|
8344
8452
|
] })
|
|
8345
8453
|
] }),
|
|
8346
|
-
channel && /* @__PURE__ */ (0,
|
|
8347
|
-
/* @__PURE__ */ (0,
|
|
8348
|
-
/* @__PURE__ */ (0,
|
|
8349
|
-
/* @__PURE__ */ (0,
|
|
8350
|
-
/* @__PURE__ */ (0,
|
|
8351
|
-
/* @__PURE__ */ (0,
|
|
8352
|
-
/* @__PURE__ */ (0,
|
|
8454
|
+
channel && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
8455
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
|
|
8456
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(WeixinGlyph, { large: true }) }),
|
|
8457
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
8458
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "WECHAT CHANNEL" }),
|
|
8459
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: channel.name }),
|
|
8460
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { children: channel.accountId })
|
|
8353
8461
|
] }),
|
|
8354
|
-
/* @__PURE__ */ (0,
|
|
8355
|
-
/* @__PURE__ */ (0,
|
|
8462
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ChannelStatus, { channel }),
|
|
8463
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": channel.enabled, disabled: busy, "aria-label": channel.enabled ? "\u505C\u7528\u5FAE\u4FE1\u6E20\u9053" : "\u542F\u7528\u5FAE\u4FE1\u6E20\u9053", onClick: () => {
|
|
8356
8464
|
void toggle();
|
|
8357
|
-
}, children: /* @__PURE__ */ (0,
|
|
8465
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("i", {}) })
|
|
8358
8466
|
] }),
|
|
8359
|
-
channel.lastError && /* @__PURE__ */ (0,
|
|
8360
|
-
/* @__PURE__ */ (0,
|
|
8361
|
-
/* @__PURE__ */ (0,
|
|
8362
|
-
/* @__PURE__ */ (0,
|
|
8363
|
-
/* @__PURE__ */ (0,
|
|
8467
|
+
channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
|
|
8468
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
|
|
8469
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
|
|
8470
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "ACCESS" }),
|
|
8471
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
|
|
8364
8472
|
] }),
|
|
8365
|
-
/* @__PURE__ */ (0,
|
|
8473
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("em", { children: [
|
|
8366
8474
|
pairings.filter((item) => item.status === "pending").length,
|
|
8367
8475
|
" \u4E2A\u5F85\u5904\u7406"
|
|
8368
8476
|
] })
|
|
8369
8477
|
] }),
|
|
8370
|
-
/* @__PURE__ */ (0,
|
|
8371
|
-
/* @__PURE__ */ (0,
|
|
8372
|
-
/* @__PURE__ */ (0,
|
|
8373
|
-
/* @__PURE__ */ (0,
|
|
8374
|
-
/* @__PURE__ */ (0,
|
|
8478
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u8054\u7CFB\u4EBA", detail: "\u6709\u4EBA\u9996\u6B21\u5411\u673A\u5668\u4EBA\u53D1\u6D88\u606F\u540E\uFF0C\u914D\u5BF9\u8BF7\u6C42\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002", compact: true }) : pairings.map((pairing) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("article", { children: [
|
|
8479
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives20.IconUserOutline16, { size: 16 }) }),
|
|
8480
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
|
|
8481
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: pairing.displayName }),
|
|
8482
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("small", { children: [
|
|
8375
8483
|
pairing.status === "pending" ? "\u7B49\u5F85\u5BA1\u6279" : pairing.status === "approved" ? "\u5DF2\u6388\u6743\u72EC\u7ACB\u4F1A\u8BDD" : "\u5DF2\u963B\u6B62",
|
|
8376
8484
|
" \xB7 ",
|
|
8377
8485
|
new Date(pairing.updatedAt).toLocaleString()
|
|
8378
8486
|
] })
|
|
8379
8487
|
] }),
|
|
8380
|
-
pairing.status === "pending" && /* @__PURE__ */ (0,
|
|
8381
|
-
/* @__PURE__ */ (0,
|
|
8488
|
+
pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
8489
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { onClick: () => {
|
|
8382
8490
|
void actPairing(pairing.id, "blocked");
|
|
8383
8491
|
}, children: "\u62D2\u7EDD" }),
|
|
8384
|
-
/* @__PURE__ */ (0,
|
|
8492
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { className: "is-primary", onClick: () => {
|
|
8385
8493
|
void actPairing(pairing.id, "approved");
|
|
8386
8494
|
}, children: "\u6279\u51C6" })
|
|
8387
8495
|
] }),
|
|
8388
|
-
pairing.status === "approved" && /* @__PURE__ */ (0,
|
|
8496
|
+
pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { onClick: () => {
|
|
8389
8497
|
void actPairing(pairing.id, "blocked");
|
|
8390
8498
|
}, children: "\u64A4\u9500" }),
|
|
8391
|
-
pairing.status === "blocked" && /* @__PURE__ */ (0,
|
|
8499
|
+
pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { onClick: () => {
|
|
8392
8500
|
void actPairing(pairing.id, "approved");
|
|
8393
8501
|
}, children: "\u91CD\u65B0\u6279\u51C6" })
|
|
8394
8502
|
] }, pairing.id)) })
|
|
8395
8503
|
] }),
|
|
8396
|
-
error && /* @__PURE__ */ (0,
|
|
8504
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "dsh-partner-inline-error", children: error })
|
|
8397
8505
|
] });
|
|
8398
8506
|
}
|
|
8399
8507
|
function installStyles() {
|