@sidecar-ai/anthropic 0.1.0-alpha.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.
- package/dist/agent.d.ts +15 -0
- package/dist/agent.js +8 -0
- package/dist/agent.js.map +1 -0
- package/dist/command.d.ts +15 -0
- package/dist/command.js +10 -0
- package/dist/command.js.map +1 -0
- package/dist/components.d.ts +280 -0
- package/dist/components.js +100 -0
- package/dist/components.js.map +1 -0
- package/dist/hooks.d.ts +45 -0
- package/dist/hooks.js +28 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp.d.ts +22 -0
- package/dist/mcp.js +8 -0
- package/dist/mcp.js.map +1 -0
- package/dist/plugin.d.ts +20 -0
- package/dist/plugin.js +60 -0
- package/dist/plugin.js.map +1 -0
- package/dist/skill.d.ts +11 -0
- package/dist/skill.js +8 -0
- package/dist/skill.js.map +1 -0
- package/package.json +52 -0
package/dist/agent.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Typed authoring helpers for Claude plugin subagents. */
|
|
2
|
+
/** Claude plugin subagent definition emitted as markdown frontmatter and body. */
|
|
3
|
+
type ClaudeAgentDefinition = {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
prompt: string;
|
|
7
|
+
tools?: string[];
|
|
8
|
+
disallowedTools?: string[];
|
|
9
|
+
model?: string;
|
|
10
|
+
color?: string;
|
|
11
|
+
};
|
|
12
|
+
/** Declares a Claude plugin subagent. */
|
|
13
|
+
declare function agent(definition: ClaudeAgentDefinition): ClaudeAgentDefinition;
|
|
14
|
+
|
|
15
|
+
export { type ClaudeAgentDefinition, agent };
|
package/dist/agent.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../packages/anthropic/src/agent.ts"],"sourcesContent":["/** Typed authoring helpers for Claude plugin subagents. */\n\n/** Claude plugin subagent definition emitted as markdown frontmatter and body. */\nexport type ClaudeAgentDefinition = {\n name: string;\n description: string;\n prompt: string;\n tools?: string[];\n disallowedTools?: string[];\n model?: string;\n color?: string;\n};\n\n/** Declares a Claude plugin subagent. */\nexport function agent(\n definition: ClaudeAgentDefinition,\n): ClaudeAgentDefinition {\n return Object.freeze(definition);\n}\n"],"mappings":";AAcO,SAAS,MACd,YACuB;AACvB,SAAO,OAAO,OAAO,UAAU;AACjC;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Typed authoring helpers for Claude slash commands. */
|
|
2
|
+
/** Claude slash command definition emitted to `commands/*.md`. */
|
|
3
|
+
type ClaudeCommandDefinition = {
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
argumentHint?: string;
|
|
7
|
+
allowedTools?: string[];
|
|
8
|
+
prompt: string;
|
|
9
|
+
};
|
|
10
|
+
/** Declares a Claude slash command. */
|
|
11
|
+
declare function command(definition: ClaudeCommandDefinition): ClaudeCommandDefinition;
|
|
12
|
+
/** Alias for `command()` when the caller wants the host term in code. */
|
|
13
|
+
declare const slashCommand: typeof command;
|
|
14
|
+
|
|
15
|
+
export { type ClaudeCommandDefinition, command, slashCommand };
|
package/dist/command.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../packages/anthropic/src/command.ts"],"sourcesContent":["/** Typed authoring helpers for Claude slash commands. */\n\n/** Claude slash command definition emitted to `commands/*.md`. */\nexport type ClaudeCommandDefinition = {\n name: string;\n description?: string;\n argumentHint?: string;\n allowedTools?: string[];\n prompt: string;\n};\n\n/** Declares a Claude slash command. */\nexport function command(\n definition: ClaudeCommandDefinition,\n): ClaudeCommandDefinition {\n return Object.freeze(definition);\n}\n\n/** Alias for `command()` when the caller wants the host term in code. */\nexport const slashCommand = command;\n"],"mappings":";AAYO,SAAS,QACd,YACyB;AACzB,SAAO,OAAO,OAAO,UAAU;AACjC;AAGO,IAAM,eAAe;","names":[]}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
4
|
+
import * as _sidecar_ai_native_components from '@sidecar-ai/native/components';
|
|
5
|
+
export { AlertProps, AvatarGroupProps, AvatarProps, BadgeProps, ButtonLinkProps, ButtonProps, CalloutProps, CheckboxProps, CheckboxState, CircularProgressProps, CodeProps, ControlSize, CopyButtonProps, DividerProps, DropdownIconType, EmptyMessageIconProps, EmptyMessageProps, EmptyMessageTitleProps, EmptyStateProps, FieldDescriptionProps, FieldErrorProps, FieldLabelProps, FormFieldProps, HeadingProps, ImageProps, InlineProps, InputProps, KeyValueItem, KeyValueProps, LoadingDotsProps, LoadingIndicatorProps, Option, OptionGroup, Options, PopoverAlign, PopoverSide, ProgressProps, RadioGroupItemProps, RadioGroupProps, SegmentedControlOptionProps, SegmentedControlProps, SelectAction, SelectControlProps, SelectProps, SemanticColor, SemanticColors, ShimmerTextProps, Size, Sizes, SkeletonProps, SliderProps, SpinnerProps, StackProps, SurfaceProps, SwitchProps, TableProps, TabsProps, TextFieldProps, TextLinkProps, TextProps, TextareaProps, Variant, Variants } from '@sidecar-ai/native/components';
|
|
6
|
+
|
|
7
|
+
declare const Alert: React.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "color" | "title"> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
8
|
+
color?: _sidecar_ai_native_components.SemanticColors<"primary" | "danger" | "success" | "info" | "discovery" | "caution" | "warning">;
|
|
9
|
+
variant?: _sidecar_ai_native_components.Variants<"solid" | "soft" | "outline">;
|
|
10
|
+
title?: ReactNode;
|
|
11
|
+
description?: ReactNode;
|
|
12
|
+
actions?: ReactNode;
|
|
13
|
+
actionsPlacement?: "end" | "bottom";
|
|
14
|
+
indicator?: ReactNode | false;
|
|
15
|
+
actionsClassName?: string;
|
|
16
|
+
tone?: "default" | "success" | "warning" | "danger";
|
|
17
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const Avatar: React.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLSpanElement>, "color"> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
19
|
+
size?: number;
|
|
20
|
+
overflowCount?: number;
|
|
21
|
+
name?: string;
|
|
22
|
+
color?: _sidecar_ai_native_components.SemanticColors<"primary" | "secondary" | "success" | "info" | "discovery" | "danger">;
|
|
23
|
+
variant?: _sidecar_ai_native_components.Variants<"soft" | "solid">;
|
|
24
|
+
imageUrl?: string;
|
|
25
|
+
Icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
26
|
+
onClick?: () => void;
|
|
27
|
+
onPointerDown?: () => void;
|
|
28
|
+
src?: string;
|
|
29
|
+
alt?: string;
|
|
30
|
+
fallback?: ReactNode;
|
|
31
|
+
} & React.RefAttributes<HTMLSpanElement>>;
|
|
32
|
+
declare const AvatarGroup: typeof _sidecar_ai_native_components.AvatarGroup;
|
|
33
|
+
declare const Button: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color"> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
34
|
+
color?: _sidecar_ai_native_components.SemanticColors<"primary" | "secondary" | "danger" | "success" | "info" | "discovery" | "caution" | "warning">;
|
|
35
|
+
variant?: _sidecar_ai_native_components.Variants<"solid" | "soft" | "outline" | "ghost"> | _sidecar_ai_native_components.ControlIntent;
|
|
36
|
+
intent?: _sidecar_ai_native_components.ControlIntent;
|
|
37
|
+
pill?: boolean;
|
|
38
|
+
disabledTone?: "relaxed";
|
|
39
|
+
block?: boolean;
|
|
40
|
+
opticallyAlign?: "start" | "end";
|
|
41
|
+
size?: _sidecar_ai_native_components.ControlSize;
|
|
42
|
+
iconSize?: _sidecar_ai_native_components.Sizes<"sm" | "md" | "lg" | "xl" | "2xl">;
|
|
43
|
+
gutterSize?: _sidecar_ai_native_components.Sizes<"3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl">;
|
|
44
|
+
uniform?: boolean;
|
|
45
|
+
selected?: boolean;
|
|
46
|
+
loading?: boolean;
|
|
47
|
+
inert?: boolean;
|
|
48
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
49
|
+
declare const ButtonLink: React.ForwardRefExoticComponent<Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "color"> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
50
|
+
color?: _sidecar_ai_native_components.SemanticColors<"primary" | "secondary" | "danger" | "success" | "info" | "discovery" | "caution" | "warning">;
|
|
51
|
+
variant?: _sidecar_ai_native_components.Variants<"solid" | "soft" | "outline" | "ghost"> | _sidecar_ai_native_components.ControlIntent;
|
|
52
|
+
intent?: _sidecar_ai_native_components.ControlIntent;
|
|
53
|
+
pill?: boolean;
|
|
54
|
+
disabledTone?: "relaxed";
|
|
55
|
+
block?: boolean;
|
|
56
|
+
opticallyAlign?: "start" | "end";
|
|
57
|
+
size?: _sidecar_ai_native_components.ControlSize;
|
|
58
|
+
iconSize?: _sidecar_ai_native_components.Sizes<"sm" | "md" | "lg" | "xl" | "2xl">;
|
|
59
|
+
gutterSize?: _sidecar_ai_native_components.Sizes<"3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl">;
|
|
60
|
+
uniform?: boolean;
|
|
61
|
+
selected?: boolean;
|
|
62
|
+
loading?: boolean;
|
|
63
|
+
inert?: boolean;
|
|
64
|
+
} & {
|
|
65
|
+
external?: boolean;
|
|
66
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
67
|
+
declare const Badge: React.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLSpanElement>, "color"> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
68
|
+
children?: ReactNode;
|
|
69
|
+
variant?: _sidecar_ai_native_components.Variants<"solid" | "soft" | "outline">;
|
|
70
|
+
size?: _sidecar_ai_native_components.Sizes<"sm" | "md" | "lg">;
|
|
71
|
+
pill?: boolean;
|
|
72
|
+
color?: _sidecar_ai_native_components.SemanticColors<"secondary" | "success" | "danger" | "warning" | "info" | "discovery">;
|
|
73
|
+
tone?: "default" | "success" | "warning" | "danger";
|
|
74
|
+
} & React.RefAttributes<HTMLSpanElement>>;
|
|
75
|
+
declare const Callout: React.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "color" | "title"> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
76
|
+
color?: _sidecar_ai_native_components.SemanticColors<"primary" | "danger" | "success" | "info" | "discovery" | "caution" | "warning">;
|
|
77
|
+
variant?: _sidecar_ai_native_components.Variants<"solid" | "soft" | "outline">;
|
|
78
|
+
title?: ReactNode;
|
|
79
|
+
description?: ReactNode;
|
|
80
|
+
actions?: ReactNode;
|
|
81
|
+
actionsPlacement?: "end" | "bottom";
|
|
82
|
+
indicator?: ReactNode | false;
|
|
83
|
+
actionsClassName?: string;
|
|
84
|
+
tone?: "default" | "success" | "warning" | "danger";
|
|
85
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
86
|
+
declare const Checkbox: typeof _sidecar_ai_native_components.Checkbox;
|
|
87
|
+
declare const CircularProgress: typeof _sidecar_ai_native_components.CircularProgress;
|
|
88
|
+
declare const Code: React.ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & _sidecar_ai_native_components.PrimitiveProps & React.RefAttributes<HTMLElement>>;
|
|
89
|
+
declare const CopyButton: typeof _sidecar_ai_native_components.CopyButton;
|
|
90
|
+
declare const Divider: React.ForwardRefExoticComponent<HTMLAttributes<HTMLHRElement> & _sidecar_ai_native_components.PrimitiveProps & React.RefAttributes<HTMLHRElement>>;
|
|
91
|
+
declare const EmptyMessage: (({ children, className, fill, recipe }: _sidecar_ai_native_components.EmptyMessageProps) => React.FunctionComponentElement<React.ProviderProps<_sidecar_ai_native_components.ComponentRecipe>>) & {
|
|
92
|
+
ActionRow: ({ children, className, }: {
|
|
93
|
+
children: ReactNode;
|
|
94
|
+
className?: string;
|
|
95
|
+
}) => React.DetailedReactHTMLElement<{
|
|
96
|
+
className: string | undefined;
|
|
97
|
+
"data-sc-component": string;
|
|
98
|
+
}, HTMLElement>;
|
|
99
|
+
Description: ({ children, className, }: {
|
|
100
|
+
children: ReactNode;
|
|
101
|
+
className?: string;
|
|
102
|
+
}) => React.DetailedReactHTMLElement<{
|
|
103
|
+
className: string | undefined;
|
|
104
|
+
"data-sc-component": string;
|
|
105
|
+
}, HTMLElement>;
|
|
106
|
+
Icon: ({ children, className, color, recipe, size }: _sidecar_ai_native_components.EmptyMessageIconProps) => React.DetailedReactHTMLElement<{
|
|
107
|
+
className: string | undefined;
|
|
108
|
+
"data-sc-color": "danger" | "warning" | "secondary";
|
|
109
|
+
"data-sc-component": string;
|
|
110
|
+
"data-sc-recipe": _sidecar_ai_native_components.ComponentRecipe;
|
|
111
|
+
"data-sc-size": "sm" | "md";
|
|
112
|
+
}, HTMLElement>;
|
|
113
|
+
Title: ({ children, className, color, recipe }: _sidecar_ai_native_components.EmptyMessageTitleProps) => React.DetailedReactHTMLElement<{
|
|
114
|
+
className: string | undefined;
|
|
115
|
+
"data-sc-color": "danger" | "warning" | "secondary";
|
|
116
|
+
"data-sc-component": string;
|
|
117
|
+
"data-sc-recipe": _sidecar_ai_native_components.ComponentRecipe;
|
|
118
|
+
}, HTMLElement>;
|
|
119
|
+
};
|
|
120
|
+
declare const EmptyState: React.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title"> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
121
|
+
title: ReactNode;
|
|
122
|
+
action?: ReactNode;
|
|
123
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
124
|
+
declare const FieldDescription: React.ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & _sidecar_ai_native_components.PrimitiveProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
125
|
+
declare const FieldError: React.ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & _sidecar_ai_native_components.PrimitiveProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
126
|
+
declare const FieldLabel: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<HTMLLabelElement> & _sidecar_ai_native_components.PrimitiveProps & React.RefAttributes<HTMLLabelElement>>;
|
|
127
|
+
declare const FormField: typeof _sidecar_ai_native_components.FormField;
|
|
128
|
+
declare const Heading: React.ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
129
|
+
level?: 1 | 2 | 3 | 4;
|
|
130
|
+
} & React.RefAttributes<HTMLHeadingElement>>;
|
|
131
|
+
declare const Image: React.ForwardRefExoticComponent<React.ImgHTMLAttributes<HTMLImageElement> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
132
|
+
forceRenderAfterLoadFail?: boolean;
|
|
133
|
+
} & React.RefAttributes<HTMLImageElement>>;
|
|
134
|
+
declare const Inline: React.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
135
|
+
align?: "start" | "center" | "end";
|
|
136
|
+
gap?: "xs" | "sm" | "md" | "lg";
|
|
137
|
+
wrap?: boolean;
|
|
138
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
139
|
+
declare const Input: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "disabled"> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
140
|
+
variant?: _sidecar_ai_native_components.Variants<"outline" | "soft">;
|
|
141
|
+
size?: _sidecar_ai_native_components.ControlSize;
|
|
142
|
+
gutterSize?: _sidecar_ai_native_components.Sizes<"2xs" | "xs" | "sm" | "md" | "lg" | "xl">;
|
|
143
|
+
disabled?: boolean;
|
|
144
|
+
invalid?: boolean;
|
|
145
|
+
allowAutofillExtensions?: boolean;
|
|
146
|
+
autoSelect?: boolean;
|
|
147
|
+
onAutofill?: () => void;
|
|
148
|
+
startAdornment?: ReactNode;
|
|
149
|
+
endAdornment?: ReactNode;
|
|
150
|
+
pill?: boolean;
|
|
151
|
+
block?: boolean;
|
|
152
|
+
opticallyAlign?: "start" | "end";
|
|
153
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
154
|
+
declare const KeyValue: React.ForwardRefExoticComponent<HTMLAttributes<HTMLDListElement> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
155
|
+
items: readonly _sidecar_ai_native_components.KeyValueItem[];
|
|
156
|
+
} & React.RefAttributes<HTMLDListElement>>;
|
|
157
|
+
declare const LoadingDots: typeof _sidecar_ai_native_components.LoadingDots;
|
|
158
|
+
declare const LoadingIndicator: typeof _sidecar_ai_native_components.LoadingIndicator;
|
|
159
|
+
declare const Progress: React.ForwardRefExoticComponent<React.ProgressHTMLAttributes<HTMLProgressElement> & _sidecar_ai_native_components.PrimitiveProps & React.RefAttributes<HTMLProgressElement>>;
|
|
160
|
+
declare const RadioGroup: (<T extends string>({ children, className, defaultValue, direction, disabled, name, onChange, recipe, required, value, ...restProps }: _sidecar_ai_native_components.RadioGroupProps<T>) => React.FunctionComponentElement<React.ProviderProps<{
|
|
161
|
+
disabled: boolean;
|
|
162
|
+
name?: string;
|
|
163
|
+
onChange(value: string): void;
|
|
164
|
+
recipe: _sidecar_ai_native_components.ComponentRecipe;
|
|
165
|
+
required: boolean;
|
|
166
|
+
value?: string;
|
|
167
|
+
} | null>>) & {
|
|
168
|
+
Item: <T extends string>({ block, children, className, disabled, required, value, }: _sidecar_ai_native_components.RadioGroupItemProps<T>) => React.DetailedReactHTMLElement<{
|
|
169
|
+
"aria-checked": boolean;
|
|
170
|
+
className: string | undefined;
|
|
171
|
+
disabled: boolean;
|
|
172
|
+
onClick: () => void;
|
|
173
|
+
role: "radio";
|
|
174
|
+
type: string;
|
|
175
|
+
"data-sc-block": string | undefined;
|
|
176
|
+
"data-sc-checked": string | undefined;
|
|
177
|
+
"data-sc-component": string;
|
|
178
|
+
"data-sc-disabled": string | undefined;
|
|
179
|
+
"data-sc-recipe": _sidecar_ai_native_components.ComponentRecipe;
|
|
180
|
+
}, HTMLElement>;
|
|
181
|
+
};
|
|
182
|
+
declare const SegmentedControl: (<T extends string>({ block, children, className, defaultValue, disabled, gutterSize, onChange, onClick, pill, recipe, size, value, ...restProps }: _sidecar_ai_native_components.SegmentedControlProps<T>) => React.FunctionComponentElement<React.ProviderProps<{
|
|
183
|
+
disabled: boolean;
|
|
184
|
+
onClick?: () => void;
|
|
185
|
+
onChange(value: string): void;
|
|
186
|
+
recipe: _sidecar_ai_native_components.ComponentRecipe;
|
|
187
|
+
selected?: string;
|
|
188
|
+
} | null>>) & {
|
|
189
|
+
Option: ({ children, disabled, value, ...restProps }: _sidecar_ai_native_components.SegmentedControlOptionProps) => React.DetailedReactHTMLElement<{
|
|
190
|
+
"aria-pressed": boolean;
|
|
191
|
+
disabled: boolean;
|
|
192
|
+
onClick: () => void;
|
|
193
|
+
type: string;
|
|
194
|
+
"data-sc-component": string;
|
|
195
|
+
"data-sc-disabled": string | undefined;
|
|
196
|
+
"data-sc-recipe": _sidecar_ai_native_components.ComponentRecipe;
|
|
197
|
+
"data-sc-selected": string | undefined;
|
|
198
|
+
"aria-label"?: string;
|
|
199
|
+
}, HTMLElement>;
|
|
200
|
+
};
|
|
201
|
+
declare const Select: typeof _sidecar_ai_native_components.Select;
|
|
202
|
+
declare const SelectControl: React.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLSpanElement>, "onClick"> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
203
|
+
variant?: _sidecar_ai_native_components.Variants<"soft" | "outline" | "ghost">;
|
|
204
|
+
pill?: boolean;
|
|
205
|
+
block?: boolean;
|
|
206
|
+
opticallyAlign?: "start" | "end";
|
|
207
|
+
disabled?: boolean;
|
|
208
|
+
invalid?: boolean;
|
|
209
|
+
selected?: boolean;
|
|
210
|
+
onClearClick?: () => void;
|
|
211
|
+
onInteract?: () => void;
|
|
212
|
+
size?: _sidecar_ai_native_components.ControlSize;
|
|
213
|
+
loading?: boolean;
|
|
214
|
+
dropdownIconType?: _sidecar_ai_native_components.DropdownIconType;
|
|
215
|
+
StartIcon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
216
|
+
children: ReactNode;
|
|
217
|
+
} & React.RefAttributes<HTMLSpanElement>>;
|
|
218
|
+
declare const ShimmerText: typeof _sidecar_ai_native_components.ShimmerText;
|
|
219
|
+
declare const Skeleton: React.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
220
|
+
width?: string;
|
|
221
|
+
height?: string;
|
|
222
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
223
|
+
declare const Slider: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> & _sidecar_ai_native_components.PrimitiveProps & React.RefAttributes<HTMLInputElement>>;
|
|
224
|
+
declare const Spinner: typeof _sidecar_ai_native_components.LoadingIndicator;
|
|
225
|
+
declare const Stack: React.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
226
|
+
gap?: "xs" | "sm" | "md" | "lg";
|
|
227
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
228
|
+
declare const Surface: React.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
229
|
+
variant?: "plain" | "card" | "inset";
|
|
230
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
231
|
+
declare const Switch: typeof _sidecar_ai_native_components.Switch;
|
|
232
|
+
declare const Table: React.ForwardRefExoticComponent<React.TableHTMLAttributes<HTMLTableElement> & _sidecar_ai_native_components.PrimitiveProps & React.RefAttributes<HTMLTableElement>>;
|
|
233
|
+
declare const Tabs: React.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & _sidecar_ai_native_components.PrimitiveProps & React.RefAttributes<HTMLDivElement>>;
|
|
234
|
+
declare const Text: React.ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
235
|
+
tone?: "default" | "muted" | "success" | "warning" | "danger";
|
|
236
|
+
} & React.RefAttributes<HTMLParagraphElement>>;
|
|
237
|
+
declare const Textarea: React.ForwardRefExoticComponent<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "disabled"> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
238
|
+
variant?: _sidecar_ai_native_components.Variants<"outline" | "soft">;
|
|
239
|
+
size?: _sidecar_ai_native_components.ControlSize;
|
|
240
|
+
gutterSize?: _sidecar_ai_native_components.Sizes<"2xs" | "xs" | "sm" | "md" | "lg" | "xl">;
|
|
241
|
+
disabled?: boolean;
|
|
242
|
+
invalid?: boolean;
|
|
243
|
+
allowAutofillExtensions?: boolean;
|
|
244
|
+
autoSelect?: boolean;
|
|
245
|
+
onAutofill?: () => void;
|
|
246
|
+
autoResize?: boolean;
|
|
247
|
+
maxRows?: number;
|
|
248
|
+
pill?: boolean;
|
|
249
|
+
block?: boolean;
|
|
250
|
+
opticallyAlign?: "start" | "end";
|
|
251
|
+
} & React.RefAttributes<HTMLTextAreaElement>>;
|
|
252
|
+
declare const TextField: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "disabled"> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
253
|
+
variant?: _sidecar_ai_native_components.Variants<"outline" | "soft">;
|
|
254
|
+
size?: _sidecar_ai_native_components.ControlSize;
|
|
255
|
+
gutterSize?: _sidecar_ai_native_components.Sizes<"2xs" | "xs" | "sm" | "md" | "lg" | "xl">;
|
|
256
|
+
disabled?: boolean;
|
|
257
|
+
invalid?: boolean;
|
|
258
|
+
allowAutofillExtensions?: boolean;
|
|
259
|
+
autoSelect?: boolean;
|
|
260
|
+
onAutofill?: () => void;
|
|
261
|
+
startAdornment?: ReactNode;
|
|
262
|
+
endAdornment?: ReactNode;
|
|
263
|
+
pill?: boolean;
|
|
264
|
+
block?: boolean;
|
|
265
|
+
opticallyAlign?: "start" | "end";
|
|
266
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
267
|
+
declare const TextLink: React.ForwardRefExoticComponent<Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "children"> & _sidecar_ai_native_components.PrimitiveProps & {
|
|
268
|
+
children: ReactNode;
|
|
269
|
+
primary?: boolean;
|
|
270
|
+
underline?: boolean;
|
|
271
|
+
forceExternal?: boolean;
|
|
272
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
273
|
+
/** Props for hiding old widget instances after supersession. */
|
|
274
|
+
type SupersededProps = HTMLAttributes<HTMLDivElement> & {
|
|
275
|
+
children?: ReactNode;
|
|
276
|
+
};
|
|
277
|
+
/** Small Claude-styled notice for an older widget instance. */
|
|
278
|
+
declare function SupersededNotice({ children, ...props }: SupersededProps): react_jsx_runtime.JSX.Element;
|
|
279
|
+
|
|
280
|
+
export { Alert, Avatar, AvatarGroup, Badge, Button, ButtonLink, Callout, Checkbox, CircularProgress, Code, CopyButton, Divider, EmptyMessage, EmptyState, FieldDescription, FieldError, FieldLabel, FormField, Heading, Image, Inline, Input, KeyValue, LoadingDots, LoadingIndicator, Progress, RadioGroup, SegmentedControl, Select, SelectControl, ShimmerText, Skeleton, Slider, Spinner, Stack, SupersededNotice, type SupersededProps, Surface, Switch, Table, Tabs, Text, TextField, TextLink, Textarea };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// packages/anthropic/src/components.tsx
|
|
2
|
+
import { createPrimitiveComponents } from "@sidecar-ai/native/components";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var primitives = createPrimitiveComponents("claude");
|
|
5
|
+
var Alert = primitives.Alert;
|
|
6
|
+
var Avatar = primitives.Avatar;
|
|
7
|
+
var AvatarGroup = primitives.AvatarGroup;
|
|
8
|
+
var Button = primitives.Button;
|
|
9
|
+
var ButtonLink = primitives.ButtonLink;
|
|
10
|
+
var Badge = primitives.Badge;
|
|
11
|
+
var Callout = primitives.Callout;
|
|
12
|
+
var Checkbox = primitives.Checkbox;
|
|
13
|
+
var CircularProgress = primitives.CircularProgress;
|
|
14
|
+
var Code = primitives.Code;
|
|
15
|
+
var CopyButton = primitives.CopyButton;
|
|
16
|
+
var Divider = primitives.Divider;
|
|
17
|
+
var EmptyMessage = primitives.EmptyMessage;
|
|
18
|
+
var EmptyState = primitives.EmptyState;
|
|
19
|
+
var FieldDescription = primitives.FieldDescription;
|
|
20
|
+
var FieldError = primitives.FieldError;
|
|
21
|
+
var FieldLabel = primitives.FieldLabel;
|
|
22
|
+
var FormField = primitives.FormField;
|
|
23
|
+
var Heading = primitives.Heading;
|
|
24
|
+
var Image = primitives.Image;
|
|
25
|
+
var Inline = primitives.Inline;
|
|
26
|
+
var Input = primitives.Input;
|
|
27
|
+
var KeyValue = primitives.KeyValue;
|
|
28
|
+
var LoadingDots = primitives.LoadingDots;
|
|
29
|
+
var LoadingIndicator = primitives.LoadingIndicator;
|
|
30
|
+
var Progress = primitives.Progress;
|
|
31
|
+
var RadioGroup = primitives.RadioGroup;
|
|
32
|
+
var SegmentedControl = primitives.SegmentedControl;
|
|
33
|
+
var Select = primitives.Select;
|
|
34
|
+
var SelectControl = primitives.SelectControl;
|
|
35
|
+
var ShimmerText = primitives.ShimmerText;
|
|
36
|
+
var Skeleton = primitives.Skeleton;
|
|
37
|
+
var Slider = primitives.Slider;
|
|
38
|
+
var Spinner = primitives.Spinner;
|
|
39
|
+
var Stack = primitives.Stack;
|
|
40
|
+
var Surface = primitives.Surface;
|
|
41
|
+
var Switch = primitives.Switch;
|
|
42
|
+
var Table = primitives.Table;
|
|
43
|
+
var Tabs = primitives.Tabs;
|
|
44
|
+
var Text = primitives.Text;
|
|
45
|
+
var Textarea = primitives.Textarea;
|
|
46
|
+
var TextField = primitives.TextField;
|
|
47
|
+
var TextLink = primitives.TextLink;
|
|
48
|
+
function SupersededNotice({
|
|
49
|
+
children = "A newer result is available in this conversation.",
|
|
50
|
+
...props
|
|
51
|
+
}) {
|
|
52
|
+
return /* @__PURE__ */ jsx("div", { "data-sc-component": "surface", "data-sc-variant": "inset", "data-sc-recipe": "claude", ...props, children: /* @__PURE__ */ jsx("p", { "data-sc-component": "text", "data-sc-tone": "muted", "data-sc-recipe": "claude", children }) });
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
Alert,
|
|
56
|
+
Avatar,
|
|
57
|
+
AvatarGroup,
|
|
58
|
+
Badge,
|
|
59
|
+
Button,
|
|
60
|
+
ButtonLink,
|
|
61
|
+
Callout,
|
|
62
|
+
Checkbox,
|
|
63
|
+
CircularProgress,
|
|
64
|
+
Code,
|
|
65
|
+
CopyButton,
|
|
66
|
+
Divider,
|
|
67
|
+
EmptyMessage,
|
|
68
|
+
EmptyState,
|
|
69
|
+
FieldDescription,
|
|
70
|
+
FieldError,
|
|
71
|
+
FieldLabel,
|
|
72
|
+
FormField,
|
|
73
|
+
Heading,
|
|
74
|
+
Image,
|
|
75
|
+
Inline,
|
|
76
|
+
Input,
|
|
77
|
+
KeyValue,
|
|
78
|
+
LoadingDots,
|
|
79
|
+
LoadingIndicator,
|
|
80
|
+
Progress,
|
|
81
|
+
RadioGroup,
|
|
82
|
+
SegmentedControl,
|
|
83
|
+
Select,
|
|
84
|
+
SelectControl,
|
|
85
|
+
ShimmerText,
|
|
86
|
+
Skeleton,
|
|
87
|
+
Slider,
|
|
88
|
+
Spinner,
|
|
89
|
+
Stack,
|
|
90
|
+
SupersededNotice,
|
|
91
|
+
Surface,
|
|
92
|
+
Switch,
|
|
93
|
+
Table,
|
|
94
|
+
Tabs,
|
|
95
|
+
Text,
|
|
96
|
+
TextField,
|
|
97
|
+
TextLink,
|
|
98
|
+
Textarea
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../packages/anthropic/src/components.tsx"],"sourcesContent":["/**\n * Claude-pinned React components.\n *\n * Shared primitives use the same Claude recipe that `@sidecar-ai/native` selects\n * at runtime inside Claude MCP Apps. Claude-specific helpers live beside them.\n */\nimport { createPrimitiveComponents } from \"@sidecar-ai/native/components\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\n\nexport type {\n AlertProps,\n AvatarGroupProps,\n AvatarProps,\n BadgeProps,\n ButtonLinkProps,\n ButtonProps,\n CalloutProps,\n CheckboxProps,\n CheckboxState,\n CircularProgressProps,\n CodeProps,\n ControlSize,\n CopyButtonProps,\n DropdownIconType,\n DividerProps,\n EmptyMessageIconProps,\n EmptyMessageProps,\n EmptyMessageTitleProps,\n EmptyStateProps,\n FieldDescriptionProps,\n FieldErrorProps,\n FieldLabelProps,\n FormFieldProps,\n HeadingProps,\n ImageProps,\n InlineProps,\n InputProps,\n KeyValueItem,\n KeyValueProps,\n LoadingDotsProps,\n LoadingIndicatorProps,\n Option,\n OptionGroup,\n Options,\n PopoverAlign,\n PopoverSide,\n ProgressProps,\n RadioGroupItemProps,\n RadioGroupProps,\n SegmentedControlOptionProps,\n SegmentedControlProps,\n SelectAction,\n SelectControlProps,\n SelectProps,\n SemanticColor,\n SemanticColors,\n ShimmerTextProps,\n Size,\n Sizes,\n SkeletonProps,\n SliderProps,\n SpinnerProps,\n StackProps,\n SurfaceProps,\n SwitchProps,\n TableProps,\n TabsProps,\n TextareaProps,\n TextFieldProps,\n TextLinkProps,\n TextProps,\n Variant,\n Variants,\n} from \"@sidecar-ai/native/components\";\n\nconst primitives = createPrimitiveComponents(\"claude\");\n\nexport const Alert = primitives.Alert;\nexport const Avatar = primitives.Avatar;\nexport const AvatarGroup = primitives.AvatarGroup;\nexport const Button = primitives.Button;\nexport const ButtonLink = primitives.ButtonLink;\nexport const Badge = primitives.Badge;\nexport const Callout = primitives.Callout;\nexport const Checkbox = primitives.Checkbox;\nexport const CircularProgress = primitives.CircularProgress;\nexport const Code = primitives.Code;\nexport const CopyButton = primitives.CopyButton;\nexport const Divider = primitives.Divider;\nexport const EmptyMessage = primitives.EmptyMessage;\nexport const EmptyState = primitives.EmptyState;\nexport const FieldDescription = primitives.FieldDescription;\nexport const FieldError = primitives.FieldError;\nexport const FieldLabel = primitives.FieldLabel;\nexport const FormField = primitives.FormField;\nexport const Heading = primitives.Heading;\nexport const Image = primitives.Image;\nexport const Inline = primitives.Inline;\nexport const Input = primitives.Input;\nexport const KeyValue = primitives.KeyValue;\nexport const LoadingDots = primitives.LoadingDots;\nexport const LoadingIndicator = primitives.LoadingIndicator;\nexport const Progress = primitives.Progress;\nexport const RadioGroup = primitives.RadioGroup;\nexport const SegmentedControl = primitives.SegmentedControl;\nexport const Select = primitives.Select;\nexport const SelectControl = primitives.SelectControl;\nexport const ShimmerText = primitives.ShimmerText;\nexport const Skeleton = primitives.Skeleton;\nexport const Slider = primitives.Slider;\nexport const Spinner = primitives.Spinner;\nexport const Stack = primitives.Stack;\nexport const Surface = primitives.Surface;\nexport const Switch = primitives.Switch;\nexport const Table = primitives.Table;\nexport const Tabs = primitives.Tabs;\nexport const Text = primitives.Text;\nexport const Textarea = primitives.Textarea;\nexport const TextField = primitives.TextField;\nexport const TextLink = primitives.TextLink;\n\n/** Props for hiding old widget instances after supersession. */\nexport type SupersededProps = HTMLAttributes<HTMLDivElement> & {\n children?: ReactNode;\n};\n\n/** Small Claude-styled notice for an older widget instance. */\nexport function SupersededNotice({\n children = \"A newer result is available in this conversation.\",\n ...props\n}: SupersededProps) {\n return (\n <div data-sc-component=\"surface\" data-sc-variant=\"inset\" data-sc-recipe=\"claude\" {...props}>\n <p data-sc-component=\"text\" data-sc-tone=\"muted\" data-sc-recipe=\"claude\">\n {children}\n </p>\n </div>\n );\n}\n"],"mappings":";AAMA,SAAS,iCAAiC;AA+HpC;AA1DN,IAAM,aAAa,0BAA0B,QAAQ;AAE9C,IAAM,QAAQ,WAAW;AACzB,IAAM,SAAS,WAAW;AAC1B,IAAM,cAAc,WAAW;AAC/B,IAAM,SAAS,WAAW;AAC1B,IAAM,aAAa,WAAW;AAC9B,IAAM,QAAQ,WAAW;AACzB,IAAM,UAAU,WAAW;AAC3B,IAAM,WAAW,WAAW;AAC5B,IAAM,mBAAmB,WAAW;AACpC,IAAM,OAAO,WAAW;AACxB,IAAM,aAAa,WAAW;AAC9B,IAAM,UAAU,WAAW;AAC3B,IAAM,eAAe,WAAW;AAChC,IAAM,aAAa,WAAW;AAC9B,IAAM,mBAAmB,WAAW;AACpC,IAAM,aAAa,WAAW;AAC9B,IAAM,aAAa,WAAW;AAC9B,IAAM,YAAY,WAAW;AAC7B,IAAM,UAAU,WAAW;AAC3B,IAAM,QAAQ,WAAW;AACzB,IAAM,SAAS,WAAW;AAC1B,IAAM,QAAQ,WAAW;AACzB,IAAM,WAAW,WAAW;AAC5B,IAAM,cAAc,WAAW;AAC/B,IAAM,mBAAmB,WAAW;AACpC,IAAM,WAAW,WAAW;AAC5B,IAAM,aAAa,WAAW;AAC9B,IAAM,mBAAmB,WAAW;AACpC,IAAM,SAAS,WAAW;AAC1B,IAAM,gBAAgB,WAAW;AACjC,IAAM,cAAc,WAAW;AAC/B,IAAM,WAAW,WAAW;AAC5B,IAAM,SAAS,WAAW;AAC1B,IAAM,UAAU,WAAW;AAC3B,IAAM,QAAQ,WAAW;AACzB,IAAM,UAAU,WAAW;AAC3B,IAAM,SAAS,WAAW;AAC1B,IAAM,QAAQ,WAAW;AACzB,IAAM,OAAO,WAAW;AACxB,IAAM,OAAO,WAAW;AACxB,IAAM,WAAW,WAAW;AAC5B,IAAM,YAAY,WAAW;AAC7B,IAAM,WAAW,WAAW;AAQ5B,SAAS,iBAAiB;AAAA,EAC/B,WAAW;AAAA,EACX,GAAG;AACL,GAAoB;AAClB,SACE,oBAAC,SAAI,qBAAkB,WAAU,mBAAgB,SAAQ,kBAAe,UAAU,GAAG,OACnF,8BAAC,OAAE,qBAAkB,QAAO,gBAAa,SAAQ,kBAAe,UAC7D,UACH,GACF;AAEJ;","names":[]}
|
package/dist/hooks.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Typed authoring helpers for Claude plugin hook configuration. */
|
|
2
|
+
/** Claude hook event name. String extension keeps the type forward-compatible. */
|
|
3
|
+
type ClaudeHookEvent = "UserPromptExpansion" | "PreToolUse" | "PermissionRequest" | "PostToolUse" | "PostToolUseFailure" | "Notification" | "UserPromptSubmit" | "Stop" | "SubagentStop" | "SessionStart" | "PreCompact" | (string & {});
|
|
4
|
+
/** Command hook executed by the host shell. */
|
|
5
|
+
type ClaudeHookCommand = {
|
|
6
|
+
type: "command";
|
|
7
|
+
command: string;
|
|
8
|
+
args?: string[];
|
|
9
|
+
timeout?: number;
|
|
10
|
+
if?: string;
|
|
11
|
+
shell?: "bash" | "powershell" | (string & {});
|
|
12
|
+
};
|
|
13
|
+
/** HTTP hook executed by the Claude host. */
|
|
14
|
+
type ClaudeHookHttp = {
|
|
15
|
+
type: "http";
|
|
16
|
+
url: string;
|
|
17
|
+
timeout?: number;
|
|
18
|
+
headers?: Record<string, string>;
|
|
19
|
+
allowedEnvVars?: string[];
|
|
20
|
+
};
|
|
21
|
+
/** Hook handler supported by Claude plugin hooks. */
|
|
22
|
+
type ClaudeHookHandler = ClaudeHookCommand | ClaudeHookHttp;
|
|
23
|
+
/** Hook matcher entry for one Claude hook event. */
|
|
24
|
+
type ClaudeHookMatcher = {
|
|
25
|
+
matcher?: string;
|
|
26
|
+
run: ClaudeHookHandler[];
|
|
27
|
+
};
|
|
28
|
+
/** Single reserved `hooks/<name>/hook.ts` declaration. */
|
|
29
|
+
type ClaudeHookDefinition = {
|
|
30
|
+
event: ClaudeHookEvent;
|
|
31
|
+
matcher?: string;
|
|
32
|
+
run: ClaudeHookHandler[];
|
|
33
|
+
};
|
|
34
|
+
/** Complete Claude hook configuration object. */
|
|
35
|
+
type ClaudeHooksDefinition = Partial<Record<ClaudeHookEvent, ClaudeHookMatcher[]>>;
|
|
36
|
+
/** Declares one Claude hook matcher entry. */
|
|
37
|
+
declare function hook(definition: ClaudeHookDefinition): ClaudeHookDefinition;
|
|
38
|
+
/** Freezes a complete hook configuration. */
|
|
39
|
+
declare function hooks(definition: ClaudeHooksDefinition): ClaudeHooksDefinition;
|
|
40
|
+
/** Creates a command hook using Claude's official hook handler vocabulary. */
|
|
41
|
+
declare function commandHook(command: string, options?: Omit<ClaudeHookCommand, "type" | "command">): ClaudeHookCommand;
|
|
42
|
+
/** Creates an HTTP hook using Claude's official hook handler vocabulary. */
|
|
43
|
+
declare function httpHook(url: string, options?: Omit<ClaudeHookHttp, "type" | "url">): ClaudeHookHttp;
|
|
44
|
+
|
|
45
|
+
export { type ClaudeHookCommand, type ClaudeHookDefinition, type ClaudeHookEvent, type ClaudeHookHandler, type ClaudeHookHttp, type ClaudeHookMatcher, type ClaudeHooksDefinition, commandHook, hook, hooks, httpHook };
|
package/dist/hooks.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// packages/anthropic/src/hooks.ts
|
|
2
|
+
function hook(definition) {
|
|
3
|
+
return Object.freeze(definition);
|
|
4
|
+
}
|
|
5
|
+
function hooks(definition) {
|
|
6
|
+
return Object.freeze(definition);
|
|
7
|
+
}
|
|
8
|
+
function commandHook(command, options = {}) {
|
|
9
|
+
return Object.freeze({
|
|
10
|
+
type: "command",
|
|
11
|
+
command,
|
|
12
|
+
...options
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function httpHook(url, options = {}) {
|
|
16
|
+
return Object.freeze({
|
|
17
|
+
type: "http",
|
|
18
|
+
url,
|
|
19
|
+
...options
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
commandHook,
|
|
24
|
+
hook,
|
|
25
|
+
hooks,
|
|
26
|
+
httpHook
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../packages/anthropic/src/hooks.ts"],"sourcesContent":["/** Typed authoring helpers for Claude plugin hook configuration. */\n\n/** Claude hook event name. String extension keeps the type forward-compatible. */\nexport type ClaudeHookEvent =\n | \"UserPromptExpansion\"\n | \"PreToolUse\"\n | \"PermissionRequest\"\n | \"PostToolUse\"\n | \"PostToolUseFailure\"\n | \"Notification\"\n | \"UserPromptSubmit\"\n | \"Stop\"\n | \"SubagentStop\"\n | \"SessionStart\"\n | \"PreCompact\"\n | (string & {});\n\n/** Command hook executed by the host shell. */\nexport type ClaudeHookCommand = {\n type: \"command\";\n command: string;\n args?: string[];\n timeout?: number;\n if?: string;\n shell?: \"bash\" | \"powershell\" | (string & {});\n};\n\n/** HTTP hook executed by the Claude host. */\nexport type ClaudeHookHttp = {\n type: \"http\";\n url: string;\n timeout?: number;\n headers?: Record<string, string>;\n allowedEnvVars?: string[];\n};\n\n/** Hook handler supported by Claude plugin hooks. */\nexport type ClaudeHookHandler = ClaudeHookCommand | ClaudeHookHttp;\n\n/** Hook matcher entry for one Claude hook event. */\nexport type ClaudeHookMatcher = {\n matcher?: string;\n run: ClaudeHookHandler[];\n};\n\n/** Single reserved `hooks/<name>/hook.ts` declaration. */\nexport type ClaudeHookDefinition = {\n event: ClaudeHookEvent;\n matcher?: string;\n run: ClaudeHookHandler[];\n};\n\n/** Complete Claude hook configuration object. */\nexport type ClaudeHooksDefinition = Partial<\n Record<ClaudeHookEvent, ClaudeHookMatcher[]>\n>;\n\n/** Declares one Claude hook matcher entry. */\nexport function hook(\n definition: ClaudeHookDefinition,\n): ClaudeHookDefinition {\n return Object.freeze(definition);\n}\n\n/** Freezes a complete hook configuration. */\nexport function hooks(\n definition: ClaudeHooksDefinition,\n): ClaudeHooksDefinition {\n return Object.freeze(definition);\n}\n\n/** Creates a command hook using Claude's official hook handler vocabulary. */\nexport function commandHook(\n command: string,\n options: Omit<ClaudeHookCommand, \"type\" | \"command\"> = {},\n): ClaudeHookCommand {\n return Object.freeze({\n type: \"command\" as const,\n command,\n ...options,\n });\n}\n\n/** Creates an HTTP hook using Claude's official hook handler vocabulary. */\nexport function httpHook(\n url: string,\n options: Omit<ClaudeHookHttp, \"type\" | \"url\"> = {},\n): ClaudeHookHttp {\n return Object.freeze({\n type: \"http\" as const,\n url,\n ...options,\n });\n}\n"],"mappings":";AA0DO,SAAS,KACd,YACsB;AACtB,SAAO,OAAO,OAAO,UAAU;AACjC;AAGO,SAAS,MACd,YACuB;AACvB,SAAO,OAAO,OAAO,UAAU;AACjC;AAGO,SAAS,YACd,SACA,UAAuD,CAAC,GACrC;AACnB,SAAO,OAAO,OAAO;AAAA,IACnB,MAAM;AAAA,IACN;AAAA,IACA,GAAG;AAAA,EACL,CAAC;AACH;AAGO,SAAS,SACd,KACA,UAAgD,CAAC,GACjC;AAChB,SAAO,OAAO,OAAO;AAAA,IACnB,MAAM;AAAA,IACN;AAAA,IACA,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ClaudePluginDefinition, claudePlugin } from './plugin.js';
|
|
2
|
+
export { ClaudeAgentDefinition, agent } from './agent.js';
|
|
3
|
+
export { ClaudeCommandDefinition, command, slashCommand } from './command.js';
|
|
4
|
+
export { ClaudeHookCommand, ClaudeHookDefinition, ClaudeHookEvent, ClaudeHookHandler, ClaudeHookHttp, ClaudeHookMatcher, ClaudeHooksDefinition, commandHook, hook, hooks, httpHook } from './hooks.js';
|
|
5
|
+
export { ClaudeMcpServerDefinition, mcpServer } from './mcp.js';
|
|
6
|
+
export { ClaudeSkillDefinition, skill } from './skill.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// packages/anthropic/src/agent.ts
|
|
2
|
+
function agent(definition) {
|
|
3
|
+
return Object.freeze(definition);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// packages/anthropic/src/command.ts
|
|
7
|
+
function command(definition) {
|
|
8
|
+
return Object.freeze(definition);
|
|
9
|
+
}
|
|
10
|
+
var slashCommand = command;
|
|
11
|
+
|
|
12
|
+
// packages/anthropic/src/hooks.ts
|
|
13
|
+
function hook(definition) {
|
|
14
|
+
return Object.freeze(definition);
|
|
15
|
+
}
|
|
16
|
+
function hooks(definition) {
|
|
17
|
+
return Object.freeze(definition);
|
|
18
|
+
}
|
|
19
|
+
function commandHook(command2, options = {}) {
|
|
20
|
+
return Object.freeze({
|
|
21
|
+
type: "command",
|
|
22
|
+
command: command2,
|
|
23
|
+
...options
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function httpHook(url, options = {}) {
|
|
27
|
+
return Object.freeze({
|
|
28
|
+
type: "http",
|
|
29
|
+
url,
|
|
30
|
+
...options
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// packages/anthropic/src/mcp.ts
|
|
35
|
+
function mcpServer(definition) {
|
|
36
|
+
return Object.freeze(definition);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// packages/anthropic/src/skill.ts
|
|
40
|
+
function skill(definition) {
|
|
41
|
+
return Object.freeze(definition);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// packages/anthropic/src/plugin.ts
|
|
45
|
+
function claudePlugin(definition) {
|
|
46
|
+
return Object.freeze(definition);
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
agent,
|
|
50
|
+
claudePlugin,
|
|
51
|
+
command,
|
|
52
|
+
commandHook,
|
|
53
|
+
hook,
|
|
54
|
+
hooks,
|
|
55
|
+
httpHook,
|
|
56
|
+
mcpServer,
|
|
57
|
+
skill,
|
|
58
|
+
slashCommand
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../packages/anthropic/src/agent.ts","../../packages/anthropic/src/command.ts","../../packages/anthropic/src/hooks.ts","../../packages/anthropic/src/mcp.ts","../../packages/anthropic/src/skill.ts","../../packages/anthropic/src/plugin.ts"],"sourcesContent":["/** Typed authoring helpers for Claude plugin subagents. */\n\n/** Claude plugin subagent definition emitted as markdown frontmatter and body. */\nexport type ClaudeAgentDefinition = {\n name: string;\n description: string;\n prompt: string;\n tools?: string[];\n disallowedTools?: string[];\n model?: string;\n color?: string;\n};\n\n/** Declares a Claude plugin subagent. */\nexport function agent(\n definition: ClaudeAgentDefinition,\n): ClaudeAgentDefinition {\n return Object.freeze(definition);\n}\n","/** Typed authoring helpers for Claude slash commands. */\n\n/** Claude slash command definition emitted to `commands/*.md`. */\nexport type ClaudeCommandDefinition = {\n name: string;\n description?: string;\n argumentHint?: string;\n allowedTools?: string[];\n prompt: string;\n};\n\n/** Declares a Claude slash command. */\nexport function command(\n definition: ClaudeCommandDefinition,\n): ClaudeCommandDefinition {\n return Object.freeze(definition);\n}\n\n/** Alias for `command()` when the caller wants the host term in code. */\nexport const slashCommand = command;\n","/** Typed authoring helpers for Claude plugin hook configuration. */\n\n/** Claude hook event name. String extension keeps the type forward-compatible. */\nexport type ClaudeHookEvent =\n | \"UserPromptExpansion\"\n | \"PreToolUse\"\n | \"PermissionRequest\"\n | \"PostToolUse\"\n | \"PostToolUseFailure\"\n | \"Notification\"\n | \"UserPromptSubmit\"\n | \"Stop\"\n | \"SubagentStop\"\n | \"SessionStart\"\n | \"PreCompact\"\n | (string & {});\n\n/** Command hook executed by the host shell. */\nexport type ClaudeHookCommand = {\n type: \"command\";\n command: string;\n args?: string[];\n timeout?: number;\n if?: string;\n shell?: \"bash\" | \"powershell\" | (string & {});\n};\n\n/** HTTP hook executed by the Claude host. */\nexport type ClaudeHookHttp = {\n type: \"http\";\n url: string;\n timeout?: number;\n headers?: Record<string, string>;\n allowedEnvVars?: string[];\n};\n\n/** Hook handler supported by Claude plugin hooks. */\nexport type ClaudeHookHandler = ClaudeHookCommand | ClaudeHookHttp;\n\n/** Hook matcher entry for one Claude hook event. */\nexport type ClaudeHookMatcher = {\n matcher?: string;\n run: ClaudeHookHandler[];\n};\n\n/** Single reserved `hooks/<name>/hook.ts` declaration. */\nexport type ClaudeHookDefinition = {\n event: ClaudeHookEvent;\n matcher?: string;\n run: ClaudeHookHandler[];\n};\n\n/** Complete Claude hook configuration object. */\nexport type ClaudeHooksDefinition = Partial<\n Record<ClaudeHookEvent, ClaudeHookMatcher[]>\n>;\n\n/** Declares one Claude hook matcher entry. */\nexport function hook(\n definition: ClaudeHookDefinition,\n): ClaudeHookDefinition {\n return Object.freeze(definition);\n}\n\n/** Freezes a complete hook configuration. */\nexport function hooks(\n definition: ClaudeHooksDefinition,\n): ClaudeHooksDefinition {\n return Object.freeze(definition);\n}\n\n/** Creates a command hook using Claude's official hook handler vocabulary. */\nexport function commandHook(\n command: string,\n options: Omit<ClaudeHookCommand, \"type\" | \"command\"> = {},\n): ClaudeHookCommand {\n return Object.freeze({\n type: \"command\" as const,\n command,\n ...options,\n });\n}\n\n/** Creates an HTTP hook using Claude's official hook handler vocabulary. */\nexport function httpHook(\n url: string,\n options: Omit<ClaudeHookHttp, \"type\" | \"url\"> = {},\n): ClaudeHookHttp {\n return Object.freeze({\n type: \"http\" as const,\n url,\n ...options,\n });\n}\n","/** Typed authoring helpers for Claude plugin MCP server declarations. */\n\n/** Remote HTTP MCP server entry. */\nexport type ClaudeHttpMcpServerDefinition = {\n name: string;\n type: \"http\";\n url: string;\n headers?: Record<string, string>;\n};\n\n/** Local stdio MCP server entry. */\nexport type ClaudeStdioMcpServerDefinition = {\n name: string;\n type: \"stdio\";\n command: string;\n args?: string[];\n env?: Record<string, string>;\n};\n\n/** Supported MCP server shapes in a Claude plugin manifest/config. */\nexport type ClaudeMcpServerDefinition =\n | ClaudeHttpMcpServerDefinition\n | ClaudeStdioMcpServerDefinition;\n\n/** Declares an MCP server entry for Claude plugin output. */\nexport function mcpServer(\n definition: ClaudeMcpServerDefinition,\n): ClaudeMcpServerDefinition {\n return Object.freeze(definition);\n}\n","/** Typed authoring helpers for Claude-compatible skills. */\n\n/** Skill declaration that can be emitted as `SKILL.md`. */\nexport type ClaudeSkillDefinition = {\n name: string;\n description: string;\n body: string;\n};\n\n/** Declares a Claude-compatible skill. */\nexport function skill(\n definition: ClaudeSkillDefinition,\n): ClaudeSkillDefinition {\n return Object.freeze(definition);\n}\n","/** Aggregated Claude plugin authoring entrypoint. */\n\nexport { agent, type ClaudeAgentDefinition } from \"./agent.js\";\nexport {\n command,\n slashCommand,\n type ClaudeCommandDefinition,\n} from \"./command.js\";\nexport {\n commandHook,\n hook,\n hooks,\n httpHook,\n type ClaudeHookCommand,\n type ClaudeHookDefinition,\n type ClaudeHookEvent,\n type ClaudeHookHandler,\n type ClaudeHookHttp,\n type ClaudeHookMatcher,\n type ClaudeHooksDefinition,\n} from \"./hooks.js\";\nexport {\n mcpServer,\n type ClaudeMcpServerDefinition,\n} from \"./mcp.js\";\nexport { skill, type ClaudeSkillDefinition } from \"./skill.js\";\n\n/** Claude plugin manifest fields Sidecar can generate. */\nexport type ClaudePluginDefinition = {\n name: string;\n version: string;\n description: string;\n displayName?: string;\n installationPreference?: \"enabled\" | \"available\" | \"disabled\" | (string & {});\n};\n\n/** Declares Claude plugin manifest metadata. */\nexport function claudePlugin(\n definition: ClaudePluginDefinition,\n): ClaudePluginDefinition {\n return Object.freeze(definition);\n}\n"],"mappings":";AAcO,SAAS,MACd,YACuB;AACvB,SAAO,OAAO,OAAO,UAAU;AACjC;;;ACNO,SAAS,QACd,YACyB;AACzB,SAAO,OAAO,OAAO,UAAU;AACjC;AAGO,IAAM,eAAe;;;ACuCrB,SAAS,KACd,YACsB;AACtB,SAAO,OAAO,OAAO,UAAU;AACjC;AAGO,SAAS,MACd,YACuB;AACvB,SAAO,OAAO,OAAO,UAAU;AACjC;AAGO,SAAS,YACdA,UACA,UAAuD,CAAC,GACrC;AACnB,SAAO,OAAO,OAAO;AAAA,IACnB,MAAM;AAAA,IACN,SAAAA;AAAA,IACA,GAAG;AAAA,EACL,CAAC;AACH;AAGO,SAAS,SACd,KACA,UAAgD,CAAC,GACjC;AAChB,SAAO,OAAO,OAAO;AAAA,IACnB,MAAM;AAAA,IACN;AAAA,IACA,GAAG;AAAA,EACL,CAAC;AACH;;;ACpEO,SAAS,UACd,YAC2B;AAC3B,SAAO,OAAO,OAAO,UAAU;AACjC;;;ACnBO,SAAS,MACd,YACuB;AACvB,SAAO,OAAO,OAAO,UAAU;AACjC;;;ACuBO,SAAS,aACd,YACwB;AACxB,SAAO,OAAO,OAAO,UAAU;AACjC;","names":["command"]}
|
package/dist/mcp.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Typed authoring helpers for Claude plugin MCP server declarations. */
|
|
2
|
+
/** Remote HTTP MCP server entry. */
|
|
3
|
+
type ClaudeHttpMcpServerDefinition = {
|
|
4
|
+
name: string;
|
|
5
|
+
type: "http";
|
|
6
|
+
url: string;
|
|
7
|
+
headers?: Record<string, string>;
|
|
8
|
+
};
|
|
9
|
+
/** Local stdio MCP server entry. */
|
|
10
|
+
type ClaudeStdioMcpServerDefinition = {
|
|
11
|
+
name: string;
|
|
12
|
+
type: "stdio";
|
|
13
|
+
command: string;
|
|
14
|
+
args?: string[];
|
|
15
|
+
env?: Record<string, string>;
|
|
16
|
+
};
|
|
17
|
+
/** Supported MCP server shapes in a Claude plugin manifest/config. */
|
|
18
|
+
type ClaudeMcpServerDefinition = ClaudeHttpMcpServerDefinition | ClaudeStdioMcpServerDefinition;
|
|
19
|
+
/** Declares an MCP server entry for Claude plugin output. */
|
|
20
|
+
declare function mcpServer(definition: ClaudeMcpServerDefinition): ClaudeMcpServerDefinition;
|
|
21
|
+
|
|
22
|
+
export { type ClaudeHttpMcpServerDefinition, type ClaudeMcpServerDefinition, type ClaudeStdioMcpServerDefinition, mcpServer };
|
package/dist/mcp.js
ADDED
package/dist/mcp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../packages/anthropic/src/mcp.ts"],"sourcesContent":["/** Typed authoring helpers for Claude plugin MCP server declarations. */\n\n/** Remote HTTP MCP server entry. */\nexport type ClaudeHttpMcpServerDefinition = {\n name: string;\n type: \"http\";\n url: string;\n headers?: Record<string, string>;\n};\n\n/** Local stdio MCP server entry. */\nexport type ClaudeStdioMcpServerDefinition = {\n name: string;\n type: \"stdio\";\n command: string;\n args?: string[];\n env?: Record<string, string>;\n};\n\n/** Supported MCP server shapes in a Claude plugin manifest/config. */\nexport type ClaudeMcpServerDefinition =\n | ClaudeHttpMcpServerDefinition\n | ClaudeStdioMcpServerDefinition;\n\n/** Declares an MCP server entry for Claude plugin output. */\nexport function mcpServer(\n definition: ClaudeMcpServerDefinition,\n): ClaudeMcpServerDefinition {\n return Object.freeze(definition);\n}\n"],"mappings":";AAyBO,SAAS,UACd,YAC2B;AAC3B,SAAO,OAAO,OAAO,UAAU;AACjC;","names":[]}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { ClaudeAgentDefinition, agent } from './agent.js';
|
|
2
|
+
export { ClaudeCommandDefinition, command, slashCommand } from './command.js';
|
|
3
|
+
export { ClaudeHookCommand, ClaudeHookDefinition, ClaudeHookEvent, ClaudeHookHandler, ClaudeHookHttp, ClaudeHookMatcher, ClaudeHooksDefinition, commandHook, hook, hooks, httpHook } from './hooks.js';
|
|
4
|
+
export { ClaudeMcpServerDefinition, mcpServer } from './mcp.js';
|
|
5
|
+
export { ClaudeSkillDefinition, skill } from './skill.js';
|
|
6
|
+
|
|
7
|
+
/** Aggregated Claude plugin authoring entrypoint. */
|
|
8
|
+
|
|
9
|
+
/** Claude plugin manifest fields Sidecar can generate. */
|
|
10
|
+
type ClaudePluginDefinition = {
|
|
11
|
+
name: string;
|
|
12
|
+
version: string;
|
|
13
|
+
description: string;
|
|
14
|
+
displayName?: string;
|
|
15
|
+
installationPreference?: "enabled" | "available" | "disabled" | (string & {});
|
|
16
|
+
};
|
|
17
|
+
/** Declares Claude plugin manifest metadata. */
|
|
18
|
+
declare function claudePlugin(definition: ClaudePluginDefinition): ClaudePluginDefinition;
|
|
19
|
+
|
|
20
|
+
export { type ClaudePluginDefinition, claudePlugin };
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// packages/anthropic/src/agent.ts
|
|
2
|
+
function agent(definition) {
|
|
3
|
+
return Object.freeze(definition);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// packages/anthropic/src/command.ts
|
|
7
|
+
function command(definition) {
|
|
8
|
+
return Object.freeze(definition);
|
|
9
|
+
}
|
|
10
|
+
var slashCommand = command;
|
|
11
|
+
|
|
12
|
+
// packages/anthropic/src/hooks.ts
|
|
13
|
+
function hook(definition) {
|
|
14
|
+
return Object.freeze(definition);
|
|
15
|
+
}
|
|
16
|
+
function hooks(definition) {
|
|
17
|
+
return Object.freeze(definition);
|
|
18
|
+
}
|
|
19
|
+
function commandHook(command2, options = {}) {
|
|
20
|
+
return Object.freeze({
|
|
21
|
+
type: "command",
|
|
22
|
+
command: command2,
|
|
23
|
+
...options
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function httpHook(url, options = {}) {
|
|
27
|
+
return Object.freeze({
|
|
28
|
+
type: "http",
|
|
29
|
+
url,
|
|
30
|
+
...options
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// packages/anthropic/src/mcp.ts
|
|
35
|
+
function mcpServer(definition) {
|
|
36
|
+
return Object.freeze(definition);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// packages/anthropic/src/skill.ts
|
|
40
|
+
function skill(definition) {
|
|
41
|
+
return Object.freeze(definition);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// packages/anthropic/src/plugin.ts
|
|
45
|
+
function claudePlugin(definition) {
|
|
46
|
+
return Object.freeze(definition);
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
agent,
|
|
50
|
+
claudePlugin,
|
|
51
|
+
command,
|
|
52
|
+
commandHook,
|
|
53
|
+
hook,
|
|
54
|
+
hooks,
|
|
55
|
+
httpHook,
|
|
56
|
+
mcpServer,
|
|
57
|
+
skill,
|
|
58
|
+
slashCommand
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../packages/anthropic/src/agent.ts","../../packages/anthropic/src/command.ts","../../packages/anthropic/src/hooks.ts","../../packages/anthropic/src/mcp.ts","../../packages/anthropic/src/skill.ts","../../packages/anthropic/src/plugin.ts"],"sourcesContent":["/** Typed authoring helpers for Claude plugin subagents. */\n\n/** Claude plugin subagent definition emitted as markdown frontmatter and body. */\nexport type ClaudeAgentDefinition = {\n name: string;\n description: string;\n prompt: string;\n tools?: string[];\n disallowedTools?: string[];\n model?: string;\n color?: string;\n};\n\n/** Declares a Claude plugin subagent. */\nexport function agent(\n definition: ClaudeAgentDefinition,\n): ClaudeAgentDefinition {\n return Object.freeze(definition);\n}\n","/** Typed authoring helpers for Claude slash commands. */\n\n/** Claude slash command definition emitted to `commands/*.md`. */\nexport type ClaudeCommandDefinition = {\n name: string;\n description?: string;\n argumentHint?: string;\n allowedTools?: string[];\n prompt: string;\n};\n\n/** Declares a Claude slash command. */\nexport function command(\n definition: ClaudeCommandDefinition,\n): ClaudeCommandDefinition {\n return Object.freeze(definition);\n}\n\n/** Alias for `command()` when the caller wants the host term in code. */\nexport const slashCommand = command;\n","/** Typed authoring helpers for Claude plugin hook configuration. */\n\n/** Claude hook event name. String extension keeps the type forward-compatible. */\nexport type ClaudeHookEvent =\n | \"UserPromptExpansion\"\n | \"PreToolUse\"\n | \"PermissionRequest\"\n | \"PostToolUse\"\n | \"PostToolUseFailure\"\n | \"Notification\"\n | \"UserPromptSubmit\"\n | \"Stop\"\n | \"SubagentStop\"\n | \"SessionStart\"\n | \"PreCompact\"\n | (string & {});\n\n/** Command hook executed by the host shell. */\nexport type ClaudeHookCommand = {\n type: \"command\";\n command: string;\n args?: string[];\n timeout?: number;\n if?: string;\n shell?: \"bash\" | \"powershell\" | (string & {});\n};\n\n/** HTTP hook executed by the Claude host. */\nexport type ClaudeHookHttp = {\n type: \"http\";\n url: string;\n timeout?: number;\n headers?: Record<string, string>;\n allowedEnvVars?: string[];\n};\n\n/** Hook handler supported by Claude plugin hooks. */\nexport type ClaudeHookHandler = ClaudeHookCommand | ClaudeHookHttp;\n\n/** Hook matcher entry for one Claude hook event. */\nexport type ClaudeHookMatcher = {\n matcher?: string;\n run: ClaudeHookHandler[];\n};\n\n/** Single reserved `hooks/<name>/hook.ts` declaration. */\nexport type ClaudeHookDefinition = {\n event: ClaudeHookEvent;\n matcher?: string;\n run: ClaudeHookHandler[];\n};\n\n/** Complete Claude hook configuration object. */\nexport type ClaudeHooksDefinition = Partial<\n Record<ClaudeHookEvent, ClaudeHookMatcher[]>\n>;\n\n/** Declares one Claude hook matcher entry. */\nexport function hook(\n definition: ClaudeHookDefinition,\n): ClaudeHookDefinition {\n return Object.freeze(definition);\n}\n\n/** Freezes a complete hook configuration. */\nexport function hooks(\n definition: ClaudeHooksDefinition,\n): ClaudeHooksDefinition {\n return Object.freeze(definition);\n}\n\n/** Creates a command hook using Claude's official hook handler vocabulary. */\nexport function commandHook(\n command: string,\n options: Omit<ClaudeHookCommand, \"type\" | \"command\"> = {},\n): ClaudeHookCommand {\n return Object.freeze({\n type: \"command\" as const,\n command,\n ...options,\n });\n}\n\n/** Creates an HTTP hook using Claude's official hook handler vocabulary. */\nexport function httpHook(\n url: string,\n options: Omit<ClaudeHookHttp, \"type\" | \"url\"> = {},\n): ClaudeHookHttp {\n return Object.freeze({\n type: \"http\" as const,\n url,\n ...options,\n });\n}\n","/** Typed authoring helpers for Claude plugin MCP server declarations. */\n\n/** Remote HTTP MCP server entry. */\nexport type ClaudeHttpMcpServerDefinition = {\n name: string;\n type: \"http\";\n url: string;\n headers?: Record<string, string>;\n};\n\n/** Local stdio MCP server entry. */\nexport type ClaudeStdioMcpServerDefinition = {\n name: string;\n type: \"stdio\";\n command: string;\n args?: string[];\n env?: Record<string, string>;\n};\n\n/** Supported MCP server shapes in a Claude plugin manifest/config. */\nexport type ClaudeMcpServerDefinition =\n | ClaudeHttpMcpServerDefinition\n | ClaudeStdioMcpServerDefinition;\n\n/** Declares an MCP server entry for Claude plugin output. */\nexport function mcpServer(\n definition: ClaudeMcpServerDefinition,\n): ClaudeMcpServerDefinition {\n return Object.freeze(definition);\n}\n","/** Typed authoring helpers for Claude-compatible skills. */\n\n/** Skill declaration that can be emitted as `SKILL.md`. */\nexport type ClaudeSkillDefinition = {\n name: string;\n description: string;\n body: string;\n};\n\n/** Declares a Claude-compatible skill. */\nexport function skill(\n definition: ClaudeSkillDefinition,\n): ClaudeSkillDefinition {\n return Object.freeze(definition);\n}\n","/** Aggregated Claude plugin authoring entrypoint. */\n\nexport { agent, type ClaudeAgentDefinition } from \"./agent.js\";\nexport {\n command,\n slashCommand,\n type ClaudeCommandDefinition,\n} from \"./command.js\";\nexport {\n commandHook,\n hook,\n hooks,\n httpHook,\n type ClaudeHookCommand,\n type ClaudeHookDefinition,\n type ClaudeHookEvent,\n type ClaudeHookHandler,\n type ClaudeHookHttp,\n type ClaudeHookMatcher,\n type ClaudeHooksDefinition,\n} from \"./hooks.js\";\nexport {\n mcpServer,\n type ClaudeMcpServerDefinition,\n} from \"./mcp.js\";\nexport { skill, type ClaudeSkillDefinition } from \"./skill.js\";\n\n/** Claude plugin manifest fields Sidecar can generate. */\nexport type ClaudePluginDefinition = {\n name: string;\n version: string;\n description: string;\n displayName?: string;\n installationPreference?: \"enabled\" | \"available\" | \"disabled\" | (string & {});\n};\n\n/** Declares Claude plugin manifest metadata. */\nexport function claudePlugin(\n definition: ClaudePluginDefinition,\n): ClaudePluginDefinition {\n return Object.freeze(definition);\n}\n"],"mappings":";AAcO,SAAS,MACd,YACuB;AACvB,SAAO,OAAO,OAAO,UAAU;AACjC;;;ACNO,SAAS,QACd,YACyB;AACzB,SAAO,OAAO,OAAO,UAAU;AACjC;AAGO,IAAM,eAAe;;;ACuCrB,SAAS,KACd,YACsB;AACtB,SAAO,OAAO,OAAO,UAAU;AACjC;AAGO,SAAS,MACd,YACuB;AACvB,SAAO,OAAO,OAAO,UAAU;AACjC;AAGO,SAAS,YACdA,UACA,UAAuD,CAAC,GACrC;AACnB,SAAO,OAAO,OAAO;AAAA,IACnB,MAAM;AAAA,IACN,SAAAA;AAAA,IACA,GAAG;AAAA,EACL,CAAC;AACH;AAGO,SAAS,SACd,KACA,UAAgD,CAAC,GACjC;AAChB,SAAO,OAAO,OAAO;AAAA,IACnB,MAAM;AAAA,IACN;AAAA,IACA,GAAG;AAAA,EACL,CAAC;AACH;;;ACpEO,SAAS,UACd,YAC2B;AAC3B,SAAO,OAAO,OAAO,UAAU;AACjC;;;ACnBO,SAAS,MACd,YACuB;AACvB,SAAO,OAAO,OAAO,UAAU;AACjC;;;ACuBO,SAAS,aACd,YACwB;AACxB,SAAO,OAAO,OAAO,UAAU;AACjC;","names":["command"]}
|
package/dist/skill.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Typed authoring helpers for Claude-compatible skills. */
|
|
2
|
+
/** Skill declaration that can be emitted as `SKILL.md`. */
|
|
3
|
+
type ClaudeSkillDefinition = {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
body: string;
|
|
7
|
+
};
|
|
8
|
+
/** Declares a Claude-compatible skill. */
|
|
9
|
+
declare function skill(definition: ClaudeSkillDefinition): ClaudeSkillDefinition;
|
|
10
|
+
|
|
11
|
+
export { type ClaudeSkillDefinition, skill };
|
package/dist/skill.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../packages/anthropic/src/skill.ts"],"sourcesContent":["/** Typed authoring helpers for Claude-compatible skills. */\n\n/** Skill declaration that can be emitted as `SKILL.md`. */\nexport type ClaudeSkillDefinition = {\n name: string;\n description: string;\n body: string;\n};\n\n/** Declares a Claude-compatible skill. */\nexport function skill(\n definition: ClaudeSkillDefinition,\n): ClaudeSkillDefinition {\n return Object.freeze(definition);\n}\n"],"mappings":";AAUO,SAAS,MACd,YACuB;AACvB,SAAO,OAAO,OAAO,UAAU;AACjC;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sidecar-ai/anthropic",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./agent": {
|
|
14
|
+
"types": "./dist/agent.d.ts",
|
|
15
|
+
"default": "./dist/agent.js"
|
|
16
|
+
},
|
|
17
|
+
"./command": {
|
|
18
|
+
"types": "./dist/command.d.ts",
|
|
19
|
+
"default": "./dist/command.js"
|
|
20
|
+
},
|
|
21
|
+
"./components": {
|
|
22
|
+
"types": "./dist/components.d.ts",
|
|
23
|
+
"default": "./dist/components.js"
|
|
24
|
+
},
|
|
25
|
+
"./hooks": {
|
|
26
|
+
"types": "./dist/hooks.d.ts",
|
|
27
|
+
"default": "./dist/hooks.js"
|
|
28
|
+
},
|
|
29
|
+
"./mcp": {
|
|
30
|
+
"types": "./dist/mcp.d.ts",
|
|
31
|
+
"default": "./dist/mcp.js"
|
|
32
|
+
},
|
|
33
|
+
"./plugin": {
|
|
34
|
+
"types": "./dist/plugin.d.ts",
|
|
35
|
+
"default": "./dist/plugin.js"
|
|
36
|
+
},
|
|
37
|
+
"./skill": {
|
|
38
|
+
"types": "./dist/skill.d.ts",
|
|
39
|
+
"default": "./dist/skill.js"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"types": "./dist/index.d.ts",
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@sidecar-ai/native": "0.1.0-alpha.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": "^18.0.0 || ^19.0.0"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
}
|
|
52
|
+
}
|