@inspecto-dev/types 0.3.10 → 0.3.11

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/index.cjs CHANGED
@@ -29,7 +29,9 @@ __export(index_exports, {
29
29
  VALID_MODES: () => VALID_MODES,
30
30
  getDualModeProviderCapability: () => getDualModeProviderCapability,
31
31
  getHostIdeLabel: () => getHostIdeLabel,
32
- isSupportedHostIde: () => isSupportedHostIde
32
+ isAiIntentConfig: () => isAiIntentConfig,
33
+ isSupportedHostIde: () => isSupportedHostIde,
34
+ isWorkflowConfig: () => isWorkflowConfig
33
35
  });
34
36
  module.exports = __toCommonJS(index_exports);
35
37
 
@@ -97,6 +99,14 @@ var DEFAULT_PROVIDER_MODE = {
97
99
  codebuddy: "builtin"
98
100
  };
99
101
 
102
+ // src/prompts.ts
103
+ function isWorkflowConfig(c) {
104
+ return c.kind === "workflow";
105
+ }
106
+ function isAiIntentConfig(c) {
107
+ return c.kind !== "workflow";
108
+ }
109
+
100
110
  // src/api.ts
101
111
  var INSPECTO_API_PATHS = {
102
112
  HEALTH: "/inspecto/api/v1/health",
@@ -162,5 +172,7 @@ Suggest practical readability, maintainability, and small structural improvement
162
172
  VALID_MODES,
163
173
  getDualModeProviderCapability,
164
174
  getHostIdeLabel,
165
- isSupportedHostIde
175
+ isAiIntentConfig,
176
+ isSupportedHostIde,
177
+ isWorkflowConfig
166
178
  });
package/dist/index.d.cts CHANGED
@@ -26,7 +26,7 @@ interface InspectoSettings {
26
26
  ide?: IdeType;
27
27
  [key: `provider.${string}`]: string | string[] | boolean | undefined;
28
28
  'inspector.hotKey'?: HotKeys;
29
- 'annotate.deliveryMode'?: 'ide' | 'agent' | 'both';
29
+ 'annotate.deliveryMode'?: 'ide' | 'agent';
30
30
  'server.host'?: string;
31
31
  'server.publicUrl'?: string;
32
32
  'prompt.includeSnippet'?: boolean;
@@ -104,13 +104,20 @@ interface IdeInfo {
104
104
  workspaceRoot?: string;
105
105
  providers: Record<Provider, ProviderInfo>;
106
106
  }
107
+ interface WorkflowSlotOption {
108
+ id: string;
109
+ label: string;
110
+ prompt: string;
111
+ confirm: boolean;
112
+ }
107
113
  interface InspectoConfig {
108
114
  ide: IdeType;
109
115
  providers?: Record<Provider, ProviderInfo>;
110
- prompts?: IntentConfig[];
116
+ prompts?: AiIntentConfig[];
117
+ workflows?: WorkflowSlotOption[];
111
118
  hotKeys?: HotKeys;
112
119
  theme?: 'light' | 'dark' | 'auto';
113
- annotateDeliveryMode?: 'ide' | 'agent' | 'both';
120
+ annotateDeliveryMode?: 'ide' | 'agent';
114
121
  includeSnippet?: boolean;
115
122
  runtimeContext?: RuntimeContextConfig;
116
123
  }
@@ -123,20 +130,30 @@ interface ServerState {
123
130
  ideInfo?: IdeInfo | null;
124
131
  }
125
132
 
133
+ type IntentKind = 'ai-prompt' | 'workflow';
126
134
  type AiIntent = 'ask' | 'fix' | 'review' | 'redesign';
127
135
  type AnnotationIntent = AiIntent;
128
- interface IntentConfigBase {
136
+ interface AiIntentConfig {
137
+ kind?: 'ai-prompt';
129
138
  id: string;
130
139
  label?: string;
140
+ aiIntent: AiIntent;
141
+ prompt?: string;
131
142
  prependPrompt?: string;
132
143
  appendPrompt?: string;
133
- prompt?: string;
134
144
  enabled?: boolean;
135
145
  }
136
- interface AiIntentConfig extends IntentConfigBase {
137
- aiIntent: AiIntent;
146
+ interface WorkflowConfig {
147
+ kind: 'workflow';
148
+ id: string;
149
+ label?: string;
150
+ prompt: string;
151
+ confirm?: boolean;
152
+ enabled?: boolean;
138
153
  }
139
- type IntentConfig = AiIntentConfig;
154
+ type IntentConfig = AiIntentConfig | WorkflowConfig;
155
+ declare function isWorkflowConfig(c: IntentConfig): c is WorkflowConfig;
156
+ declare function isAiIntentConfig(c: IntentConfig): c is AiIntentConfig;
140
157
  type InspectoPromptsConfig = (string | IntentConfig)[] | {
141
158
  $replace: true;
142
159
  items: (string | IntentConfig)[];
@@ -156,8 +173,8 @@ interface InspectorOptions {
156
173
  runtimeContext?: RuntimeContextConfig;
157
174
  }
158
175
  interface SendToAiRequest {
159
- location: SourceLocation;
160
- snippet: string;
176
+ location?: SourceLocation;
177
+ snippet?: string;
161
178
  prompt?: string;
162
179
  target?: Provider;
163
180
  runtimeContext?: RuntimeContextEnvelope;
@@ -292,6 +309,8 @@ interface AnnotationThreadMessage {
292
309
  }
293
310
  interface AnnotationWorkSession {
294
311
  id: string;
312
+ source?: 'annotation' | 'workflow';
313
+ workflowId?: string;
295
314
  instruction: string;
296
315
  annotations: Annotation[];
297
316
  deliveryMode?: AnnotationDeliveryMode;
@@ -313,6 +332,8 @@ interface AnnotationWorkSessionSummary {
313
332
  updatedAt: number;
314
333
  }
315
334
  interface CreateAnnotationWorkSessionInput {
335
+ source?: 'annotation' | 'workflow';
336
+ workflowId?: string;
316
337
  instruction?: string;
317
338
  annotations: Annotation[];
318
339
  deliveryMode?: AnnotationDeliveryMode;
@@ -354,6 +375,8 @@ interface AnnotationTransport {
354
375
  }
355
376
  type AnnotationDeliveryMode = 'ide' | 'agent';
356
377
  interface SendAnnotationsToAiRequest {
378
+ source?: 'annotation' | 'workflow';
379
+ workflowId?: string;
357
380
  instruction?: string;
358
381
  annotations: AnnotationTransport[];
359
382
  runtimeContext?: RuntimeContextEnvelope;
@@ -401,4 +424,4 @@ declare const DEFAULT_INTENTS: {
401
424
  prompt: string;
402
425
  }[];
403
426
 
404
- export { type AiErrorCode, type AiIntent, type AiIntentConfig, type AiPayload, type AiStrategyContext, type AiStrategyResult, type Annotation, type AnnotationDeliveryMode, type AnnotationIntent, type AnnotationSession, type AnnotationSessionClaimRequest, type AnnotationSessionEvent, type AnnotationSessionEventType, type AnnotationSessionMutationResponse, type AnnotationSessionReplyRequest, type AnnotationSessionResolveRequest, type AnnotationSessionStatus, type AnnotationTarget, type AnnotationThreadMessage, type AnnotationThreadRole, type AnnotationTransport, type AnnotationTransportTarget, type AnnotationWorkSession, type AnnotationWorkSessionSummary, type AppendAnnotationThreadMessageInput, type ChannelDef, type CreateAnnotationWorkSessionInput, DEFAULT_INTENTS, DEFAULT_PROVIDER_MODE, DUAL_MODE_PROVIDER_CAPABILITIES, type DualModeProvider, type FeedbackRecord, type FeedbackRecordDraft, type FeedbackRecordSession, HOST_IDE_IDS, HOST_IDE_LABELS, type HotKey, type HotKeyString, type HotKeys, INSPECTO_API_PATHS, type IdeInfo, type IdeType, type InspectoConfig, type InspectoLocale, type InspectoMessages, type InspectoPromptsConfig, type InspectoSettings, type InspectorOptions, type IntentConfig, type IntentConfigBase, type LogLevel, type OpenFileRequest, type PathType, type Provider, type ProviderInfo, type ProviderMode, type RuntimeContextConfig, type RuntimeContextEnvelope, type RuntimeContextSummary, type RuntimeEvidenceKind, type RuntimeEvidenceLevel, type RuntimeEvidenceRecord, type SendAnnotationsToAiRequest, type SendAnnotationsToAiResponse, type SendToAiRequest, type SendToAiResponse, type ServerState, type SnippetRequest, type SnippetResponse, type SourceAttrValue, type SourceLocation, type SupportedHostIde, type ToolOverrides, type UnpluginOptions, VALID_MODES, getDualModeProviderCapability, getHostIdeLabel, isSupportedHostIde };
427
+ export { type AiErrorCode, type AiIntent, type AiIntentConfig, type AiPayload, type AiStrategyContext, type AiStrategyResult, type Annotation, type AnnotationDeliveryMode, type AnnotationIntent, type AnnotationSession, type AnnotationSessionClaimRequest, type AnnotationSessionEvent, type AnnotationSessionEventType, type AnnotationSessionMutationResponse, type AnnotationSessionReplyRequest, type AnnotationSessionResolveRequest, type AnnotationSessionStatus, type AnnotationTarget, type AnnotationThreadMessage, type AnnotationThreadRole, type AnnotationTransport, type AnnotationTransportTarget, type AnnotationWorkSession, type AnnotationWorkSessionSummary, type AppendAnnotationThreadMessageInput, type ChannelDef, type CreateAnnotationWorkSessionInput, DEFAULT_INTENTS, DEFAULT_PROVIDER_MODE, DUAL_MODE_PROVIDER_CAPABILITIES, type DualModeProvider, type FeedbackRecord, type FeedbackRecordDraft, type FeedbackRecordSession, HOST_IDE_IDS, HOST_IDE_LABELS, type HotKey, type HotKeyString, type HotKeys, INSPECTO_API_PATHS, type IdeInfo, type IdeType, type InspectoConfig, type InspectoLocale, type InspectoMessages, type InspectoPromptsConfig, type InspectoSettings, type InspectorOptions, type IntentConfig, type IntentKind, type LogLevel, type OpenFileRequest, type PathType, type Provider, type ProviderInfo, type ProviderMode, type RuntimeContextConfig, type RuntimeContextEnvelope, type RuntimeContextSummary, type RuntimeEvidenceKind, type RuntimeEvidenceLevel, type RuntimeEvidenceRecord, type SendAnnotationsToAiRequest, type SendAnnotationsToAiResponse, type SendToAiRequest, type SendToAiResponse, type ServerState, type SnippetRequest, type SnippetResponse, type SourceAttrValue, type SourceLocation, type SupportedHostIde, type ToolOverrides, type UnpluginOptions, VALID_MODES, type WorkflowConfig, type WorkflowSlotOption, getDualModeProviderCapability, getHostIdeLabel, isAiIntentConfig, isSupportedHostIde, isWorkflowConfig };
package/dist/index.d.ts CHANGED
@@ -26,7 +26,7 @@ interface InspectoSettings {
26
26
  ide?: IdeType;
27
27
  [key: `provider.${string}`]: string | string[] | boolean | undefined;
28
28
  'inspector.hotKey'?: HotKeys;
29
- 'annotate.deliveryMode'?: 'ide' | 'agent' | 'both';
29
+ 'annotate.deliveryMode'?: 'ide' | 'agent';
30
30
  'server.host'?: string;
31
31
  'server.publicUrl'?: string;
32
32
  'prompt.includeSnippet'?: boolean;
@@ -104,13 +104,20 @@ interface IdeInfo {
104
104
  workspaceRoot?: string;
105
105
  providers: Record<Provider, ProviderInfo>;
106
106
  }
107
+ interface WorkflowSlotOption {
108
+ id: string;
109
+ label: string;
110
+ prompt: string;
111
+ confirm: boolean;
112
+ }
107
113
  interface InspectoConfig {
108
114
  ide: IdeType;
109
115
  providers?: Record<Provider, ProviderInfo>;
110
- prompts?: IntentConfig[];
116
+ prompts?: AiIntentConfig[];
117
+ workflows?: WorkflowSlotOption[];
111
118
  hotKeys?: HotKeys;
112
119
  theme?: 'light' | 'dark' | 'auto';
113
- annotateDeliveryMode?: 'ide' | 'agent' | 'both';
120
+ annotateDeliveryMode?: 'ide' | 'agent';
114
121
  includeSnippet?: boolean;
115
122
  runtimeContext?: RuntimeContextConfig;
116
123
  }
@@ -123,20 +130,30 @@ interface ServerState {
123
130
  ideInfo?: IdeInfo | null;
124
131
  }
125
132
 
133
+ type IntentKind = 'ai-prompt' | 'workflow';
126
134
  type AiIntent = 'ask' | 'fix' | 'review' | 'redesign';
127
135
  type AnnotationIntent = AiIntent;
128
- interface IntentConfigBase {
136
+ interface AiIntentConfig {
137
+ kind?: 'ai-prompt';
129
138
  id: string;
130
139
  label?: string;
140
+ aiIntent: AiIntent;
141
+ prompt?: string;
131
142
  prependPrompt?: string;
132
143
  appendPrompt?: string;
133
- prompt?: string;
134
144
  enabled?: boolean;
135
145
  }
136
- interface AiIntentConfig extends IntentConfigBase {
137
- aiIntent: AiIntent;
146
+ interface WorkflowConfig {
147
+ kind: 'workflow';
148
+ id: string;
149
+ label?: string;
150
+ prompt: string;
151
+ confirm?: boolean;
152
+ enabled?: boolean;
138
153
  }
139
- type IntentConfig = AiIntentConfig;
154
+ type IntentConfig = AiIntentConfig | WorkflowConfig;
155
+ declare function isWorkflowConfig(c: IntentConfig): c is WorkflowConfig;
156
+ declare function isAiIntentConfig(c: IntentConfig): c is AiIntentConfig;
140
157
  type InspectoPromptsConfig = (string | IntentConfig)[] | {
141
158
  $replace: true;
142
159
  items: (string | IntentConfig)[];
@@ -156,8 +173,8 @@ interface InspectorOptions {
156
173
  runtimeContext?: RuntimeContextConfig;
157
174
  }
158
175
  interface SendToAiRequest {
159
- location: SourceLocation;
160
- snippet: string;
176
+ location?: SourceLocation;
177
+ snippet?: string;
161
178
  prompt?: string;
162
179
  target?: Provider;
163
180
  runtimeContext?: RuntimeContextEnvelope;
@@ -292,6 +309,8 @@ interface AnnotationThreadMessage {
292
309
  }
293
310
  interface AnnotationWorkSession {
294
311
  id: string;
312
+ source?: 'annotation' | 'workflow';
313
+ workflowId?: string;
295
314
  instruction: string;
296
315
  annotations: Annotation[];
297
316
  deliveryMode?: AnnotationDeliveryMode;
@@ -313,6 +332,8 @@ interface AnnotationWorkSessionSummary {
313
332
  updatedAt: number;
314
333
  }
315
334
  interface CreateAnnotationWorkSessionInput {
335
+ source?: 'annotation' | 'workflow';
336
+ workflowId?: string;
316
337
  instruction?: string;
317
338
  annotations: Annotation[];
318
339
  deliveryMode?: AnnotationDeliveryMode;
@@ -354,6 +375,8 @@ interface AnnotationTransport {
354
375
  }
355
376
  type AnnotationDeliveryMode = 'ide' | 'agent';
356
377
  interface SendAnnotationsToAiRequest {
378
+ source?: 'annotation' | 'workflow';
379
+ workflowId?: string;
357
380
  instruction?: string;
358
381
  annotations: AnnotationTransport[];
359
382
  runtimeContext?: RuntimeContextEnvelope;
@@ -401,4 +424,4 @@ declare const DEFAULT_INTENTS: {
401
424
  prompt: string;
402
425
  }[];
403
426
 
404
- export { type AiErrorCode, type AiIntent, type AiIntentConfig, type AiPayload, type AiStrategyContext, type AiStrategyResult, type Annotation, type AnnotationDeliveryMode, type AnnotationIntent, type AnnotationSession, type AnnotationSessionClaimRequest, type AnnotationSessionEvent, type AnnotationSessionEventType, type AnnotationSessionMutationResponse, type AnnotationSessionReplyRequest, type AnnotationSessionResolveRequest, type AnnotationSessionStatus, type AnnotationTarget, type AnnotationThreadMessage, type AnnotationThreadRole, type AnnotationTransport, type AnnotationTransportTarget, type AnnotationWorkSession, type AnnotationWorkSessionSummary, type AppendAnnotationThreadMessageInput, type ChannelDef, type CreateAnnotationWorkSessionInput, DEFAULT_INTENTS, DEFAULT_PROVIDER_MODE, DUAL_MODE_PROVIDER_CAPABILITIES, type DualModeProvider, type FeedbackRecord, type FeedbackRecordDraft, type FeedbackRecordSession, HOST_IDE_IDS, HOST_IDE_LABELS, type HotKey, type HotKeyString, type HotKeys, INSPECTO_API_PATHS, type IdeInfo, type IdeType, type InspectoConfig, type InspectoLocale, type InspectoMessages, type InspectoPromptsConfig, type InspectoSettings, type InspectorOptions, type IntentConfig, type IntentConfigBase, type LogLevel, type OpenFileRequest, type PathType, type Provider, type ProviderInfo, type ProviderMode, type RuntimeContextConfig, type RuntimeContextEnvelope, type RuntimeContextSummary, type RuntimeEvidenceKind, type RuntimeEvidenceLevel, type RuntimeEvidenceRecord, type SendAnnotationsToAiRequest, type SendAnnotationsToAiResponse, type SendToAiRequest, type SendToAiResponse, type ServerState, type SnippetRequest, type SnippetResponse, type SourceAttrValue, type SourceLocation, type SupportedHostIde, type ToolOverrides, type UnpluginOptions, VALID_MODES, getDualModeProviderCapability, getHostIdeLabel, isSupportedHostIde };
427
+ export { type AiErrorCode, type AiIntent, type AiIntentConfig, type AiPayload, type AiStrategyContext, type AiStrategyResult, type Annotation, type AnnotationDeliveryMode, type AnnotationIntent, type AnnotationSession, type AnnotationSessionClaimRequest, type AnnotationSessionEvent, type AnnotationSessionEventType, type AnnotationSessionMutationResponse, type AnnotationSessionReplyRequest, type AnnotationSessionResolveRequest, type AnnotationSessionStatus, type AnnotationTarget, type AnnotationThreadMessage, type AnnotationThreadRole, type AnnotationTransport, type AnnotationTransportTarget, type AnnotationWorkSession, type AnnotationWorkSessionSummary, type AppendAnnotationThreadMessageInput, type ChannelDef, type CreateAnnotationWorkSessionInput, DEFAULT_INTENTS, DEFAULT_PROVIDER_MODE, DUAL_MODE_PROVIDER_CAPABILITIES, type DualModeProvider, type FeedbackRecord, type FeedbackRecordDraft, type FeedbackRecordSession, HOST_IDE_IDS, HOST_IDE_LABELS, type HotKey, type HotKeyString, type HotKeys, INSPECTO_API_PATHS, type IdeInfo, type IdeType, type InspectoConfig, type InspectoLocale, type InspectoMessages, type InspectoPromptsConfig, type InspectoSettings, type InspectorOptions, type IntentConfig, type IntentKind, type LogLevel, type OpenFileRequest, type PathType, type Provider, type ProviderInfo, type ProviderMode, type RuntimeContextConfig, type RuntimeContextEnvelope, type RuntimeContextSummary, type RuntimeEvidenceKind, type RuntimeEvidenceLevel, type RuntimeEvidenceRecord, type SendAnnotationsToAiRequest, type SendAnnotationsToAiResponse, type SendToAiRequest, type SendToAiResponse, type ServerState, type SnippetRequest, type SnippetResponse, type SourceAttrValue, type SourceLocation, type SupportedHostIde, type ToolOverrides, type UnpluginOptions, VALID_MODES, type WorkflowConfig, type WorkflowSlotOption, getDualModeProviderCapability, getHostIdeLabel, isAiIntentConfig, isSupportedHostIde, isWorkflowConfig };
package/dist/index.js CHANGED
@@ -62,6 +62,14 @@ var DEFAULT_PROVIDER_MODE = {
62
62
  codebuddy: "builtin"
63
63
  };
64
64
 
65
+ // src/prompts.ts
66
+ function isWorkflowConfig(c) {
67
+ return c.kind === "workflow";
68
+ }
69
+ function isAiIntentConfig(c) {
70
+ return c.kind !== "workflow";
71
+ }
72
+
65
73
  // src/api.ts
66
74
  var INSPECTO_API_PATHS = {
67
75
  HEALTH: "/inspecto/api/v1/health",
@@ -126,5 +134,7 @@ export {
126
134
  VALID_MODES,
127
135
  getDualModeProviderCapability,
128
136
  getHostIdeLabel,
129
- isSupportedHostIde
137
+ isAiIntentConfig,
138
+ isSupportedHostIde,
139
+ isWorkflowConfig
130
140
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inspecto-dev/types",
3
- "version": "0.3.10",
3
+ "version": "0.3.11",
4
4
  "description": "Shared TypeScript definitions for the Inspecto monorepo",
5
5
  "license": "MIT",
6
6
  "type": "module",