cdeops 12.0.4-alpha.431 → 12.0.4-alpha.459
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/package.json +2 -2
- package/server.d.ts +636 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cdeops",
|
|
3
|
-
"version": "12.0.4-alpha.
|
|
3
|
+
"version": "12.0.4-alpha.459",
|
|
4
4
|
"description": "Cdecode - Extension API: build extensions that enhance coding experience in your cdeops editor",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "1e46831d09b585e97f766263255798f1fcf82f78"
|
|
33
33
|
}
|
package/server.d.ts
CHANGED
|
@@ -1,5 +1,639 @@
|
|
|
1
|
+
/* eslint-disable no-use-before-define */
|
|
2
|
+
/* eslint-disable import/export */
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
1
5
|
/// <reference path="./src/cdeops.d.ts"/>
|
|
2
6
|
/// <reference path="./src/cdeops.proposed.d.ts"/>
|
|
3
7
|
|
|
4
|
-
|
|
5
|
-
|
|
8
|
+
declare module 'cdeops/server' {
|
|
9
|
+
import {
|
|
10
|
+
OrganizationResource,
|
|
11
|
+
RelativePattern,
|
|
12
|
+
GlobPattern,
|
|
13
|
+
LogLevel,
|
|
14
|
+
Uri as URI,
|
|
15
|
+
Unsubscribable,
|
|
16
|
+
Subscribable,
|
|
17
|
+
Workspace,
|
|
18
|
+
ConfigurationTarget,
|
|
19
|
+
OrganizationConfiguration,
|
|
20
|
+
configuration,
|
|
21
|
+
organization,
|
|
22
|
+
} from 'cdeops';
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
OrganizationResource,
|
|
26
|
+
RelativePattern,
|
|
27
|
+
GlobPattern,
|
|
28
|
+
URI,
|
|
29
|
+
LogLevel,
|
|
30
|
+
Unsubscribable,
|
|
31
|
+
Subscribable,
|
|
32
|
+
Workspace,
|
|
33
|
+
ConfigurationTarget,
|
|
34
|
+
OrganizationConfiguration,
|
|
35
|
+
configuration,
|
|
36
|
+
organization,
|
|
37
|
+
commands,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// AI Service Interfaces
|
|
41
|
+
export interface IAISocketContribution {
|
|
42
|
+
key: string;
|
|
43
|
+
name: string;
|
|
44
|
+
type: string;
|
|
45
|
+
required?: boolean;
|
|
46
|
+
enum?: string[];
|
|
47
|
+
default?: any;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface ICodeJavascriptRequest {
|
|
51
|
+
script: string;
|
|
52
|
+
args: any[];
|
|
53
|
+
timeout?: number;
|
|
54
|
+
context?: Record<string, any>;
|
|
55
|
+
}
|
|
56
|
+
export interface IAIWorkflowNode {
|
|
57
|
+
id: string;
|
|
58
|
+
type: string;
|
|
59
|
+
position: { x: number; y: number };
|
|
60
|
+
data: Record<string, any>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface IAIWorkflowEdge {
|
|
64
|
+
id: string;
|
|
65
|
+
source: string;
|
|
66
|
+
target: string;
|
|
67
|
+
sourceOutput: string;
|
|
68
|
+
targetInput: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface ICodeJavascriptResponse {
|
|
72
|
+
result: any;
|
|
73
|
+
error?: string;
|
|
74
|
+
executionTime: number;
|
|
75
|
+
memoryUsage?: number;
|
|
76
|
+
}
|
|
77
|
+
export interface IAIWorkflowConfig {
|
|
78
|
+
id: string;
|
|
79
|
+
name: string;
|
|
80
|
+
description?: string;
|
|
81
|
+
nodes: IAIWorkflowNode[];
|
|
82
|
+
edges: IAIWorkflowEdge[];
|
|
83
|
+
metadata: {
|
|
84
|
+
organizationId: string;
|
|
85
|
+
workflowId: string;
|
|
86
|
+
workflowVersionId: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface IAINodeContribution {
|
|
91
|
+
id: string;
|
|
92
|
+
label: string;
|
|
93
|
+
description: string;
|
|
94
|
+
icon: string;
|
|
95
|
+
category: string;
|
|
96
|
+
inputs: IAISocketContribution[];
|
|
97
|
+
outputs: IAISocketContribution[];
|
|
98
|
+
machine: any; // XState machine
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface DocumentFilter {
|
|
102
|
+
/** A language id, such as `typescript` or `*`. */
|
|
103
|
+
language?: string;
|
|
104
|
+
|
|
105
|
+
/** A URI scheme, such as `file` or `untitled`. */
|
|
106
|
+
scheme?: string;
|
|
107
|
+
|
|
108
|
+
/** A glob pattern, such as `*.{ts,js}`. */
|
|
109
|
+
pattern?: string;
|
|
110
|
+
|
|
111
|
+
/** A base URI (e.g. root URI of a workspace folder) that the document must be within. */
|
|
112
|
+
baseUri?: URL | string;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* A document selector is the combination of one or many document filters.
|
|
117
|
+
* A document matches the selector if any of the given filters matches.
|
|
118
|
+
* If the filter is a string and not a {@link DocumentFilter}, it will be treated as a language id.
|
|
119
|
+
*
|
|
120
|
+
* @example let sel: DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }];
|
|
121
|
+
*/
|
|
122
|
+
export type DocumentSelector = (string | DocumentFilter)[];
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* A panel view created by {@link sourcegraph.app.createPanelView}.
|
|
126
|
+
*/
|
|
127
|
+
export interface PanelView extends Unsubscribable {
|
|
128
|
+
/**
|
|
129
|
+
* The title of the panel view.
|
|
130
|
+
*/
|
|
131
|
+
title: string;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The content to show in the panel view. Markdown is supported.
|
|
135
|
+
*/
|
|
136
|
+
content: string;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* The priority of this panel view. A higher value means that the item is shown near the beginning (usually
|
|
140
|
+
* the left side).
|
|
141
|
+
*/
|
|
142
|
+
priority: number;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Display the results of the location provider (with the given ID) in this panel below the
|
|
146
|
+
* {@link PanelView#contents}.
|
|
147
|
+
*
|
|
148
|
+
* Experimental. Subject to change or removal without notice.
|
|
149
|
+
*
|
|
150
|
+
* @internal
|
|
151
|
+
*/
|
|
152
|
+
component: { locationProvider: string } | null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* A style for a {@link TextDocumentDecoration}.
|
|
157
|
+
*/
|
|
158
|
+
export interface ThemableDecorationStyle {
|
|
159
|
+
/** The CSS background-color property value for the line. */
|
|
160
|
+
backgroundColor?: string;
|
|
161
|
+
|
|
162
|
+
/** The CSS border property value for the line. */
|
|
163
|
+
border?: string;
|
|
164
|
+
|
|
165
|
+
/** The CSS border-color property value for the line. */
|
|
166
|
+
borderColor?: string;
|
|
167
|
+
|
|
168
|
+
/** The CSS border-width property value for the line. */
|
|
169
|
+
borderWidth?: string;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* A text document decoration changes the appearance of a range in the document and/or adds other content to
|
|
173
|
+
* it.
|
|
174
|
+
*/
|
|
175
|
+
export interface TextDocumentDecoration extends ThemableDecorationStyle {
|
|
176
|
+
/**
|
|
177
|
+
* The range that the decoration applies to. Currently, decorations are
|
|
178
|
+
* only applied only on the start line, and the entire line. Multiline
|
|
179
|
+
* and intra-line ranges are not supported.
|
|
180
|
+
*/
|
|
181
|
+
range: Range;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* If true, the decoration applies to all lines in the range (inclusive), even if not all characters on the
|
|
185
|
+
* line are included.
|
|
186
|
+
*/
|
|
187
|
+
isWholeLine?: boolean;
|
|
188
|
+
|
|
189
|
+
/** Content to display after the range. */
|
|
190
|
+
after?: DecorationAttachmentRenderOptions;
|
|
191
|
+
|
|
192
|
+
/** Overwrite style for light themes. */
|
|
193
|
+
light?: ThemableDecorationStyle;
|
|
194
|
+
|
|
195
|
+
/** Overwrite style for dark themes. */
|
|
196
|
+
dark?: ThemableDecorationStyle;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* A style for {@link BadgeAttachmentRenderOptions}.
|
|
201
|
+
*/
|
|
202
|
+
export interface ThemableBadgeAttachmentStyle {
|
|
203
|
+
/**
|
|
204
|
+
* The icon (a base64-encoded image icon) to display next to the wrapped value.
|
|
205
|
+
*
|
|
206
|
+
* @deprecated Use {@link BadgeAttachmentRenderOptions#kind} to pick a predefined icon
|
|
207
|
+
*/
|
|
208
|
+
icon?: string;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* The CSS background-color property value for the attachment.
|
|
212
|
+
*
|
|
213
|
+
* @deprecated Use {@link BadgeAttachmentRenderOptions#kind} to pick a predefined icon
|
|
214
|
+
*/
|
|
215
|
+
backgroundColor?: string;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* The CSS color property value for the attachment.
|
|
219
|
+
*
|
|
220
|
+
* @deprecated Use {@link BadgeAttachmentRenderOptions#kind} to pick a predefined icon
|
|
221
|
+
*/
|
|
222
|
+
color?: string;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/** An attachment adds content to a hover tooltip or result in a locations panel. */
|
|
226
|
+
export interface BadgeAttachmentRenderOptions extends ThemableBadgeAttachmentStyle {
|
|
227
|
+
/** Predefined icons for badge attachments */
|
|
228
|
+
kind: 'info' | 'error' | 'warning';
|
|
229
|
+
|
|
230
|
+
/** Tooltip text to display when hovering over the attachment. */
|
|
231
|
+
hoverMessage?: string;
|
|
232
|
+
|
|
233
|
+
/** If set, the attachment becomes a link with this destination URL. */
|
|
234
|
+
linkURL?: string;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Overwrite style for light themes.
|
|
238
|
+
*
|
|
239
|
+
* @deprecated Use {@link BadgeAttachmentRenderOptions#kind} to pick a predefined icon
|
|
240
|
+
*/
|
|
241
|
+
light?: ThemableBadgeAttachmentStyle;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Overwrite style for dark themes.
|
|
245
|
+
*
|
|
246
|
+
* @deprecated Use {@link BadgeAttachmentRenderOptions#kind} to pick a predefined icon
|
|
247
|
+
*/
|
|
248
|
+
dark?: ThemableBadgeAttachmentStyle;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* A wrapper around a providable type (currently hover and locations) with additional
|
|
253
|
+
* context to enable displaying badges next to the wrapped result value in the UI.
|
|
254
|
+
*/
|
|
255
|
+
export type Badged<T extends object> = T & {
|
|
256
|
+
badge?: BadgeAttachmentRenderOptions;
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* A hover represents additional information for a symbol or word. Hovers are rendered in a tooltip-like
|
|
261
|
+
* widget.
|
|
262
|
+
*/
|
|
263
|
+
export interface Hover {
|
|
264
|
+
/**
|
|
265
|
+
* The contents of this hover.
|
|
266
|
+
*/
|
|
267
|
+
contents: MarkupContent;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* The range to which this hover applies. When missing, the editor will use the range at the current
|
|
271
|
+
* position or the current position itself.
|
|
272
|
+
*/
|
|
273
|
+
range?: Range;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Alerts that should be shown in this hover.
|
|
277
|
+
*/
|
|
278
|
+
alerts?: Badged<HoverAlert>[];
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface HoverAlert {
|
|
282
|
+
/**
|
|
283
|
+
* Text content to be shown on hovers. Since the alert is displayed inline,
|
|
284
|
+
* multiparagraph content will be rendered on one line. It's recommended to
|
|
285
|
+
* provide a brief message here, and place futher details in the badge or
|
|
286
|
+
* provide a link.
|
|
287
|
+
*/
|
|
288
|
+
summary: MarkupContent;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* When an alert has a dismissal type, dismissing it will prevent all alerts
|
|
292
|
+
* of that type from being shown. If no type is provided, the alert is not
|
|
293
|
+
* dismissible.
|
|
294
|
+
*/
|
|
295
|
+
type?: string;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export interface ContextValues {
|
|
299
|
+
[key: string]: string | number | boolean | null;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Internal API for Cdeops extensions. ost of those wil be removed for the beta release of Cdeops
|
|
304
|
+
* extensions. They are necessary now due to limitations in the extension API and its implementation tha will
|
|
305
|
+
* be addressed in the beta release.
|
|
306
|
+
*
|
|
307
|
+
* @internal
|
|
308
|
+
* @hidden
|
|
309
|
+
*/
|
|
310
|
+
export namespace internal {
|
|
311
|
+
/**
|
|
312
|
+
* Returns a promise that resolve when all pending messages have been sent to the client.
|
|
313
|
+
* It helps enforce serialization of messages.
|
|
314
|
+
*
|
|
315
|
+
* @internal
|
|
316
|
+
*/
|
|
317
|
+
export function sync(): Promise<void>;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Updates context values for use in context expressions and contribution labels.
|
|
321
|
+
*
|
|
322
|
+
* @param updates The updates to apply to the context. If a context property's value is null, it is deleted from the
|
|
323
|
+
* context.
|
|
324
|
+
*/
|
|
325
|
+
export function updateContext(updates: ContextValues): void;
|
|
326
|
+
|
|
327
|
+
export const cdeopsURL: URI;
|
|
328
|
+
|
|
329
|
+
export const clientApplication: 'cdeops' | 'other';
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Server api
|
|
333
|
+
*/
|
|
334
|
+
export const serverApi: any;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* gql
|
|
338
|
+
*/
|
|
339
|
+
export const gql: any;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* The extension context is passed to the extension's activate function and contains utilities for
|
|
344
|
+
* extension lifecycle.
|
|
345
|
+
*/
|
|
346
|
+
export interface ExtensionContext {
|
|
347
|
+
/**
|
|
348
|
+
* An object that maintains subscriptions to resources that should be freed when the extension is
|
|
349
|
+
* deactivated.
|
|
350
|
+
*
|
|
351
|
+
* When an extension is deactivated, first its exported `deactivate` function is called (if one exists).
|
|
352
|
+
* The `deactivate` function may be async, in which case deactivation blocks on it finishing. Next,
|
|
353
|
+
* regardless of whether the `deactivate` function finished successfully or rejected with an error, all
|
|
354
|
+
* unsubscribables passed to {@link ExtensionContext#subscriptions#add} are unsubscribed from.
|
|
355
|
+
*
|
|
356
|
+
* (An extension is deactivated when the user disables it, or after an arbitary time period if
|
|
357
|
+
* activationEvents no longer evaluated to true.)
|
|
358
|
+
*/
|
|
359
|
+
subscriptions: {
|
|
360
|
+
/**
|
|
361
|
+
* Mark a resource's teardown function to be called when the extension is deactivated.
|
|
362
|
+
*
|
|
363
|
+
* @param unsubscribable An {@link Unsubscribable} that frees (unsubscribes from) a resource, or a
|
|
364
|
+
* plan function that deos the same. Async functions are not supported. (If deactivation requires
|
|
365
|
+
* async operations, make the `deactivate` function async; that is supported.)
|
|
366
|
+
*/
|
|
367
|
+
add: (unsubscribe: Unsubscribable | (() => void)) => void;
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Namespace for dealing with commands. In short, a command is a function with a
|
|
373
|
+
* unique identifier. The function is sometimes also called _command handler_.
|
|
374
|
+
*
|
|
375
|
+
* Commands can be added to the editor using the [registerCommand](#commands.registerCommand)
|
|
376
|
+
* and [registerTextEditorCommand](#commands.registerTextEditorCommand) functions. Commands
|
|
377
|
+
* can be executed [manually](#commands.executeCommand) or from a UI gesture. Those are:
|
|
378
|
+
*
|
|
379
|
+
* * palette - Use the `commands`-section in `package.json` to make a command show in
|
|
380
|
+
* the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette).
|
|
381
|
+
* * keybinding - Use the `keybindings`-section in `package.json` to enable
|
|
382
|
+
* [keybindings](https://code.visualstudio.com/docs/getstarted/keybindings#_customizing-shortcuts)
|
|
383
|
+
* for your extension.
|
|
384
|
+
*
|
|
385
|
+
* Commands from other extensions and from the editor itself are accessible to an extension. However,
|
|
386
|
+
* when invoking an editor command not all argument types are supported.
|
|
387
|
+
*
|
|
388
|
+
* This is a sample that registers a command handler and adds an entry for that command to the palette. First
|
|
389
|
+
* register a command handler with the identifier `extension.sayHello`.
|
|
390
|
+
* ```javascript
|
|
391
|
+
* commands.registerCommand('extension.sayHello', () => {
|
|
392
|
+
* window.showInformationMessage('Hello World!');
|
|
393
|
+
* });
|
|
394
|
+
* ```
|
|
395
|
+
* Second, bind the command identifier to a title under which it will show in the palette (`package.json`).
|
|
396
|
+
* ```json
|
|
397
|
+
* {
|
|
398
|
+
* "contributes": {
|
|
399
|
+
* "commands": [{
|
|
400
|
+
* "command": "extension.sayHello",
|
|
401
|
+
* "title": "Hello World"
|
|
402
|
+
* }]
|
|
403
|
+
* }
|
|
404
|
+
* }
|
|
405
|
+
* ```
|
|
406
|
+
*/
|
|
407
|
+
export namespace commands {
|
|
408
|
+
/**
|
|
409
|
+
* Registers a command that can be invoked via a keyboard shortcut,
|
|
410
|
+
* a menu item, an action, or directly.
|
|
411
|
+
*
|
|
412
|
+
* Registering a command with an existing command identifier twice
|
|
413
|
+
* will cause an error.
|
|
414
|
+
*
|
|
415
|
+
* @param command A unique identifier for the command.
|
|
416
|
+
* @param callback A command handler function.
|
|
417
|
+
* @param thisArg The `this` context used when invoking the handler function.
|
|
418
|
+
* @return Disposable which unregisters this command on disposal.
|
|
419
|
+
*/
|
|
420
|
+
export function registerCommand(command: string, callback: (...args: any[]) => any, thisArg?: any): Disposable;
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Registers a text editor command that can be invoked via a keyboard shortcut,
|
|
424
|
+
* a menu item, an action, or directly.
|
|
425
|
+
*
|
|
426
|
+
* Text editor commands are different from ordinary [commands](#commands.registerCommand) as
|
|
427
|
+
* they only execute when there is an active editor when the command is called. Also, the
|
|
428
|
+
* command handler of an editor command has access to the active editor and to an
|
|
429
|
+
* [edit](#TextEditorEdit)-builder.
|
|
430
|
+
*
|
|
431
|
+
* @param command A unique identifier for the command.
|
|
432
|
+
* @param callback A command handler function with access to an [editor](#TextEditor) and an [edit](#TextEditorEdit).
|
|
433
|
+
* @param thisArg The `this` context used when invoking the handler function.
|
|
434
|
+
* @return Disposable which unregisters this command on disposal.
|
|
435
|
+
*/
|
|
436
|
+
export function registerTextEditorCommand(
|
|
437
|
+
command: string,
|
|
438
|
+
callback: (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => void,
|
|
439
|
+
thisArg?: any,
|
|
440
|
+
): Disposable;
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Executes the command denoted by the given command identifier.
|
|
444
|
+
*
|
|
445
|
+
* * *Note 1:* When executing an editor command not all types are allowed to
|
|
446
|
+
* be passed as arguments. Allowed are the primitive types `string`, `boolean`,
|
|
447
|
+
* `number`, `undefined`, and `null`, as well as [`Position`](#Position), [`Range`](#Range), [`Uri`](#Uri) and [`Location`](#Location).
|
|
448
|
+
* * *Note 2:* There are no restrictions when executing commands that have been contributed
|
|
449
|
+
* by extensions.
|
|
450
|
+
*
|
|
451
|
+
* @param command Identifier of the command to execute.
|
|
452
|
+
* @param rest Parameters passed to the command function.
|
|
453
|
+
* @return A promise that resolves to the returned value of the given command. `undefined` when
|
|
454
|
+
* the command handler function doesn't return anything.
|
|
455
|
+
*/
|
|
456
|
+
export function executeCommand<T>(command: string, ...rest: any[]): Promise<T | undefined>;
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Retrieve the list of all available commands. Commands starting an underscore are
|
|
460
|
+
* treated as internal commands.
|
|
461
|
+
*
|
|
462
|
+
* @param filterInternal Set `true` to not see internal commands (starting with an underscore)
|
|
463
|
+
* @return Promise that resolves to a list of command ids.
|
|
464
|
+
*/
|
|
465
|
+
export function getCommands(filterInternal?: boolean): Promise<string[]>;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export namespace code {
|
|
469
|
+
/**
|
|
470
|
+
* Namespace for JavaScript code execution and library management.
|
|
471
|
+
*/
|
|
472
|
+
export namespace javascript {
|
|
473
|
+
/**
|
|
474
|
+
* Executes a script in the JavaScript environment.
|
|
475
|
+
* @param request The script execution request.
|
|
476
|
+
* @returns Promise that resolves to the execution result.
|
|
477
|
+
*/
|
|
478
|
+
export function executeScript(request: ICodeJavascriptRequest): Promise<ICodeJavascriptResponse>;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Installs a library in the JavaScript environment.
|
|
482
|
+
* @param url The URL of the library to install.
|
|
483
|
+
* @param accessors The accessor names for the library.
|
|
484
|
+
* @returns Promise that resolves when the library is installed.
|
|
485
|
+
*/
|
|
486
|
+
export function installLibrary(url: string, accessors: string[]): Promise<any>;
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Uninstalls libraries from the JavaScript environment.
|
|
490
|
+
* @param accessors The accessor names to uninstall.
|
|
491
|
+
* @returns Promise that resolves to the uninstall result.
|
|
492
|
+
*/
|
|
493
|
+
export function uninstallLibrary(accessors: string[]): Promise<{ success: boolean; error?: string }>;
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Resets the JavaScript environment context.
|
|
497
|
+
* @returns Promise that resolves when the context is reset.
|
|
498
|
+
*/
|
|
499
|
+
export function resetContext(): Promise<void>;
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* Gets code completions for the given context.
|
|
503
|
+
* @param context The completion context with text, position, and optional scope.
|
|
504
|
+
* @returns Promise that resolves to completions and metadata.
|
|
505
|
+
*/
|
|
506
|
+
export function getCompletions(context: { text: string; position: number; scope?: string[] }): Promise<{
|
|
507
|
+
completions: Array<{
|
|
508
|
+
name: string;
|
|
509
|
+
type?: string;
|
|
510
|
+
doc?: string;
|
|
511
|
+
url?: string;
|
|
512
|
+
}>;
|
|
513
|
+
isIncomplete: boolean;
|
|
514
|
+
}>;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Gets type information for a symbol.
|
|
518
|
+
* @param symbol The symbol name to get type info for.
|
|
519
|
+
* @param scope Optional scope context.
|
|
520
|
+
* @returns Type information or null if not found.
|
|
521
|
+
*/
|
|
522
|
+
export function getTypeInfo(
|
|
523
|
+
symbol: string,
|
|
524
|
+
scope?: string[],
|
|
525
|
+
): { type?: string; doc?: string; url?: string } | null;
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Gets list of available definition libraries.
|
|
529
|
+
* @returns Array of definition library names.
|
|
530
|
+
*/
|
|
531
|
+
export function getAvailableDefinitions(): string[];
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Gets the current autocomplete configuration.
|
|
535
|
+
* @returns The current autocomplete settings.
|
|
536
|
+
*/
|
|
537
|
+
export function getAutocompleteConfig(): {
|
|
538
|
+
includeDefaults: boolean;
|
|
539
|
+
includeLibraries: boolean;
|
|
540
|
+
enableDynamicLibraries: boolean;
|
|
541
|
+
customDefinitions: string[];
|
|
542
|
+
};
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Updates the autocomplete configuration.
|
|
546
|
+
* @param config Partial configuration to update.
|
|
547
|
+
*/
|
|
548
|
+
export function updateAutocompleteConfig(config: {
|
|
549
|
+
includeDefaults?: boolean;
|
|
550
|
+
includeLibraries?: boolean;
|
|
551
|
+
enableDynamicLibraries?: boolean;
|
|
552
|
+
customDefinitions?: string[];
|
|
553
|
+
}): void;
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Gets the raw Tern definitions for debugging and inspection.
|
|
557
|
+
* @returns The combined Tern definition object.
|
|
558
|
+
*/
|
|
559
|
+
export function getTernDefinitions(): unknown;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Namespace for AI services. Provides access to AI workflow, and node registry functionality.
|
|
564
|
+
*/
|
|
565
|
+
export namespace ai {
|
|
566
|
+
/**
|
|
567
|
+
* AI Workflow service for managing and executing workflows.
|
|
568
|
+
*/
|
|
569
|
+
export namespace workflow {
|
|
570
|
+
/**
|
|
571
|
+
* Creates a new AI workflow.
|
|
572
|
+
* @param config The workflow configuration.
|
|
573
|
+
* @returns Promise that resolves to the workflow ID.
|
|
574
|
+
*/
|
|
575
|
+
export function createWorkflow(config: IAIWorkflowConfig): Promise<string>;
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Runs an AI workflow.
|
|
579
|
+
* @param workflowId The ID of the workflow to run.
|
|
580
|
+
* @param inputId The ID of the input node.
|
|
581
|
+
* @param inputs Optional input data.
|
|
582
|
+
* @returns Promise that resolves to the workflow result.
|
|
583
|
+
*/
|
|
584
|
+
export function runWorkflow(
|
|
585
|
+
workflowId: string,
|
|
586
|
+
inputId: string,
|
|
587
|
+
inputs?: Record<string, any>,
|
|
588
|
+
): Promise<any>;
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* Stops a running AI workflow.
|
|
592
|
+
* @param workflowId The ID of the workflow to stop.
|
|
593
|
+
* @returns Promise that resolves when the workflow is stopped.
|
|
594
|
+
*/
|
|
595
|
+
export function stopWorkflow(workflowId: string): Promise<void>;
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Gets the state of an AI workflow.
|
|
599
|
+
* @param workflowId The ID of the workflow.
|
|
600
|
+
* @returns Promise that resolves to the workflow state.
|
|
601
|
+
*/
|
|
602
|
+
export function getWorkflowState(workflowId: string): Promise<any>;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* AI Node Registry service for managing AI node contributions.
|
|
607
|
+
*/
|
|
608
|
+
export namespace nodeRegistry {
|
|
609
|
+
/**
|
|
610
|
+
* Registers an AI node.
|
|
611
|
+
* @param node The node contribution to register.
|
|
612
|
+
* @param extensionId The ID of the extension registering the node.
|
|
613
|
+
* @returns Promise that resolves when the node is registered.
|
|
614
|
+
*/
|
|
615
|
+
export function registerNode(node: IAINodeContribution, extensionId: string): Promise<void>;
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Unregisters an AI node.
|
|
619
|
+
* @param nodeId The ID of the node to unregister.
|
|
620
|
+
* @param extensionId The ID of the extension that registered the node.
|
|
621
|
+
* @returns Promise that resolves when the node is unregistered.
|
|
622
|
+
*/
|
|
623
|
+
export function unregisterNode(nodeId: string, extensionId: string): Promise<void>;
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Gets all registered AI nodes.
|
|
627
|
+
* @returns Promise that resolves to an array of registered nodes.
|
|
628
|
+
*/
|
|
629
|
+
export function getNodes(): Promise<IAINodeContribution[]>;
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Gets a specific AI node by ID.
|
|
633
|
+
* @param nodeId The ID of the node to retrieve.
|
|
634
|
+
* @returns Promise that resolves to the node or undefined if not found.
|
|
635
|
+
*/
|
|
636
|
+
export function getNodeById(nodeId: string): Promise<IAINodeContribution | undefined>;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|