@v587d/capital-generation 2.24.0 → 2.26.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/CHANGELOG.md +49 -0
- package/README.md +9 -4
- package/THIRD_PARTY_NOTICES.md +20 -0
- package/automation/brief.js +21 -24
- package/automation/builtins.js +55 -54
- package/automation/client.js +11 -3
- package/automation/client.src.cjs +70 -8
- package/automation/package.json +1 -1
- package/chart-ui/package.json +1 -1
- package/config/client.js +21 -5
- package/config/client.src.cjs +264 -0
- package/config/package.json +1 -1
- package/cordis.patch.yml +9 -2
- package/lib/agents/role-tool-policy.d.ts +1 -1
- package/lib/agents/root-tool-policy.d.ts +3 -3
- package/lib/agents/root-tool-policy.js +2 -2
- package/lib/data-collector/catalog-taxonomy.js +4 -0
- package/lib/python-runtime/child-env.d.ts +11 -0
- package/lib/python-runtime/child-env.js +39 -0
- package/lib/python-runtime/errors.d.ts +8 -0
- package/lib/python-runtime/errors.js +34 -0
- package/lib/python-runtime/lock.d.ts +11 -0
- package/lib/python-runtime/lock.js +68 -0
- package/lib/python-runtime/manager.d.ts +61 -0
- package/lib/python-runtime/manager.js +517 -0
- package/lib/python-runtime/manifest.d.ts +5 -0
- package/lib/python-runtime/manifest.js +160 -0
- package/lib/python-runtime/paths.d.ts +20 -0
- package/lib/python-runtime/paths.js +156 -0
- package/lib/python-runtime/platform.d.ts +32 -0
- package/lib/python-runtime/platform.js +145 -0
- package/lib/python-runtime/pnpm.d.ts +24 -0
- package/lib/python-runtime/pnpm.js +115 -0
- package/lib/python-runtime/probe.d.ts +13 -0
- package/lib/python-runtime/probe.js +101 -0
- package/lib/python-runtime/routes.d.ts +6 -0
- package/lib/python-runtime/routes.js +152 -0
- package/lib/python-runtime/types.d.ts +105 -0
- package/lib/python-runtime/types.js +3 -0
- package/lib/python-runtime-entry.d.ts +10 -0
- package/lib/python-runtime-entry.js +60 -0
- package/lib/sources/eastmoney-http.js +346 -1
- package/lib/sources/tencent-http.js +248 -2
- package/lib/sources/tencent-public-core.js +1 -1
- package/lib/sources-entry.d.ts +1 -1
- package/lib/time/tools.js +2 -0
- package/lib/web-retriever/local-fetch.d.ts +1 -1
- package/lib/web-retriever/local-fetch.js +1 -1
- package/lib/web-retriever/sources.d.ts +16 -1
- package/lib/web-retriever/sources.js +133 -1
- package/lib/web-retriever/tools.js +41 -1
- package/lib/web-retriever/wind-client.d.ts +1 -1
- package/lib/web-retriever/wind-client.js +1 -1
- package/package.json +13 -1
- package/plugin-page/README.en.md +1 -7
- package/plugin-page/README.zh.md +1 -8
- package/preset/capital-generation/agent.patch.yml +12 -13
- package/preset/capital-generation/skills/capital-web-protocol/SKILL.md +10 -4
- package/python/worker.py +154 -0
- package/runtime/manifest.json +75 -0
- package/scripts/python-runtime.mjs +139 -0
- package/watchlist/client.js +83 -3
- package/watchlist/client.src.cjs +565 -1
- package/watchlist/package.json +1 -1
|
@@ -24,6 +24,7 @@ const {
|
|
|
24
24
|
IconRefreshOutlineRegular,
|
|
25
25
|
IconRightUpOutlineRegular,
|
|
26
26
|
IconSearchOutlineRegular,
|
|
27
|
+
IconSlidersTwoOutlineRegular,
|
|
27
28
|
IconSparkleRegular,
|
|
28
29
|
IconTrashOutlineRegular,
|
|
29
30
|
IconWarningOutlineRegular,
|
|
@@ -845,6 +846,14 @@ function installStyles() {
|
|
|
845
846
|
.capital-automation-select:disabled { opacity: .5; cursor: not-allowed; }
|
|
846
847
|
.capital-automation-selectvalue { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
847
848
|
.capital-automation-select > svg { flex: none; color: var(--ca-muted); }
|
|
849
|
+
.capital-automation-select.capital-automation-taskfilter { width: auto; min-width: 112px; max-width: 170px; height: 30px; padding: 0 9px 0 11px; border: .5px solid var(--ca-line-soft); border-radius: 999px; background: var(--ca-card); font-size: 12px; }
|
|
850
|
+
.capital-automation-select.capital-automation-taskfilter:hover:not(:disabled) { border-color: var(--ca-line); background: var(--ca-card); }
|
|
851
|
+
.capital-automation-taskfiltervalue { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
|
|
852
|
+
.capital-automation-taskfiltervalue > svg { flex: none; color: var(--ca-muted); }
|
|
853
|
+
.capital-automation-taskfilter .capital-automation-filtercount { background: color-mix(in srgb, var(--ca-business) 12%, transparent); color: var(--ca-business-text); }
|
|
854
|
+
.capital-automation-taskfiltermenu { min-width: 176px; }
|
|
855
|
+
.capital-automation-taskfilteroption { display: flex; align-items: center; justify-content: flex-start; gap: 7px; min-width: 0; }
|
|
856
|
+
.capital-automation-taskfilteroptionlabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
848
857
|
.capital-automation-formactions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: .5px solid var(--ca-line); }
|
|
849
858
|
.capital-automation-formactions[data-sticky="true"] { position: sticky; bottom: -1px; z-index: 2; margin-top: 2px; padding: 12px 0 4px; background: var(--dsw-alias-bg-base); }
|
|
850
859
|
.capital-automation-formstatus { margin-right: auto; color: var(--ca-caption); font-size: 11.5px; line-height: 18px; }
|
|
@@ -2331,6 +2340,56 @@ function FilterButton(props) {
|
|
|
2331
2340
|
count > 0 ? h('span', { className: 'capital-automation-filtercount' }, String(count)) : null)
|
|
2332
2341
|
}
|
|
2333
2342
|
|
|
2343
|
+
function TaskFilterOption(props) {
|
|
2344
|
+
const { label, count } = props
|
|
2345
|
+
return h('span', { className: 'capital-automation-taskfilteroption' },
|
|
2346
|
+
h('span', { className: 'capital-automation-taskfilteroptionlabel' }, label),
|
|
2347
|
+
count > 0 ? h('span', { className: 'capital-automation-filtercount' }, String(count)) : null)
|
|
2348
|
+
}
|
|
2349
|
+
|
|
2350
|
+
// items[].selectedId only covers `items`, so counted rows mark `selected` themselves.
|
|
2351
|
+
function TaskFilterMenu(props) {
|
|
2352
|
+
const { value, options, counts, label, onChange } = props
|
|
2353
|
+
const [open, setOpen] = useState(false)
|
|
2354
|
+
const triggerRef = useRef(null)
|
|
2355
|
+
const current = options.find((option) => option.value === value) ?? options[0]
|
|
2356
|
+
const currentCount = counts[value] ?? 0
|
|
2357
|
+
const closeMenu = () => setOpen(false)
|
|
2358
|
+
const selectValue = (id) => {
|
|
2359
|
+
setOpen(false)
|
|
2360
|
+
triggerRef.current?.focus?.({ preventScroll: true })
|
|
2361
|
+
if (id !== value) onChange(id)
|
|
2362
|
+
}
|
|
2363
|
+
return h(Menu, {
|
|
2364
|
+
open,
|
|
2365
|
+
anchor: h('button', {
|
|
2366
|
+
ref: triggerRef,
|
|
2367
|
+
type: 'button',
|
|
2368
|
+
className: 'capital-automation-select capital-automation-taskfilter',
|
|
2369
|
+
'aria-label': currentCount > 0 ? `${label}:${current.label},${currentCount} 个` : `${label}:${current.label}`,
|
|
2370
|
+
'aria-haspopup': 'menu',
|
|
2371
|
+
'aria-expanded': open ? 'true' : 'false',
|
|
2372
|
+
title: `${label}:${current.label}`,
|
|
2373
|
+
onClick: () => setOpen((currentOpen) => !currentOpen),
|
|
2374
|
+
},
|
|
2375
|
+
h('span', { className: 'capital-automation-taskfiltervalue' },
|
|
2376
|
+
h(IconSlidersTwoOutlineRegular, { size: 13 }),
|
|
2377
|
+
h('span', { className: 'capital-automation-selectvalue' }, current.label),
|
|
2378
|
+
currentCount > 0 ? h('span', { className: 'capital-automation-filtercount' }, String(currentCount)) : null),
|
|
2379
|
+
h(IconChevronDownOutlineRegular, { size: 14 })),
|
|
2380
|
+
items: [],
|
|
2381
|
+
onClose: closeMenu,
|
|
2382
|
+
align: 'end',
|
|
2383
|
+
portal: true,
|
|
2384
|
+
listClassName: 'capital-automation-taskfiltermenu',
|
|
2385
|
+
children: options.map((option) => h(MenuItemButton, {
|
|
2386
|
+
key: option.value,
|
|
2387
|
+
selected: option.value === value,
|
|
2388
|
+
onSelect: () => selectValue(option.value),
|
|
2389
|
+
}, h(TaskFilterOption, { label: option.label, count: counts[option.value] }))),
|
|
2390
|
+
})
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2334
2393
|
function TaskTags(props) {
|
|
2335
2394
|
const { task } = props
|
|
2336
2395
|
const tags = [[categoryLabel(task.category), toneOf(task)]]
|
|
@@ -2674,20 +2733,23 @@ function TaskDashboard(props) {
|
|
|
2674
2733
|
monitor: roster.filter((task) => task.category === 'monitor').length,
|
|
2675
2734
|
}
|
|
2676
2735
|
const filters = ['all', 'custom', 'news', 'market', 'review', 'research', 'portfolio', 'monitor']
|
|
2736
|
+
const filterOptions = filters.map((value) => ({
|
|
2737
|
+
value,
|
|
2738
|
+
label: value === 'all' ? zh.filterAll : value === 'custom' ? zh.filterCustom : categoryLabel(value),
|
|
2739
|
+
}))
|
|
2677
2740
|
return h('div', null,
|
|
2678
2741
|
h('section', { className: 'capital-automation-section', style: { marginTop: 0 } },
|
|
2679
2742
|
h('div', { className: 'capital-automation-sectionhead' },
|
|
2680
2743
|
h('h2', null, zh.taskSection),
|
|
2681
2744
|
h('span', null, zh.taskSectionHint),
|
|
2682
2745
|
h('div', { className: 'capital-automation-sectiontools' },
|
|
2683
|
-
h(
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
}))),
|
|
2746
|
+
h(TaskFilterMenu, {
|
|
2747
|
+
value: filter,
|
|
2748
|
+
options: filterOptions,
|
|
2749
|
+
counts: filterCounts,
|
|
2750
|
+
label: zh.filterLabel,
|
|
2751
|
+
onChange: setFilter,
|
|
2752
|
+
}),
|
|
2691
2753
|
h('label', { className: 'capital-automation-search' },
|
|
2692
2754
|
h(IconSearchOutlineRegular, { size: 13 }),
|
|
2693
2755
|
h('input', {
|
package/automation/package.json
CHANGED