@portel/photon-core 2.10.1 → 2.12.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
@@ -28,6 +28,12 @@ export interface PhotonTool {
28
28
  outputFormat?: OutputFormat;
29
29
  /** When true, method uses individual params instead of a single params object */
30
30
  simpleParams?: boolean;
31
+ /**
32
+ * Icon image entries from @icon (file path) or @icons tags.
33
+ * Raw paths — resolved to data URIs by the runtime.
34
+ * Maps to MCP Tool.icons[]
35
+ */
36
+ iconImages?: Array<{ path: string; sizes?: string; theme?: string }>;
31
37
  }
32
38
 
33
39
  /**
@@ -61,6 +67,12 @@ export interface ExtractedSchema {
61
67
  buttonLabel?: string;
62
68
  /** Icon from @icon tag (emoji or icon name) */
63
69
  icon?: string;
70
+ /**
71
+ * Icon image entries from @icon (file path) or @icons tags
72
+ * Raw paths — resolved to data URIs by the runtime
73
+ * Maps to MCP Tool.icons[]
74
+ */
75
+ iconImages?: Array<{ path: string; sizes?: string; theme?: string }>;
64
76
  /** True if this method is an async generator (uses yield for prompts) */
65
77
  isGenerator?: boolean;
66
78
  /** Yield information for generator methods (used by REST APIs) */
@@ -211,6 +223,59 @@ export interface ExtractedSchema {
211
223
  * Typically mirrors the return type of the method
212
224
  */
213
225
  eventPayload?: Record<string, string>;
226
+
227
+ // ═══ MCP STANDARD ANNOTATIONS ═══
228
+
229
+ /**
230
+ * Human-readable display name (from @title tag)
231
+ * Maps to MCP Tool.annotations.title
232
+ */
233
+ title?: string;
234
+
235
+ /**
236
+ * Tool has no side effects — safe for auto-approval (from @readOnly method-level tag)
237
+ * Maps to MCP Tool.annotations.readOnlyHint
238
+ * Note: Different from param-level {@readOnly} which marks a field as immutable
239
+ */
240
+ readOnlyHint?: boolean;
241
+
242
+ /**
243
+ * Tool performs destructive operations — requires confirmation (from @destructive tag)
244
+ * Maps to MCP Tool.annotations.destructiveHint
245
+ */
246
+ destructiveHint?: boolean;
247
+
248
+ /**
249
+ * Tool is safe to retry — calling multiple times has same effect (from @idempotent tag)
250
+ * Maps to MCP Tool.annotations.idempotentHint
251
+ */
252
+ idempotentHint?: boolean;
253
+
254
+ /**
255
+ * Tool interacts with external world beyond local system (from @openWorld tag)
256
+ * @openWorld → true, @closedWorld → false
257
+ * Maps to MCP Tool.annotations.openWorldHint
258
+ */
259
+ openWorldHint?: boolean;
260
+
261
+ /**
262
+ * Content audience control (from @audience tag)
263
+ * Determines who sees tool results: 'user' (human only), 'assistant' (AI only), or both
264
+ * Maps to MCP content block Annotations.audience
265
+ */
266
+ audience?: ('user' | 'assistant')[];
267
+
268
+ /**
269
+ * Content importance hint 0.0-1.0 (from @priority tag)
270
+ * Maps to MCP content block Annotations.priority
271
+ */
272
+ contentPriority?: number;
273
+
274
+ /**
275
+ * JSON Schema for structured output (from @returns.field {type} tags)
276
+ * Maps to MCP Tool.outputSchema
277
+ */
278
+ outputSchema?: { type: 'object'; properties: Record<string, any>; required?: string[] };
214
279
  }
215
280
 
216
281
  export interface PhotonClass {