@codingame/monaco-vscode-xterm-common 32.0.2 → 34.0.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 (25) hide show
  1. package/package.json +5 -5
  2. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/notifications.d.ts +51 -0
  3. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/notifications.js +9 -0
  4. package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostPty.js +15 -14
  5. package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostTerminalService.js +8 -8
  6. package/vscode/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +5 -5
  7. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.js +61 -61
  8. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.js +55 -43
  9. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +9 -3
  10. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.d.ts +1 -1
  11. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.js +7 -16
  12. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTabsList.js +5 -5
  13. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTooltip.js +3 -3
  14. package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.d.ts +38 -0
  15. package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.js +321 -0
  16. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.d.ts +78 -0
  17. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +83 -0
  18. package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry.js +3 -3
  19. package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.js +3 -3
  20. package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.d.ts +0 -1054
  21. package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.js +0 -59
  22. package/vscode/src/vs/platform/agentHost/common/state/protocol/notifications.d.ts +0 -179
  23. package/vscode/src/vs/platform/agentHost/common/state/protocol/notifications.js +0 -16
  24. package/vscode/src/vs/platform/agentHost/common/state/sessionState.d.ts +0 -139
  25. package/vscode/src/vs/platform/agentHost/common/state/sessionState.js +0 -24
@@ -1,59 +0,0 @@
1
-
2
-
3
- var ActionType;
4
- (function (ActionType) {
5
- ActionType["RootAgentsChanged"] = "root/agentsChanged";
6
- ActionType["RootActiveSessionsChanged"] = "root/activeSessionsChanged";
7
- ActionType["SessionReady"] = "session/ready";
8
- ActionType["SessionCreationFailed"] = "session/creationFailed";
9
- ActionType["SessionTurnStarted"] = "session/turnStarted";
10
- ActionType["SessionDelta"] = "session/delta";
11
- ActionType["SessionResponsePart"] = "session/responsePart";
12
- ActionType["SessionToolCallStart"] = "session/toolCallStart";
13
- ActionType["SessionToolCallDelta"] = "session/toolCallDelta";
14
- ActionType["SessionToolCallReady"] = "session/toolCallReady";
15
- ActionType["SessionToolCallConfirmed"] = "session/toolCallConfirmed";
16
- ActionType["SessionToolCallComplete"] = "session/toolCallComplete";
17
- ActionType["SessionToolCallResultConfirmed"] = "session/toolCallResultConfirmed";
18
- ActionType["SessionToolCallContentChanged"] = "session/toolCallContentChanged";
19
- ActionType["SessionTurnComplete"] = "session/turnComplete";
20
- ActionType["SessionTurnCancelled"] = "session/turnCancelled";
21
- ActionType["SessionError"] = "session/error";
22
- ActionType["SessionTitleChanged"] = "session/titleChanged";
23
- ActionType["SessionUsage"] = "session/usage";
24
- ActionType["SessionReasoning"] = "session/reasoning";
25
- ActionType["SessionModelChanged"] = "session/modelChanged";
26
- ActionType["SessionServerToolsChanged"] = "session/serverToolsChanged";
27
- ActionType["SessionActiveClientChanged"] = "session/activeClientChanged";
28
- ActionType["SessionActiveClientToolsChanged"] = "session/activeClientToolsChanged";
29
- ActionType["SessionPendingMessageSet"] = "session/pendingMessageSet";
30
- ActionType["SessionPendingMessageRemoved"] = "session/pendingMessageRemoved";
31
- ActionType["SessionQueuedMessagesReordered"] = "session/queuedMessagesReordered";
32
- ActionType["SessionInputRequested"] = "session/inputRequested";
33
- ActionType["SessionInputAnswerChanged"] = "session/inputAnswerChanged";
34
- ActionType["SessionInputCompleted"] = "session/inputCompleted";
35
- ActionType["SessionCustomizationsChanged"] = "session/customizationsChanged";
36
- ActionType["SessionCustomizationToggled"] = "session/customizationToggled";
37
- ActionType["SessionTruncated"] = "session/truncated";
38
- ActionType["SessionIsReadChanged"] = "session/isReadChanged";
39
- ActionType["SessionIsArchivedChanged"] = "session/isArchivedChanged";
40
- ActionType["SessionActivityChanged"] = "session/activityChanged";
41
- ActionType["SessionDiffsChanged"] = "session/diffsChanged";
42
- ActionType["SessionConfigChanged"] = "session/configChanged";
43
- ActionType["SessionMetaChanged"] = "session/metaChanged";
44
- ActionType["RootTerminalsChanged"] = "root/terminalsChanged";
45
- ActionType["RootConfigChanged"] = "root/configChanged";
46
- ActionType["TerminalData"] = "terminal/data";
47
- ActionType["TerminalInput"] = "terminal/input";
48
- ActionType["TerminalResized"] = "terminal/resized";
49
- ActionType["TerminalClaimed"] = "terminal/claimed";
50
- ActionType["TerminalTitleChanged"] = "terminal/titleChanged";
51
- ActionType["TerminalCwdChanged"] = "terminal/cwdChanged";
52
- ActionType["TerminalExited"] = "terminal/exited";
53
- ActionType["TerminalCleared"] = "terminal/cleared";
54
- ActionType["TerminalCommandDetectionAvailable"] = "terminal/commandDetectionAvailable";
55
- ActionType["TerminalCommandExecuted"] = "terminal/commandExecuted";
56
- ActionType["TerminalCommandFinished"] = "terminal/commandFinished";
57
- })(ActionType || (ActionType = {}));
58
-
59
- export { ActionType };
@@ -1,179 +0,0 @@
1
- import type { URI, SessionSummary } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/state";
2
- /**
3
- * Reason why authentication is required.
4
- *
5
- * @category Protocol Notifications
6
- */
7
- export declare enum AuthRequiredReason {
8
- /** The client has not yet authenticated for the resource */
9
- Required = "required",
10
- /** A previously valid token has expired or been revoked */
11
- Expired = "expired"
12
- }
13
- /**
14
- * Discriminant values for all protocol notifications.
15
- *
16
- * @category Protocol Notifications
17
- */
18
- export declare enum NotificationType {
19
- SessionAdded = "notify/sessionAdded",
20
- SessionRemoved = "notify/sessionRemoved",
21
- SessionSummaryChanged = "notify/sessionSummaryChanged",
22
- AuthRequired = "notify/authRequired"
23
- }
24
- /**
25
- * Broadcast to all connected clients when a new session is created.
26
- *
27
- * @category Protocol Notifications
28
- * @version 1
29
- * @example
30
- * ```json
31
- * {
32
- * "jsonrpc": "2.0",
33
- * "method": "notification",
34
- * "params": {
35
- * "notification": {
36
- * "type": "notify/sessionAdded",
37
- * "summary": {
38
- * "resource": "copilot:/<uuid>",
39
- * "provider": "copilot",
40
- * "title": "New Session",
41
- * "status": 1,
42
- * "createdAt": 1710000000000,
43
- * "modifiedAt": 1710000000000
44
- * }
45
- * }
46
- * }
47
- * }
48
- * ```
49
- */
50
- export interface SessionAddedNotification {
51
- type: NotificationType.SessionAdded;
52
- /** Summary of the new session */
53
- summary: SessionSummary;
54
- }
55
- /**
56
- * Broadcast to all connected clients when a session is disposed.
57
- *
58
- * @category Protocol Notifications
59
- * @version 1
60
- * @example
61
- * ```json
62
- * {
63
- * "jsonrpc": "2.0",
64
- * "method": "notification",
65
- * "params": {
66
- * "notification": {
67
- * "type": "notify/sessionRemoved",
68
- * "session": "copilot:/<uuid>"
69
- * }
70
- * }
71
- * }
72
- * ```
73
- */
74
- export interface SessionRemovedNotification {
75
- type: NotificationType.SessionRemoved;
76
- /** URI of the removed session */
77
- session: URI;
78
- }
79
- /**
80
- * Broadcast to all connected clients when an existing session's summary
81
- * changes (title, status, `modifiedAt`, model, working directory, read/done
82
- * state, or diff statistics).
83
- *
84
- * This notification lets clients that maintain a cached session list — for
85
- * example, the result of a previous `listSessions()` call — stay in sync with
86
- * in-flight sessions without having to subscribe to every session URI
87
- * individually. It is complementary to, not a replacement for,
88
- * `notify/sessionAdded` and `notify/sessionRemoved`: those signal lifecycle
89
- * (creation/disposal), while this signals summary-level mutations on an
90
- * already-known session.
91
- *
92
- * Semantics:
93
- *
94
- * - Only fields present in `changes` have new values; omitted fields are
95
- * unchanged on the client's cached summary.
96
- * - Identity fields (`resource`, `provider`, `createdAt`) never change and
97
- * are not carried.
98
- * - Like all protocol notifications, this is ephemeral: it is **not**
99
- * replayed on reconnect. On reconnect, clients should re-fetch the full
100
- * catalog via `listSessions()` as usual.
101
- * - The server SHOULD emit this notification whenever any mutable field on
102
- * {@link SessionSummary | `SessionSummary`} changes for a session the
103
- * server has surfaced via `listSessions()` or `notify/sessionAdded`.
104
- * Servers MAY coalesce or debounce updates for noisy fields (for example,
105
- * `modifiedAt` bumps while a turn is streaming, or rapidly changing
106
- * `diffs`) at their discretion.
107
- * - Clients that have no cached entry for `session` MAY ignore the
108
- * notification; it is not a substitute for `notify/sessionAdded`.
109
- *
110
- * @category Protocol Notifications
111
- * @version 1
112
- * @example
113
- * ```json
114
- * {
115
- * "jsonrpc": "2.0",
116
- * "method": "notification",
117
- * "params": {
118
- * "notification": {
119
- * "type": "notify/sessionSummaryChanged",
120
- * "session": "copilot:/<uuid>",
121
- * "changes": {
122
- * "title": "Refactor auth middleware",
123
- * "status": 8,
124
- * "modifiedAt": 1710000123456
125
- * }
126
- * }
127
- * }
128
- * }
129
- * ```
130
- */
131
- export interface SessionSummaryChangedNotification {
132
- type: NotificationType.SessionSummaryChanged;
133
- /** URI of the session whose summary changed */
134
- session: URI;
135
- /**
136
- * Mutable summary fields that changed; omitted fields are unchanged.
137
- *
138
- * Identity fields (`resource`, `provider`, `createdAt`) never change and
139
- * MUST be omitted by senders; receivers SHOULD ignore them if present.
140
- */
141
- changes: Partial<SessionSummary>;
142
- }
143
- /**
144
- * Sent by the server when a protected resource requires (re-)authentication.
145
- *
146
- * This notification is sent when a previously valid token expires or is
147
- * revoked, or when the server discovers a new authentication requirement.
148
- * Clients should obtain a fresh token and push it via the `authenticate`
149
- * command.
150
- *
151
- * @category Protocol Notifications
152
- * @version 1
153
- * @see {@link /specification/authentication | Authentication}
154
- * @example
155
- * ```json
156
- * {
157
- * "jsonrpc": "2.0",
158
- * "method": "notification",
159
- * "params": {
160
- * "notification": {
161
- * "type": "notify/authRequired",
162
- * "resource": "https://api.github.com",
163
- * "reason": "expired"
164
- * }
165
- * }
166
- * }
167
- * ```
168
- */
169
- export interface AuthRequiredNotification {
170
- type: NotificationType.AuthRequired;
171
- /** The protected resource identifier that requires authentication */
172
- resource: string;
173
- /** Why authentication is required */
174
- reason?: AuthRequiredReason;
175
- }
176
- /**
177
- * Discriminated union of all protocol notifications.
178
- */
179
- export type ProtocolNotification = SessionAddedNotification | SessionRemovedNotification | SessionSummaryChangedNotification | AuthRequiredNotification;
@@ -1,16 +0,0 @@
1
-
2
-
3
- var AuthRequiredReason;
4
- (function (AuthRequiredReason) {
5
- AuthRequiredReason["Required"] = "required";
6
- AuthRequiredReason["Expired"] = "expired";
7
- })(AuthRequiredReason || (AuthRequiredReason = {}));
8
- var NotificationType;
9
- (function (NotificationType) {
10
- NotificationType["SessionAdded"] = "notify/sessionAdded";
11
- NotificationType["SessionRemoved"] = "notify/sessionRemoved";
12
- NotificationType["SessionSummaryChanged"] = "notify/sessionSummaryChanged";
13
- NotificationType["AuthRequired"] = "notify/authRequired";
14
- })(NotificationType || (NotificationType = {}));
15
-
16
- export { AuthRequiredReason, NotificationType };
@@ -1,139 +0,0 @@
1
- import { URI as ResourceURI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
2
- import { ToolResultFileEditContent, type ActiveTurn, type RootState, type SessionState, type SessionSummary, type ToolCallCancelledState, type ToolCallCompletedState, type ToolCallResult, type ToolCallState, type ToolResultContent, type ToolResultSubagentContent, type URI as ProtocolURI, type UserMessage, TerminalState } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/state";
3
- export { type ActiveTurn, type AgentInfo, type ConfigPropertySchema, type ConfigSchema, type ContentRef, type ErrorInfo, type ProjectInfo, type MarkdownResponsePart, type MessageAttachment, type MessageResourceAttachment, type ReasoningResponsePart, type ResponsePart, type RootState, type SessionActiveClient, type SessionConfigState, type FileEdit as ISessionFileDiff, type ModelSelection, type SessionModelInfo, type SessionState, type SessionSummary, type Snapshot, type TerminalState, type ToolAnnotations, type ToolCallCancelledState, type ToolCallCompletedState, type ToolCallPendingConfirmationState, type ToolCallPendingResultConfirmationState, type ToolCallResponsePart, type ToolCallResult, type ToolCallRunningState, type ToolCallState, type ToolCallStreamingState, type ToolDefinition, type CustomizationRef, type SessionCustomization, type ToolResultEmbeddedResourceContent as IToolResultBinaryContent, type ToolResultContent, type ToolResultFileEditContent, type ToolResultSubagentContent, type ToolResultTextContent, type Turn, type UsageInfo, type UserMessage, type PendingMessage, type StringOrMarkdown, type URI, type SessionInputRequest, type SessionInputQuestion, type SessionInputAnswer, type SessionInputOption, CustomizationStatus, MessageAttachmentKind, PendingMessageKind, PolicyState, ResponsePartKind, SessionInputAnswerState, SessionInputAnswerValueKind, SessionInputQuestionKind, SessionInputResponseKind, SessionLifecycle, SessionStatus, ToolCallConfirmationReason, ToolCallCancellationReason, ToolCallStatus, ToolResultContentType, TurnState, } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/state";
4
- /**
5
- * The kind of file edit operation. Derived from the presence/absence of
6
- * `before`/`after` in {@link ToolResultFileEditContent}.
7
- */
8
- export declare enum FileEditKind {
9
- /** Content edit (same file URI, different content). */
10
- Edit = "edit",
11
- /** File creation (no before state). */
12
- Create = "create",
13
- /** File deletion (no after state). */
14
- Delete = "delete",
15
- /** File rename/move (different before and after URIs). */
16
- Rename = "rename"
17
- }
18
- /** URI for the root state subscription. */
19
- export declare const ROOT_STATE_URI = "agenthost:/root";
20
- /**
21
- * A tool call in a terminal state, stored in completed turns.
22
- */
23
- export type ICompletedToolCall = ToolCallCompletedState | ToolCallCancelledState;
24
- /**
25
- * Derived status type for the tool call lifecycle.
26
- */
27
- export type ToolCallStatusString = ToolCallState["status"];
28
- /**
29
- * Extracts a plain-text tool output string from a tool call result's `content`
30
- * array. Joins all text-type content parts into a single string.
31
- *
32
- * Returns `undefined` if there are no text content parts.
33
- */
34
- export declare function getToolOutputText(result: ToolCallResult): string | undefined;
35
- /**
36
- * Extracts file edit content entries from a tool call result's `content` array.
37
- * Returns an empty array if there are no file edit content parts.
38
- */
39
- export declare function getToolFileEdits(result: ToolCallResult): ToolResultFileEditContent[];
40
- /**
41
- * Extracts the first subagent content entry from a tool call's `content` array.
42
- * Works with both completed tool call results and running tool call states.
43
- * Returns `undefined` if there are no subagent content parts.
44
- */
45
- export declare function getToolSubagentContent(result: {
46
- content?: readonly ToolResultContent[];
47
- }): ToolResultSubagentContent | undefined;
48
- /**
49
- * Builds a subagent session URI from a parent session URI and tool call ID.
50
- * Convention: `{parentSessionUri}/subagent/{toolCallId}`
51
- */
52
- export declare function buildSubagentSessionUri(parentSession: ProtocolURI | ResourceURI, toolCallId: string): string;
53
- /**
54
- * Parses a subagent session URI into its parent session URI and tool call ID.
55
- * Returns `undefined` if the URI does not follow the subagent convention.
56
- */
57
- export declare function parseSubagentSessionUri(uri: ProtocolURI | ResourceURI): {
58
- parentSession: ResourceURI;
59
- toolCallId: string;
60
- } | undefined;
61
- /**
62
- * Returns whether a session URI represents a subagent session.
63
- */
64
- export declare function isSubagentSession(uri: ProtocolURI | ResourceURI): boolean;
65
- /**
66
- * Builds the string prefix used by the state manager for cached subagent sessions.
67
- */
68
- export declare function buildSubagentSessionUriPrefix(parentSession: ProtocolURI | ResourceURI): string;
69
- export declare function createRootState(): RootState;
70
- export declare function createSessionState(summary: SessionSummary): SessionState;
71
- export declare function createActiveTurn(id: string, userMessage: UserMessage): ActiveTurn;
72
- export declare enum StateComponents {
73
- Root = 0,
74
- Session = 1,
75
- Terminal = 2
76
- }
77
- export type ComponentToState = {
78
- [StateComponents.Root]: RootState;
79
- [StateComponents.Session]: SessionState;
80
- [StateComponents.Terminal]: TerminalState;
81
- };
82
- /**
83
- * VS Code-side alias for the protocol's open `_meta` property bag on
84
- * {@link SessionState}. Keys SHOULD be namespaced (e.g. `git`, `vscode.foo`)
85
- * to avoid collisions; values MUST be JSON-serializable.
86
- */
87
- export type SessionMeta = Record<string, unknown>;
88
- /**
89
- * Reserved key under {@link SessionMeta} for the well-known git-state
90
- * payload. Value at this key, when present, MUST be shaped like
91
- * {@link ISessionGitState}. This is a VS Code-specific convention layered
92
- * on top of the protocol's generic `_meta` bag — the protocol itself does
93
- * not know about git state.
94
- */
95
- export declare const SESSION_META_GIT_KEY = "git";
96
- /**
97
- * Git state of a session's working directory, carried under
98
- * {@link SessionMeta} at {@link SESSION_META_GIT_KEY}. Used by clients to
99
- * drive source-control affordances (e.g. PR/merge buttons in the Agents
100
- * app).
101
- *
102
- * All fields are optional — agents that do not track a particular field
103
- * should omit it rather than send a placeholder, so clients can distinguish
104
- * "unknown" from "known to be zero".
105
- */
106
- export interface ISessionGitState {
107
- /** Whether the working directory has a `github.com` git remote. */
108
- readonly hasGitHubRemote?: boolean;
109
- /** Current branch name. */
110
- readonly branchName?: string;
111
- /** Base branch the work targets (e.g. `main`). */
112
- readonly baseBranchName?: string;
113
- /** Upstream tracking branch (e.g. `origin/feature`). */
114
- readonly upstreamBranchName?: string;
115
- /** Number of commits the upstream branch has ahead of the local branch. */
116
- readonly incomingChanges?: number;
117
- /** Number of commits the local branch has ahead of the upstream branch. */
118
- readonly outgoingChanges?: number;
119
- /** Number of files with uncommitted changes. */
120
- readonly uncommittedChanges?: number;
121
- /** GitHub repository owner parsed from the working copy's GitHub remote (preferring `origin`, falling back to the first GitHub remote). */
122
- readonly githubOwner?: string;
123
- /** GitHub repository name parsed from the working copy's GitHub remote (preferring `origin`, falling back to the first GitHub remote). */
124
- readonly githubRepo?: string;
125
- }
126
- /**
127
- * Reads the well-known git-state payload from {@link SessionMeta}, if
128
- * present. Returns `undefined` when the meta bag is absent or the value at
129
- * the git key is not a plain object (e.g. an array or a primitive).
130
- * Individual fields with wrong types are silently dropped so partial state
131
- * still propagates.
132
- */
133
- export declare function readSessionGitState(meta: SessionMeta | undefined): ISessionGitState | undefined;
134
- /**
135
- * Returns a new {@link SessionMeta} with the git-state payload set to
136
- * `gitState`, or with the git slot removed if `gitState` is `undefined`.
137
- * Returns `undefined` if the result would be empty.
138
- */
139
- export declare function withSessionGitState(meta: SessionMeta | undefined, gitState: ISessionGitState | undefined): SessionMeta | undefined;
@@ -1,24 +0,0 @@
1
-
2
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
3
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/charCode';
4
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/marshallingIds';
5
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
6
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
7
- export { CustomizationStatus, MessageAttachmentKind, PendingMessageKind, PolicyState, ResponsePartKind, SessionInputAnswerState, SessionInputAnswerValueKind, SessionInputQuestionKind, SessionInputResponseKind, SessionLifecycle, SessionStatus, ToolCallCancellationReason, ToolCallConfirmationReason, ToolCallStatus, ToolResultContentType, TurnState } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/state';
8
-
9
- var FileEditKind;
10
- (function(FileEditKind) {
11
- FileEditKind["Edit"] = "edit";
12
- FileEditKind["Create"] = "create";
13
- FileEditKind["Delete"] = "delete";
14
- FileEditKind["Rename"] = "rename";
15
- })(FileEditKind || (FileEditKind = {}));
16
- const ROOT_STATE_URI = "agenthost:/root";
17
- var StateComponents;
18
- (function(StateComponents) {
19
- StateComponents[StateComponents["Root"] = 0] = "Root";
20
- StateComponents[StateComponents["Session"] = 1] = "Session";
21
- StateComponents[StateComponents["Terminal"] = 2] = "Terminal";
22
- })(StateComponents || (StateComponents = {}));
23
-
24
- export { FileEditKind, ROOT_STATE_URI, StateComponents };