@inspecto-dev/types 0.3.9 → 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,9 @@ 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
+ 'server.host'?: string;
31
+ 'server.publicUrl'?: string;
30
32
  'prompt.includeSnippet'?: boolean;
31
33
  'prompt.autoSend'?: boolean;
32
34
  }
@@ -102,13 +104,20 @@ interface IdeInfo {
102
104
  workspaceRoot?: string;
103
105
  providers: Record<Provider, ProviderInfo>;
104
106
  }
107
+ interface WorkflowSlotOption {
108
+ id: string;
109
+ label: string;
110
+ prompt: string;
111
+ confirm: boolean;
112
+ }
105
113
  interface InspectoConfig {
106
114
  ide: IdeType;
107
115
  providers?: Record<Provider, ProviderInfo>;
108
- prompts?: IntentConfig[];
116
+ prompts?: AiIntentConfig[];
117
+ workflows?: WorkflowSlotOption[];
109
118
  hotKeys?: HotKeys;
110
119
  theme?: 'light' | 'dark' | 'auto';
111
- annotateDeliveryMode?: 'ide' | 'agent' | 'both';
120
+ annotateDeliveryMode?: 'ide' | 'agent';
112
121
  includeSnippet?: boolean;
113
122
  runtimeContext?: RuntimeContextConfig;
114
123
  }
@@ -121,20 +130,30 @@ interface ServerState {
121
130
  ideInfo?: IdeInfo | null;
122
131
  }
123
132
 
133
+ type IntentKind = 'ai-prompt' | 'workflow';
124
134
  type AiIntent = 'ask' | 'fix' | 'review' | 'redesign';
125
135
  type AnnotationIntent = AiIntent;
126
- interface IntentConfigBase {
136
+ interface AiIntentConfig {
137
+ kind?: 'ai-prompt';
127
138
  id: string;
128
139
  label?: string;
140
+ aiIntent: AiIntent;
141
+ prompt?: string;
129
142
  prependPrompt?: string;
130
143
  appendPrompt?: string;
131
- prompt?: string;
132
144
  enabled?: boolean;
133
145
  }
134
- interface AiIntentConfig extends IntentConfigBase {
135
- aiIntent: AiIntent;
146
+ interface WorkflowConfig {
147
+ kind: 'workflow';
148
+ id: string;
149
+ label?: string;
150
+ prompt: string;
151
+ confirm?: boolean;
152
+ enabled?: boolean;
136
153
  }
137
- 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;
138
157
  type InspectoPromptsConfig = (string | IntentConfig)[] | {
139
158
  $replace: true;
140
159
  items: (string | IntentConfig)[];
@@ -154,8 +173,8 @@ interface InspectorOptions {
154
173
  runtimeContext?: RuntimeContextConfig;
155
174
  }
156
175
  interface SendToAiRequest {
157
- location: SourceLocation;
158
- snippet: string;
176
+ location?: SourceLocation;
177
+ snippet?: string;
159
178
  prompt?: string;
160
179
  target?: Provider;
161
180
  runtimeContext?: RuntimeContextEnvelope;
@@ -290,6 +309,8 @@ interface AnnotationThreadMessage {
290
309
  }
291
310
  interface AnnotationWorkSession {
292
311
  id: string;
312
+ source?: 'annotation' | 'workflow';
313
+ workflowId?: string;
293
314
  instruction: string;
294
315
  annotations: Annotation[];
295
316
  deliveryMode?: AnnotationDeliveryMode;
@@ -311,6 +332,8 @@ interface AnnotationWorkSessionSummary {
311
332
  updatedAt: number;
312
333
  }
313
334
  interface CreateAnnotationWorkSessionInput {
335
+ source?: 'annotation' | 'workflow';
336
+ workflowId?: string;
314
337
  instruction?: string;
315
338
  annotations: Annotation[];
316
339
  deliveryMode?: AnnotationDeliveryMode;
@@ -352,6 +375,8 @@ interface AnnotationTransport {
352
375
  }
353
376
  type AnnotationDeliveryMode = 'ide' | 'agent';
354
377
  interface SendAnnotationsToAiRequest {
378
+ source?: 'annotation' | 'workflow';
379
+ workflowId?: string;
355
380
  instruction?: string;
356
381
  annotations: AnnotationTransport[];
357
382
  runtimeContext?: RuntimeContextEnvelope;
@@ -399,4 +424,4 @@ declare const DEFAULT_INTENTS: {
399
424
  prompt: string;
400
425
  }[];
401
426
 
402
- 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,9 @@ 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
+ 'server.host'?: string;
31
+ 'server.publicUrl'?: string;
30
32
  'prompt.includeSnippet'?: boolean;
31
33
  'prompt.autoSend'?: boolean;
32
34
  }
@@ -102,13 +104,20 @@ interface IdeInfo {
102
104
  workspaceRoot?: string;
103
105
  providers: Record<Provider, ProviderInfo>;
104
106
  }
107
+ interface WorkflowSlotOption {
108
+ id: string;
109
+ label: string;
110
+ prompt: string;
111
+ confirm: boolean;
112
+ }
105
113
  interface InspectoConfig {
106
114
  ide: IdeType;
107
115
  providers?: Record<Provider, ProviderInfo>;
108
- prompts?: IntentConfig[];
116
+ prompts?: AiIntentConfig[];
117
+ workflows?: WorkflowSlotOption[];
109
118
  hotKeys?: HotKeys;
110
119
  theme?: 'light' | 'dark' | 'auto';
111
- annotateDeliveryMode?: 'ide' | 'agent' | 'both';
120
+ annotateDeliveryMode?: 'ide' | 'agent';
112
121
  includeSnippet?: boolean;
113
122
  runtimeContext?: RuntimeContextConfig;
114
123
  }
@@ -121,20 +130,30 @@ interface ServerState {
121
130
  ideInfo?: IdeInfo | null;
122
131
  }
123
132
 
133
+ type IntentKind = 'ai-prompt' | 'workflow';
124
134
  type AiIntent = 'ask' | 'fix' | 'review' | 'redesign';
125
135
  type AnnotationIntent = AiIntent;
126
- interface IntentConfigBase {
136
+ interface AiIntentConfig {
137
+ kind?: 'ai-prompt';
127
138
  id: string;
128
139
  label?: string;
140
+ aiIntent: AiIntent;
141
+ prompt?: string;
129
142
  prependPrompt?: string;
130
143
  appendPrompt?: string;
131
- prompt?: string;
132
144
  enabled?: boolean;
133
145
  }
134
- interface AiIntentConfig extends IntentConfigBase {
135
- aiIntent: AiIntent;
146
+ interface WorkflowConfig {
147
+ kind: 'workflow';
148
+ id: string;
149
+ label?: string;
150
+ prompt: string;
151
+ confirm?: boolean;
152
+ enabled?: boolean;
136
153
  }
137
- 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;
138
157
  type InspectoPromptsConfig = (string | IntentConfig)[] | {
139
158
  $replace: true;
140
159
  items: (string | IntentConfig)[];
@@ -154,8 +173,8 @@ interface InspectorOptions {
154
173
  runtimeContext?: RuntimeContextConfig;
155
174
  }
156
175
  interface SendToAiRequest {
157
- location: SourceLocation;
158
- snippet: string;
176
+ location?: SourceLocation;
177
+ snippet?: string;
159
178
  prompt?: string;
160
179
  target?: Provider;
161
180
  runtimeContext?: RuntimeContextEnvelope;
@@ -290,6 +309,8 @@ interface AnnotationThreadMessage {
290
309
  }
291
310
  interface AnnotationWorkSession {
292
311
  id: string;
312
+ source?: 'annotation' | 'workflow';
313
+ workflowId?: string;
293
314
  instruction: string;
294
315
  annotations: Annotation[];
295
316
  deliveryMode?: AnnotationDeliveryMode;
@@ -311,6 +332,8 @@ interface AnnotationWorkSessionSummary {
311
332
  updatedAt: number;
312
333
  }
313
334
  interface CreateAnnotationWorkSessionInput {
335
+ source?: 'annotation' | 'workflow';
336
+ workflowId?: string;
314
337
  instruction?: string;
315
338
  annotations: Annotation[];
316
339
  deliveryMode?: AnnotationDeliveryMode;
@@ -352,6 +375,8 @@ interface AnnotationTransport {
352
375
  }
353
376
  type AnnotationDeliveryMode = 'ide' | 'agent';
354
377
  interface SendAnnotationsToAiRequest {
378
+ source?: 'annotation' | 'workflow';
379
+ workflowId?: string;
355
380
  instruction?: string;
356
381
  annotations: AnnotationTransport[];
357
382
  runtimeContext?: RuntimeContextEnvelope;
@@ -399,4 +424,4 @@ declare const DEFAULT_INTENTS: {
399
424
  prompt: string;
400
425
  }[];
401
426
 
402
- 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.9",
3
+ "version": "0.3.11",
4
4
  "description": "Shared TypeScript definitions for the Inspecto monorepo",
5
5
  "license": "MIT",
6
6
  "type": "module",