@stina/extension-api 0.58.0 → 1.3.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.
@@ -24,6 +24,7 @@ var VALID_PERMISSIONS = [
24
24
  "settings.register",
25
25
  "commands.register",
26
26
  "panels.register",
27
+ "statusCards.register",
27
28
  "events.emit",
28
29
  "scheduler.register",
29
30
  "background.workers",
@@ -60,6 +61,7 @@ var CapabilityPermissionSchema = z.enum([
60
61
  "settings.register",
61
62
  "commands.register",
62
63
  "panels.register",
64
+ "statusCards.register",
63
65
  "events.emit",
64
66
  "scheduler.register",
65
67
  "chat.message.write",
@@ -188,6 +190,10 @@ var LabelPropsSchema = z2.object({
188
190
  text: z2.string().describe("Label text"),
189
191
  style: ExtensionComponentStyleSchema.optional()
190
192
  }).passthrough().describe("Label component");
193
+ var ClockPropsSchema = z2.object({
194
+ component: z2.literal("Clock"),
195
+ style: ExtensionComponentStyleSchema.optional()
196
+ }).passthrough().describe("Clock component: the current date and time where the user is");
191
197
  var ParagraphPropsSchema = z2.object({
192
198
  component: z2.literal("Paragraph"),
193
199
  text: z2.string().describe("Paragraph text"),
@@ -477,6 +483,22 @@ var StatTilePropsSchema = z2.object({
477
483
  trendIsGood: z2.boolean().optional().describe("Whether up is the good direction. Defaults to true"),
478
484
  style: ExtensionComponentStyleSchema.optional()
479
485
  }).passthrough().describe("Single-number stat tile component");
486
+ var ProgressShapeSchema = z2.enum(["bar", "circle"]).describe("Drawn as a rail or as a ring");
487
+ var ProgressColorSchema = z2.enum(["accent", "success", "warning", "danger", "info", "neutral"]).describe("One of the theme colours");
488
+ var ProgressBarPropsSchema = z2.object({
489
+ component: z2.literal("ProgressBar"),
490
+ label: z2.string().describe("What is being measured"),
491
+ value: z2.number().describe("Where the reading sits. Clamped to the range"),
492
+ min: z2.number().optional().describe("Bottom of the range. Defaults to 0"),
493
+ max: z2.number().optional().describe("Top of the range. Defaults to 100"),
494
+ shape: ProgressShapeSchema.optional().describe("Defaults to bar"),
495
+ color: ProgressColorSchema.optional().describe("Defaults to accent"),
496
+ unit: z2.string().optional().describe("Written after the value"),
497
+ valueLabel: z2.string().optional().describe("The readout in words, replacing value and unit"),
498
+ caption: z2.string().optional().describe("One quiet line under the reading"),
499
+ icon: z2.string().optional().describe("Icon name"),
500
+ style: ExtensionComponentStyleSchema.optional()
501
+ }).passthrough().describe("Progress component");
480
502
  var KeyValueRowSchema = z2.object({
481
503
  label: z2.string(),
482
504
  value: z2.string(),
@@ -604,6 +626,13 @@ var PanelDefinitionSchema = z3.object({
604
626
  icon: z3.string().optional().describe("Icon name (from huge-icons)"),
605
627
  view: PanelViewSchema.describe("Panel view schema")
606
628
  }).describe("Panel definition");
629
+ var StatusCardDefinitionSchema = z3.object({
630
+ id: z3.string().describe("Unique card ID within the extension"),
631
+ title: z3.string().describe("What it is called where the user picks it"),
632
+ icon: z3.string().optional().describe("Icon name (from huge-icons)"),
633
+ size: z3.enum(["line", "block"]).describe("How much room it may take: one row, or up to three"),
634
+ view: PanelComponentViewSchema.describe("What it draws, and where the data comes from")
635
+ }).describe("Status card definition");
607
636
  var ProviderConfigViewSchema = z3.object({
608
637
  content: ExtensionComponentDataSchema.describe("Root component to render")
609
638
  }).describe("Provider configuration view (component tree)");
@@ -646,6 +675,7 @@ var StorageContributionsSchema = z3.object({
646
675
  var ExtensionContributionsSchema = z3.object({
647
676
  toolSettings: z3.array(ToolSettingsViewDefinitionSchema).optional().describe("Tool settings views"),
648
677
  panels: z3.array(PanelDefinitionSchema).optional().describe("Right panel contributions"),
678
+ statusCards: z3.array(StatusCardDefinitionSchema).optional().describe("Cards for the strip above the conversation list"),
649
679
  providers: z3.array(ProviderDefinitionSchema).optional().describe("AI providers"),
650
680
  tools: z3.array(ToolDefinitionSchema).optional().describe("Tools for Stina to use"),
651
681
  commands: z3.array(CommandDefinitionSchema).optional().describe("Slash commands"),
@@ -801,6 +831,20 @@ var StatTileCardSchema = z5.object({
801
831
  trendIsGood: z5.boolean().optional(),
802
832
  style
803
833
  }).strict();
834
+ var ProgressBarCardSchema = z5.object({
835
+ component: z5.literal("ProgressBar"),
836
+ label: z5.string(),
837
+ value: z5.number(),
838
+ min: z5.number().optional(),
839
+ max: z5.number().optional(),
840
+ shape: ProgressShapeSchema.optional(),
841
+ color: ProgressColorSchema.optional(),
842
+ unit: z5.string().optional(),
843
+ valueLabel: z5.string().optional(),
844
+ caption: z5.string().optional(),
845
+ icon: z5.string().optional(),
846
+ style
847
+ }).strict();
804
848
  var KeyValueListCardSchema = z5.object({
805
849
  component: z5.literal("KeyValueList"),
806
850
  rows: z5.array(
@@ -869,6 +913,7 @@ var CHAT_CARD_COMPONENTS = [
869
913
  "WeatherForecast",
870
914
  "Chart",
871
915
  "StatTile",
916
+ "ProgressBar",
872
917
  "KeyValueList",
873
918
  "Timeline",
874
919
  "Note",
@@ -891,11 +936,21 @@ var CARD_MEMBERS = [
891
936
  WeatherForecastCardSchema,
892
937
  ChartCardSchema,
893
938
  StatTileCardSchema,
939
+ ProgressBarCardSchema,
894
940
  KeyValueListCardSchema,
895
941
  TimelineCardSchema,
896
942
  NoteCardSchema,
897
943
  CalendarEventCardSchema
898
944
  ];
945
+ var CHAT_CARD_PROPS = Object.freeze(
946
+ Object.fromEntries(
947
+ CARD_MEMBERS.map((member) => {
948
+ const shape = member.shape;
949
+ const name = shape["component"]._def.value;
950
+ return [name, Object.freeze(Object.keys(shape))];
951
+ })
952
+ )
953
+ );
899
954
  var ChatCardComponentSchema = z5.lazy(
900
955
  () => z5.discriminatedUnion(
901
956
  "component",
@@ -1048,6 +1103,7 @@ export {
1048
1103
  AuthorSchema,
1049
1104
  ButtonPropsSchema,
1050
1105
  CHAT_CARD_COMPONENTS,
1106
+ CHAT_CARD_PROPS,
1051
1107
  CalendarEventPropsSchema,
1052
1108
  CalendarEventStatusSchema,
1053
1109
  CapabilityPermissionSchema,
@@ -1057,6 +1113,7 @@ export {
1057
1113
  ChatCardComponentSchema,
1058
1114
  ChatCardSchema,
1059
1115
  CheckboxPropsSchema,
1116
+ ClockPropsSchema,
1060
1117
  CollapsiblePropsSchema,
1061
1118
  CommandDefinitionSchema,
1062
1119
  ConditionalGroupPropsSchema,
@@ -1104,6 +1161,9 @@ export {
1104
1161
  PillPropsSchema,
1105
1162
  PillVariantSchema,
1106
1163
  PlatformSchema,
1164
+ ProgressBarPropsSchema,
1165
+ ProgressColorSchema,
1166
+ ProgressShapeSchema,
1107
1167
  PromptContributionSchema,
1108
1168
  PromptSectionSchema,
1109
1169
  ProviderConfigViewSchema,
@@ -1111,6 +1171,7 @@ export {
1111
1171
  SelectPropsSchema,
1112
1172
  StatTilePropsSchema,
1113
1173
  StatTrendSchema,
1174
+ StatusCardDefinitionSchema,
1114
1175
  StoragePermissionSchema,
1115
1176
  SystemPermissionSchema,
1116
1177
  TextInputPropsSchema,