@noldova/terminal 0.0.11 → 0.0.13

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/module.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "id": "terminal",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "displayName": "Terminal",
5
5
  "description": "Runs shells in terminal panes, and lets AI agents run commands in them through permission requests.",
6
6
  "parts": ["runtime", "window"],
7
7
  "pseudoTerminals": true,
8
8
  "dependencies": {},
9
- "noldovaDesktop": ">=0.0.24 <0.1.0",
9
+ "noldovaDesktop": ">=0.0.30 <0.1.0",
10
10
  "contributes": {
11
11
  "methods": [
12
12
  "terminal.shells", "terminal.open", "terminal.close", "terminal.restart", "terminal.sessions", "terminal.attach", "terminal.input", "terminal.resize",
13
13
  "terminal.ack", "terminal.visibility", "terminal.detach", "terminal.lines", "terminal.restore", "terminal.closeOwner", "terminal.launch",
14
14
  "terminal.run", "terminal.runOutput", "terminal.windowStarted", "terminal.showOwner", "terminal.rename",
15
- "terminal.complete", "terminal.findCommands", "terminal.write", "terminal.changeFolder"
15
+ "terminal.complete", "terminal.findCommands", "terminal.describe", "terminal.write", "terminal.changeFolder"
16
16
  ],
17
17
  "events": [
18
18
  "terminal.output", "terminal.exited", "terminal.restarted", "terminal.titleChanged", "terminal.cwdChanged", "terminal.detached",
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "commands": ["terminal.new", "terminal.newWithShell", "terminal.toggle", "terminal.restartShell"],
24
24
  "menus": ["terminal.tabRow", "terminal.shellMenu"],
25
- "settings": ["terminal.defaultShell", "terminal.outputLimit", "terminal.fontSize", "terminal.suggestions", "terminal.commandColors", "terminal.completionList", "terminal.linkClick"],
25
+ "settings": ["terminal.defaultShell", "terminal.outputLimit", "terminal.fontSize", "terminal.suggestions", "terminal.commandColors", "terminal.completionList", "terminal.linkClick", "terminal.restoreTerminals"],
26
26
  "views": ["terminal.panel", "terminal.session"],
27
27
  "tools": ["terminal_list", "terminal_read", "terminal_open", "terminal_run", "terminal_write", "terminal_interrupt", "terminal_close"]
28
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noldova/terminal",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "The terminal module for apps on Noldova Desktop: terminal panes over real shells, and agent tools that run commands through permission requests.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -37,18 +37,18 @@
37
37
  "registry": "https://registry.npmjs.org/"
38
38
  },
39
39
  "dependencies": {
40
- "@noldova/terminal.protocol": "0.0.11",
41
- "@noldova/terminal.window": "0.0.11",
40
+ "@noldova/terminal.protocol": "0.0.13",
41
+ "@noldova/terminal.window": "0.0.13",
42
42
  "@xterm/addon-serialize": "0.14.0",
43
43
  "@xterm/headless": "6.0.0",
44
44
  "node-pty": "1.2.0-beta.15"
45
45
  },
46
46
  "peerDependencies": {
47
- "@noldova/desktop.protocol": ">=0.0.24 <0.1.0",
48
- "@noldova/desktop.runtime": ">=0.0.24 <0.1.0",
47
+ "@noldova/desktop.protocol": ">=0.0.30 <0.1.0",
48
+ "@noldova/desktop.runtime": ">=0.0.30 <0.1.0",
49
49
  "@noldova/context.core": ">=0.0.18 <0.1.0",
50
50
  "@noldova/context.exceptions": ">=0.0.18 <0.1.0",
51
51
  "@noldova/context.json": ">=0.0.18 <0.1.0"
52
52
  },
53
- "gitHead": "f4cfef7c6d5c0e3594311e1f220adb65d1404beb"
53
+ "gitHead": "84d04389daae0ffc8961880c1cbc8c11239c80f9"
54
54
  }
package/settings.json CHANGED
@@ -95,6 +95,17 @@
95
95
  "scopes": [],
96
96
  "page": "Terminal",
97
97
  "group": "Terminal"
98
+ },
99
+ {
100
+ "name": "terminal.restoreTerminals",
101
+ "title": "Restore terminals at start",
102
+ "description": "Whether a window opens again the terminals you left open when the app last closed, and their tabs after a reload.",
103
+ "type": { "kind": "Boolean" },
104
+ "default": true,
105
+ "locality": "Shared",
106
+ "scopes": [],
107
+ "page": "Terminal",
108
+ "group": "Terminal"
98
109
  }
99
110
  ]
100
111
  }
@@ -58,6 +58,63 @@ export { TerminalWindowException } from "@noldova/terminal.window";
58
58
  */
59
59
  export { StartFolderProvidedException } from "@noldova/terminal.window";
60
60
 
61
+ /**
62
+ * What New Terminal does in a window whose app opens terminals of its own, from `@noldova/terminal.window`.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * import type { IWindowPartContext } from "@noldova/desktop.window";
67
+ * import { TerminalNew } from "@noldova/terminal/window";
68
+ *
69
+ * export function provideNew(context: IWindowPartContext, open: () => Promise<void>): () => void {
70
+ * return TerminalNew.provide(context, open);
71
+ * }
72
+ * ```
73
+ */
74
+ export { TerminalNew } from "@noldova/terminal.window";
75
+
76
+ /**
77
+ * Thrown when a window that already has a New Terminal provider is given another, from `@noldova/terminal.window`.
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * import { NewTerminalProvidedException } from "@noldova/terminal/window";
82
+ *
83
+ * console.log(new NewTerminalProvidedException().name);
84
+ * ```
85
+ */
86
+ export { NewTerminalProvidedException } from "@noldova/terminal.window";
87
+
88
+ /**
89
+ * What Toggle Terminal does in a window whose app shows a terminal of its own, from `@noldova/terminal.window`.
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * import type { IWindowPartContext } from "@noldova/desktop.window";
94
+ * import { TerminalToggle } from "@noldova/terminal/window";
95
+ *
96
+ * export function provideLineToggle(context: IWindowPartContext, line: HTMLElement): () => void {
97
+ * return TerminalToggle.provide(context, () => {
98
+ * line.focus();
99
+ * return true;
100
+ * });
101
+ * }
102
+ * ```
103
+ */
104
+ export { TerminalToggle } from "@noldova/terminal.window";
105
+
106
+ /**
107
+ * Thrown when a window that already has a toggle provider is given another, from `@noldova/terminal.window`.
108
+ *
109
+ * @example
110
+ * ```ts
111
+ * import { ToggleProvidedException } from "@noldova/terminal/window";
112
+ *
113
+ * console.log(new ToggleProvidedException().name);
114
+ * ```
115
+ */
116
+ export { ToggleProvidedException } from "@noldova/terminal.window";
117
+
61
118
  /**
62
119
  * What an app ties a window's terminals to, such as its chats, from `@noldova/terminal.window`.
63
120
  *
package/src/api/window.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * This source code is licensed under the license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
- export { EmbeddedRowsRefusedException, EmbeddedTerminal, LaunchArgumentRefusedException, LaunchedTab, LaunchedTerminal, LaunchFolderMissingException, LaunchPartInactiveException, LaunchRowsRefusedException, LaunchRowsWithoutTabException, LaunchTitleRefusedException, OwnersProvidedException, RunArgumentRefusedException, RunLinesRefusedException, RunPartInactiveException, RunShellKindsMissingException, StartFolderProvidedException, TerminalEnd, TerminalLaunch, TerminalLauncher, TerminalLaunchRefusedException, TerminalEndedException, TerminalFolderNotFollowedException, TerminalFolderRefusedException, TerminalNotActiveException, TerminalLine, TerminalListener, TerminalOwners, TerminalRun, TerminalRunBusy, TerminalRunEnd, TerminalRunNotFoundException, TerminalRunNotTypedException, TerminalRunOutcome, TerminalRunOutput, TerminalRunRefusedException, TerminalRunTarget, TerminalShellKind, TerminalStartFolder, TerminalTextRun, TerminalTextStyle, TerminalWindowException, TerminalWithoutTabException, windowPart } from "@noldova/terminal.window";
8
+ export { EmbeddedRowsRefusedException, EmbeddedTerminal, LaunchArgumentRefusedException, LaunchedTab, LaunchedTerminal, LaunchFolderMissingException, LaunchPartInactiveException, LaunchRowsRefusedException, LaunchRowsWithoutTabException, LaunchTitleRefusedException, NewTerminalProvidedException, OwnersProvidedException, RunArgumentRefusedException, RunLinesRefusedException, RunPartInactiveException, RunShellKindsMissingException, StartFolderProvidedException, TerminalEnd, TerminalLaunch, TerminalLauncher, TerminalLaunchRefusedException, TerminalEndedException, TerminalFolderNotFollowedException, TerminalFolderRefusedException, TerminalNotActiveException, TerminalLine, TerminalListener, TerminalNew, TerminalOwners, TerminalRun, TerminalRunBusy, TerminalRunEnd, TerminalRunNotFoundException, TerminalRunNotTypedException, TerminalRunOutcome, TerminalRunOutput, TerminalRunRefusedException, TerminalRunTarget, TerminalShellKind, TerminalStartFolder, TerminalTextRun, TerminalTextStyle, TerminalToggle, TerminalWindowException, TerminalWithoutTabException, ToggleProvidedException, windowPart } from "@noldova/terminal.window";
@@ -10,5 +10,6 @@ export const ShellFamily = {
10
10
  Zsh: "Zsh",
11
11
  PowerShell: "PowerShell",
12
12
  CommandPrompt: "CommandPrompt",
13
+ Wsl: "Wsl",
13
14
  Other: "Other"
14
15
  };
@@ -10,10 +10,17 @@ export class CompletionCandidate {
10
10
  label;
11
11
  kind;
12
12
  closesQuote;
13
- constructor(value, label, kind, closesQuote) {
13
+ description;
14
+ rank;
15
+ constructor(value, label, kind, closesQuote, description = null, rank = 0) {
14
16
  this.value = value;
15
17
  this.label = label;
16
18
  this.kind = kind;
17
19
  this.closesQuote = closesQuote;
20
+ this.description = description;
21
+ this.rank = rank;
22
+ }
23
+ ranked(rank) {
24
+ return new CompletionCandidate(this.value, this.label, this.kind, this.closesQuote, this.description, rank);
18
25
  }
19
26
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ export class DescribeGroup {
9
+ names = [];
10
+ answer = Promise.withResolvers();
11
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { Resources } from "../resources.js";
9
+ export class KnownDescription {
10
+ description;
11
+ failedAt = null;
12
+ constructor(description) {
13
+ this.description = description;
14
+ }
15
+ isFresh(now) {
16
+ return Object.isNull(this.failedAt) || now - this.failedAt < Resources.describeRetryMilliseconds;
17
+ }
18
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ export class ProgramCall {
9
+ file;
10
+ args;
11
+ constructor(file, args) {
12
+ this.file = file;
13
+ this.args = args;
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ export class ToolCommand {
9
+ name;
10
+ words;
11
+ constructor(name, words) {
12
+ this.name = name;
13
+ this.words = words;
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ export class ToolWord {
9
+ name;
10
+ description;
11
+ constructor(name, description) {
12
+ this.name = name;
13
+ this.description = description;
14
+ }
15
+ }