@codingame/monaco-vscode-xterm-addons-common 36.2.7 → 37.2.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.
Files changed (20) hide show
  1. package/package.json +10 -10
  2. package/vscode/src/vs/base/browser/htmlToMarkdown.js +24 -6
  3. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.d.ts +27 -0
  4. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.js +158 -24
  5. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.js +8 -16
  6. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.js +15 -15
  7. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.js +9 -9
  8. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.js +30 -29
  9. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.js +42 -38
  10. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatPasteProviders.d.ts +22 -6
  11. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatPasteProviders.js +254 -132
  12. package/vscode/src/vs/workbench/contrib/git/common/utils.d.ts +8 -0
  13. package/vscode/src/vs/workbench/contrib/git/common/utils.js +105 -0
  14. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.d.ts +1 -2
  15. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +27 -22
  16. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +1 -11
  17. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +16 -1
  18. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +75 -17
  19. package/vscode/src/vs/workbench/contrib/chat/browser/copilotCliEventsUri.d.ts +0 -82
  20. package/vscode/src/vs/workbench/contrib/chat/browser/copilotCliEventsUri.js +0 -114
@@ -1,82 +0,0 @@
1
- import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
2
- import { IRemoteAgentHostConnectionInfo } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/remoteAgentHostService";
3
- export declare const COPILOT_CLI_LOCAL_AH_SCHEME = "agent-host-copilotcli";
4
- export declare const COPILOT_CLI_EH_SCHEME = "copilotcli";
5
- /**
6
- * Builds the local `events.jsonl` URI under `~/.copilot/session-state/<rawId>/`.
7
- *
8
- * Used for both the local Agent Host Copilot CLI provider and the
9
- * extension-host Copilot CLI provider, which share the same on-disk layout
10
- * and the same chat session URI shape (`copilotcli:/<rawId>`).
11
- */
12
- export declare function buildLocalEventsUri(userHome: URI, rawSessionId: string): URI;
13
- /**
14
- * Builds the local `~/.copilot/logs` directory URI.
15
- */
16
- export declare function buildLocalCopilotLogsUri(userHome: URI): URI;
17
- /**
18
- * Builds a `vscode-agent-host://` URI for the `events.jsonl` file inside
19
- * the host's user home directory, using the connection's reported
20
- * `defaultDirectory` (set from `os.homedir()` on the host during the
21
- * AHP handshake).
22
- *
23
- * The path is joined at the URI-path level using forward slashes, which
24
- * works for both POSIX hosts (`/home/me`) and Windows hosts whose
25
- * `URI.file(os.homedir()).path` is also forward-slash-rooted (e.g.
26
- * `/c:/Users/me`). Returns `undefined` if the host did not report a
27
- * usable `defaultDirectory`.
28
- */
29
- export declare function buildRemoteEventsUri(connection: IRemoteAgentHostConnectionInfo, rawSessionId: string): URI | undefined;
30
- /**
31
- * Builds a `vscode-agent-host://` URI for the host's `~/.copilot/logs`
32
- * directory, using the connection's reported home directory.
33
- */
34
- export declare function buildRemoteCopilotLogsUri(connection: IRemoteAgentHostConnectionInfo): URI | undefined;
35
- /**
36
- * Parses the connection authority out of a remote AH chat session scheme
37
- * of the form `remote-<authority>-copilotcli`. Returns `undefined` for
38
- * any other scheme, including the local `copilotcli` scheme.
39
- */
40
- export declare function parseRemoteAuthorityFromScheme(scheme: string): string | undefined;
41
- /**
42
- * Extracts the raw Copilot CLI session id from a chat session resource.
43
- */
44
- export declare function getCopilotCliSessionRawId(sessionResource: URI | undefined): string | undefined;
45
- export type ResolveEventsUriResult = {
46
- readonly kind: "ok";
47
- readonly resource: URI;
48
- } | {
49
- readonly kind: "no-session";
50
- } | {
51
- readonly kind: "unsupported-scheme";
52
- readonly scheme: string;
53
- } | {
54
- readonly kind: "remote-not-connected";
55
- readonly authority: string;
56
- } | {
57
- readonly kind: "remote-no-home";
58
- readonly authority: string;
59
- };
60
- /**
61
- * Pure resolver for tests. Translates a chat session resource into the
62
- * `events.jsonl` URI for the corresponding Copilot CLI session, or
63
- * returns a structured error.
64
- */
65
- export declare function resolveEventsUri(sessionResource: URI | undefined, userHome: URI, getConnectionByAuthority: (authority: string) => IRemoteAgentHostConnectionInfo | undefined): ResolveEventsUriResult;
66
- /**
67
- * Resolves the host-local filesystem path string of a Copilot CLI session's
68
- * `events.jsonl`, suitable for tooling that runs **on the host** (e.g. the
69
- * agent's terminal), as opposed to a workbench {@link URI} consumed by the
70
- * file service.
71
- *
72
- * Reuses {@link resolveEventsUri} so it stays in lockstep with the resolution
73
- * used by the chat debug panel and the "Open Copilot CLI State File" command,
74
- * then unwraps the result into a plain path:
75
- * - a local `file://` URI becomes its `fsPath` (same machine as the host).
76
- * - a remote `vscode-agent-host://` URI is unwrapped to the underlying file
77
- * URI whose `path` is the real path on the remote host the agent runs on.
78
- *
79
- * Returns `undefined` when the session is not a Copilot CLI session or the
80
- * path cannot be resolved (e.g. a remote host that reported no home directory).
81
- */
82
- export declare function buildHostLocalEventsPath(sessionResource: URI | undefined, userHome: URI, getConnectionByAuthority: (authority: string) => IRemoteAgentHostConnectionInfo | undefined): string | undefined;
@@ -1,114 +0,0 @@
1
-
2
- import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
3
- import { joinPath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
4
- import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
5
- import { parseRemoteAgentHostSessionTypeAuthority } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostSessionType';
6
- import { agentHostAuthority, toAgentHostUri, fromAgentHostUri } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostUri';
7
-
8
- const COPILOT_CLI_PROVIDER = "copilotcli";
9
- const COPILOT_CLI_LOCAL_AH_SCHEME = `agent-host-${COPILOT_CLI_PROVIDER}`;
10
- const COPILOT_CLI_EH_SCHEME = COPILOT_CLI_PROVIDER;
11
- function buildLocalEventsUri(userHome, rawSessionId) {
12
- return joinPath(userHome, ".copilot", "session-state", rawSessionId, "events.jsonl");
13
- }
14
- function buildLocalCopilotLogsUri(userHome) {
15
- return joinPath(userHome, ".copilot", "logs");
16
- }
17
- function buildRemoteEventsUri(connection, rawSessionId) {
18
- const homePath = connection.defaultDirectory;
19
- if (!homePath) {
20
- return undefined;
21
- }
22
- const trimmed = homePath.endsWith("/") ? homePath.slice(0, -1) : homePath;
23
- const remoteFileUri = ( URI.from({
24
- scheme: "file",
25
- path: `${trimmed}/.copilot/session-state/${rawSessionId}/events.jsonl`
26
- }));
27
- const authority = agentHostAuthority(connection.address);
28
- return toAgentHostUri(remoteFileUri, authority);
29
- }
30
- function buildRemoteCopilotLogsUri(connection) {
31
- const homePath = connection.defaultDirectory;
32
- if (!homePath) {
33
- return undefined;
34
- }
35
- const trimmed = homePath.endsWith("/") ? homePath.slice(0, -1) : homePath;
36
- const remoteFileUri = ( URI.from({
37
- scheme: "file",
38
- path: `${trimmed}/.copilot/logs`
39
- }));
40
- const authority = agentHostAuthority(connection.address);
41
- return toAgentHostUri(remoteFileUri, authority);
42
- }
43
- function parseRemoteAuthorityFromScheme(scheme) {
44
- return parseRemoteAgentHostSessionTypeAuthority(scheme, COPILOT_CLI_PROVIDER);
45
- }
46
- function getCopilotCliSessionRawId(sessionResource) {
47
- if (!sessionResource) {
48
- return undefined;
49
- }
50
- if (sessionResource.scheme !== COPILOT_CLI_LOCAL_AH_SCHEME && sessionResource.scheme !== COPILOT_CLI_EH_SCHEME && !parseRemoteAuthorityFromScheme(sessionResource.scheme)) {
51
- return undefined;
52
- }
53
- return getRawSessionId(sessionResource);
54
- }
55
- function resolveEventsUri(sessionResource, userHome, getConnectionByAuthority) {
56
- if (!sessionResource) {
57
- return {
58
- kind: "no-session"
59
- };
60
- }
61
- const rawId = getRawSessionId(sessionResource);
62
- if (!rawId) {
63
- return {
64
- kind: "no-session"
65
- };
66
- }
67
- if (sessionResource.scheme === COPILOT_CLI_LOCAL_AH_SCHEME || sessionResource.scheme === COPILOT_CLI_EH_SCHEME) {
68
- return {
69
- kind: "ok",
70
- resource: buildLocalEventsUri(userHome, rawId)
71
- };
72
- }
73
- const remoteAuthority = parseRemoteAuthorityFromScheme(sessionResource.scheme);
74
- if (remoteAuthority) {
75
- const connection = getConnectionByAuthority(remoteAuthority);
76
- if (!connection) {
77
- return {
78
- kind: "remote-not-connected",
79
- authority: remoteAuthority
80
- };
81
- }
82
- const resource = buildRemoteEventsUri(connection, rawId);
83
- if (!resource) {
84
- return {
85
- kind: "remote-no-home",
86
- authority: remoteAuthority
87
- };
88
- }
89
- return {
90
- kind: "ok",
91
- resource
92
- };
93
- }
94
- return {
95
- kind: "unsupported-scheme",
96
- scheme: sessionResource.scheme
97
- };
98
- }
99
- function getRawSessionId(sessionResource) {
100
- const rawId = sessionResource.path.startsWith("/") ? sessionResource.path.substring(1) : sessionResource.path;
101
- return rawId || undefined;
102
- }
103
- function buildHostLocalEventsPath(sessionResource, userHome, getConnectionByAuthority) {
104
- const result = resolveEventsUri(sessionResource, userHome, getConnectionByAuthority);
105
- if (result.kind !== "ok") {
106
- return undefined;
107
- }
108
- if (result.resource.scheme === Schemas.file) {
109
- return result.resource.fsPath;
110
- }
111
- return fromAgentHostUri(result.resource).path.replace(/^\/([a-zA-Z]:)/, "$1");
112
- }
113
-
114
- export { COPILOT_CLI_EH_SCHEME, COPILOT_CLI_LOCAL_AH_SCHEME, buildHostLocalEventsPath, buildLocalCopilotLogsUri, buildLocalEventsUri, buildRemoteCopilotLogsUri, buildRemoteEventsUri, getCopilotCliSessionRawId, parseRemoteAuthorityFromScheme, resolveEventsUri };