@follenfang/fupload 0.0.21 → 0.0.22

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/fupload/SKILL.md CHANGED
@@ -2,7 +2,7 @@
2
2
  name: fupload
3
3
  description: Explicit author-publishing workflow for World of Warcraft plugins, configuration shares, and WA/strings on NewBeeBox, NetEase DD, CurseForge, Heybox Workshop, and ModUs.Creator, including local Creator login reuse and plugin ZIP publishing. Use only when the user explicitly invokes `$fupload`, explicitly asks to use the Fupload Skill, or loads this Skill by path. Do not trigger from ordinary mentions of publishing, NewBeeBox, DD, CurseForge, Heybox, ModUs, plugins, configurations, or WA.
4
4
  metadata:
5
- version: "0.0.21"
5
+ version: "0.0.22"
6
6
  ---
7
7
 
8
8
  # Fupload
@@ -1,3 +1,3 @@
1
1
  """Fupload Python CLI."""
2
2
 
3
- __version__ = "0.0.21"
3
+ __version__ = "0.0.22"
@@ -1486,13 +1486,15 @@ def plugin_form(
1486
1486
  if isinstance(author_value, Mapping) and isinstance(author_value.get("latest_version"), dict)
1487
1487
  else {}
1488
1488
  )
1489
- # Official detail dialog projection followed by the editor's pick list.
1489
+ # The author list is the live publication projection. DD detail_v2 can
1490
+ # retain an older latest_version, so an available author-list value wins
1491
+ # over detail for the version/package fields used to rebuild modify form.
1490
1492
  source = {name: copy.deepcopy(value[name]) for name in PLUGIN_FIELDS if name in value}
1491
1493
  for name in ("detail_url", "release_type", "version"):
1492
1494
  latest_name = {"detail_url": "file_path"}.get(name, name)
1493
- projected = latest.get(latest_name)
1495
+ projected = author_latest.get(latest_name)
1494
1496
  if projected is None:
1495
- projected = author_latest.get(latest_name)
1497
+ projected = latest.get(latest_name)
1496
1498
  if projected is None:
1497
1499
  source.pop(name, None)
1498
1500
  else:
@@ -1517,22 +1519,29 @@ def plugin_form(
1517
1519
  return form
1518
1520
 
1519
1521
 
1520
- def plugin_version_projection(value: Mapping[str, Any]) -> Dict[str, Any]:
1522
+ def plugin_version_projection(
1523
+ value: Mapping[str, Any], author_value: Optional[Mapping[str, Any]] = None,
1524
+ ) -> Dict[str, Any]:
1521
1525
  """Project version fields for readback without feeding them into modify."""
1522
1526
  latest = value.get("latest_version") if isinstance(value.get("latest_version"), dict) else {}
1527
+ author_latest = (
1528
+ author_value.get("latest_version")
1529
+ if isinstance(author_value, Mapping) and isinstance(author_value.get("latest_version"), dict)
1530
+ else {}
1531
+ )
1523
1532
  projection: Dict[str, Any] = {}
1524
1533
  sources = {
1525
- "game_versions": (latest, "game_versions", value, "game_versions"),
1526
- "detail_url": (latest, "file_path", value, "detail_url"),
1527
- "release_type": (latest, "release_type", value, "release_type"),
1528
- "version": (latest, "version", value, "version"),
1529
- "update_desc": (latest, "update_desc", value, "update_desc"),
1534
+ "game_versions": ((author_latest, "game_versions"), (latest, "game_versions"), (value, "game_versions")),
1535
+ "detail_url": ((author_latest, "file_path"), (latest, "file_path"), (value, "detail_url")),
1536
+ "release_type": ((author_latest, "release_type"), (latest, "release_type"), (value, "release_type")),
1537
+ "version": ((author_latest, "version"), (latest, "version"), (value, "version")),
1538
+ "update_desc": ((author_latest, "update_desc"), (latest, "update_desc"), (value, "update_desc")),
1530
1539
  }
1531
- for name, (preferred, preferred_name, fallback, fallback_name) in sources.items():
1532
- if preferred.get(preferred_name) is not None:
1533
- projection[name] = copy.deepcopy(preferred[preferred_name])
1534
- elif fallback.get(fallback_name) is not None:
1535
- projection[name] = copy.deepcopy(fallback[fallback_name])
1540
+ for name, candidates in sources.items():
1541
+ for source, source_name in candidates:
1542
+ if source.get(source_name) is not None:
1543
+ projection[name] = copy.deepcopy(source[source_name])
1544
+ break
1536
1545
  return projection
1537
1546
 
1538
1547
 
@@ -2088,11 +2097,33 @@ class DD:
2088
2097
  apply_present(form, doc, PLUGIN_FIELDS)
2089
2098
  else:
2090
2099
  current = self._fresh_detail(session, "plugin", doc["sn"])
2100
+ if current.get("assign_user_sn") and doc.get("scope") == "private":
2101
+ raise ValidationError("assigned plugins can only use public scope", path="$.scope")
2091
2102
  game_type = current.get("game_type") or (current.get("game_types") or [None])[0]
2092
2103
  listing = author_item(
2093
2104
  session, "plugin", str(doc["sn"]), str(current.get("name") or ""), game_type,
2094
2105
  )
2095
- form = plugin_form(current, listing)
2106
+ if action == "edit":
2107
+ if not listing:
2108
+ raise FuploadError(
2109
+ "DD author-list projection is required to preserve the published plugin version",
2110
+ kind="verification_required", stage="dependency_get", endpoint="/addon/list",
2111
+ verification_required=True,
2112
+ )
2113
+ published_version = plugin_version_projection({}, listing)
2114
+ missing_published = [
2115
+ name for name in ("detail_url", "release_type", "version")
2116
+ if name not in published_version
2117
+ ]
2118
+ if missing_published:
2119
+ raise FuploadError(
2120
+ "DD author-list projection is missing published plugin field(s): %s"
2121
+ % ", ".join(missing_published),
2122
+ kind="verification_required", stage="dependency_get", endpoint="/addon/list",
2123
+ verification_required=True,
2124
+ details={"fields": missing_published},
2125
+ )
2126
+ form = plugin_form(current, listing) if action == "edit" else plugin_form(current)
2096
2127
  allowed = PLUGIN_EDIT_FIELDS if action == "edit" else ("game_versions", "detail_url", "release_type", "version", "update_desc")
2097
2128
  current_version = str(form.get("version") or "").strip()
2098
2129
  apply_present(form, doc, allowed)
@@ -2152,6 +2183,7 @@ class DD:
2152
2183
  "creation_statement", "need_buy",
2153
2184
  "price_fen", "buy_life_type", "jump_room", "room_id", "channel_id", "channel_type",
2154
2185
  "sync_room", "with_associate", "associated_acts", "need_anchor_vip", "vip_levels",
2186
+ "game_versions", "detail_url", "release_type", "version",
2155
2187
  )
2156
2188
  if action != "update":
2157
2189
  raw_readback: Any = {}
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "schema": "fupload.npm-skill-manifest.v1",
3
3
  "package_name": "@follenfang/fupload",
4
- "package_version": "0.0.21",
5
- "skill_version": "0.0.21",
6
- "tree_sha256": "06e04c9d9820c812a5bce0e530887212460eb5aa55ada6f9cfa0f68b92222ae9",
4
+ "package_version": "0.0.22",
5
+ "skill_version": "0.0.22",
6
+ "tree_sha256": "fffd84093cea75f44ca8ad836f4cfb643e692cf121162201892ad130f23fbc5a",
7
7
  "files": [
8
8
  {
9
9
  "path": "agents/openai.yaml",
@@ -113,7 +113,7 @@
113
113
  {
114
114
  "path": "scripts/fupload_cli/__init__.py",
115
115
  "bytes": 50,
116
- "sha256": "72bdf8ff38debf5bf6e764f214f7381a9dca2a17d9a0396952ac63b58bba679d"
116
+ "sha256": "0cec28503481955d702020619b9cd9b3ec7032c4d20be0bbad2aa9f4f5dac6f8"
117
117
  },
118
118
  {
119
119
  "path": "scripts/fupload_cli/blackbox_web.py",
@@ -147,8 +147,8 @@
147
147
  },
148
148
  {
149
149
  "path": "scripts/fupload_cli/dd.py",
150
- "bytes": 115484,
151
- "sha256": "bf42e40784111e07ded17e7f7ad3cfacd007cf8efad6f61df475d0b3873a2793"
150
+ "bytes": 117372,
151
+ "sha256": "19a303e84ce08dd3af9a905d04d24f7224c3302f83f0d62f899618cf45fe0433"
152
152
  },
153
153
  {
154
154
  "path": "scripts/fupload_cli/errors.py",
@@ -208,7 +208,7 @@
208
208
  {
209
209
  "path": "SKILL.md",
210
210
  "bytes": 28582,
211
- "sha256": "d24b44882de93eb9fc43655ef995ff33c075b3b2fb5230b1a357ab43bedd082c"
211
+ "sha256": "925b6b480edae4272a6922200a7f046e95df96908edecd4660e1fc49bdb6688d"
212
212
  }
213
213
  ]
214
214
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@follenfang/fupload",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "Install and run the Fuploader Agent Skill and Python CLI.",
5
5
  "type": "module",
6
6
  "bin": {