@us_momo/dsh-erp-analysis 1.5.2 → 1.6.1

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 CHANGED
@@ -18,6 +18,14 @@ ERP 账号须由管理员开启“允许 DSH 接入”。登录记住 30 天,
18
18
  设备授权与工作资料保存在当前 Windows 用户的 `%LOCALAPPDATA%/CompanyDSH`,与插件安装目录分开,更新和重新安装保留。
19
19
  正式报告自动集中共享,所有已启用成员可查看完整报告,包括成本和利润。聊天、草稿和临时附件各机保存。公司知识与共享报告从 ERP 中读取,内容变化无需重新安装插件。
20
20
 
21
+ ## 备货分析参考
22
+
23
+ 明确备货分析时使用erp-stock-analysis,按一个经营商和一家供应商生成ERP参考记录,复用原数量、利润、自动费用估算和运输依据。答复提供记录与同记录Excel入口。在ERP生成草稿时可增删同范围商品、改量和改名,原分析不变;分析页不跟踪后续采购或发货。普通库存咨询继续只读。更新插件后重启并新建公司分析对话使用新版方法。
24
+
21
25
  ## 市场研究与选品
22
26
 
23
27
  直接在“公司 ERP 分析”对话中提供关键词或卖家精灵 Excel,使用 erp-market-research 看产品图片、类型、销售表现、人群及需求,由 DSH 根据实际内容识别主题并核对已有研究;基于研究讨论多个方向时使用 erp-selection,给出1688中文现货关键词。研究和方向可以先在对话中讨论,明确保存后由 DSH 接续已有档案或创建新主题及方向,ERP 页面用于查看、编辑已有资料和记录货源。用户自行找货,ERP 保存链接和简单备注。普通讨论不自动保存;本轮不开展后续办理。更新插件后重启并新建公司分析对话使用这两个方法。
28
+
29
+ 1.6.0 的市场研究采用全量代码核算、少量代表图抽样:本机原件沿随包Python入口读取,已保存原件用 erp_selection_analyze;默认返回12个候选,按需要补看主要类型及结构边界,同款颜色图复用,不逐张识别全部ASIN。来源小类目、标题判断与图片核实分别解释。
30
+
31
+ 明确保存时使用 erp_selection_research_save,将本机结构化草稿和选中图片/原件分步保存,自动形成ERP可读取的图文报告与链接;原请求可恢复成功步骤。面板显示实际方法版本及研究建档工具是否就绪,普通旧会话的只读连接不能替代公司分析入口。方法目录被占用且回退完整时显示待重启,保留旧方法可用。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@us_momo/dsh-erp-analysis",
3
- "version": "1.5.2",
3
+ "version": "1.6.1",
4
4
  "description": "公司 ERP 分析:选品研究、个人账号关联、统一方法、共享知识与报告。",
5
5
  "type": "module",
6
6
  "files": [
@@ -8,6 +8,7 @@
8
8
  "company-public.json",
9
9
  "plugin/",
10
10
  "release.json",
11
+ "selection_archive.mjs",
11
12
  "release.mjs"
12
13
  ],
13
14
  "publishConfig": {
package/plugin/client.js CHANGED
@@ -14,6 +14,7 @@ window.__ModuleLoader__.load({
14
14
  start: "开始公司分析", account: "个人 ERP 账号", devices: "我的设备", revoke: "解除此设备",
15
15
  revokedDevice: "已解除", expires: "有效期至", version: "公司方法版本", needReload: "新版已准备好,完成当前任务后重启 DSH。",
16
16
  methods: "使用统一公司方法;模型由你在 DSH 中自行选择。",
17
+ selectionReady: "研究建档工具已就绪", selectionMissing: "当前连接未就绪选品建档工具,请刷新状态核对公司接入。",
17
18
  reports: "共享正式报告", loadReports: "读取共享报告", retry: "恢复待共享报告", queue: "份报告待共享",
18
19
  sharing: "生成或保存正式报告后自动共享,所有已启用成员均可查看完整内容,包括成本和利润。聊天、草稿和临时附件仅保存在本机。",
19
20
  noReports: "暂无共享报告。", reportTitle: "报告", author: "作者", reportVersion: "版本", time: "生成时间", download: "下载",
@@ -33,6 +34,7 @@ window.__ModuleLoader__.load({
33
34
  start: "Start company analysis", account: "Your ERP account", devices: "My devices", revoke: "Revoke device",
34
35
  revokedDevice: "Revoked", expires: "Valid until", version: "Company method version", needReload: "An update is ready. Finish your work, then restart DSH.",
35
36
  methods: "Company methods are managed centrally. Choose your own model in DSH.",
37
+ selectionReady: "Research archive tools are ready", selectionMissing: "Research archive tools are unavailable on this connection. Refresh to check company access.",
36
38
  reports: "Shared formal reports", loadReports: "Load shared reports", retry: "Retry pending reports", queue: "reports pending upload",
37
39
  sharing: "Formal reports are shared automatically with every enabled member, including costs and profit. Chats, drafts and temporary attachments stay on this computer.",
38
40
  noReports: "No shared reports yet.", reportTitle: "Report", author: "Author", reportVersion: "Version", time: "Created", download: "Download",
@@ -152,6 +154,7 @@ window.__ModuleLoader__.load({
152
154
  }, !active || state?.pendingReload, true)),
153
155
  verification ? h("p", null, h("a", { className: "company-button", href: verification, target: "_blank", rel: "noreferrer noopener" }, t("authorize"))) : null,
154
156
  h("p", null, h("small", null, `${t("version")} ${state?.version || "—"} · ${t("methods")}`)),
157
+ active ? h("p", { role: "status" }, t(state?.selection?.available ? "selectionReady" : "selectionMissing")) : null,
155
158
  state?.pendingReload ? h("p", { role: "status" }, t("needReload")) : null),
156
159
  h("section", null, h("h2", null, t("reports")), h("p", null, t("sharing")),
157
160
  h("div", { className: "company-row" },
@@ -3,6 +3,7 @@ import { join, resolve } from "node:path";
3
3
  import { homedir } from "node:os";
4
4
  import { TeamClient } from "../client.mjs";
5
5
  import { installRelease, currentRelease, readJson, atomicJson, trustedErpUrl } from "../release.mjs";
6
+ import { selectionCapability } from "../selection_archive.mjs";
6
7
 
7
8
  export const PRESET = "company-erp-analysis";
8
9
  export const defaultRoot = () => join(process.env.LOCALAPPDATA || join(homedir(), ".local", "share"), "CompanyDSH");
@@ -63,6 +64,9 @@ export function companyActions(runtime) {
63
64
  let connection;
64
65
  try { connection = await client.status(); }
65
66
  catch (error) { connection = { status: "unavailable", message: error.message }; }
67
+ const selection = connection.status === "active"
68
+ ? await client.tools().then(result => selectionCapability(result.tools || [])).catch(error => ({ available: false, message: error.message }))
69
+ : { available: false };
66
70
  let pendingReports = 0;
67
71
  const queues = join(runtime.root, "private", "reports");
68
72
  for (const owner of await readdir(queues, { withFileTypes: true }).catch((e) => {
@@ -71,7 +75,7 @@ export function companyActions(runtime) {
71
75
  if (owner.isDirectory()) pendingReports += (await readdir(join(queues, owner.name)))
72
76
  .filter((name) => name.endsWith(".json")).length;
73
77
  }
74
- return { connection, version: runtime.release.version, packageVersion: runtime.packageVersion,
78
+ return { connection, selection, version: runtime.release.version, packageVersion: runtime.packageVersion,
75
79
  pendingReload: runtime.pendingReload, workspace: runtime.workspace, pendingReports };
76
80
  }
77
81
  if (action === "connect") return client.connect();