@stina/extension-api 0.57.0 → 1.0.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.
@@ -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",
@@ -477,6 +479,22 @@ var StatTilePropsSchema = z2.object({
477
479
  trendIsGood: z2.boolean().optional().describe("Whether up is the good direction. Defaults to true"),
478
480
  style: ExtensionComponentStyleSchema.optional()
479
481
  }).passthrough().describe("Single-number stat tile component");
482
+ var ProgressShapeSchema = z2.enum(["bar", "circle"]).describe("Drawn as a rail or as a ring");
483
+ var ProgressColorSchema = z2.enum(["accent", "success", "warning", "danger", "info", "neutral"]).describe("One of the theme colours");
484
+ var ProgressBarPropsSchema = z2.object({
485
+ component: z2.literal("ProgressBar"),
486
+ label: z2.string().describe("What is being measured"),
487
+ value: z2.number().describe("Where the reading sits. Clamped to the range"),
488
+ min: z2.number().optional().describe("Bottom of the range. Defaults to 0"),
489
+ max: z2.number().optional().describe("Top of the range. Defaults to 100"),
490
+ shape: ProgressShapeSchema.optional().describe("Defaults to bar"),
491
+ color: ProgressColorSchema.optional().describe("Defaults to accent"),
492
+ unit: z2.string().optional().describe("Written after the value"),
493
+ valueLabel: z2.string().optional().describe("The readout in words, replacing value and unit"),
494
+ caption: z2.string().optional().describe("One quiet line under the reading"),
495
+ icon: z2.string().optional().describe("Icon name"),
496
+ style: ExtensionComponentStyleSchema.optional()
497
+ }).passthrough().describe("Progress component");
480
498
  var KeyValueRowSchema = z2.object({
481
499
  label: z2.string(),
482
500
  value: z2.string(),
@@ -604,6 +622,13 @@ var PanelDefinitionSchema = z3.object({
604
622
  icon: z3.string().optional().describe("Icon name (from huge-icons)"),
605
623
  view: PanelViewSchema.describe("Panel view schema")
606
624
  }).describe("Panel definition");
625
+ var StatusCardDefinitionSchema = z3.object({
626
+ id: z3.string().describe("Unique card ID within the extension"),
627
+ title: z3.string().describe("What it is called where the user picks it"),
628
+ icon: z3.string().optional().describe("Icon name (from huge-icons)"),
629
+ size: z3.enum(["line", "block"]).describe("How much room it may take: one row, or up to three"),
630
+ view: PanelComponentViewSchema.describe("What it draws, and where the data comes from")
631
+ }).describe("Status card definition");
607
632
  var ProviderConfigViewSchema = z3.object({
608
633
  content: ExtensionComponentDataSchema.describe("Root component to render")
609
634
  }).describe("Provider configuration view (component tree)");
@@ -646,6 +671,7 @@ var StorageContributionsSchema = z3.object({
646
671
  var ExtensionContributionsSchema = z3.object({
647
672
  toolSettings: z3.array(ToolSettingsViewDefinitionSchema).optional().describe("Tool settings views"),
648
673
  panels: z3.array(PanelDefinitionSchema).optional().describe("Right panel contributions"),
674
+ statusCards: z3.array(StatusCardDefinitionSchema).optional().describe("Cards for the strip above the conversation list"),
649
675
  providers: z3.array(ProviderDefinitionSchema).optional().describe("AI providers"),
650
676
  tools: z3.array(ToolDefinitionSchema).optional().describe("Tools for Stina to use"),
651
677
  commands: z3.array(CommandDefinitionSchema).optional().describe("Slash commands"),
@@ -801,6 +827,20 @@ var StatTileCardSchema = z5.object({
801
827
  trendIsGood: z5.boolean().optional(),
802
828
  style
803
829
  }).strict();
830
+ var ProgressBarCardSchema = z5.object({
831
+ component: z5.literal("ProgressBar"),
832
+ label: z5.string(),
833
+ value: z5.number(),
834
+ min: z5.number().optional(),
835
+ max: z5.number().optional(),
836
+ shape: ProgressShapeSchema.optional(),
837
+ color: ProgressColorSchema.optional(),
838
+ unit: z5.string().optional(),
839
+ valueLabel: z5.string().optional(),
840
+ caption: z5.string().optional(),
841
+ icon: z5.string().optional(),
842
+ style
843
+ }).strict();
804
844
  var KeyValueListCardSchema = z5.object({
805
845
  component: z5.literal("KeyValueList"),
806
846
  rows: z5.array(
@@ -869,6 +909,7 @@ var CHAT_CARD_COMPONENTS = [
869
909
  "WeatherForecast",
870
910
  "Chart",
871
911
  "StatTile",
912
+ "ProgressBar",
872
913
  "KeyValueList",
873
914
  "Timeline",
874
915
  "Note",
@@ -891,11 +932,21 @@ var CARD_MEMBERS = [
891
932
  WeatherForecastCardSchema,
892
933
  ChartCardSchema,
893
934
  StatTileCardSchema,
935
+ ProgressBarCardSchema,
894
936
  KeyValueListCardSchema,
895
937
  TimelineCardSchema,
896
938
  NoteCardSchema,
897
939
  CalendarEventCardSchema
898
940
  ];
941
+ var CHAT_CARD_PROPS = Object.freeze(
942
+ Object.fromEntries(
943
+ CARD_MEMBERS.map((member) => {
944
+ const shape = member.shape;
945
+ const name = shape["component"]._def.value;
946
+ return [name, Object.freeze(Object.keys(shape))];
947
+ })
948
+ )
949
+ );
899
950
  var ChatCardComponentSchema = z5.lazy(
900
951
  () => z5.discriminatedUnion(
901
952
  "component",
@@ -1007,7 +1058,8 @@ function describeType(schema) {
1007
1058
  return "component[]";
1008
1059
  case "ZodArray": {
1009
1060
  const inner = describeType(def.type);
1010
- return `${inner}[]`;
1061
+ const max = def.maxLength?.value;
1062
+ return typeof max === "number" ? `${inner}[\u2264${max}]` : `${inner}[]`;
1011
1063
  }
1012
1064
  case "ZodObject": {
1013
1065
  const shape = schema.shape;
@@ -1047,6 +1099,7 @@ export {
1047
1099
  AuthorSchema,
1048
1100
  ButtonPropsSchema,
1049
1101
  CHAT_CARD_COMPONENTS,
1102
+ CHAT_CARD_PROPS,
1050
1103
  CalendarEventPropsSchema,
1051
1104
  CalendarEventStatusSchema,
1052
1105
  CapabilityPermissionSchema,
@@ -1103,6 +1156,9 @@ export {
1103
1156
  PillPropsSchema,
1104
1157
  PillVariantSchema,
1105
1158
  PlatformSchema,
1159
+ ProgressBarPropsSchema,
1160
+ ProgressColorSchema,
1161
+ ProgressShapeSchema,
1106
1162
  PromptContributionSchema,
1107
1163
  PromptSectionSchema,
1108
1164
  ProviderConfigViewSchema,
@@ -1110,6 +1166,7 @@ export {
1110
1166
  SelectPropsSchema,
1111
1167
  StatTilePropsSchema,
1112
1168
  StatTrendSchema,
1169
+ StatusCardDefinitionSchema,
1113
1170
  StoragePermissionSchema,
1114
1171
  SystemPermissionSchema,
1115
1172
  TextInputPropsSchema,