agentuity-vscode 0.0.95 → 0.0.96

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.
@@ -86,43 +86,61 @@ export class DevServerManager {
86
86
  this.hasReceivedOutput = false;
87
87
 
88
88
  const cli = getCliClient();
89
- const cliPath = cli.getCliPath();
90
89
  const env = cli.getCliEnv();
91
90
 
91
+ // Use bunx to run the local CLI package
92
+ const cliPath = 'bunx';
93
+ const args = ['agentuity', 'dev'];
94
+ const spawnOpts: Parameters<typeof spawn>[2] = {
95
+ cwd: project.rootPath,
96
+ shell: true,
97
+ env: {
98
+ ...env,
99
+ // Disable color output for cleaner logs
100
+ NO_COLOR: '1',
101
+ // Force non-interactive mode without disabling public URL
102
+ TERM: 'dumb',
103
+ },
104
+ stdio: ['ignore', 'pipe', 'pipe'],
105
+ // On Unix, create a new process group so we can kill the entire tree
106
+ detached: process.platform !== 'win32',
107
+ };
108
+
92
109
  try {
93
- this.process = spawn(cliPath, ['dev'], {
94
- cwd: project.rootPath,
95
- shell: true,
96
- env,
97
- // On Unix, create a new process group so we can kill the entire tree
98
- detached: process.platform !== 'win32',
99
- });
110
+ this.process = spawn(cliPath, args, spawnOpts);
100
111
 
101
- this.process.stdout?.on('data', (data: Buffer) => {
112
+ const proc = this.process;
113
+ proc.stdout?.on('data', (data: Buffer) => {
102
114
  const text = data.toString();
103
115
  this.outputChannel.append(text);
104
116
  this.hasReceivedOutput = true;
105
117
 
106
- // Detect ready signals from the dev server
107
- if (text.includes('listening') || text.includes('started') || text.includes('ready')) {
118
+ // Detect ready signals from the dev server (case-insensitive)
119
+ const lowerText = text.toLowerCase();
120
+ if (
121
+ lowerText.includes('listening') ||
122
+ lowerText.includes('started') ||
123
+ lowerText.includes('ready')
124
+ ) {
108
125
  this.clearStartupTimeout();
109
126
  this.setState('running');
110
127
  }
111
128
  });
112
129
 
113
- this.process.stderr?.on('data', (data: Buffer) => {
114
- this.outputChannel.append(data.toString());
130
+ proc.stderr?.on('data', (data: Buffer) => {
131
+ const text = data.toString();
132
+ this.outputChannel.append(text);
115
133
  this.hasReceivedOutput = true;
116
134
  });
117
135
 
118
- this.process.on('error', (err: Error) => {
136
+ proc.on('error', (err: Error) => {
119
137
  this.clearStartupTimeout();
120
138
  this.outputChannel.appendLine(`Error: ${err.message}`);
121
139
  this.setState('error');
122
140
  this.process = undefined;
123
141
  });
124
142
 
125
- this.process.on('close', (code: number | null) => {
143
+ proc.on('close', (code: number | null) => {
126
144
  this.clearStartupTimeout();
127
145
  this.outputChannel.appendLine(`\nDev server exited with code ${code}`);
128
146
  if (this.state !== 'stopped') {
@@ -1,7 +1,7 @@
1
1
  import * as vscode from 'vscode';
2
2
  import { getCurrentProject } from '../../core/project';
3
3
 
4
- const WORKBENCH_BASE_URL = 'https://app.agentuity.com';
4
+ const WORKBENCH_BASE_URL = 'https://app-v1.agentuity.com';
5
5
 
6
6
  export function registerWorkbenchCommands(context: vscode.ExtensionContext): void {
7
7
  context.subscriptions.push(
@@ -0,0 +1,96 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ declare module 'vscode' {
7
+ // https://github.com/microsoft/vscode/issues/271104 @alexr00
8
+
9
+ export namespace chat {
10
+ /**
11
+ * Register a chat context provider. Chat context can be provided:
12
+ * - For a resource. Make sure to pass a selector that matches the resource you want to provide context for.
13
+ * Providers registered without a selector will not be called for resource-based context.
14
+ * - Explicitly. These context items are shown as options when the user explicitly attaches context.
15
+ *
16
+ * To ensure your extension is activated when chat context is requested, make sure to include the `onChatContextProvider:<id>` activation event in your `package.json`.
17
+ *
18
+ * @param selector Optional document selector to filter which resources the provider is called for. If omitted, the provider will only be called for explicit context requests.
19
+ * @param id Unique identifier for the provider.
20
+ * @param provider The chat context provider.
21
+ */
22
+ export function registerChatContextProvider(
23
+ selector: DocumentSelector | undefined,
24
+ id: string,
25
+ provider: ChatContextProvider
26
+ ): Disposable;
27
+ }
28
+
29
+ export interface ChatContextItem {
30
+ /**
31
+ * Icon for the context item.
32
+ */
33
+ icon: ThemeIcon;
34
+
35
+ /**
36
+ * Human readable label for the context item.
37
+ */
38
+ label: string;
39
+
40
+ /**
41
+ * An optional description of the context item, e.g. to describe the item to the language model.
42
+ */
43
+ modelDescription?: string;
44
+
45
+ /**
46
+ * The value of the context item. Can be omitted when returned from one of the `provide` methods if the provider supports `resolveChatContext`.
47
+ */
48
+ value?: string;
49
+ }
50
+
51
+ export interface ChatContextProvider<T extends ChatContextItem = ChatContextItem> {
52
+ /**
53
+ * An optional event that should be fired when the workspace chat context has changed.
54
+ */
55
+ onDidChangeWorkspaceChatContext?: Event<void>;
56
+
57
+ /**
58
+ * Provide a list of chat context items to be included as workspace context for all chat sessions.
59
+ *
60
+ * @param token A cancellation token.
61
+ */
62
+ provideWorkspaceChatContext?(token: CancellationToken): ProviderResult<T[]>;
63
+
64
+ /**
65
+ * Provide a list of chat context items that a user can choose from. These context items are shown as options when the user explicitly attaches context.
66
+ * Chat context items can be provided without a `value`, as the `value` can be resolved later using `resolveChatContext`.
67
+ * `resolveChatContext` is only called for items that do not have a `value`.
68
+ *
69
+ * @param token A cancellation token.
70
+ */
71
+ provideChatContextExplicit?(token: CancellationToken): ProviderResult<T[]>;
72
+
73
+ /**
74
+ * Given a particular resource, provide a chat context item for it. This is used for implicit context (see the settings `chat.implicitContext.enabled` and `chat.implicitContext.suggestedContext`).
75
+ * Chat context items can be provided without a `value`, as the `value` can be resolved later using `resolveChatContext`.
76
+ * `resolveChatContext` is only called for items that do not have a `value`.
77
+ *
78
+ * Currently only called when the resource is a webview.
79
+ *
80
+ * @param options Options include the resource for which to provide context.
81
+ * @param token A cancellation token.
82
+ */
83
+ provideChatContextForResource?(
84
+ options: { resource: Uri },
85
+ token: CancellationToken
86
+ ): ProviderResult<T | undefined>;
87
+
88
+ /**
89
+ * If a chat context item is provided without a `value`, from either of the `provide` methods, this method is called to resolve the `value` for the item.
90
+ *
91
+ * @param context The context item to resolve.
92
+ * @param token A cancellation token.
93
+ */
94
+ resolveChatContext(context: T, token: CancellationToken): ProviderResult<ChatContextItem>;
95
+ }
96
+ }
package/tsconfig.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "target": "ES2022",
4
- "module": "CommonJS",
4
+ "module": "ESNext",
5
5
  "lib": ["ES2022"],
6
- "moduleResolution": "node",
6
+ "moduleResolution": "bundler",
7
7
  "strict": true,
8
8
  "esModuleInterop": true,
9
9
  "skipLibCheck": true,
@@ -13,8 +13,10 @@
13
13
  "declarationMap": true,
14
14
  "sourceMap": true,
15
15
  "outDir": "./dist",
16
- "rootDir": "./src"
16
+ "rootDir": "./src",
17
+ "composite": true,
18
+ "types": ["node"]
17
19
  },
18
20
  "include": ["src/**/*"],
19
- "exclude": ["node_modules", "dist"]
21
+ "exclude": ["node_modules", "dist", "test/**/*"]
20
22
  }
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "lib": ["ES2022"],
6
+ "moduleResolution": "bundler",
7
+ "strict": true,
8
+ "esModuleInterop": true,
9
+ "skipLibCheck": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "resolveJsonModule": true,
12
+ "outDir": "./dist-test",
13
+ "rootDir": ".",
14
+ "composite": false,
15
+ "types": ["node"]
16
+ },
17
+ "include": ["src/**/*", "test/**/*"],
18
+ "exclude": ["node_modules", "dist"]
19
+ }