@displaydev/cli 0.9.0 → 0.10.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.
Files changed (2) hide show
  1. package/dist/mcp-server.js +144 -19
  2. package/package.json +1 -1
@@ -693,17 +693,77 @@ export function registerTools(server, api) {
693
693
  });
694
694
  })();
695
695
  });
696
- // Agent-native parity for the artifact-detail per-artifact toggle.
697
- // Metadata-only: does NOT bump the artifact version. Use the `publish`
698
- // tool (with `show_branding`) when you're changing content at the same
699
- // time so both writes happen in one transaction.
700
- server.tool('artifact_set_branding', 'Override display.dev branding for an existing artifact without re-publishing. Paid tiers only (free-tier orgs must keep inherit).', {
701
- short_id: z.string().describe('Artifact shortId'),
702
- show_branding: z.enum([
703
- 'show',
704
- 'hide',
705
- 'inherit'
706
- ]).describe('show = force branding on; hide = force off; inherit = follow org default')
696
+ server.tool('share', 'Change an artifact\'s visibility and/or add/remove individual shared-with emails without republishing.', {
697
+ short_id: z.string().describe('Short ID of the artifact (8 chars).'),
698
+ visibility: z.enum([
699
+ 'public',
700
+ 'company',
701
+ 'private'
702
+ ]).optional().describe('Change the visibility level. Omit to keep current. "private" requires the Pro plan.'),
703
+ add_users: z.array(z.string()).optional().describe('Emails to add to sharedWith (idempotent).'),
704
+ remove_users: z.array(z.string()).optional().describe('Emails to remove from sharedWith (idempotent).')
705
+ }, function(args) {
706
+ return _async_to_generator(function() {
707
+ var result, err;
708
+ return _ts_generator(this, function(_state) {
709
+ switch(_state.label){
710
+ case 0:
711
+ if (args.visibility === undefined && !args.add_users && !args.remove_users) {
712
+ return [
713
+ 2,
714
+ {
715
+ content: [
716
+ {
717
+ type: 'text',
718
+ text: JSON.stringify({
719
+ error: 'invalid_input',
720
+ message: 'Provide at least one of visibility, add_users, or remove_users'
721
+ })
722
+ }
723
+ ],
724
+ isError: true
725
+ }
726
+ ];
727
+ }
728
+ _state.label = 1;
729
+ case 1:
730
+ _state.trys.push([
731
+ 1,
732
+ 3,
733
+ ,
734
+ 4
735
+ ]);
736
+ return [
737
+ 4,
738
+ api.share(args.short_id, {
739
+ visibility: args.visibility,
740
+ addUsers: args.add_users,
741
+ removeUsers: args.remove_users
742
+ })
743
+ ];
744
+ case 2:
745
+ result = _state.sent();
746
+ return [
747
+ 2,
748
+ okResponse(result)
749
+ ];
750
+ case 3:
751
+ err = _state.sent();
752
+ return [
753
+ 2,
754
+ errorResponse(err)
755
+ ];
756
+ case 4:
757
+ return [
758
+ 2
759
+ ];
760
+ }
761
+ });
762
+ })();
763
+ });
764
+ server.tool('rename', 'Rename a published artifact. The URL slug updates to match; existing URLs still resolve because routing uses the shortId.', {
765
+ short_id: z.string().describe('The 8-character shortId returned at publish.'),
766
+ name: z.string().describe('New display name. 1–200 characters.')
707
767
  }, function(args) {
708
768
  return _async_to_generator(function() {
709
769
  var result, err;
@@ -718,13 +778,73 @@ export function registerTools(server, api) {
718
778
  ]);
719
779
  return [
720
780
  4,
721
- api.setArtifactBranding(args.short_id, args.show_branding)
781
+ api.renameArtifact(args.short_id, args.name)
722
782
  ];
723
783
  case 1:
724
784
  result = _state.sent();
725
785
  return [
726
786
  2,
727
- okResponse(result)
787
+ okResponse({
788
+ url: result.url,
789
+ shortId: result.shortId,
790
+ name: result.name
791
+ })
792
+ ];
793
+ case 2:
794
+ err = _state.sent();
795
+ return [
796
+ 2,
797
+ errorResponse(err)
798
+ ];
799
+ case 3:
800
+ return [
801
+ 2
802
+ ];
803
+ }
804
+ });
805
+ })();
806
+ });
807
+ server.tool('export', 'Retrieve the source bytes of a published artifact. `format: "original"` returns the publisher\'s upload (markdown for .md, HTML for .html). `format: "markdown"` always returns markdown — `.md` is unchanged, `.html` is converted via Workers AI (cached).', {
808
+ short_id: z.string().describe('Short ID of the artifact (8 chars).'),
809
+ version: z.number().int().min(1).optional().describe('Pinned version number. Omit for current.'),
810
+ format: z.enum([
811
+ 'original',
812
+ 'markdown'
813
+ ]).default('original').describe('Representation requested. Default "original".')
814
+ }, function(args) {
815
+ return _async_to_generator(function() {
816
+ var result, err;
817
+ return _ts_generator(this, function(_state) {
818
+ switch(_state.label){
819
+ case 0:
820
+ _state.trys.push([
821
+ 0,
822
+ 2,
823
+ ,
824
+ 3
825
+ ]);
826
+ return [
827
+ 4,
828
+ api.exportSource(args.short_id, args.version, args.format)
829
+ ];
830
+ case 1:
831
+ result = _state.sent();
832
+ return [
833
+ 2,
834
+ {
835
+ content: [
836
+ {
837
+ type: 'text',
838
+ text: result.data.toString('utf-8')
839
+ }
840
+ ],
841
+ _meta: {
842
+ shortId: args.short_id,
843
+ version: args.version,
844
+ contentType: result.contentType,
845
+ sizeBytes: result.data.length
846
+ }
847
+ }
728
848
  ];
729
849
  case 2:
730
850
  err = _state.sent();
@@ -740,11 +860,16 @@ export function registerTools(server, api) {
740
860
  });
741
861
  })();
742
862
  });
743
- // Agent-native parity for the Settings Branding dashboard toggle.
744
- // Pairs with `publish`'s `show_branding` param: this tool controls the
745
- // default; that param overrides it per-artifact.
746
- server.tool('org_set_branding', 'Enable or disable display.dev branding for every artifact in the org (paid tiers only). Per-artifact overrides keep precedence.', {
747
- enabled: z.boolean().describe('true to show the bar by default; false to hide it')
863
+ // Metadata-only: does NOT bump the artifact version. Use the `publish`
864
+ // tool (with `show_branding`) when you're changing content at the same
865
+ // time so both writes happen in one transaction.
866
+ server.tool('branding', 'Override display.dev branding for an existing artifact without re-publishing. Paid tiers only (free-tier orgs must keep inherit).', {
867
+ short_id: z.string().describe('Artifact shortId'),
868
+ show_branding: z.enum([
869
+ 'show',
870
+ 'hide',
871
+ 'inherit'
872
+ ]).describe('show = force branding on; hide = force off; inherit = follow org default')
748
873
  }, function(args) {
749
874
  return _async_to_generator(function() {
750
875
  var result, err;
@@ -759,7 +884,7 @@ export function registerTools(server, api) {
759
884
  ]);
760
885
  return [
761
886
  4,
762
- api.setOrgBranding(args.enabled)
887
+ api.setArtifactBranding(args.short_id, args.show_branding)
763
888
  ];
764
889
  case 1:
765
890
  result = _state.sent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@displaydev/cli",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "dsp": "dist/main.js"