@await-widget/runtime 0.0.25 → 0.0.26

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/bin/await-widget.js +13 -14
  2. package/package.json +1 -1
@@ -564,13 +564,13 @@ function zipFiles(files) {
564
564
 
565
565
  const appCommands = [
566
566
  {
567
- name: 'list_app_widgets',
567
+ name: 'list-app-widgets',
568
568
  usage: 'list-app-widgets',
569
569
  description: 'List Await widgets currently stored in the Await app.',
570
570
  inputSchema: {type: 'object', properties: {}},
571
571
  },
572
572
  {
573
- name: 'open_widget_detail',
573
+ name: 'open-widget-detail',
574
574
  usage: 'open-widget-detail --widget-id <id>',
575
575
  description: 'Open a widget detail page in the Await app.',
576
576
  inputSchema: {
@@ -580,13 +580,13 @@ const appCommands = [
580
580
  },
581
581
  },
582
582
  {
583
- name: 'open_syncing_widget_detail',
583
+ name: 'open-syncing-widget-detail',
584
584
  usage: 'open-syncing-widget-detail',
585
585
  description: 'Open the widget detail page for the widget currently syncing from this computer.',
586
586
  inputSchema: {type: 'object', properties: {}},
587
587
  },
588
588
  {
589
- name: 'set_preview_mode',
589
+ name: 'set-preview-mode',
590
590
  usage: 'set-preview-mode --mode <small|medium|large|extraLarge> [--widget-id <id>]',
591
591
  description: 'Set the current widget detail preview mode.',
592
592
  inputSchema: {
@@ -599,7 +599,7 @@ const appCommands = [
599
599
  },
600
600
  },
601
601
  {
602
- name: 'capture_current_preview',
602
+ name: 'capture-current-preview',
603
603
  usage: 'capture-current-preview [--widget-id <id>]',
604
604
  description: 'Capture the currently visible widget preview as PNG.',
605
605
  inputSchema: {
@@ -608,7 +608,7 @@ const appCommands = [
608
608
  },
609
609
  },
610
610
  {
611
- name: 'get_widget_status',
611
+ name: 'get-widget-status',
612
612
  usage: 'get-widget-status --widget-id <id>',
613
613
  description: 'Get App-side status for a widget.',
614
614
  inputSchema: {
@@ -618,7 +618,7 @@ const appCommands = [
618
618
  },
619
619
  },
620
620
  {
621
- name: 'wait_for_widget_ready',
621
+ name: 'wait-for-widget-ready',
622
622
  usage: 'wait-for-widget-ready --widget-id <id> [--timeout-ms <ms>]',
623
623
  description: 'Wait for the current widget preview to have rendered data.',
624
624
  inputSchema: {
@@ -631,7 +631,7 @@ const appCommands = [
631
631
  },
632
632
  },
633
633
  {
634
- name: 'get_build_errors',
634
+ name: 'get-build-errors',
635
635
  usage: 'get-build-errors --widget-id <id>',
636
636
  description: 'Get recent build errors for a widget.',
637
637
  inputSchema: {
@@ -641,7 +641,7 @@ const appCommands = [
641
641
  },
642
642
  },
643
643
  {
644
- name: 'list_widget_intents',
644
+ name: 'list-widget-intents',
645
645
  usage: 'list-widget-intents --widget-id <id>',
646
646
  description: 'List widget intents registered by a widget.',
647
647
  inputSchema: {
@@ -651,7 +651,7 @@ const appCommands = [
651
651
  },
652
652
  },
653
653
  {
654
- name: 'call_widget_intent',
654
+ name: 'call-widget-intent',
655
655
  usage: 'call-widget-intent --widget-id <id> --intent-id <id> [--input <json-array>]',
656
656
  description: 'Call a widget intent with positional input arguments.',
657
657
  inputSchema: {
@@ -670,12 +670,11 @@ const appCommands = [
670
670
  ];
671
671
 
672
672
  function appCommandName(value) {
673
- const name = value.replaceAll('-', '_');
674
- if (!appCommands.some(command => command.name === name)) {
673
+ if (!appCommands.some(command => command.name === value)) {
675
674
  throw new Error(`Unsupported Await app command: ${value}`);
676
675
  }
677
676
 
678
- return name;
677
+ return value;
679
678
  }
680
679
 
681
680
  async function runAppCommand(options) {
@@ -725,7 +724,7 @@ async function callAppCommand(bridgeUrl, tool, args) {
725
724
  }
726
725
 
727
726
  function appCommandResult(options, tool, result) {
728
- if (tool === 'capture_current_preview' && result.imageBase64) {
727
+ if (tool === 'capture-current-preview' && result.imageBase64) {
729
728
  const filePath = saveCapture(options, result);
730
729
  return {...result, imageBase64: undefined, filePath};
731
730
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@await-widget/runtime",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "TypeScript declarations for Await widgets.",
5
5
  "license": "MIT",
6
6
  "author": "LitoMore",