@combos-fun/plugin-development-tool 0.0.46 → 0.0.48

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/agent-skill.md CHANGED
@@ -15,7 +15,7 @@ Read when integrating the Combos editor iframe, pick mode, Scene Edit messages,
15
15
  - `postMessageOrigin`: outbound parent `targetOrigin`, default `'*'`.
16
16
  - `allowedMessageOrigins`: inbound origins merged with the default `knoffice.tech` and `converge.ai` host suffixes.
17
17
 
18
- It exposes `setEnabled`, `requestSceneRescan`, `setMuted`, and `setMarkerOverlay`, plus matching `COMBOS_DEVELOPMENT_TOOL_*` constants and protocol helpers. There is no `CombosDevelopmentToolSelectScope`. `COMBOS_DEVELOPMENT_TOOL_READY` is exported but never posted; wait for engine `combos-game:ready`.
18
+ It exposes `setEnabled`, `requestSceneRescan`, and `setMarkerOverlay`, plus matching `COMBOS_DEVELOPMENT_TOOL_*` constants and protocol helpers. `setMuted` still forwards to `SoundSystem` but host mute messages are owned by `@combos-fun/plugin-sound`. There is no `CombosDevelopmentToolSelectScope`. `COMBOS_DEVELOPMENT_TOOL_READY` is exported but never posted; wait for engine `combos-game:ready`.
19
19
 
20
20
  ## Required setup
21
21
 
@@ -49,7 +49,6 @@ Parent → iframe:
49
49
  - `set-pick-mode { enabled }`
50
50
  - `refresh`, `clear-selection`
51
51
  - `apply-property`
52
- - `set-muted { muted }`
53
52
  - `set-marker-overlay { enabled }`
54
53
 
55
54
  Iframe → parent:
@@ -57,7 +56,6 @@ Iframe → parent:
57
56
  - `pick-mode-success { enabled }`
58
57
  - `gameobject-selected { snapshot, pointer }`
59
58
  - `gameobject-deselected { reason }`
60
- - `state-changed { muted }`
61
59
  - `marker-overlay-success { enabled, total, markers }`
62
60
 
63
61
  Inbound messages are origin-checked. `allowedMessageOrigins: ['localhost']` adds local development; `['*']` alone disables the check. `postMessageOrigin` controls outbound delivery separately.
@@ -24,10 +24,8 @@ const COMBOS_DEVELOPMENT_TOOL_APPLY_PROPERTY = 'combos-development-tool:apply-pr
24
24
  /** iframe → parent: game scene bootstrap finished; parent may enable pick mode. */
25
25
  const COMBOS_DEVELOPMENT_TOOL_READY = 'combos-development-tool:ready';
26
26
  /**
27
- * Parent → iframe: mute or unmute audio when `SoundSystem` is registered. Payload: `{ muted: boolean }`.
28
- *
29
- * Note: play / pause / resume are owned by the engine core lifecycle protocol
30
- * (`combos-game:set-playing` / `combos-game:state-changed`), not this tool.
27
+ * Parent → iframe: mute or unmute. Handled by `@combos-fun/plugin-sound`.
28
+ * Payload: `{ muted: boolean }`.
31
29
  */
32
30
  const COMBOS_DEVELOPMENT_TOOL_SET_MUTED = 'combos-development-tool:set-muted';
33
31
  /** iframe → parent (and `game.emit`): current mute snapshot after a successful change. */
@@ -498,8 +496,8 @@ function syncMoverOriginFromTransform(go) {
498
496
  mover.originX = go.transform.position.x;
499
497
  mover.originY = go.transform.position.y;
500
498
  }
501
- function applyTransformProperty(go, comp, path, value) {
502
- const transform = go.transform ?? comp;
499
+ function applyTransformProperty(go, _comp, path, value) {
500
+ const transform = go.transform;
503
501
  const transformRecord = transform;
504
502
  if (path.length === 1 && path[0] === 'rotation') {
505
503
  const next = asNumber(value);
@@ -601,11 +599,9 @@ const MARKER_GO_NAME_PREFIX = '__combosDevelopmentToolMarker:';
601
599
  * - `window.postMessage({ type: COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, enabled: true }, targetOrigin)` (e.g. from parent iframe)
602
600
  * - `game.emit(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, { enabled: true })` or `getSystem(CombosDevelopmentToolSystem).setEnabled(true)`
603
601
  *
604
- * Mute (independent of pick mode; parent toolbar or in-game debug UI):
605
- * - `postMessage({ type: COMBOS_DEVELOPMENT_TOOL_SET_MUTED, muted: true })`
606
- * - `game.emit(COMBOS_DEVELOPMENT_TOOL_SET_MUTED, { muted: true })` or `.setMuted(true)`
607
- * Mute applies when `SoundSystem` is registered; otherwise the desired value is remembered until it appears.
608
- * Emits / posts `COMBOS_DEVELOPMENT_TOOL_STATE_CHANGED` with `{ muted }`.
602
+ * Mute is owned by `@combos-fun/plugin-sound` (`combos-development-tool:set-muted` /
603
+ * `SoundSystem.setMuted`). This system still forwards `.setMuted()` to
604
+ * `SoundSystem` so older in-game callers keep working.
609
605
  *
610
606
  * Play / pause / resume are handled by the engine core lifecycle protocol
611
607
  * (`combos-game:set-playing` / `combos-game:state-changed`), not this tool.
@@ -649,12 +645,6 @@ let CombosDevelopmentToolSystem$1 = class CombosDevelopmentToolSystem extends en
649
645
  this.setEnabled(d.enabled);
650
646
  }
651
647
  };
652
- this.onWindowSetMuted = (e) => {
653
- const d = e.detail;
654
- if (d && typeof d.muted === 'boolean') {
655
- this.setMuted(d.muted);
656
- }
657
- };
658
648
  this.onWindowSetMarkerOverlay = (e) => {
659
649
  const d = e.detail;
660
650
  if (d && typeof d.enabled === 'boolean') {
@@ -676,9 +666,6 @@ let CombosDevelopmentToolSystem$1 = class CombosDevelopmentToolSystem extends en
676
666
  if (d.type === COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE && typeof d.enabled === 'boolean') {
677
667
  this.setEnabled(d.enabled);
678
668
  }
679
- else if (d.type === COMBOS_DEVELOPMENT_TOOL_SET_MUTED && typeof d.muted === 'boolean') {
680
- this.setMuted(d.muted);
681
- }
682
669
  else if (d.type === COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY &&
683
670
  typeof d.enabled === 'boolean') {
684
671
  this.setMarkerOverlay(d.enabled);
@@ -701,11 +688,6 @@ let CombosDevelopmentToolSystem$1 = class CombosDevelopmentToolSystem extends en
701
688
  this.onGameRefresh = () => {
702
689
  this.requestSceneRescan();
703
690
  };
704
- this.onGameSetMuted = (payload) => {
705
- if (payload && typeof payload.muted === 'boolean') {
706
- this.setMuted(payload.muted);
707
- }
708
- };
709
691
  this.onWindowRefresh = () => {
710
692
  this.requestSceneRescan();
711
693
  };
@@ -716,13 +698,11 @@ let CombosDevelopmentToolSystem$1 = class CombosDevelopmentToolSystem extends en
716
698
  this.allowedMessageOrigins = mergeAllowedMessageOrigins(params?.allowedMessageOrigins);
717
699
  if (typeof window !== 'undefined') {
718
700
  window.addEventListener(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, this.onWindowSetPickMode);
719
- window.addEventListener(COMBOS_DEVELOPMENT_TOOL_SET_MUTED, this.onWindowSetMuted);
720
701
  window.addEventListener(COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY, this.onWindowSetMarkerOverlay);
721
702
  window.addEventListener(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onWindowRefresh);
722
703
  window.addEventListener('message', this.onWindowMessage);
723
704
  }
724
705
  this.game.on(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, this.onGameSetPickMode);
725
- this.game.on(COMBOS_DEVELOPMENT_TOOL_SET_MUTED, this.onGameSetMuted);
726
706
  this.game.on(COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY, this.onGameSetMarkerOverlay);
727
707
  this.game.on(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onGameRefresh);
728
708
  if (this.enabled) {
@@ -732,13 +712,11 @@ let CombosDevelopmentToolSystem$1 = class CombosDevelopmentToolSystem extends en
732
712
  onDestroy() {
733
713
  if (typeof window !== 'undefined') {
734
714
  window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, this.onWindowSetPickMode);
735
- window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_SET_MUTED, this.onWindowSetMuted);
736
715
  window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY, this.onWindowSetMarkerOverlay);
737
716
  window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onWindowRefresh);
738
717
  window.removeEventListener('message', this.onWindowMessage);
739
718
  }
740
719
  this.game.off(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, this.onGameSetPickMode);
741
- this.game.off(COMBOS_DEVELOPMENT_TOOL_SET_MUTED, this.onGameSetMuted);
742
720
  this.game.off(COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY, this.onGameSetMarkerOverlay);
743
721
  this.game.off(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onGameRefresh);
744
722
  this.detachAllPicks();
@@ -802,18 +780,16 @@ let CombosDevelopmentToolSystem$1 = class CombosDevelopmentToolSystem extends en
802
780
  return this.mutedWithoutSoundSystem;
803
781
  }
804
782
  /**
805
- * Mute or unmute audio via `SoundSystem` when registered.
806
- * No-op on the audio graph if `SoundSystem` is missing; value is remembered for `isMuted`.
783
+ * @deprecated Host mute is handled by `@combos-fun/plugin-sound`.
784
+ * Forwards to `SoundSystem.muted` when that system is registered.
807
785
  */
808
786
  setMuted(muted) {
809
787
  const sound = this.getSoundSystem();
810
788
  if (sound) {
811
789
  sound.muted = muted;
790
+ return;
812
791
  }
813
- else {
814
- this.mutedWithoutSoundSystem = muted;
815
- }
816
- this.postStateChanged();
792
+ this.mutedWithoutSoundSystem = muted;
817
793
  }
818
794
  update(e) {
819
795
  if (this.enabled && this.needsRescan) {
@@ -1104,19 +1080,6 @@ let CombosDevelopmentToolSystem$1 = class CombosDevelopmentToolSystem extends en
1104
1080
  }
1105
1081
  this.game.emit(COMBOS_DEVELOPMENT_TOOL_PICK_MODE_SUCCESS, { enabled });
1106
1082
  }
1107
- postStateChanged() {
1108
- const state = {
1109
- muted: this.isMuted,
1110
- };
1111
- const payload = {
1112
- type: COMBOS_DEVELOPMENT_TOOL_STATE_CHANGED,
1113
- ...state,
1114
- };
1115
- if (typeof window !== 'undefined' && window.parent && window.parent !== window) {
1116
- window.parent.postMessage(payload, this.postMessageOrigin);
1117
- }
1118
- this.game.emit(COMBOS_DEVELOPMENT_TOOL_STATE_CHANGED, state);
1119
- }
1120
1083
  /** (Re)build markers for every object owning a registered marker component. */
1121
1084
  attachMarkers() {
1122
1085
  this.detachAllMarkers();
@@ -1375,7 +1338,7 @@ var CombosDevelopmentToolSystem = CombosDevelopmentToolSystem$1;
1375
1338
  /** Auto-generated by scripts/build-package.mjs — do not edit. */
1376
1339
  Object.assign(CombosDevelopmentToolSystem, {
1377
1340
  packageName: "@combos-fun/plugin-development-tool",
1378
- packageVersion: "0.0.46",
1341
+ packageVersion: "0.0.48",
1379
1342
  });
1380
1343
 
1381
1344
  exports.COMBOS_DEVELOPMENT_TOOL_APPLY_PROPERTY = COMBOS_DEVELOPMENT_TOOL_APPLY_PROPERTY;