opencode-snippets 1.2.0 → 1.4.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/src/types.ts CHANGED
@@ -11,9 +11,21 @@ export interface Snippet {
11
11
  }
12
12
 
13
13
  /**
14
- * Snippet registry that maps keys to content
14
+ * Extended snippet info with file metadata
15
15
  */
16
- export type SnippetRegistry = Map<string, string>;
16
+ export interface SnippetInfo {
17
+ name: string;
18
+ content: string;
19
+ aliases: string[];
20
+ description?: string;
21
+ filePath: string;
22
+ source: "global" | "project";
23
+ }
24
+
25
+ /**
26
+ * Snippet registry that maps keys to snippet info
27
+ */
28
+ export type SnippetRegistry = Map<string, SnippetInfo>;
17
29
 
18
30
  /**
19
31
  * Frontmatter data from snippet files
@@ -24,3 +36,27 @@ export interface SnippetFrontmatter {
24
36
  /** Optional description of what this snippet does */
25
37
  description?: string;
26
38
  }
39
+
40
+ /**
41
+ * Parsed snippet content with inline text and prepend/append blocks
42
+ */
43
+ export interface ParsedSnippetContent {
44
+ /** Content outside blocks (replaces hashtag inline) */
45
+ inline: string;
46
+ /** <prepend> block contents in document order */
47
+ prepend: string[];
48
+ /** <append> block contents in document order */
49
+ append: string[];
50
+ }
51
+
52
+ /**
53
+ * Result of expanding hashtags, including collected prepend/append blocks
54
+ */
55
+ export interface ExpansionResult {
56
+ /** The inline-expanded text */
57
+ text: string;
58
+ /** Collected prepend blocks from all expanded snippets */
59
+ prepend: string[];
60
+ /** Collected append blocks from all expanded snippets */
61
+ append: string[];
62
+ }